406 | Reyaz | Fix scroll of page when user opens keyboard

This commit is contained in:
Reyaz Ahmad
2019-11-29 17:39:25 +05:30
parent 5269ee2445
commit 2a15ba84ed
6 changed files with 5415 additions and 57 deletions

View File

@@ -38,6 +38,7 @@ android {
ext {
version_retrofit = '2.6.2'
version_kotlin_coroutines = '1.3.2'
lottie_version = '3.2.2'
}
repositories {
@@ -80,4 +81,5 @@ dependencies {
testImplementation 'android.arch.core:core-testing:1.0.0'
testImplementation 'org.mockito:mockito-inline:2.13.0'
implementation "com.airbnb.android:lottie:$lottie_version"
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,655 @@
{
"v": "4.10.1",
"fr": 48,
"ip": 0,
"op": 48,
"w": 80,
"h": 80,
"nm": "引导 对勾 2",
"ddd": 0,
"assets": [],
"layers": [
{
"ddd": 0,
"ind": 1,
"ty": 4,
"nm": "对勾",
"sr": 1,
"ks": {
"o": {
"a": 0,
"k": 100,
"ix": 11
},
"r": {
"a": 0,
"k": 0,
"ix": 10
},
"p": {
"a": 0,
"k": [
38.875,
36.5,
0
],
"ix": 2
},
"a": {
"a": 0,
"k": [
0,
0,
0
],
"ix": 1
},
"s": {
"a": 0,
"k": [
100,
100,
100
],
"ix": 6
}
},
"ao": 0,
"shapes": [
{
"ty": "gr",
"it": [
{
"ind": 0,
"ty": "sh",
"ix": 1,
"ks": {
"a": 0,
"k": {
"i": [
[
0,
0
],
[
0,
0
],
[
0,
0
]
],
"o": [
[
0,
0
],
[
0,
0
],
[
0,
0
]
],
"v": [
[
-25.236,
-8.222
],
[
-1.702,
13.989
],
[
20.459,
-8.403
]
],
"c": false
},
"ix": 2
},
"nm": "路径 1",
"mn": "ADBE Vector Shape - Group",
"hd": false
},
{
"ty": "tm",
"s": {
"a": 1,
"k": [
{
"i": {
"x": [
0.735
],
"y": [
1
]
},
"o": {
"x": [
0.254
],
"y": [
0.884
]
},
"n": [
"0p735_1_0p254_0p884"
],
"t": 24,
"s": [
2
],
"e": [
95
]
},
{
"t": 36
}
],
"ix": 1
},
"e": {
"a": 1,
"k": [
{
"i": {
"x": [
0.46
],
"y": [
0.944
]
},
"o": {
"x": [
0.66
],
"y": [
0.047
]
},
"n": [
"0p46_0p944_0p66_0p047"
],
"t": 24,
"s": [
0
],
"e": [
25
]
},
{
"t": 36
}
],
"ix": 2
},
"o": {
"a": 1,
"k": [
{
"i": {
"x": [
0.833
],
"y": [
0.833
]
},
"o": {
"x": [
0.167
],
"y": [
0.167
]
},
"n": [
"0p833_0p833_0p167_0p167"
],
"t": 24,
"s": [
0
],
"e": [
16
]
},
{
"i": {
"x": [
0.833
],
"y": [
0.833
]
},
"o": {
"x": [
0.167
],
"y": [
0.167
]
},
"n": [
"0p833_0p833_0p167_0p167"
],
"t": 36,
"s": [
16
],
"e": [
0
]
},
{
"t": 38
}
],
"ix": 3
},
"m": 1,
"ix": 2,
"nm": "修剪路径 1",
"mn": "ADBE Vector Filter - Trim",
"hd": false
},
{
"ty": "st",
"c": {
"a": 0,
"k": [
0.49411764705882355,
0.8274509803921568,
0.12941176470588237,
1
],
"ix": 3
},
"o": {
"a": 0,
"k": 100,
"ix": 4
},
"w": {
"a": 0,
"k": 3,
"ix": 5
},
"lc": 1,
"lj": 1,
"ml": 4,
"nm": "描边 1",
"mn": "ADBE Vector Graphic - Stroke",
"hd": false
},
{
"ty": "tr",
"p": {
"a": 0,
"k": [
0,
0
],
"ix": 2
},
"a": {
"a": 0,
"k": [
0,
0
],
"ix": 1
},
"s": {
"a": 0,
"k": [
100,
100
],
"ix": 3
},
"r": {
"a": 0,
"k": 0,
"ix": 6
},
"o": {
"a": 0,
"k": 100,
"ix": 7
},
"sk": {
"a": 0,
"k": 0,
"ix": 4
},
"sa": {
"a": 0,
"k": 0,
"ix": 5
},
"nm": "变换"
}
],
"nm": "形状 1",
"np": 4,
"cix": 2,
"ix": 1,
"mn": "ADBE Vector Group",
"hd": false
}
],
"ip": 24,
"op": 480,
"st": 0,
"bm": 0
},
{
"ddd": 0,
"ind": 2,
"ty": 4,
"nm": "外圈",
"sr": 1,
"ks": {
"o": {
"a": 0,
"k": 100,
"ix": 11
},
"r": {
"a": 1,
"k": [
{
"i": {
"x": [
0.425
],
"y": [
0.998
]
},
"o": {
"x": [
0.525
],
"y": [
0.035
]
},
"n": [
"0p425_0p998_0p525_0p035"
],
"t": 0,
"s": [
80
],
"e": [
22
]
},
{
"t": 24
}
],
"ix": 10
},
"p": {
"a": 0,
"k": [
40.5,
40,
0
],
"ix": 2
},
"a": {
"a": 0,
"k": [
1.201,
3.701,
0
],
"ix": 1
},
"s": {
"a": 0,
"k": [
106.43400000000001,
106.43400000000001,
100
],
"ix": 6
}
},
"ao": 0,
"shapes": [
{
"ty": "gr",
"it": [
{
"ind": 0,
"ty": "sh",
"ix": 1,
"ks": {
"a": 0,
"k": {
"i": [
[
-15.023,
0
],
[
0,
-15.023
],
[
15.023,
0
],
[
0,
15.023
]
],
"o": [
[
15.023,
0
],
[
0,
15.023
],
[
-15.023,
0
],
[
0,
-15.023
]
],
"v": [
[
0,
-27.201
],
[
27.201,
0
],
[
0,
27.201
],
[
-27.201,
0
]
],
"c": true
},
"ix": 2
},
"nm": "路径 1",
"mn": "ADBE Vector Shape - Group",
"hd": false
},
{
"ty": "tm",
"s": {
"a": 1,
"k": [
{
"i": {
"x": [
0.482
],
"y": [
0.997
]
},
"o": {
"x": [
0.878
],
"y": [
0
]
},
"n": [
"0p482_0p997_0p878_0"
],
"t": 0,
"s": [
100
],
"e": [
0
]
},
{
"t": 24
}
],
"ix": 1
},
"e": {
"a": 0,
"k": 100,
"ix": 2
},
"o": {
"a": 0,
"k": 0,
"ix": 3
},
"m": 1,
"ix": 2,
"nm": "修剪路径 1",
"mn": "ADBE Vector Filter - Trim",
"hd": false
},
{
"ty": "st",
"c": {
"a": 0,
"k": [
0.49411764705882355,
0.8274509803921568,
0.12941176470588237,
1
],
"ix": 3
},
"o": {
"a": 0,
"k": 100,
"ix": 4
},
"w": {
"a": 0,
"k": 3,
"ix": 5
},
"lc": 2,
"lj": 1,
"ml": 4,
"nm": "描边 1",
"mn": "ADBE Vector Graphic - Stroke",
"hd": false
},
{
"ty": "tr",
"p": {
"a": 0,
"k": [
1.518,
3.736
],
"ix": 2
},
"a": {
"a": 0,
"k": [
0,
0
],
"ix": 1
},
"s": {
"a": 0,
"k": [
100,
100
],
"ix": 3
},
"r": {
"a": 0,
"k": -90,
"ix": 6
},
"o": {
"a": 0,
"k": 100,
"ix": 7
},
"sk": {
"a": 0,
"k": 0,
"ix": 4
},
"sa": {
"a": 0,
"k": 0,
"ix": 5
},
"nm": "变换"
}
],
"nm": "椭圆 1",
"np": 4,
"cix": 2,
"ix": 1,
"mn": "ADBE Vector Group",
"hd": false
}
],
"ip": 0,
"op": 480,
"st": 0,
"bm": 0
}
]
}

View File

@@ -4,8 +4,6 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.animation.Animation
import android.view.animation.AnimationUtils
import android.widget.Toast
import androidx.databinding.DataBindingUtil
import androidx.fragment.app.Fragment
@@ -49,7 +47,6 @@ class OfferAcceptFragment : Fragment() {
val activity = activity as FragmentActivity
viewModel = ViewModelProviders.of(activity).get(OfferAcceptViewModel::class.java)
animateLoanApproval()
viewModel.fetchApplication(PreferenceManager.getLoanApplicationId(activity))
binding.acceptOfferBtn.setOnClickListener {
if (binding.checkbox.isChecked) {
@@ -84,22 +81,6 @@ class OfferAcceptFragment : Fragment() {
}
}
private fun animateLoanApproval() {
binding.fireworkImage11.startAnimation(buildAnimation(200))
binding.fireworkImage12.startAnimation(buildAnimation(400))
binding.fireworkImage13.startAnimation(buildAnimation(600))
binding.fireworkImage21.startAnimation(buildAnimation(200))
binding.fireworkImage22.startAnimation(buildAnimation(400))
binding.fireworkImage23.startAnimation(buildAnimation(600))
}
private fun buildAnimation(startOffset: Long): Animation {
return AnimationUtils.loadAnimation(context, R.anim.zoom_in).apply {
this.startOffset = startOffset
}
}
companion object {
const val TAG = "OFFER_ACCEPT_FRAGMENT"
}

View File

@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator">
<scale
android:duration="1000"
android:fromXScale="0.2"
android:fromYScale="0.2"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="infinite"
android:repeatMode="reverse"
android:toXScale="1"
android:toYScale="1" />
</set>

View File

@@ -22,39 +22,46 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/tick_mark_image">
<ImageView
android:id="@+id/firework_image1_1"
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/firework_image_one"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="4dp"
android:src="@drawable/firework" />
app:lottie_autoPlay="true"
app:lottie_fileName="firework.json"
app:lottie_loop="true" />
<ImageView
android:id="@+id/firework_image1_2"
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/firework_animation_two"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="20dp"
android:layout_toEndOf="@id/firework_image1_1"
android:src="@drawable/firework" />
android:layout_toEndOf="@id/firework_image_one"
app:lottie_autoPlay="true"
app:lottie_fileName="firework.json"
app:lottie_loop="true" />
<ImageView
android:id="@+id/firework_image1_3"
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/firework_animation_three"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_below="@id/firework_image1_1"
android:layout_below="@id/firework_image_one"
android:layout_marginTop="5dp"
android:src="@drawable/firework"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
app:lottie_autoPlay="true"
app:lottie_fileName="firework.json"
app:lottie_loop="true" />
</RelativeLayout>
<ImageView
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/tick_mark_image"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:adjustViewBounds="true"
android:src="@drawable/tick_mark"
app:lottie_autoPlay="true"
app:layout_constrainedWidth="true"
app:lottie_fileName="tick_mark.json"
app:layout_constraintEnd_toEndOf="@id/guideline_2"
app:layout_constraintStart_toStartOf="@id/guideline_1"
app:layout_constraintTop_toTopOf="parent" />
@@ -70,29 +77,35 @@
app:layout_constraintStart_toEndOf="@+id/tick_mark_image"
app:layout_constraintTop_toTopOf="@+id/tick_mark_image">
<ImageView
android:id="@+id/firework_image2_1"
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/firework_animation_four"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_toEndOf="@id/firework_image2_2"
android:src="@drawable/firework" />
app:lottie_autoPlay="true"
app:lottie_fileName="firework.json"
app:lottie_loop="true" />
<ImageView
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/firework_image2_2"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="5dp"
android:src="@drawable/firework" />
app:lottie_autoPlay="true"
app:lottie_fileName="firework.json"
app:lottie_loop="true" />
<ImageView
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/firework_image2_3"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_below="@id/firework_image2_1"
android:layout_below="@id/firework_animation_four"
android:layout_marginTop="5dp"
android:layout_toEndOf="@id/firework_image2_2"
android:src="@drawable/firework"
app:lottie_autoPlay="true"
app:lottie_fileName="firework.json"
app:lottie_loop="true"
app:layout_constraintTop_toTopOf="parent" />
</RelativeLayout>
@@ -111,11 +124,11 @@
<TextView
android:id="@+id/loan_approved_label_text"
style="@style/paragraphCustomFontStyle"
android:textSize="22sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/your_loan_got_approved"
android:textSize="22sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/congratulations_label_text" />