Skip to content

Commit 11ef649

Browse files
committed
Initial commit
0 parents  commit 11ef649

File tree

60 files changed

+2696
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2696
-0
lines changed

.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx
15+
local.properties
16+
17+
/.gradle/5.4.1/javaCompile/taskHistory.bin
18+
19+
/keystore.properties
20+
/.idea
21+
/buildSrc/buildSrc.iml
22+
/app/build
23+
/app/.idea
24+
gradlew.bat
25+
gradlew
26+
/app/gradle
27+
/app/local.properties
28+
misc.xml
29+
/buildSrc/build
30+
/vcs.xml
31+
/app/release
32+
/app/staging
33+
/buildConfigKeys.properties
34+
/app/schemas
35+
*.jks

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Mindinventory
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
ShimmerTextView
2+
====
3+
4+
ShimmerTextView is a simple library to integrate shimmer effect in your TextView.
5+
6+
![image](art/ShimmerTextView.gif)
7+
![image](art/ShimmerTextViewOffer.gif)
8+
9+
# Key features
10+
11+
* Set a base color in ShimmerTextView.
12+
* Set a highlight color in ShimmerTextView.
13+
* Set animation duration for shimmer effect(in millisecond).
14+
* Set animation direction(left_to_right, top_to_bottom, right_to_left, bottom_to_top).
15+
* Set ShimmerTextView shape(Linear/Radial)
16+
17+
# Usage
18+
19+
**Dependencies**
20+
> Insert gradle dependency here.
21+
22+
**Implementation**
23+
24+
* Step 1 : Use custom ShimmerTextView in XML.
25+
26+
<com.app.shimmertextview.ShimmerTextView
27+
android:id="@+id/textView"
28+
android:layout_width="0dp"
29+
android:layout_height="wrap_content"
30+
android:text="@string/text_mi"
31+
android:textSize="24sp"
32+
app:layout_constraintEnd_toEndOf="parent"
33+
app:layout_constraintStart_toEndOf="@id/ivLeftToRight"
34+
app:layout_constraintTop_toTopOf="@id/ivLeftToRight"
35+
app:layout_constraintBottom_toTopOf="@id/tvLeftToRight"
36+
app:shimmer_base_color="@color/dark_red"
37+
app:shimmer_colored="true"
38+
app:shimmer_highlight_color="@color/orange"
39+
android:fontFamily="@font/poppins_bold"
40+
app:shimmer_duration="3000"
41+
android:layout_marginHorizontal="16dp"
42+
android:includeFontPadding="false"/>
43+
44+
* Step 2 : Use all attributes dynamically in your.
45+
46+
class MainActivity : AppCompatActivity() {
47+
override fun onCreate(savedInstanceState: Bundle?) {
48+
super.onCreate(savedInstanceState)
49+
setContentView(R.layout.activity_main)
50+
51+
val textView = findViewById<ShimmerTextView>(R.id.textView)
52+
textView.setBaseColor(ContextCompat.getColor(this, R.color.dark_red))
53+
.setHighLightColor(ContextCompat.getColor(this, R.color.orange))
54+
.setDirection(Shimmer.Direction.LEFT_TO_RIGHT)
55+
.build()
56+
textView.startShimmer()
57+
}
58+
}
59+
60+
**XML Properties**
61+
62+
| Properties | Description |
63+
|------------------------|-------------------------------------------|
64+
|shimmer_base_color |Set base color of ShimmerTextView |
65+
|Shimmer_highlight_color |Set highlight color of shimmer animation |
66+
|shimmer_colored |Set it to true for colored ShimmerTextView |
67+
|shimmer_duration |Set duration for animation |
68+
|shimmer_direction |Set animation direction(left_to_right,top_to_bottom, right_to_left, bottom_to_top)|
69+
70+
That's it 👍 and you're good to go 🚀
71+
72+
### Guideline to report an issue/feature request
73+
---------
74+
It would be very helpful for us, if the reporter can share the below things to understand the root cause of the issue.
75+
76+
* Library version.
77+
* Code snippet.
78+
* Logs if applicable.
79+
* Screenshot/video with steps to reproduce the issue.
80+
81+
### LICENCE
82+
----------------
83+
ShimmerTextView is [MIT-licensed.](https://git.mindinventory.com/mi-android/android-libs/shimmertextview/-/blob/master/LICENSE)
84+
85+
### Let us know!
86+
---------
87+
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/)
88+
89+
Please feel free to use this component and let us know if you are interested to building Apps or Designing Products.

ShimmerTextView/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

ShimmerTextView/build.gradle

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
plugins {
2+
id 'com.android.library'
3+
id 'org.jetbrains.kotlin.android'
4+
}
5+
6+
android {
7+
compileSdk 32
8+
9+
defaultConfig {
10+
minSdk 22
11+
targetSdk 32
12+
13+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
14+
consumerProguardFiles "consumer-rules.pro"
15+
}
16+
17+
buildTypes {
18+
release {
19+
minifyEnabled false
20+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21+
}
22+
}
23+
compileOptions {
24+
sourceCompatibility JavaVersion.VERSION_1_8
25+
targetCompatibility JavaVersion.VERSION_1_8
26+
}
27+
kotlinOptions {
28+
jvmTarget = '1.8'
29+
}
30+
}
31+
32+
dependencies {
33+
34+
implementation 'androidx.core:core-ktx:1.8.0'
35+
implementation 'androidx.appcompat:appcompat:1.4.1'
36+
implementation 'com.google.android.material:material:1.6.0'
37+
testImplementation 'junit:junit:4.13.2'
38+
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
39+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
40+
}

ShimmerTextView/consumer-rules.pro

Whitespace-only changes.

ShimmerTextView/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.app.shimmertextview
2+
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* See [testing documentation](http://d.android.com/tools/testing).
15+
*/
16+
@RunWith(AndroidJUnit4::class)
17+
class ExampleInstrumentedTest {
18+
@Test
19+
fun useAppContext() {
20+
// Context of the app under test.
21+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22+
assertEquals("com.app.shimmertextview.test", appContext.packageName)
23+
}
24+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.app.shimmertextview">
4+
5+
</manifest>

0 commit comments

Comments
 (0)