Skip to content

Commit 869d274

Browse files
authored
Merge pull request #12 from JDevZone/dev
updated to latest version-
2 parents 4978951 + 7fa3cea commit 869d274

5 files changed

Lines changed: 132 additions & 74 deletions

File tree

app/build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ apply plugin: 'kotlin-android-extensions'
66

77
android {
88
compileSdkVersion 29
9-
buildToolsVersion "29.0.2"
9+
buildToolsVersion "29.0.3"
1010
defaultConfig {
1111
applicationId "com.devzone.fillprogresslayout"
1212
minSdkVersion 17
1313
targetSdkVersion 29
1414
versionCode 1
1515
versionName "1.0"
1616
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17+
vectorDrawables.useSupportLibrary true
1718
}
1819
buildTypes {
1920
release {
@@ -26,11 +27,11 @@ android {
2627
dependencies {
2728
implementation fileTree(dir: 'libs', include: ['*.jar'])
2829
implementation 'androidx.appcompat:appcompat:1.1.0'
29-
implementation 'androidx.core:core-ktx:1.1.0'
30+
implementation 'androidx.core:core-ktx:1.3.0'
3031
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
3132
implementation project(path: ':fillprogresslayout')
3233

33-
testImplementation 'junit:junit:4.12'
34+
testImplementation 'junit:junit:4.13'
3435
androidTestImplementation 'androidx.test:runner:1.2.0'
3536
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
3637
}

app/src/main/java/com/devzone/fpl_sample/MainActivity.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.devzone.fpl_sample
22

33
import android.os.Bundle
44
import android.view.View
5+
import android.view.animation.LinearInterpolator
56
import android.widget.Button
67
import android.widget.SeekBar
78
import androidx.appcompat.app.AppCompatActivity
@@ -15,6 +16,8 @@ class MainActivity : AppCompatActivity() {
1516
super.onCreate(savedInstanceState)
1617
setContentView(R.layout.activity_main)
1718
handlePreciseControls()
19+
fillNF.setAnimationInterpolator(LinearInterpolator())
20+
1821

1922
}
2023

@@ -55,13 +58,15 @@ class MainActivity : AppCompatActivity() {
5558
}
5659

5760
fun toggleFill(view: View) {
61+
val isAnimated = animateCB.isChecked
5862
val button: Button = view as Button
5963
button.isEnabled = false
6064
isFilled = !isFilled
61-
fillL?.setDoOnProgressEnd { v ->
65+
fillL?.setDoOnProgressEnd { _ ->
6266
button.isEnabled = true;button.text = if (isFilled) "UnFill" else "Fill"
6367
}
64-
fillL?.setProgress(if (isFilled) 100 else 0, false)
68+
fillL?.setProgress(if (isFilled) 100 else 0, isAnimated)
69+
fillNF?.setProgress(if (isFilled) 100 else 0)
6570
fillL?.setProgressColors(intArrayOf(R.color.colorGradient1, R.color.colorGradient2))
6671
}
6772
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="24.0"
5+
android:viewportHeight="24.0">
6+
<path
7+
android:fillColor="@color/netflix_black"
8+
android:pathData="M8,5v14l11,-7z"/>
9+
</vector>
Lines changed: 108 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,148 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:app="http://schemas.android.com/apk/res-auto"
4-
xmlns:tools="http://schemas.android.com/tools"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
android:orientation="vertical"
8+
tools:context=".MainActivity">
9+
10+
<FrameLayout
511
android:layout_width="match_parent"
6-
android:layout_height="match_parent"
7-
android:orientation="vertical"
8-
tools:context=".MainActivity">
12+
android:layout_height="wrap_content"
13+
android:background="@color/netflix_black">
914

10-
<com.devzone.fillprogresslayout.FillProgressLayout
11-
android:id="@+id/fillL"
12-
android:layout_width="match_parent"
15+
<com.devzone.fillprogresslayout.FillProgressLayout
16+
android:id="@+id/fillNF"
17+
android:layout_width="wrap_content"
1318
android:layout_height="wrap_content"
14-
android:layout_margin="30dp"
15-
app:fpl_backgroundColor="@color/colorRedTrans"
19+
android:layout_gravity="center_horizontal"
20+
android:layout_margin="20dp"
21+
android:gravity="center"
22+
app:fpl_backgroundColor="@color/netflix_gray"
1623
app:fpl_gradientMovement="true"
1724
app:fpl_isRounded="true"
1825
app:fpl_progress="0"
19-
app:fpl_progressColor="@color/colorGreenTrans"
26+
app:fpl_progressColor="@color/netflix_white"
2027
app:fpl_progressDirection="left_to_right"
2128
app:fpl_progressDuration="2000"
22-
app:fpl_roundedCornerRadius="100"
29+
app:fpl_roundedCornerRadius="8"
2330
app:fpl_shouldRestart="false">
2431

25-
<TextView
32+
<TextView
2633
android:layout_width="wrap_content"
2734
android:layout_height="wrap_content"
28-
android:layout_gravity="center_vertical"
29-
android:layout_weight="1"
35+
android:layout_gravity="center"
36+
android:layout_marginStart="10dp"
37+
android:layout_marginEnd="20dp"
38+
android:drawableStart="@drawable/ic_play_vector"
39+
android:drawablePadding="10dp"
3040
android:gravity="center"
31-
android:padding="10dp"
32-
android:text="@string/app_name" />
41+
android:padding="5dp"
42+
android:text="Next Episode"
43+
android:textColor="@color/netflix_black"
44+
android:textStyle="bold" />
45+
46+
</com.devzone.fillprogresslayout.FillProgressLayout>
47+
</FrameLayout>
48+
49+
<com.devzone.fillprogresslayout.FillProgressLayout
50+
android:id="@+id/fillL"
51+
android:layout_width="match_parent"
52+
android:layout_height="wrap_content"
53+
android:layout_margin="30dp"
54+
app:fpl_backgroundColor="@color/colorRedTrans"
55+
app:fpl_gradientMovement="true"
56+
app:fpl_isRounded="true"
57+
app:fpl_progress="0"
58+
app:fpl_progressColor="@color/colorGreenTrans"
59+
app:fpl_progressDirection="left_to_right"
60+
app:fpl_progressDuration="2000"
61+
app:fpl_roundedCornerRadius="100"
62+
app:fpl_shouldRestart="false">
3363

3464
<TextView
35-
android:layout_width="wrap_content"
36-
android:layout_height="wrap_content"
37-
android:layout_gravity="center_vertical"
38-
android:layout_weight="1"
39-
android:gravity="center"
40-
android:padding="10dp"
41-
android:text="@string/app_name" />
42-
</com.devzone.fillprogresslayout.FillProgressLayout>
65+
android:layout_width="wrap_content"
66+
android:layout_height="wrap_content"
67+
android:layout_gravity="center_vertical"
68+
android:layout_weight="1"
69+
android:gravity="center"
70+
android:padding="10dp"
71+
android:text="@string/app_name" />
4372

44-
<Button
73+
<TextView
4574
android:layout_width="wrap_content"
4675
android:layout_height="wrap_content"
47-
android:layout_gravity="center_horizontal"
48-
android:layout_marginTop="20dp"
49-
android:layout_marginBottom="20dp"
50-
android:onClick="toggleFill"
51-
android:text="fill"
52-
tools:ignore="HardcodedText" />
76+
android:layout_gravity="center_vertical"
77+
android:layout_weight="1"
78+
android:gravity="center"
79+
android:padding="10dp"
80+
android:text="@string/app_name" />
81+
</com.devzone.fillprogresslayout.FillProgressLayout>
82+
83+
<Button
84+
android:layout_width="wrap_content"
85+
android:layout_height="wrap_content"
86+
android:layout_gravity="center_horizontal"
87+
android:layout_marginTop="20dp"
88+
android:layout_marginBottom="20dp"
89+
android:onClick="toggleFill"
90+
android:text="fill"
91+
tools:ignore="HardcodedText" />
5392

5493
<RelativeLayout
55-
android:layout_width="match_parent"
56-
android:layout_height="wrap_content"
57-
android:layout_margin="20dp">
94+
android:layout_width="match_parent"
95+
android:layout_height="wrap_content"
96+
android:layout_margin="20dp">
5897

5998
<com.devzone.fillprogresslayout.FillProgressLayout
60-
android:id="@+id/fillB"
61-
android:layout_width="match_parent"
62-
android:layout_height="wrap_content"
63-
android:layout_alignBottom="@+id/tv"
64-
android:layout_alignParentTop="true"
65-
app:fpl_gradientColors="@array/gradientColors"
66-
app:fpl_gradientMovement="false"
67-
app:fpl_isRounded="true"
68-
app:fpl_roundedCornerRadius="20" />
99+
android:id="@+id/fillB"
100+
android:layout_width="match_parent"
101+
android:layout_height="wrap_content"
102+
android:layout_alignBottom="@+id/tv"
103+
android:layout_alignParentTop="true"
104+
app:fpl_gradientColors="@array/gradientColors"
105+
app:fpl_gradientMovement="false"
106+
app:fpl_isRounded="true"
107+
app:fpl_roundedCornerRadius="20" />
69108

70109
<androidx.appcompat.widget.AppCompatTextView
71-
android:id="@+id/tv"
72-
android:layout_width="match_parent"
73-
android:layout_height="wrap_content"
74-
android:gravity="center"
75-
android:padding="20dp"
76-
android:text="@string/app_name" />
77-
</RelativeLayout>
78-
79-
<RadioGroup
110+
android:id="@+id/tv"
80111
android:layout_width="match_parent"
81112
android:layout_height="wrap_content"
82-
android:layout_margin="10dp"
83113
android:gravity="center"
84-
android:orientation="horizontal">
114+
android:padding="20dp"
115+
android:text="@string/app_name" />
116+
</RelativeLayout>
117+
118+
<RadioGroup
119+
android:layout_width="match_parent"
120+
android:layout_height="wrap_content"
121+
android:layout_margin="10dp"
122+
android:gravity="center"
123+
android:orientation="horizontal">
85124

86125
<androidx.appcompat.widget.AppCompatCheckBox
87-
android:id="@+id/reverseCB"
88-
android:layout_width="wrap_content"
89-
android:layout_height="wrap_content"
90-
android:layout_margin="5dp"
91-
android:text="Reverse" />
126+
android:id="@+id/reverseCB"
127+
android:layout_width="wrap_content"
128+
android:layout_height="wrap_content"
129+
android:layout_margin="5dp"
130+
android:text="Reverse" />
92131

93132
<androidx.appcompat.widget.AppCompatCheckBox
94-
android:id="@+id/animateCB"
95-
android:layout_width="wrap_content"
96-
android:layout_height="wrap_content"
97-
android:layout_margin="5dp"
98-
android:text="Animate" />
133+
android:id="@+id/animateCB"
134+
android:layout_width="wrap_content"
135+
android:layout_height="wrap_content"
136+
android:layout_margin="5dp"
137+
android:text="Animate" />
99138
</RadioGroup>
100139

101140

102141
<SeekBar
103-
android:id="@+id/progressSeek"
104-
android:layout_width="match_parent"
105-
android:layout_height="wrap_content"
106-
android:layout_margin="10dp" />
142+
android:id="@+id/progressSeek"
143+
android:layout_width="match_parent"
144+
android:layout_height="wrap_content"
145+
android:layout_margin="10dp" />
107146

108147

109148
</LinearLayout>

app/src/main/res/values/colors.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@
1717
<item>#FFA7A0</item>
1818
<item>#388E3C</item>
1919
</array>
20+
21+
<color name="netflix_white">#FFFFFFFF</color>
22+
<color name="netflix_gray">#FFB2B2B2</color>
23+
<color name="netflix_black">#FF1C1C1C</color>
2024
</resources>

0 commit comments

Comments
 (0)