diff --git a/README.md b/README.md index c2f48acf..4b30f127 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,14 @@ goes to Bruno. --> +## Acknowledgments: + + * [Apache Commons Code](https://commons.apache.org/proper/commons-codec/) + * [Code Parts from Google's Android Samples](https://android.googlesource.com/platform/development/+/master/samples/Vault/src/com/example/android/vault) + * [MaterialProgressBar](https://github.com/DreaminginCodeZH/MaterialProgressBar) + * [ZXing](https://github.com/zxing/zxing) + * [ZXing Android Embedded](https://github.com/journeyapps/zxing-android-embedded) + ## License: ``` Copyright (C) 2017 Jakob Nixdorf diff --git a/app/build.gradle b/app/build.gradle index 9489fd7c..ba37d3df 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -37,6 +37,7 @@ dependencies { compile 'com.journeyapps:zxing-android-embedded:3.0.3@aar' compile 'com.google.zxing:core:3.2.1' compile 'commons-codec:commons-codec:1.5' + compile 'me.zhanghai.android.materialprogressbar:library:1.4.1' androidTestCompile 'com.android.support:support-annotations:25.3.1' androidTestCompile 'com.android.support.test:runner:0.5' diff --git a/app/src/main/java/org/shadowice/flocke/andotp/MainActivity.java b/app/src/main/java/org/shadowice/flocke/andotp/MainActivity.java index 5dafdfd3..68409357 100644 --- a/app/src/main/java/org/shadowice/flocke/andotp/MainActivity.java +++ b/app/src/main/java/org/shadowice/flocke/andotp/MainActivity.java @@ -177,10 +177,10 @@ public class MainActivity extends AppCompatActivity { { @Override public void run() { - int progress = (int) (System.currentTimeMillis() / 1000) % 30 ; + int progress = (int) (TOTPHelper.TOTP_DEFAULT_PERIOD - (System.currentTimeMillis() / 1000) % TOTPHelper.TOTP_DEFAULT_PERIOD) ; progressBar.setProgress(progress*100); - ObjectAnimator animation = ObjectAnimator.ofInt(progressBar, "progress", (progress+1)*100); + ObjectAnimator animation = ObjectAnimator.ofInt(progressBar, "progress", (progress-1)*100); animation.setDuration(1000); animation.setInterpolator(new LinearInterpolator()); animation.start(); diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 1420cd30..55bc0e8c 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -26,24 +26,19 @@ android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay" /> - - - - - - - - + app:mpb_progressStyle="horizontal" + app:mpb_useIntrinsicPadding="false" + app:mpb_showProgressBackground="false" + style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal.NoPadding" /> + @@ -55,6 +50,6 @@ android:layout_height="wrap_content" android:layout_gravity="bottom|end" android:layout_margin="@dimen/fab_margin" - android:src="@drawable/ic_add_white"> + android:src="@drawable/ic_add_white" />