From 188d924c18f24dffa796425c9ba528ac03ce9a74 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Mon, 23 Jul 2018 19:43:42 +0200 Subject: [PATCH 1/3] Watchlist : Edit button animations --- .../HomeActivityFragments/Watchlist.java | 20 +++++++++++-- app/src/main/res/drawable/check_to_edit.xml | 27 ++++++++++++++++++ app/src/main/res/drawable/edit_to_check.xml | 28 +++++++++++++++++++ 3 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 app/src/main/res/drawable/check_to_edit.xml create mode 100644 app/src/main/res/drawable/edit_to_check.xml diff --git a/app/src/main/java/com/herbron/moodl/Activities/HomeActivityFragments/Watchlist.java b/app/src/main/java/com/herbron/moodl/Activities/HomeActivityFragments/Watchlist.java index 01654a4..d4d1e2f 100644 --- a/app/src/main/java/com/herbron/moodl/Activities/HomeActivityFragments/Watchlist.java +++ b/app/src/main/java/com/herbron/moodl/Activities/HomeActivityFragments/Watchlist.java @@ -3,7 +3,9 @@ package com.herbron.moodl.Activities.HomeActivityFragments; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; +import android.graphics.drawable.AnimatedVectorDrawable; import android.os.AsyncTask; +import android.os.Build; import android.support.annotation.NonNull; import android.support.v4.app.Fragment; import android.os.Bundle; @@ -143,14 +145,20 @@ public class Watchlist extends Fragment { private void setupEditButton() { - ImageButton editButton = view.findViewById(R.id.edit_button); + final ImageButton editButton = view.findViewById(R.id.edit_button); editButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if(editModeEnabled) { - ((ImageView) view.findViewById(R.id.edit_button)).setBackground(MoodlBox.getDrawable(R.drawable.ic_mode_edit_white_24dp, getContext())); + editButton.setBackground(MoodlBox.getDrawable(R.drawable.check_to_edit, getContext())); + + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) + { + AnimatedVectorDrawable animatedVectorDrawable = (AnimatedVectorDrawable) editButton.getBackground(); + animatedVectorDrawable.start(); + } editModeEnabled = false; @@ -168,7 +176,13 @@ public class Watchlist extends Fragment { } else { - ((ImageView) view.findViewById(R.id.edit_button)).setBackground(MoodlBox.getDrawable(R.drawable.ic_check_white_24dp, getContext())); + editButton.setBackground(MoodlBox.getDrawable(R.drawable.edit_to_check, getContext())); + + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) + { + AnimatedVectorDrawable animatedVectorDrawable = (AnimatedVectorDrawable) editButton.getBackground(); + animatedVectorDrawable.start(); + } editModeEnabled = true; diff --git a/app/src/main/res/drawable/check_to_edit.xml b/app/src/main/res/drawable/check_to_edit.xml new file mode 100644 index 0000000..83ceb8f --- /dev/null +++ b/app/src/main/res/drawable/check_to_edit.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/edit_to_check.xml b/app/src/main/res/drawable/edit_to_check.xml new file mode 100644 index 0000000..350bbbb --- /dev/null +++ b/app/src/main/res/drawable/edit_to_check.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + From 533aea5bb6225216f73f11caef4d63a1f6f1e896 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Mon, 23 Jul 2018 23:44:44 +0200 Subject: [PATCH 2/3] Ripple effect on watchlist/holdings add button --- .../res/drawable/button_dashed_background.xml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/drawable/button_dashed_background.xml b/app/src/main/res/drawable/button_dashed_background.xml index 9af5197..61c918f 100644 --- a/app/src/main/res/drawable/button_dashed_background.xml +++ b/app/src/main/res/drawable/button_dashed_background.xml @@ -1,6 +1,15 @@ - - + + + + + + + + + + @@ -11,4 +20,4 @@ android:dashWidth="9dp"/> - \ No newline at end of file + \ No newline at end of file From 6fe8831c69002a23a4c617a6e6782808dc7dc81b Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Tue, 31 Jul 2018 01:19:00 +0200 Subject: [PATCH 3/3] Several fixes/adjustments - LineCharts are now smooth - The splashscreens works 'properly' even when there is no cached icons - Edit mode is disabled when adding a coin in the watchlist - Add option to clear cache in the settings menu when in debug mode --- .idea/caches/build_file_checksums.ser | Bin 540 -> 545 bytes .idea/gradle.xml | 2 +- .../DetailsActivityFragments/Charts.java | 1 + .../HomeActivityFragments/Summary.java | 61 ++++++----- .../HomeActivityFragments/Watchlist.java | 102 ++++++++++-------- .../moodl/Activities/SettingsActivity.java | 28 +++++ .../CurrencyData/CurrencyCardview.java | 1 + app/src/main/res/layout/splash_screen.xml | 8 ++ app/src/main/res/xml/pref_main.xml | 11 +- 9 files changed, 143 insertions(+), 71 deletions(-) diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index 9b9448ccb03674b8e21339225f424dd4004f500e..986613b486bffe2026aa53d36f2e4a08dc10fee8 100644 GIT binary patch delta 81 zcmV-X0IvU>1fc|wm;~zlsDY83wUe0vL^7xp5}ld>Xcf?C5YOMJAn0@eFhe?ARdZ!> nb6i1WZE0?4b98cHbZ>H8E@yIKWNc+zlkfo>lZOEklkWj7lH4Io delta 75 zcmV-R0JQ(11e^qrm;}5RawU