-
Notifications
You must be signed in to change notification settings - Fork 0
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
Ali Haider
committed
Sep 2, 2022
0 parents
commit 4b8acae
Showing
75 changed files
with
2,676 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,4 @@ | ||
|
||
.gradle/ | ||
.ides/ | ||
.idea/ |
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,38 @@ | ||
plugins { | ||
id 'com.android.library' | ||
id 'org.jetbrains.kotlin.android' | ||
} | ||
|
||
android { | ||
compileSdk 30 | ||
|
||
defaultConfig { | ||
minSdk 21 | ||
targetSdk 30 | ||
|
||
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.5.0' | ||
implementation 'androidx.appcompat:appcompat:1.0.2' | ||
implementation 'com.google.android.material:material:1.1.0-alpha09' | ||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3' | ||
} |
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 |
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.mohsin.onboardingbubbles"> | ||
|
||
</manifest> |
53 changes: 53 additions & 0 deletions
53
OnBoardingBubbles/src/main/java/com/mohsin/onboardingbubbles/AnimationUtils.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,53 @@ | ||
package com.mohsin.onboardingbubbles | ||
|
||
import android.animation.ObjectAnimator | ||
import android.animation.PropertyValuesHolder | ||
import android.view.View | ||
import android.view.animation.AlphaAnimation | ||
import android.view.animation.Animation | ||
import android.view.animation.DecelerateInterpolator | ||
import android.view.animation.ScaleAnimation | ||
|
||
object AnimationUtils { | ||
|
||
fun getScaleAnimation(offset: Int, duration: Int): Animation { | ||
val anim = ScaleAnimation( | ||
0f, 1f, // Start and end values for the X axis scaling | ||
0f, 1f, // Start and end values for the Y axis scaling | ||
Animation.RELATIVE_TO_SELF, 0.5f, // Pivot point of X scaling | ||
Animation.RELATIVE_TO_SELF, 0.5f | ||
) // Pivot point of Y scaling | ||
anim.fillAfter = true | ||
anim.startOffset = offset.toLong() | ||
anim.duration = duration.toLong() | ||
return anim | ||
} | ||
|
||
fun getFadeInAnimation(offset: Int, duration: Int): Animation { | ||
val fadeIn = AlphaAnimation(0f, 1f) | ||
fadeIn.startOffset = offset.toLong() | ||
fadeIn.interpolator = DecelerateInterpolator() | ||
fadeIn.duration = duration.toLong() | ||
return fadeIn | ||
} | ||
|
||
fun setBouncingAnimation(view: View, offset: Int, duration: Int): View { | ||
|
||
val objAnim = ObjectAnimator.ofPropertyValuesHolder( | ||
view, | ||
PropertyValuesHolder.ofFloat("scaleX", 1.05f), | ||
PropertyValuesHolder.ofFloat("scaleY", 1.05f) | ||
) | ||
objAnim.duration = duration.toLong() | ||
objAnim.startDelay = offset.toLong() | ||
objAnim.repeatCount = ObjectAnimator.INFINITE | ||
objAnim.repeatMode = ObjectAnimator.REVERSE | ||
objAnim.start() | ||
return view | ||
} | ||
|
||
fun setAnimationToView(view: View, animation: Animation): View { | ||
view.startAnimation(animation) | ||
return view | ||
} | ||
} |
Oops, something went wrong.