diff --git a/.gitignore b/.gitignore index 9c4de58..cc08c68 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,12 @@ +*.iml .gradle /local.properties -/.idea/workspace.xml +/.idea/caches /.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml .DS_Store /build /captures diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 96cc43e..61a9130 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,22 +1,6 @@ - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index fb232ac..813108d 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -1,8 +1,10 @@ + diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..a5f05cd --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 0df579a..9e762bb 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -35,7 +35,7 @@ - + diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index a7b8a83..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/README.md b/README.md index 63a66a7..2bea962 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,8 @@ dependencies { android:id="@+id/your_state_progress_bar_id" android:layout_width="wrap_content" android:layout_height="wrap_content" - app:spb_currentStateNumber="three" - app:spb_maxStateNumber="four" + app:spb_currentStateNumber="3" + app:spb_maxStateNumber="4" app:spb_stateBackgroundColor="#BDBDBD" app:spb_stateForegroundColor="#009688" app:spb_stateNumberBackgroundColor="#808080" @@ -64,11 +64,14 @@ protected void onCreate(Bundle savedInstanceState) { ## XML Attributes - spb_currentStateNumber => Current state number. Must be one of the following constant values : one , two , three , four . - Related method : setCurrentStateNumber(StateNumber) + spb_currentStateNumber => Current state number (starts from 1). + Related method : setCurrentStateNumber(int) - spb_maxStateNumber => Maximum state number. Must be one of the following constant values : one , two , three , four . - Related method : setMaxStateNumber(StateNumber) + spb_maxStateNumber => Maximum state number. + Related method : setMaxStateNumber(int) + + spb_textStartNumber => The number of the first label. + Related method : setTextStartNumber(int) spb_stateBackgroundColor => State background color. Should be a color value. Possible forms are "#rgb", "#argb", "#rrggbb", or "#aarrggbb". Related method : setBackgroundColor(int) @@ -87,8 +90,17 @@ protected void onCreate(Bundle savedInstanceState) { spb_stateDescriptionColor => State description color. Should be a color value. Possible forms are "#rgb", "#argb", "#rrggbb", or "#aarrggbb". Related method : setStateDescriptionColor(int) - - spb_stateSize => State size . Must be a dimension value with preferrable unit of dp eg. 25dp + + spb_currentStateDescriptionBackgroundColor => Current state description background color. Should be a color value. Possible forms are "#rgb", "#argb", "#rrggbb", or "#aarrggbb". + Related method : setCurrentStateBackgroundDescriptionColor(int) + + spb_stateDescriptionBackgroundColor => State description background color. Should be a color value. Possible forms are "#rgb", "#argb", "#rrggbb", or "#aarrggbb". + Related method : setStateBackgroundDescriptionColor(int) + + spb_stateHighlightMode => Choose which states should be colored according to currentState. Should be one of "none", "current" (the current state only) and "finished" (the current state and all states before it). + Related method : setStateHighlightMode(StateHighlightMode) + + spb_stateSize => State size. Must be a dimension value with preferrable unit of dp eg. 25dp Related method : setStateSize(float) spb_stateTextSize => State text(number) size . Must be a dimension value with preferrable unit of sp eg. 15sp @@ -177,8 +189,8 @@ StateProgressBar stateProgressBar = (StateProgressBar) findViewById(R.id.state_p + app:spb_currentStateNumber="1" + app:spb_maxStateNumber="2"/> ``` @@ -191,8 +203,8 @@ StateProgressBar stateProgressBar = (StateProgressBar) findViewById(R.id.state_p + app:spb_currentStateNumber="2" + app:spb_maxStateNumber="3"/> ``` @@ -205,8 +217,8 @@ StateProgressBar stateProgressBar = (StateProgressBar) findViewById(R.id.state_p + app:spb_currentStateNumber="3" + app:spb_maxStateNumber="4"/> ``` @@ -219,8 +231,8 @@ StateProgressBar stateProgressBar = (StateProgressBar) findViewById(R.id.state_p + app:spb_currentStateNumber="4" + app:spb_maxStateNumber="5"/> ``` @@ -234,8 +246,8 @@ StateProgressBar stateProgressBar = (StateProgressBar) findViewById(R.id.state_p ``` @@ -250,8 +262,8 @@ StateProgressBar stateProgressBar = (StateProgressBar) findViewById(R.id.state_p ``` @@ -266,8 +278,8 @@ StateProgressBar stateProgressBar = (StateProgressBar) findViewById(R.id.state_p ``` @@ -280,8 +292,8 @@ StateProgressBar stateProgressBar = (StateProgressBar) findViewById(R.id.state_p + app:spb_currentStateNumber="2" + app:spb_maxStateNumber="4"/> String[] descriptionData = {"Details", "Status", "Photo", "Confirm"}; @@ -368,8 +380,8 @@ protected void onCreate(Bundle savedInstanceState) { + app:spb_currentStateNumber="3" + app:spb_maxStateNumber="5"/> String[] descriptionData = {"Details\nPlace", "Status\nPrice", "Photo\nShoot", "Confirm\nResponse" , "Buy\nDone"}; @@ -461,8 +473,8 @@ protected void onCreate(Bundle savedInstanceState) { android:id="@+id/your_state_progress_bar_id" android:layout_width="wrap_content" android:layout_height="wrap_content" - app:spb_currentStateNumber="three" - app:spb_maxStateNumber="five" + app:spb_currentStateNumber="3" + app:spb_maxStateNumber="5" app:spb_justifyMultilineDescription="true" app:spb_descriptionLinesSpacing="5dp"/> diff --git a/StateProgressBar.iml b/StateProgressBar.iml deleted file mode 100644 index 2ad27de..0000000 --- a/StateProgressBar.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/build.gradle b/build.gradle index 80fc77f..29de607 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.0.1' + classpath 'com.android.tools.build:gradle:4.1.3' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' // NOTE: Do not place your application dependencies here; they belong @@ -19,4 +19,4 @@ allprojects { jcenter() google() } -} +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 7975d4b..8c4b033 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,3 +15,5 @@ #Wed Jul 05 13:59:29 BRT 2017 # Remove this sometimes to resolve gradle issue +android.enableJetifier=true +android.useAndroidX=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 8c0fb64..62d4c05 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 662e1af..790e14f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sat Jan 27 16:37:10 GMT 2018 +#Fri Mar 19 19:40:40 CST 2021 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip diff --git a/gradlew b/gradlew index e69de29..fbd7c51 100644 --- a/gradlew +++ b/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 8a0b282..5093609 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -8,14 +24,17 @@ @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome @@ -46,10 +65,9 @@ echo location of your Java installation. goto fail :init -@rem Get command-line arguments, handling Windowz variants +@rem Get command-line arguments, handling Windows variants if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args :win9xME_args @rem Slurp the command line arguments. @@ -60,17 +78,13 @@ set _SKIP=2 if "x%~1" == "x" goto execute set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% diff --git a/sample/build.gradle b/sample/build.gradle index bb7a93d..406e595 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 26 + compileSdkVersion 30 defaultConfig { applicationId "com.kofigyan.stateprogressbarsample" minSdkVersion 14 - targetSdkVersion 26 + targetSdkVersion 30 versionCode 1 versionName "1.1" } @@ -19,8 +19,11 @@ android { } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'com.android.support:appcompat-v7:26.1.0' - compile 'com.android.support:recyclerview-v7:26.1.0' - compile project(":stateprogressbar") + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'androidx.recyclerview:recyclerview:1.1.0' + implementation project(":stateprogressbar") + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.2' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' } diff --git a/sample/sample.iml b/sample/sample.iml deleted file mode 100644 index 90929cc..0000000 --- a/sample/sample.iml +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sample/src/androidTest/java/com/kofigyan/stateprogressbarsample/ApplicationTest.java b/sample/src/androidTest/java/com/kofigyan/stateprogressbarsample/ApplicationTest.java deleted file mode 100644 index 4191b25..0000000 --- a/sample/src/androidTest/java/com/kofigyan/stateprogressbarsample/ApplicationTest.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.kofigyan.stateprogressbarsample; - -import android.app.Application; -import android.test.ApplicationTestCase; - -/** - * Testing Fundamentals - */ -public class ApplicationTest extends ApplicationTestCase { - public ApplicationTest() { - super(Application.class); - } -} \ No newline at end of file diff --git a/sample/src/androidTest/java/com/kofigyan/stateprogressbarsample/ExampleInstrumentedTest.java b/sample/src/androidTest/java/com/kofigyan/stateprogressbarsample/ExampleInstrumentedTest.java new file mode 100644 index 0000000..26a76de --- /dev/null +++ b/sample/src/androidTest/java/com/kofigyan/stateprogressbarsample/ExampleInstrumentedTest.java @@ -0,0 +1,17 @@ +package com.kofigyan.stateprogressbarsample; + +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() {} +} \ No newline at end of file diff --git a/sample/src/main/java/com/kofigyan/stateprogressbarsample/BaseActivity.java b/sample/src/main/java/com/kofigyan/stateprogressbarsample/BaseActivity.java index e9c5030..c9f1461 100644 --- a/sample/src/main/java/com/kofigyan/stateprogressbarsample/BaseActivity.java +++ b/sample/src/main/java/com/kofigyan/stateprogressbarsample/BaseActivity.java @@ -1,14 +1,13 @@ package com.kofigyan.stateprogressbarsample; import android.app.Activity; -import android.support.v4.content.ContextCompat; import android.view.Menu; import android.view.MenuItem; import android.widget.Toast; +import androidx.core.content.ContextCompat; + import com.kofigyan.stateprogressbar.StateProgressBar; -import com.kofigyan.stateprogressbar.components.StateItem; -import com.kofigyan.stateprogressbar.listeners.OnStateItemClickListener; /** * Created by Kofi Gyan on 7/22/2016. @@ -21,7 +20,7 @@ public abstract class BaseActivity extends Activity { @Override public void setContentView(int layoutResID) { super.setContentView(layoutResID); - stateProgressBar = (StateProgressBar) findViewById(R.id.state_progress_bar); + stateProgressBar = findViewById(R.id.state_progress_bar); } @@ -71,8 +70,8 @@ public boolean onOptionsItemSelected(MenuItem item) { break; case R.id.current_state: - if (stateProgressBar.getMaxStateNumber() >= StateProgressBar.StateNumber.TWO.getValue()) - stateProgressBar.setCurrentStateNumber(StateProgressBar.StateNumber.TWO); + if (stateProgressBar.getMaxStateNumber() >= 2) + stateProgressBar.setCurrentStateNumber(2); else Toast.makeText(getApplicationContext() , getResources().getString(R.string.max_error_message) , Toast.LENGTH_LONG).show(); @@ -80,8 +79,8 @@ public boolean onOptionsItemSelected(MenuItem item) { break; case R.id.max_state: - if (stateProgressBar.getCurrentStateNumber() <= StateProgressBar.StateNumber.FOUR.getValue()) - stateProgressBar.setMaxStateNumber(StateProgressBar.StateNumber.FOUR); + if (stateProgressBar.getCurrentStateNumber() <= 4) + stateProgressBar.setMaxStateNumber(4); else Toast.makeText(getApplicationContext() , getResources().getString(R.string.max_error_message) , Toast.LENGTH_LONG).show(); diff --git a/sample/src/main/java/com/kofigyan/stateprogressbarsample/BaseDescriptionActivity.java b/sample/src/main/java/com/kofigyan/stateprogressbarsample/BaseDescriptionActivity.java index 00f8065..d716238 100644 --- a/sample/src/main/java/com/kofigyan/stateprogressbarsample/BaseDescriptionActivity.java +++ b/sample/src/main/java/com/kofigyan/stateprogressbarsample/BaseDescriptionActivity.java @@ -1,10 +1,11 @@ package com.kofigyan.stateprogressbarsample; -import android.support.v4.content.ContextCompat; import android.view.Menu; import android.view.MenuItem; import android.widget.Toast; +import androidx.core.content.ContextCompat; + import com.kofigyan.stateprogressbar.StateProgressBar; import com.kofigyan.stateprogressbar.components.StateItem; import com.kofigyan.stateprogressbar.listeners.OnStateItemClickListener; diff --git a/sample/src/main/java/com/kofigyan/stateprogressbarsample/ListBaseActivity.java b/sample/src/main/java/com/kofigyan/stateprogressbarsample/ListBaseActivity.java index 5760362..e36fd60 100644 --- a/sample/src/main/java/com/kofigyan/stateprogressbarsample/ListBaseActivity.java +++ b/sample/src/main/java/com/kofigyan/stateprogressbarsample/ListBaseActivity.java @@ -3,12 +3,13 @@ import android.app.Activity; import android.content.Intent; import android.net.Uri; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; import android.view.Menu; import android.view.MenuItem; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + import com.kofigyan.stateprogressbarsample.not_stateprogressbar.custom.DividerItemDecoration; /** diff --git a/sample/src/main/java/com/kofigyan/stateprogressbarsample/UsageAmenitiesActivity.java b/sample/src/main/java/com/kofigyan/stateprogressbarsample/UsageAmenitiesActivity.java index a4621c4..cf0ad3c 100644 --- a/sample/src/main/java/com/kofigyan/stateprogressbarsample/UsageAmenitiesActivity.java +++ b/sample/src/main/java/com/kofigyan/stateprogressbarsample/UsageAmenitiesActivity.java @@ -21,7 +21,7 @@ protected void onCreate(Bundle savedInstanceState) { injectBackView(); - stateprogressbar.setCurrentStateNumber(StateProgressBar.StateNumber.THREE); + stateprogressbar.setCurrentStateNumber(3); } @Override diff --git a/sample/src/main/java/com/kofigyan/stateprogressbarsample/UsageDetailsActivity.java b/sample/src/main/java/com/kofigyan/stateprogressbarsample/UsageDetailsActivity.java index b713d03..f0df421 100644 --- a/sample/src/main/java/com/kofigyan/stateprogressbarsample/UsageDetailsActivity.java +++ b/sample/src/main/java/com/kofigyan/stateprogressbarsample/UsageDetailsActivity.java @@ -20,7 +20,7 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_usage_details); - stateprogressbar.setCurrentStateNumber(StateProgressBar.StateNumber.ONE); + stateprogressbar.setCurrentStateNumber(1); setupUserDetailsView(); } diff --git a/sample/src/main/java/com/kofigyan/stateprogressbarsample/UsagePricingActivity.java b/sample/src/main/java/com/kofigyan/stateprogressbarsample/UsagePricingActivity.java index 25ba096..c92ea0f 100644 --- a/sample/src/main/java/com/kofigyan/stateprogressbarsample/UsagePricingActivity.java +++ b/sample/src/main/java/com/kofigyan/stateprogressbarsample/UsagePricingActivity.java @@ -21,7 +21,7 @@ protected void onCreate(Bundle savedInstanceState) { injectBackView(); - stateprogressbar.setCurrentStateNumber(StateProgressBar.StateNumber.TWO); + stateprogressbar.setCurrentStateNumber(2); } @Override diff --git a/sample/src/main/java/com/kofigyan/stateprogressbarsample/UsageStatusActivity.java b/sample/src/main/java/com/kofigyan/stateprogressbarsample/UsageStatusActivity.java index 4093dfd..8556e63 100644 --- a/sample/src/main/java/com/kofigyan/stateprogressbarsample/UsageStatusActivity.java +++ b/sample/src/main/java/com/kofigyan/stateprogressbarsample/UsageStatusActivity.java @@ -4,8 +4,6 @@ import android.os.Bundle; import android.view.View; -import com.kofigyan.stateprogressbar.StateProgressBar; - /** * Created by Kofi Gyan on 7/13/2016. */ @@ -22,7 +20,7 @@ protected void onCreate(Bundle savedInstanceState) { injectBackView(); nextBtn.setText("Submit"); - stateprogressbar.setCurrentStateNumber(StateProgressBar.StateNumber.FOUR); + stateprogressbar.setCurrentStateNumber(4); } diff --git a/sample/src/main/java/com/kofigyan/stateprogressbarsample/not_stateprogressbar/adapter/ApiFeatureAdapter.java b/sample/src/main/java/com/kofigyan/stateprogressbarsample/not_stateprogressbar/adapter/ApiFeatureAdapter.java index 5e99564..7f8c3d3 100644 --- a/sample/src/main/java/com/kofigyan/stateprogressbarsample/not_stateprogressbar/adapter/ApiFeatureAdapter.java +++ b/sample/src/main/java/com/kofigyan/stateprogressbarsample/not_stateprogressbar/adapter/ApiFeatureAdapter.java @@ -2,12 +2,13 @@ import android.content.Context; import android.content.Intent; -import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; +import androidx.recyclerview.widget.RecyclerView; + import com.kofigyan.stateprogressbarsample.R; import com.kofigyan.stateprogressbarsample.not_stateprogressbar.pojo.ApiFeature; import com.kofigyan.stateprogressbarsample.not_stateprogressbar.utils.Utils; diff --git a/sample/src/main/java/com/kofigyan/stateprogressbarsample/not_stateprogressbar/adapter/StatesListAdapter.java b/sample/src/main/java/com/kofigyan/stateprogressbarsample/not_stateprogressbar/adapter/StatesListAdapter.java index 2d1795c..c612f8d 100644 --- a/sample/src/main/java/com/kofigyan/stateprogressbarsample/not_stateprogressbar/adapter/StatesListAdapter.java +++ b/sample/src/main/java/com/kofigyan/stateprogressbarsample/not_stateprogressbar/adapter/StatesListAdapter.java @@ -2,12 +2,13 @@ import android.content.Context; import android.content.Intent; -import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; +import androidx.recyclerview.widget.RecyclerView; + import com.kofigyan.stateprogressbarsample.R; import com.kofigyan.stateprogressbarsample.not_stateprogressbar.utils.Utils; diff --git a/sample/src/main/java/com/kofigyan/stateprogressbarsample/not_stateprogressbar/custom/DividerItemDecoration.java b/sample/src/main/java/com/kofigyan/stateprogressbarsample/not_stateprogressbar/custom/DividerItemDecoration.java index 13f773d..dc699fb 100644 --- a/sample/src/main/java/com/kofigyan/stateprogressbarsample/not_stateprogressbar/custom/DividerItemDecoration.java +++ b/sample/src/main/java/com/kofigyan/stateprogressbarsample/not_stateprogressbar/custom/DividerItemDecoration.java @@ -5,10 +5,11 @@ import android.graphics.Canvas; import android.graphics.Rect; import android.graphics.drawable.Drawable; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; import android.view.View; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + /** * Created by Kofi Gyan on 7/12/2016. diff --git a/sample/src/main/res/layout/activity_all_states_completed.xml b/sample/src/main/res/layout/activity_all_states_completed.xml index fc19972..fa7b39b 100644 --- a/sample/src/main/res/layout/activity_all_states_completed.xml +++ b/sample/src/main/res/layout/activity_all_states_completed.xml @@ -10,8 +10,8 @@ android:id="@+id/state_progress_bar" android:layout_width="wrap_content" android:layout_height="wrap_content" - app:spb_currentStateNumber="three" + app:spb_currentStateNumber="3" app:spb_enableAllStatesCompleted="true" - app:spb_maxStateNumber="four" /> + app:spb_maxStateNumber="4" /> \ No newline at end of file diff --git a/sample/src/main/res/layout/activity_animation_four_states.xml b/sample/src/main/res/layout/activity_animation_four_states.xml index bc3ffb6..d009fa8 100644 --- a/sample/src/main/res/layout/activity_animation_four_states.xml +++ b/sample/src/main/res/layout/activity_animation_four_states.xml @@ -12,8 +12,8 @@ android:layout_height="wrap_content" app:spb_animateToCurrentProgressState="true" app:spb_checkStateCompleted="true" - app:spb_currentStateNumber="three" - app:spb_maxStateNumber="four" /> + app:spb_currentStateNumber="3" + app:spb_maxStateNumber="4" /> \ No newline at end of file diff --git a/sample/src/main/res/layout/activity_basic_five_descending_states.xml b/sample/src/main/res/layout/activity_basic_five_descending_states.xml index dc68e1b..ac93cc6 100644 --- a/sample/src/main/res/layout/activity_basic_five_descending_states.xml +++ b/sample/src/main/res/layout/activity_basic_five_descending_states.xml @@ -11,8 +11,8 @@ android:id="@+id/state_progress_bar" android:layout_width="wrap_content" android:layout_height="wrap_content" - app:spb_currentStateNumber="four" - app:spb_maxStateNumber="five" + app:spb_currentStateNumber="4" + app:spb_maxStateNumber="5" app:spb_stateNumberIsDescending="true" /> \ No newline at end of file diff --git a/sample/src/main/res/layout/activity_basic_five_states.xml b/sample/src/main/res/layout/activity_basic_five_states.xml index 5a91747..fbc19e8 100644 --- a/sample/src/main/res/layout/activity_basic_five_states.xml +++ b/sample/src/main/res/layout/activity_basic_five_states.xml @@ -11,7 +11,7 @@ android:id="@+id/state_progress_bar" android:layout_width="wrap_content" android:layout_height="wrap_content" - app:spb_currentStateNumber="four" - app:spb_maxStateNumber="five" /> + app:spb_currentStateNumber="4" + app:spb_maxStateNumber="5" /> \ No newline at end of file diff --git a/sample/src/main/res/layout/activity_basic_four_descending_states.xml b/sample/src/main/res/layout/activity_basic_four_descending_states.xml index 229de66..83db9c7 100644 --- a/sample/src/main/res/layout/activity_basic_four_descending_states.xml +++ b/sample/src/main/res/layout/activity_basic_four_descending_states.xml @@ -11,8 +11,8 @@ android:id="@+id/state_progress_bar" android:layout_width="wrap_content" android:layout_height="wrap_content" - app:spb_currentStateNumber="three" - app:spb_maxStateNumber="four" + app:spb_currentStateNumber="3" + app:spb_maxStateNumber="4" app:spb_stateNumberIsDescending="true" /> \ No newline at end of file diff --git a/sample/src/main/res/layout/activity_basic_four_states.xml b/sample/src/main/res/layout/activity_basic_four_states.xml index 36c66e9..a094e6c 100644 --- a/sample/src/main/res/layout/activity_basic_four_states.xml +++ b/sample/src/main/res/layout/activity_basic_four_states.xml @@ -11,7 +11,7 @@ android:id="@+id/state_progress_bar" android:layout_width="wrap_content" android:layout_height="wrap_content" - app:spb_currentStateNumber="three" - app:spb_maxStateNumber="four" /> + app:spb_currentStateNumber="3" + app:spb_maxStateNumber="4" /> \ No newline at end of file diff --git a/sample/src/main/res/layout/activity_basic_three_descending_states.xml b/sample/src/main/res/layout/activity_basic_three_descending_states.xml index b88ab57..be3695d 100644 --- a/sample/src/main/res/layout/activity_basic_three_descending_states.xml +++ b/sample/src/main/res/layout/activity_basic_three_descending_states.xml @@ -11,8 +11,8 @@ android:id="@+id/state_progress_bar" android:layout_width="wrap_content" android:layout_height="wrap_content" - app:spb_currentStateNumber="two" - app:spb_maxStateNumber="three" + app:spb_currentStateNumber="2" + app:spb_maxStateNumber="3" app:spb_stateNumberIsDescending="true" /> \ No newline at end of file diff --git a/sample/src/main/res/layout/activity_basic_three_states.xml b/sample/src/main/res/layout/activity_basic_three_states.xml index 6c444a7..7249614 100644 --- a/sample/src/main/res/layout/activity_basic_three_states.xml +++ b/sample/src/main/res/layout/activity_basic_three_states.xml @@ -11,7 +11,7 @@ android:id="@+id/state_progress_bar" android:layout_width="wrap_content" android:layout_height="wrap_content" - app:spb_currentStateNumber="two" - app:spb_maxStateNumber="three" /> + app:spb_currentStateNumber="2" + app:spb_maxStateNumber="3" /> \ No newline at end of file diff --git a/sample/src/main/res/layout/activity_basic_two_descending_states.xml b/sample/src/main/res/layout/activity_basic_two_descending_states.xml index 949455b..4a9ddd4 100644 --- a/sample/src/main/res/layout/activity_basic_two_descending_states.xml +++ b/sample/src/main/res/layout/activity_basic_two_descending_states.xml @@ -10,8 +10,8 @@ android:id="@+id/state_progress_bar" android:layout_width="wrap_content" android:layout_height="wrap_content" - app:spb_currentStateNumber="one" - app:spb_maxStateNumber="two" + app:spb_currentStateNumber="1" + app:spb_maxStateNumber="2" app:spb_stateNumberIsDescending="true" /> \ No newline at end of file diff --git a/sample/src/main/res/layout/activity_basic_two_states.xml b/sample/src/main/res/layout/activity_basic_two_states.xml index 7faa6d1..1997faf 100644 --- a/sample/src/main/res/layout/activity_basic_two_states.xml +++ b/sample/src/main/res/layout/activity_basic_two_states.xml @@ -10,7 +10,7 @@ android:id="@+id/state_progress_bar" android:layout_width="wrap_content" android:layout_height="wrap_content" - app:spb_currentStateNumber="one" - app:spb_maxStateNumber="two" /> + app:spb_currentStateNumber="1" + app:spb_maxStateNumber="2" /> \ No newline at end of file diff --git a/sample/src/main/res/layout/activity_check_four_states.xml b/sample/src/main/res/layout/activity_check_four_states.xml index 8b822a0..1a2886d 100644 --- a/sample/src/main/res/layout/activity_check_four_states.xml +++ b/sample/src/main/res/layout/activity_check_four_states.xml @@ -11,8 +11,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" app:spb_checkStateCompleted="true" - app:spb_currentStateNumber="three" - app:spb_maxStateNumber="four" /> + app:spb_currentStateNumber="3" + app:spb_maxStateNumber="4" /> \ No newline at end of file diff --git a/sample/src/main/res/layout/activity_coloring_states.xml b/sample/src/main/res/layout/activity_coloring_states.xml index 2479d9a..2b5b84c 100644 --- a/sample/src/main/res/layout/activity_coloring_states.xml +++ b/sample/src/main/res/layout/activity_coloring_states.xml @@ -14,8 +14,8 @@ app:spb_animateToCurrentProgressState="true" app:spb_checkStateCompleted="true" app:spb_currentStateDescriptionColor="@color/demo_state_foreground_color" - app:spb_currentStateNumber="three" - app:spb_maxStateNumber="four" + app:spb_currentStateNumber="3" + app:spb_maxStateNumber="4" app:spb_stateBackgroundColor="@color/state_background_color" app:spb_stateDescriptionColor="@color/state_background_text_color" app:spb_stateForegroundColor="@color/demo_state_foreground_color" diff --git a/sample/src/main/res/layout/activity_description_four_states.xml b/sample/src/main/res/layout/activity_description_four_states.xml index edf163a..12f2de0 100644 --- a/sample/src/main/res/layout/activity_description_four_states.xml +++ b/sample/src/main/res/layout/activity_description_four_states.xml @@ -10,7 +10,7 @@ android:id="@+id/state_progress_bar" android:layout_width="wrap_content" android:layout_height="wrap_content" - app:spb_currentStateNumber="two" - app:spb_maxStateNumber="four" /> + app:spb_currentStateNumber="2" + app:spb_maxStateNumber="4" /> \ No newline at end of file diff --git a/sample/src/main/res/layout/activity_main.xml b/sample/src/main/res/layout/activity_main.xml index 410a501..f165f48 100644 --- a/sample/src/main/res/layout/activity_main.xml +++ b/sample/src/main/res/layout/activity_main.xml @@ -5,7 +5,7 @@ android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"> - - + app:spb_stateNumberForegroundColor="@color/state_foreground_text_color" /> \ No newline at end of file diff --git a/stateprogressbar/build.gradle b/stateprogressbar/build.gradle index 976c02a..641bcec 100644 --- a/stateprogressbar/build.gradle +++ b/stateprogressbar/build.gradle @@ -24,11 +24,11 @@ ext { } android { - compileSdkVersion 26 + compileSdkVersion 30 defaultConfig { minSdkVersion 14 - targetSdkVersion 26 + targetSdkVersion 30 versionCode 1 versionName "1.0" } @@ -41,8 +41,11 @@ android { } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'com.android.support:appcompat-v7:26.1.0' + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation 'androidx.appcompat:appcompat:1.2.0' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.2' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' } apply from: 'https://raw.githubusercontent.com/kofigyan/JCenter/master/installv1.gradle' diff --git a/stateprogressbar/src/androidTest/java/com/kofigyan/stateprogressbar/ApplicationTest.java b/stateprogressbar/src/androidTest/java/com/kofigyan/stateprogressbar/ApplicationTest.java deleted file mode 100644 index be50b28..0000000 --- a/stateprogressbar/src/androidTest/java/com/kofigyan/stateprogressbar/ApplicationTest.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.kofigyan.stateprogressbar; - -import android.app.Application; -import android.test.ApplicationTestCase; - -/** - * Testing Fundamentals - */ -public class ApplicationTest extends ApplicationTestCase { - public ApplicationTest() { - super(Application.class); - } -} \ No newline at end of file diff --git a/stateprogressbar/src/androidTest/java/com/kofigyan/stateprogressbar/ExampleInstrumentedTest.java b/stateprogressbar/src/androidTest/java/com/kofigyan/stateprogressbar/ExampleInstrumentedTest.java new file mode 100644 index 0000000..d72cb08 --- /dev/null +++ b/stateprogressbar/src/androidTest/java/com/kofigyan/stateprogressbar/ExampleInstrumentedTest.java @@ -0,0 +1,17 @@ +package com.kofigyan.stateprogressbar; + +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() {} +} \ No newline at end of file diff --git a/stateprogressbar/src/main/java/com/kofigyan/stateprogressbar/StateProgressBar.java b/stateprogressbar/src/main/java/com/kofigyan/stateprogressbar/StateProgressBar.java index 4b83045..e6b86d5 100644 --- a/stateprogressbar/src/main/java/com/kofigyan/stateprogressbar/StateProgressBar.java +++ b/stateprogressbar/src/main/java/com/kofigyan/stateprogressbar/StateProgressBar.java @@ -4,16 +4,20 @@ import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Paint; +import android.graphics.RectF; import android.graphics.Typeface; import android.os.Bundle; import android.os.Parcelable; -import android.support.v4.content.ContextCompat; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.view.animation.AccelerateDecelerateInterpolator; import android.widget.Scroller; +import androidx.annotation.NonNull; +import androidx.core.content.ContextCompat; +import androidx.core.content.res.ResourcesCompat; + import com.kofigyan.stateprogressbar.components.StateItem; import com.kofigyan.stateprogressbar.components.StateItemDescription; import com.kofigyan.stateprogressbar.components.StateItemNumber; @@ -29,24 +33,30 @@ * Created by Kofi Gyan on 4/19/2016. */ +@SuppressWarnings({"DanglingJavadoc", "unused", "RedundantSuppression"}) public class StateProgressBar extends View { + public enum StateHighlightMode { + NONE(0), CURRENT(1), FINISHED(2); + private final int value; - public enum StateNumber { - ONE(1), TWO(2), THREE(3), FOUR(4), FIVE(5); - private int value; - - StateNumber(int value) { + StateHighlightMode(int value) { this.value = value; } - public int getValue() { - return value; + public int getValue() { return value; } + + static StateHighlightMode fromInt(int value) { + switch (value) { + case 0: return StateHighlightMode.NONE; + case 1: return StateHighlightMode.CURRENT; + case 2: return StateHighlightMode.FINISHED; + } + return StateHighlightMode.CURRENT; } } private static final int MIN_STATE_NUMBER = 1; - private static final int MAX_STATE_NUMBER = 5; private static final String STATE_SIZE_KEY = "mStateSize"; private static final String STATE_LINE_THICKNESS_KEY = "mStateLineThickness"; @@ -55,6 +65,7 @@ public int getValue() { private static final String MAX_STATE_NUMBER_KEY = "mMaxStateNumber"; private static final String CURRENT_STATE_NUMBER_KEY = "mCurrentStateNumber"; + private static final String TEXT_START_NUMBER_KEY = "mTextStartNumber"; private static final String ANIM_START_DELAY_KEY = "mAnimStartDelay"; private static final String ANIM_DURATION_KEY = "mAnimDuration"; @@ -69,6 +80,10 @@ public int getValue() { private static final String CURRENT_STATE_DESC_COLOR_KEY = "mCurrentStateDescriptionColor"; private static final String STATE_DESC_COLOR_KEY = "mStateDescriptionColor"; + private static final String CURRENT_STATE_DESC_BACKGROUND_COLOR_KEY = "mCurrentStateDescriptionBackgroundColor"; + private static final String STATE_DESC_BACKGROUND_COLOR_KEY = "mStateDescriptionBackgroundColor"; + + private static final String STATE_HIGHLIGHT_MODE_KEY = "mStateHighlightMode"; private static final String CHECK_STATE_COMPLETED_KEY = "mCheckStateCompleted"; @@ -87,7 +102,7 @@ public int getValue() { private static final String IS_STATE_NUMBER_DESCENDING_KEY = "mIsStateNumberDescending"; private static final String INSTANCE_STATE = "saved_instance"; - private ArrayList mStateDescriptionData = new ArrayList(); + private ArrayList mStateDescriptionData = new ArrayList<>(); private float mStateRadius; private float mStateSize; @@ -119,6 +134,7 @@ public int getValue() { private int mMaxStateNumber; private int mCurrentStateNumber; + private int mTextStartNumber; private int mAnimStartDelay; private int mAnimDuration; @@ -128,6 +144,8 @@ public int getValue() { private float mDescTopSpaceDecrementer; private float mDescTopSpaceIncrementer; + private StateHighlightMode mStateHighlightMode; + private static final float DEFAULT_TEXT_SIZE = 15f; private static final float DEFAULT_STATE_SIZE = 25f; @@ -141,6 +159,8 @@ public int getValue() { private Paint mForegroundPaint; private Paint mCurrentStateDescriptionPaint; private Paint mStateDescriptionPaint; + private Paint mCurrentStateDescriptionBackgroundPaint; + private Paint mStateDescriptionBackgroundPaint; private int mBackgroundColor; private int mForegroundColor; @@ -148,6 +168,8 @@ public int getValue() { private int mStateNumberForegroundColor; private int mCurrentStateDescriptionColor; private int mStateDescriptionColor; + private int mCurrentStateDescriptionBackgroundColor; + private int mStateDescriptionBackgroundColor; /** * animate inner line to current progress state @@ -237,9 +259,14 @@ private void init(Context context, AttributeSet attrs, int defStyle) { mStateNumberForegroundColor = a.getColor(R.styleable.StateProgressBar_spb_stateNumberForegroundColor, mStateNumberForegroundColor); mCurrentStateDescriptionColor = a.getColor(R.styleable.StateProgressBar_spb_currentStateDescriptionColor, mCurrentStateDescriptionColor); mStateDescriptionColor = a.getColor(R.styleable.StateProgressBar_spb_stateDescriptionColor, mStateDescriptionColor); + mCurrentStateDescriptionBackgroundColor = a.getColor(R.styleable.StateProgressBar_spb_currentStateDescriptionBackgroundColor, mCurrentStateDescriptionBackgroundColor); + mStateDescriptionBackgroundColor = a.getColor(R.styleable.StateProgressBar_spb_stateDescriptionBackgroundColor, mStateDescriptionBackgroundColor); + + mStateHighlightMode = StateHighlightMode.fromInt(a.getInteger(R.styleable.StateProgressBar_spb_stateHighlightMode, mStateHighlightMode.getValue())); mCurrentStateNumber = a.getInteger(R.styleable.StateProgressBar_spb_currentStateNumber, mCurrentStateNumber); mMaxStateNumber = a.getInteger(R.styleable.StateProgressBar_spb_maxStateNumber, mMaxStateNumber); + mTextStartNumber = a.getInteger(R.styleable.StateProgressBar_spb_textStartNumber, mTextStartNumber); mStateSize = a.getDimension(R.styleable.StateProgressBar_spb_stateSize, mStateSize); mStateNumberTextSize = a.getDimension(R.styleable.StateProgressBar_spb_stateTextSize, mStateNumberTextSize); @@ -262,6 +289,11 @@ private void init(Context context, AttributeSet attrs, int defStyle) { mDescriptionLinesSpacing = a.getDimension(R.styleable.StateProgressBar_spb_descriptionLinesSpacing, mDescriptionLinesSpacing); + int fontId = a.getResourceId(R.styleable.StateProgressBar_spb_descriptionFontFamily, -1); + if (fontId != -1) { + mCustomStateDescriptionTypeface = ResourcesCompat.getFont(context, fontId); + } + mJustifyMultilineDescription = a.getBoolean(R.styleable.StateProgressBar_spb_justifyMultilineDescription, mJustifyMultilineDescription); @@ -286,13 +318,17 @@ private void initializePainters() { mBackgroundPaint = setPaintAttributes(mStateLineThickness, mBackgroundColor); mForegroundPaint = setPaintAttributes(mStateLineThickness, mForegroundColor); - mStateNumberForegroundPaint = setPaintAttributes(mStateNumberTextSize, mStateNumberForegroundColor, mCustomStateNumberTypeface != null ? mCustomStateNumberTypeface : mDefaultTypefaceBold); + Typeface typeface = mCustomStateDescriptionTypeface != null ? mCustomStateDescriptionTypeface : mDefaultTypefaceBold; + mStateNumberForegroundPaint = setPaintAttributes(mStateNumberTextSize, mStateNumberForegroundColor, typeface); mStateCheckedForegroundPaint = setPaintAttributes(mStateNumberTextSize, mStateNumberForegroundColor, mCheckFont); - mStateNumberBackgroundPaint = setPaintAttributes(mStateNumberTextSize, mStateNumberBackgroundColor, mCustomStateNumberTypeface != null ? mCustomStateNumberTypeface : mDefaultTypefaceBold); - mCurrentStateDescriptionPaint = setPaintAttributes(mStateDescriptionSize, mCurrentStateDescriptionColor, mCustomStateDescriptionTypeface != null ? mCustomStateDescriptionTypeface : mDefaultTypefaceBold); + mStateNumberBackgroundPaint = setPaintAttributes(mStateNumberTextSize, mStateNumberBackgroundColor, typeface); - mStateDescriptionPaint = setPaintAttributes(mStateDescriptionSize, mStateDescriptionColor, mCustomStateDescriptionTypeface != null ? mCustomStateDescriptionTypeface : mDefaultTypefaceBold); + mCurrentStateDescriptionPaint = setPaintAttributes(mStateDescriptionSize, mCurrentStateDescriptionColor, typeface); + mStateDescriptionPaint = setPaintAttributes(mStateDescriptionSize, mStateDescriptionColor, typeface); + + mCurrentStateDescriptionBackgroundPaint = setPaintAttributes(mCurrentStateDescriptionBackgroundColor); + mStateDescriptionBackgroundPaint = setPaintAttributes(mStateDescriptionBackgroundColor); } @@ -415,9 +451,29 @@ public int getCurrentStateDescriptionColor() { return mCurrentStateDescriptionColor; } - public void setCurrentStateNumber(StateNumber currentStateNumber) { - validateStateNumber(currentStateNumber.getValue()); - mCurrentStateNumber = currentStateNumber.getValue(); + public void setStateDescriptionBackgroundColor(int stateDescriptionBackgroundColor) { + mStateDescriptionBackgroundColor = stateDescriptionBackgroundColor; + mStateDescriptionBackgroundPaint.setColor(mStateDescriptionBackgroundColor); + invalidate(); + } + + public int getStateDescriptionBackgroundColor() { + return mStateDescriptionBackgroundColor; + } + + public void setCurrentStateDescriptionBackgroundColor(int currentStateDescriptionBackgroundColor) { + mCurrentStateDescriptionBackgroundColor = currentStateDescriptionBackgroundColor; + mCurrentStateDescriptionBackgroundPaint.setColor(mCurrentStateDescriptionBackgroundColor); + invalidate(); + } + + public int getCurrentStateDescriptionBackgroundColor() { + return mCurrentStateDescriptionBackgroundColor; + } + + public void setCurrentStateNumber(int currentStateNumber) { + validateStateNumber(currentStateNumber); + mCurrentStateNumber = currentStateNumber; updateCheckAllStatesValues(mEnableAllStatesCompleted); invalidate(); } @@ -427,8 +483,9 @@ public int getCurrentStateNumber() { } - public void setMaxStateNumber(StateNumber maximumState) { - mMaxStateNumber = maximumState.getValue(); + public void setMaxStateNumber(int maximumState) { + mMaxStateNumber = maximumState; + computeCellWidth(); resolveMaxStateNumber(); } @@ -442,6 +499,14 @@ public int getMaxStateNumber() { return mMaxStateNumber; } + public void setTextStartNumber(int textStart) { + mTextStartNumber = textStart; + } + + public int getTextStartNumber() { + return mTextStartNumber; + } + public void setStateSize(float stateSize) { mStateSize = convertDpToPixel(stateSize); @@ -604,7 +669,13 @@ public boolean isDescriptionMultiline() { return mIsDescriptionMultiline; } + public float getStatePosition(int stateNumber) { + int statePosition = mIsStateNumberDescending ? mMaxStateNumber - stateNumber : stateNumber - 1; + return mCellWidth * (statePosition + 0.5f); + } + + @SuppressWarnings("SameParameterValue") private void updateDescriptionMultilineStatus(boolean multiline) { mIsDescriptionMultiline = multiline; } @@ -660,14 +731,19 @@ private void initStateProgressBar(Context context) { mStateNumberForegroundColor = ContextCompat.getColor(context, R.color.foreground_text_color); mCurrentStateDescriptionColor = ContextCompat.getColor(context, R.color.foreground_color); mStateDescriptionColor = ContextCompat.getColor(context, R.color.background_text_color); + mCurrentStateDescriptionBackgroundColor = 0; // transparent + mStateDescriptionBackgroundColor = 0; + + mStateHighlightMode = StateHighlightMode.CURRENT; mStateSize = 0.0f; mStateLineThickness = 4.0f; mStateNumberTextSize = 0.0f; mStateDescriptionSize = 15f; - mMaxStateNumber = StateNumber.FIVE.getValue(); - mCurrentStateNumber = StateNumber.ONE.getValue(); + mMaxStateNumber = 5; + mCurrentStateNumber = 1; + mTextStartNumber = 1; mSpacing = 4.0f; @@ -756,24 +832,31 @@ public boolean performClick() { private boolean isPointInCircle(int clickX, int clickY) { - boolean isTouched = false; - for (int i = 0; i < mMaxStateNumber; i++) { - isTouched = (!(clickX < mCellWidth * (i + 1) - (mCellWidth / 2) - mStateRadius || clickX > mCellWidth * (i + 1) - (mCellWidth / 2) + mStateRadius || clickY < mCellHeight / 2 - mStateRadius || clickY > mCellHeight / 2 + mStateRadius)); - if (isTouched) { - mStateItemClickedNumber = mIsStateNumberDescending ? mMaxStateNumber - i : i + 1; - return isTouched; - } + int cellNum = (int)(clickX / mCellWidth); + float centerX = mCellWidth * (cellNum + 0.5f); + float centerY = mCellHeight / 2; + RectF rect = new RectF( + centerX - mStateRadius, + centerY - mStateRadius, + centerX + mStateRadius, + centerY + mStateRadius + ); + + if (rect.contains(clickX, clickY)) { + mStateItemClickedNumber = mIsStateNumberDescending ? mMaxStateNumber - cellNum : cellNum + 1; + return true; } - return isTouched; + + return false; } private StateItem getStateItem(int stateItemClickedNumber) { - final boolean isCurrentState = getCurrentStateNumber() == stateItemClickedNumber; - final boolean isForegroundColor = getCurrentStateNumber() >= stateItemClickedNumber; - final boolean isCompletedState = getCurrentStateNumber() > stateItemClickedNumber; + final boolean isCurrentState = mCurrentStateNumber == stateItemClickedNumber; + final boolean isForegroundColor = mCurrentStateNumber >= stateItemClickedNumber; + final boolean isCompletedState = mCurrentStateNumber > stateItemClickedNumber; final float stateSize = getStateSize(); final int stateColor = isForegroundColor ? mForegroundColor : mBackgroundColor; boolean isCheckedState = false; @@ -787,7 +870,7 @@ private StateItem getStateItem(int stateItemClickedNumber) { final int stateNumberColor = isForegroundColor ? mStateNumberForegroundColor : mStateNumberBackgroundColor; final float stateNumberSize = getStateNumberTextSize(); - final int stateDescriptionColor = isCurrentState ? mCurrentStateDescriptionColor : mStateDescriptionColor; + final int stateDescriptionColor = isStateHighlighted(stateItemClickedNumber) ? mCurrentStateDescriptionColor : mStateDescriptionColor; StateItemNumber stateItemNumber = StateItemNumber.builder(). @@ -817,13 +900,16 @@ private StateItem getStateItem(int stateItemClickedNumber) { build(); } + private void computeCellWidth() { + mCellWidth = (float)getWidth() / mMaxStateNumber; + mNextCellWidth = mCellWidth; + } @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); - mCellWidth = getWidth() / mMaxStateNumber; - mNextCellWidth = mCellWidth; + computeCellWidth(); } @Override @@ -867,15 +953,14 @@ private int getCellHeight() { private boolean checkForDescriptionMultiLine(ArrayList stateDescriptionData) { - boolean isMultiLine = false; for (String stateDescription : stateDescriptionData) { - isMultiLine = stateDescription.contains(STATE_DESCRIPTION_LINE_SEPARATOR); + boolean isMultiLine = stateDescription.contains(STATE_DESCRIPTION_LINE_SEPARATOR); if (isMultiLine) { - updateDescriptionMultilineStatus(isMultiLine); - return isMultiLine; + updateDescriptionMultilineStatus(true); + return true; } } - return isMultiLine; + return false; } @@ -883,7 +968,7 @@ private int getMaxDescriptionLine(List stateDescriptionData) { int maxLine = 1; for (String stateDescription : stateDescriptionData) { int lineSize = stateDescription.split(STATE_DESCRIPTION_LINE_SEPARATOR).length; - maxLine = lineSize > maxLine ? lineSize : maxLine; + maxLine = Math.max(lineSize, maxLine); } mMaxDescriptionLine = maxLine; return maxLine; @@ -974,7 +1059,7 @@ private void drawLines(Canvas canvas, Paint paint, int startIndex, int endIndex) private void setAnimatorStartEndCenterX() { - if (mCurrentStateNumber > MIN_STATE_NUMBER && mCurrentStateNumber < MAX_STATE_NUMBER + 1) { + if (mCurrentStateNumber > MIN_STATE_NUMBER) { final int count = mIsStateNumberDescending ? mMaxStateNumber - mCurrentStateNumber + 1 : mCurrentStateNumber - 1; for (int i = 0; i < count; i++) { @@ -1046,50 +1131,60 @@ private void animateToCurrentState(Canvas canvas) { mNextCellWidth = mCellWidth; } + private @NonNull + RectF getTextBackgroundSize(float x, float y, @NonNull String text, @NonNull Paint paint) { + Paint.FontMetrics fontMetrics = paint.getFontMetrics(); + float halfTextLength = paint.measureText(text) / 2; + RectF ret = new RectF( + x - halfTextLength, + y + fontMetrics.top, + x + halfTextLength, + y + fontMetrics.bottom); + ret.inset(-5, 0); + return ret; + } private void drawStateDescriptionText(Canvas canvas) { - int xPos; - int yPos; - Paint innerPaintType; - - if (!mStateDescriptionData.isEmpty()) { - - for (int i = 0; i < mStateDescriptionData.size(); i++) { - if (i < mMaxStateNumber) { - innerPaintType = selectDescriptionPaint(mCurrentStateNumber, i); - xPos = (int) (mNextCellWidth - (mCellWidth / 2)); - + int numDescription = Math.min(mStateDescriptionData.size(), mMaxStateNumber); - if (mIsDescriptionMultiline && mMaxDescriptionLine > 1) { - String stateDescription = mIsStateNumberDescending ? mStateDescriptionData.get(mStateDescriptionData.size() - 1 - i) : mStateDescriptionData.get(i); - int nextLineCounter = 0; - int newXPos = 0; - String[] stateDescriptionLines = stateDescription.split(STATE_DESCRIPTION_LINE_SEPARATOR); + for (int i = 0; i < numDescription; i++) { + Paint innerPaintType = selectDescriptionPaint(i); + Paint backgroundPaintType = selectDescriptionBackgroundPaint(i); - for (String line : stateDescriptionLines) { - nextLineCounter = nextLineCounter + 1; + int xPos = (int) (mNextCellWidth - (mCellWidth / 2)); - if (mJustifyMultilineDescription && nextLineCounter > 1) { - newXPos = getNewXPosForDescriptionMultilineJustification(stateDescriptionLines[0], line, innerPaintType, xPos); - } + if (mIsDescriptionMultiline && mMaxDescriptionLine > 1) { + String stateDescription = mIsStateNumberDescending ? mStateDescriptionData.get(mStateDescriptionData.size() - 1 - i) : mStateDescriptionData.get(i); + int nextLineCounter = 0; + int newXPos = 0; + String[] stateDescriptionLines = stateDescription.split(STATE_DESCRIPTION_LINE_SEPARATOR); - if (nextLineCounter <= mMaxDescriptionLine) { - yPos = (int) (mCellHeight + (nextLineCounter * mStateDescriptionSize) - mSpacing - mDescTopSpaceDecrementer + mDescTopSpaceIncrementer + (nextLineCounter > 1 ? (mDescriptionLinesSpacing * (nextLineCounter - 1)) : 0));//mSpacing = mStateNumberForegroundPaint.getTextSize() - canvas.drawText(line, newXPos == 0 ? xPos : newXPos, yPos, innerPaintType); - } + for (String line : stateDescriptionLines) { + nextLineCounter = nextLineCounter + 1; - } - - } else { - yPos = (int) (mCellHeight + mStateDescriptionSize - mSpacing - mDescTopSpaceDecrementer + mDescTopSpaceIncrementer);//mSpacing = mStateNumberForegroundPaint.getTextSize() - canvas.drawText(mIsStateNumberDescending ? mStateDescriptionData.get(mStateDescriptionData.size() - 1 - i) : mStateDescriptionData.get(i), xPos, yPos, innerPaintType); + if (mJustifyMultilineDescription && nextLineCounter > 1) { + newXPos = getNewXPosForDescriptionMultilineJustification(stateDescriptionLines[0], line, innerPaintType, xPos); } - mNextCellWidth += mCellWidth; + if (nextLineCounter <= mMaxDescriptionLine) { + int yPos = (int) (mCellHeight + (nextLineCounter * mStateDescriptionSize) - mSpacing - mDescTopSpaceDecrementer + mDescTopSpaceIncrementer + (nextLineCounter > 1 ? (mDescriptionLinesSpacing * (nextLineCounter - 1)) : 0));//mSpacing = mStateNumberForegroundPaint.getTextSize() + int x = newXPos == 0 ? xPos : newXPos; + RectF backgroundRect = getTextBackgroundSize(x, yPos, line, innerPaintType); + canvas.drawRect(backgroundRect, backgroundPaintType); + canvas.drawText(line, x, yPos, innerPaintType); + } } + } else { + //mSpacing = mStateNumberForegroundPaint.getTextSize() + int yPos = (int) (mCellHeight + mStateDescriptionSize - mSpacing - mDescTopSpaceDecrementer + mDescTopSpaceIncrementer); + String text = mStateDescriptionData.get(mIsStateNumberDescending ? mStateDescriptionData.size() - 1 - i : i); + RectF backgroundRect = getTextBackgroundSize(xPos, yPos, text, innerPaintType); + canvas.drawRect(backgroundRect, backgroundPaintType); + canvas.drawText(text, xPos, yPos, innerPaintType); } + mNextCellWidth += mCellWidth; } mNextCellWidth = mCellWidth; @@ -1123,18 +1218,38 @@ private int getNewXPosForDescriptionMultilineJustification(String firstLine, Str } + private boolean isStateHighlighted(int state) { + switch (mStateHighlightMode) { + case NONE: return false; + case CURRENT: return state == mCurrentStateNumber; + case FINISHED: return state <= mCurrentStateNumber; + } + // unreachable + return false; + } - private Paint selectDescriptionPaint(int currentState, int statePosition) { + private Paint selectDescriptionPaint(int statePosition) { - currentState = mIsStateNumberDescending ? mMaxStateNumber + 1 - currentState : currentState; + int state = mIsStateNumberDescending ? mMaxStateNumber - statePosition : statePosition + 1; - if (statePosition + 1 == currentState) { + if (isStateHighlighted(state)) { return mCurrentStateDescriptionPaint; } else { return mStateDescriptionPaint; } } + private Paint selectDescriptionBackgroundPaint(int statePosition) { + + int state = mIsStateNumberDescending ? mMaxStateNumber - statePosition : statePosition + 1; + + if (isStateHighlighted(state)) { + return mCurrentStateDescriptionBackgroundPaint; + } else { + return mStateDescriptionBackgroundPaint; + } + } + private void resolveStateDescriptionDataSize(ArrayList stateDescriptionData) { @@ -1195,9 +1310,9 @@ private void drawStateNumberText(Canvas canvas, int noOfCircles) { canvas.drawText(getContext().getString(R.string.check_icon), xPos, yPos, innerPaintType); } else { if (mIsStateNumberDescending) - canvas.drawText(String.valueOf(noOfCircles - i), xPos, yPos, innerPaintType); + canvas.drawText(String.valueOf(noOfCircles - i - 1 + mTextStartNumber), xPos, yPos, innerPaintType); else - canvas.drawText(String.valueOf(i + 1), xPos, yPos, innerPaintType); + canvas.drawText(String.valueOf(i + mTextStartNumber), xPos, yPos, innerPaintType); } } @@ -1211,10 +1326,9 @@ private Paint selectPaintType(int currentState, int statePosition, boolean check Paint backgroundPaint = mIsStateNumberDescending ? mStateNumberForegroundPaint : mStateNumberBackgroundPaint; if (checkStateCompleted) { - return applyCheckStateCompletedPaintType(currentState, statePosition, checkStateCompleted); + return applyCheckStateCompletedPaintType(currentState, statePosition, true); } else { - - if ((statePosition + 1 == currentState) || (statePosition + 1 < currentState && !checkStateCompleted)) { + if (statePosition + 1 == currentState || statePosition + 1 < currentState) { return foregroundPaint; } else { return backgroundPaint; @@ -1224,6 +1338,7 @@ private Paint selectPaintType(int currentState, int statePosition, boolean check } + @SuppressWarnings("SameParameterValue") private Paint applyCheckStateCompletedPaintType(int currentState, int statePosition, boolean checkStateCompleted) { if (checkStateCompleted(currentState, statePosition, checkStateCompleted)) { return mStateCheckedForegroundPaint; @@ -1237,15 +1352,10 @@ private Paint applyCheckStateCompletedPaintType(int currentState, int statePosit private boolean checkStateCompleted(int currentState, int statePosition, boolean checkStateCompleted) { if (!mIsStateNumberDescending) { - if ((mEnableAllStatesCompleted && checkStateCompleted) || (statePosition + 1 < currentState && checkStateCompleted)) { - return true; - } + return (mEnableAllStatesCompleted && checkStateCompleted) || (statePosition + 1 < currentState && checkStateCompleted); } else { - if ((mEnableAllStatesCompleted && checkStateCompleted) || (statePosition + 1 > currentState + 1 && checkStateCompleted)) { - return true; - } + return (mEnableAllStatesCompleted && checkStateCompleted) || (statePosition + 1 > currentState + 1 && checkStateCompleted); } - return false; } @@ -1273,7 +1383,7 @@ private void stopAnimation() { private class Animator implements Runnable { - private Scroller mScroller; + private final Scroller mScroller; private boolean mRestartAnimation = false; public Animator() { @@ -1376,6 +1486,7 @@ public Parcelable onSaveInstanceState() { bundle.putInt(MAX_STATE_NUMBER_KEY, this.mMaxStateNumber); bundle.putInt(CURRENT_STATE_NUMBER_KEY, this.mCurrentStateNumber); + bundle.putInt(TEXT_START_NUMBER_KEY, this.mTextStartNumber); bundle.putInt(ANIM_START_DELAY_KEY, this.mAnimStartDelay); bundle.putInt(ANIM_DURATION_KEY, this.mAnimDuration); @@ -1391,6 +1502,10 @@ public Parcelable onSaveInstanceState() { bundle.putInt(CURRENT_STATE_DESC_COLOR_KEY, this.mCurrentStateDescriptionColor); bundle.putInt(STATE_DESC_COLOR_KEY, this.mStateDescriptionColor); + bundle.putInt(CURRENT_STATE_DESC_BACKGROUND_COLOR_KEY, this.mCurrentStateDescriptionBackgroundColor); + bundle.putInt(STATE_DESC_BACKGROUND_COLOR_KEY, this.mStateDescriptionBackgroundColor); + + bundle.putInt(STATE_HIGHLIGHT_MODE_KEY, this.mStateHighlightMode.getValue()); bundle.putBoolean(CHECK_STATE_COMPLETED_KEY, this.mCheckStateCompleted); @@ -1435,6 +1550,7 @@ public void onRestoreInstanceState(Parcelable state) { mMaxStateNumber = bundle.getInt(MAX_STATE_NUMBER_KEY); mCurrentStateNumber = bundle.getInt(CURRENT_STATE_NUMBER_KEY); + mTextStartNumber = bundle.getInt(TEXT_START_NUMBER_KEY); resolveMaxStateNumber(); mAnimStartDelay = bundle.getInt(ANIM_START_DELAY_KEY); @@ -1451,16 +1567,17 @@ public void onRestoreInstanceState(Parcelable state) { setDescriptionTopSpaceIncrementer(mDescTopSpaceIncrementer); // call requestLayout mBackgroundColor = bundle.getInt(BACKGROUND_COLOR_KEY); - mForegroundColor = bundle.getInt(FOREGROUND_COLOR_KEY); mStateNumberBackgroundColor = bundle.getInt(STATE_NUMBER_BACKGROUND_COLOR_KEY); - mStateNumberForegroundColor = bundle.getInt(STATE_NUMBER_FOREGROUND_COLOR_KEY); mCurrentStateDescriptionColor = bundle.getInt(CURRENT_STATE_DESC_COLOR_KEY); - mStateDescriptionColor = bundle.getInt(STATE_DESC_COLOR_KEY); + mCurrentStateDescriptionBackgroundColor = bundle.getInt(CURRENT_STATE_DESC_BACKGROUND_COLOR_KEY); + mStateDescriptionBackgroundColor = bundle.getInt(STATE_DESC_BACKGROUND_COLOR_KEY); + + mStateHighlightMode = StateHighlightMode.fromInt(bundle.getInt(STATE_HIGHLIGHT_MODE_KEY)); mJustifyMultilineDescription = bundle.getBoolean(JUSTIFY_MULTILINE_DESC_KEY); diff --git a/stateprogressbar/src/main/res/values/attrs.xml b/stateprogressbar/src/main/res/values/attrs.xml index 1bcd8f5..f0636d7 100644 --- a/stateprogressbar/src/main/res/values/attrs.xml +++ b/stateprogressbar/src/main/res/values/attrs.xml @@ -12,6 +12,15 @@ + + + + + + + + + @@ -39,26 +48,16 @@ + - - - - - - - + + - - - - - - - + diff --git a/stateprogressbar/stateprogressbar.iml b/stateprogressbar/stateprogressbar.iml deleted file mode 100644 index 1fe002e..0000000 --- a/stateprogressbar/stateprogressbar.iml +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file