From 169c2b969ba61865d5203ed9fa77b62172afefdb Mon Sep 17 00:00:00 2001 From: h4h13 Date: Tue, 4 Jun 2019 22:19:20 +0530 Subject: [PATCH] Toolbar background color --- app/build.gradle | 2 +- app/src/main/assets/retro-changelog.html | 2 +- .../retromusic/activities/SearchActivity.kt | 2 +- .../mainactivity/LibraryFragment.java | 4 +- .../mainactivity/folders/FoldersFragment.java | 3 +- .../mainactivity/home/BannerHomeFragment.kt | 2 +- .../monkey/retromusic/util/RetroUtil.java | 13 ++++- .../fragment_main_activity_recycler_view.xml | 1 - .../res/layout/item_list_quick_actions.xml | 50 +++++++++++++++++++ .../main/res/layout/item_list_single_row.xml | 16 +++--- app/src/main/res/menu/menu_main.xml | 2 +- 11 files changed, 80 insertions(+), 17 deletions(-) create mode 100644 app/src/main/res/layout/item_list_quick_actions.xml diff --git a/app/build.gradle b/app/build.gradle index 10957472..324630bf 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -31,7 +31,7 @@ android { vectorDrawables.useSupportLibrary = true applicationId "code.name.monkey.retromusic" - versionCode 329 + versionCode 330 versionName '3.1.850' multiDexEnabled true diff --git a/app/src/main/assets/retro-changelog.html b/app/src/main/assets/retro-changelog.html index b5298f28..487e19cf 100644 --- a/app/src/main/assets/retro-changelog.html +++ b/app/src/main/assets/retro-changelog.html @@ -1 +1 @@ -

We're really sorry for Announcing this Retro Music is driving towards pure Android Material Design guidelines we don't want any unnecessary UI elements that don't need for Music player.

Artist images are not loading because last.fm changed policy for image downloading

v3.1.850

v3.1.800

v3.1.700

v3.1.400

v3.1.300

v3.1.240

v3.1.200

v3.0.570

If you see entire app white or dark or black select same theme in settings to fix

FAQ's

*If you face any UI related issues you clear app data and cache, if its not working try to uninstall and install again.

\ No newline at end of file +

We're really sorry for Announcing this Retro Music is driving towards pure Android Material Design guidelines we don't want any unnecessary UI elements that don't need for Music player.

Artist images are not loading because last.fm changed policy for image downloading

v3.1.850

v3.1.800

v3.1.700

v3.1.400

v3.1.300

v3.1.240

v3.1.200

v3.0.570

If you see entire app white or dark or black select same theme in settings to fix

FAQ's

*If you face any UI related issues you clear app data and cache, if its not working try to uninstall and install again.

\ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/SearchActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/SearchActivity.kt index 63216992..066e1146 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/SearchActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/SearchActivity.kt @@ -59,7 +59,7 @@ class SearchActivity : AbsMusicServiceActivity(), OnQueryTextListener, SearchCon back.setOnClickListener { onBackPressed() } voiceSearch.setOnClickListener { startMicSearch() } - searchContainer.setCardBackgroundColor(ColorStateList.valueOf(ThemeStore.primaryColor(this))) + searchContainer.setCardBackgroundColor(RetroUtil.toolbarColor(this)) keyboardPopup.setOnClickListener { val inputManager = getSystemService(Service.INPUT_METHOD_SERVICE) as InputMethodManager diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/LibraryFragment.java b/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/LibraryFragment.java index d7c8209b..f422220d 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/LibraryFragment.java +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/LibraryFragment.java @@ -1,6 +1,7 @@ package code.name.monkey.retromusic.fragments.mainactivity; import android.app.Activity; +import android.graphics.Color; import android.os.Bundle; import android.view.LayoutInflater; import android.view.Menu; @@ -28,6 +29,7 @@ import org.jetbrains.annotations.NotNull; import code.name.monkey.appthemehelper.ThemeStore; import code.name.monkey.appthemehelper.common.ATHToolbarActivity; import code.name.monkey.appthemehelper.util.ATHUtil; +import code.name.monkey.appthemehelper.util.ColorUtil; import code.name.monkey.appthemehelper.util.TintHelper; import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper; import code.name.monkey.retromusic.R; @@ -142,7 +144,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde private void setupToolbar() { int primaryColor = ThemeStore.Companion.primaryColor(getContext()); TintHelper.setTintAuto(contentContainer, primaryColor, true); - toolbar.setBackgroundColor(primaryColor); + toolbar.setBackgroundColor(RetroUtil.toolbarColor(getMainActivity())); toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp); toolbar.setOnClickListener(v -> { Pair pair = new Pair<>(toolbarContainer, getString(R.string.transition_toolbar)); diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/folders/FoldersFragment.java b/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/folders/FoldersFragment.java index 8e9864b6..d2123907 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/folders/FoldersFragment.java +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/folders/FoldersFragment.java @@ -63,6 +63,7 @@ import code.name.monkey.retromusic.model.Song; import code.name.monkey.retromusic.util.FileUtil; import code.name.monkey.retromusic.util.PreferenceUtil; import code.name.monkey.retromusic.util.RetroColorUtil; +import code.name.monkey.retromusic.util.RetroUtil; import code.name.monkey.retromusic.util.ViewUtil; import code.name.monkey.retromusic.views.BreadCrumbLayout; @@ -228,7 +229,7 @@ public class FoldersFragment extends AbsMainActivityFragment implements getMainActivity().setSupportActionBar(toolbar); TintHelper.setTintAuto(container, primaryColor, true); appBarLayout.setBackgroundColor(primaryColor); - toolbar.setBackgroundColor(primaryColor); + toolbar.setBackgroundColor(RetroUtil.toolbarColor(getMainActivity())); toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp); toolbar.setOnClickListener(v -> { showMainMenu(); diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/home/BannerHomeFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/home/BannerHomeFragment.kt index 083c0521..5e26e71c 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/home/BannerHomeFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/home/BannerHomeFragment.kt @@ -152,7 +152,7 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba private fun setupToolbar() { toolbar.apply { - setBackgroundColor(ThemeStore.primaryColor(context)) + setBackgroundColor(RetroUtil.toolbarColor(mainActivity)) setNavigationIcon(R.drawable.ic_menu_white_24dp) setOnClickListener { diff --git a/app/src/main/java/code/name/monkey/retromusic/util/RetroUtil.java b/app/src/main/java/code/name/monkey/retromusic/util/RetroUtil.java index a292900e..c06c41a1 100755 --- a/app/src/main/java/code/name/monkey/retromusic/util/RetroUtil.java +++ b/app/src/main/java/code/name/monkey/retromusic/util/RetroUtil.java @@ -61,15 +61,26 @@ import java.util.Collections; import java.util.List; import code.name.monkey.appthemehelper.ThemeStore; +import code.name.monkey.appthemehelper.util.ATHUtil; import code.name.monkey.appthemehelper.util.TintHelper; import code.name.monkey.retromusic.App; +import code.name.monkey.retromusic.R; public class RetroUtil { private static final int[] TEMP_ARRAY = new int[1]; private static final String SHOW_NAV_BAR_RES_NAME = "config_showNavigationBar"; - public static int calculateNoOfColumns(Context context) { + public static int toolbarColor(@NonNull Context context) { + int color = ThemeStore.Companion.primaryColor(context); + if (ATHUtil.INSTANCE.isWindowBackgroundDark(context)) { + return ATHUtil.INSTANCE.resolveColor(context, R.attr.cardBackgroundColor); + } else { + return color; + } + } + + public static int calculateNoOfColumns(@NonNull Context context) { DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics(); float dpWidth = displayMetrics.widthPixels / displayMetrics.density; return (int) (dpWidth / 180); diff --git a/app/src/main/res/layout/fragment_main_activity_recycler_view.xml b/app/src/main/res/layout/fragment_main_activity_recycler_view.xml index 21ddd5e3..5e389b02 100644 --- a/app/src/main/res/layout/fragment_main_activity_recycler_view.xml +++ b/app/src/main/res/layout/fragment_main_activity_recycler_view.xml @@ -6,7 +6,6 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_list_single_row.xml b/app/src/main/res/layout/item_list_single_row.xml index 650a5938..3e86e5af 100644 --- a/app/src/main/res/layout/item_list_single_row.xml +++ b/app/src/main/res/layout/item_list_single_row.xml @@ -12,8 +12,8 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="center_vertical|start" - android:layout_marginLeft="-8dp" android:layout_marginStart="-8dp" + android:layout_marginLeft="-8dp" android:visibility="gone" app:srcCompat="@drawable/ic_drag_vertical_white_24dp" tools:ignore="ContentDescription" /> @@ -28,10 +28,10 @@ android:id="@+id/image_container" android:layout_width="wrap_content" android:layout_height="match_parent" - android:paddingEnd="0dp" + android:paddingStart="16dp" android:paddingLeft="16dp" - android:paddingRight="0dp" - android:paddingStart="16dp"> + android:paddingEnd="0dp" + android:paddingRight="0dp"> @@ -88,8 +88,8 @@ android:layout_width="match_parent" android:layout_height="1dp" android:layout_gravity="bottom" - android:layout_marginLeft="72dp" android:layout_marginStart="72dp" + android:layout_marginLeft="72dp" android:background="?attr/dividerColor" /> \ No newline at end of file diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml index c843df1a..e8af2d31 100644 --- a/app/src/main/res/menu/menu_main.xml +++ b/app/src/main/res/menu/menu_main.xml @@ -22,7 +22,7 @@ android:id="@+id/action_grid_size" android:icon="@drawable/ic_grid_size_white_24dp" android:title="@string/action_grid_size" - app:showAsAction="ifRoom"> + app:showAsAction="never">