-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 11ef649
Showing
60 changed files
with
2,696 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/caches | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
/.idea/navEditor.xml | ||
/.idea/assetWizardSettings.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild | ||
.cxx | ||
local.properties | ||
|
||
/.gradle/5.4.1/javaCompile/taskHistory.bin | ||
|
||
/keystore.properties | ||
/.idea | ||
/buildSrc/buildSrc.iml | ||
/app/build | ||
/app/.idea | ||
gradlew.bat | ||
gradlew | ||
/app/gradle | ||
/app/local.properties | ||
misc.xml | ||
/buildSrc/build | ||
/vcs.xml | ||
/app/release | ||
/app/staging | ||
/buildConfigKeys.properties | ||
/app/schemas | ||
*.jks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 Mindinventory | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
ShimmerTextView | ||
==== | ||
|
||
ShimmerTextView is a simple library to integrate shimmer effect in your TextView. | ||
|
||
![image](art/ShimmerTextView.gif) | ||
![image](art/ShimmerTextViewOffer.gif) | ||
|
||
# Key features | ||
|
||
* Set a base color in ShimmerTextView. | ||
* Set a highlight color in ShimmerTextView. | ||
* Set animation duration for shimmer effect(in millisecond). | ||
* Set animation direction(left_to_right, top_to_bottom, right_to_left, bottom_to_top). | ||
* Set ShimmerTextView shape(Linear/Radial) | ||
|
||
# Usage | ||
|
||
**Dependencies** | ||
> Insert gradle dependency here. | ||
**Implementation** | ||
|
||
* Step 1 : Use custom ShimmerTextView in XML. | ||
|
||
<com.app.shimmertextview.ShimmerTextView | ||
android:id="@+id/textView" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:text="@string/text_mi" | ||
android:textSize="24sp" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toEndOf="@id/ivLeftToRight" | ||
app:layout_constraintTop_toTopOf="@id/ivLeftToRight" | ||
app:layout_constraintBottom_toTopOf="@id/tvLeftToRight" | ||
app:shimmer_base_color="@color/dark_red" | ||
app:shimmer_colored="true" | ||
app:shimmer_highlight_color="@color/orange" | ||
android:fontFamily="@font/poppins_bold" | ||
app:shimmer_duration="3000" | ||
android:layout_marginHorizontal="16dp" | ||
android:includeFontPadding="false"/> | ||
|
||
* Step 2 : Use all attributes dynamically in your. | ||
|
||
class MainActivity : AppCompatActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_main) | ||
val textView = findViewById<ShimmerTextView>(R.id.textView) | ||
textView.setBaseColor(ContextCompat.getColor(this, R.color.dark_red)) | ||
.setHighLightColor(ContextCompat.getColor(this, R.color.orange)) | ||
.setDirection(Shimmer.Direction.LEFT_TO_RIGHT) | ||
.build() | ||
textView.startShimmer() | ||
} | ||
} | ||
|
||
**XML Properties** | ||
|
||
| Properties | Description | | ||
|------------------------|-------------------------------------------| | ||
|shimmer_base_color |Set base color of ShimmerTextView | | ||
|Shimmer_highlight_color |Set highlight color of shimmer animation | | ||
|shimmer_colored |Set it to true for colored ShimmerTextView | | ||
|shimmer_duration |Set duration for animation | | ||
|shimmer_direction |Set animation direction(left_to_right,top_to_bottom, right_to_left, bottom_to_top)| | ||
|
||
That's it 👍 and you're good to go 🚀 | ||
|
||
### Guideline to report an issue/feature request | ||
--------- | ||
It would be very helpful for us, if the reporter can share the below things to understand the root cause of the issue. | ||
|
||
* Library version. | ||
* Code snippet. | ||
* Logs if applicable. | ||
* Screenshot/video with steps to reproduce the issue. | ||
|
||
### LICENCE | ||
---------------- | ||
ShimmerTextView is [MIT-licensed.](https://git.mindinventory.com/mi-android/android-libs/shimmertextview/-/blob/master/LICENSE) | ||
|
||
### Let us know! | ||
--------- | ||
If you use open-source libraries in your project, please make sure to credit us and Give a star to [www.mindinventory.com](https://www.mindinventory.com/) | ||
|
||
Please feel free to use this component and let us know if you are interested to building Apps or Designing Products. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
plugins { | ||
id 'com.android.library' | ||
id 'org.jetbrains.kotlin.android' | ||
} | ||
|
||
android { | ||
compileSdk 32 | ||
|
||
defaultConfig { | ||
minSdk 22 | ||
targetSdk 32 | ||
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
consumerProguardFiles "consumer-rules.pro" | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
kotlinOptions { | ||
jvmTarget = '1.8' | ||
} | ||
} | ||
|
||
dependencies { | ||
|
||
implementation 'androidx.core:core-ktx:1.8.0' | ||
implementation 'androidx.appcompat:appcompat:1.4.1' | ||
implementation 'com.google.android.material:material:1.6.0' | ||
testImplementation 'junit:junit:4.13.2' | ||
androidTestImplementation 'androidx.test.ext:junit:1.1.3' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
24 changes: 24 additions & 0 deletions
24
ShimmerTextView/src/androidTest/java/com/app/shimmertextview/ExampleInstrumentedTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.app.shimmertextview | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
|
||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
import org.junit.Assert.* | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertEquals("com.app.shimmertextview.test", appContext.packageName) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.app.shimmertextview"> | ||
|
||
</manifest> |
Oops, something went wrong.