From 5fcdacb86beed808f05e3c06d44a7f129c1d6635 Mon Sep 17 00:00:00 2001 From: h4h13 Date: Mon, 3 Jun 2019 08:47:20 +0530 Subject: [PATCH] Fix color issues --- app/src/main/assets/retro-changelog.html | 2 +- .../retromusic/activities/MainActivity.kt | 6 +- .../retromusic/activities/SettingsActivity.kt | 2 +- .../dialogs/OptionsSheetDialogFragment.kt | 7 +- .../fragments/base/AbsMainActivityFragment.kt | 5 +- .../mainactivity/LibraryFragment.java | 4 +- .../mainactivity/folders/FoldersFragment.java | 35 ++--- .../mainactivity/home/BannerHomeFragment.kt | 6 +- .../res/layout-land/fragment_banner_home.xml | 128 ------------------ .../fragment_banner_home.xml | 128 ------------------ .../layout-xlarge/fragment_banner_home.xml | 126 ----------------- .../main/res/layout/fragment_banner_home.xml | 120 ---------------- app/src/main/res/layout/fragment_folder.xml | 37 +++-- app/src/main/res/layout/fragment_home.xml | 20 ++- app/src/main/res/layout/fragment_library.xml | 30 ++-- app/src/main/res/menu/menu_folders.xml | 6 +- app/src/main/res/values/styles.xml | 5 +- .../util/ToolbarContentTintHelper.java | 12 +- 18 files changed, 98 insertions(+), 581 deletions(-) delete mode 100644 app/src/main/res/layout-land/fragment_banner_home.xml delete mode 100644 app/src/main/res/layout-xlarge-land/fragment_banner_home.xml delete mode 100644 app/src/main/res/layout-xlarge/fragment_banner_home.xml delete mode 100644 app/src/main/res/layout/fragment_banner_home.xml diff --git a/app/src/main/assets/retro-changelog.html b/app/src/main/assets/retro-changelog.html index e8e31a1b..0b305f09 100644 --- a/app/src/main/assets/retro-changelog.html +++ b/app/src/main/assets/retro-changelog.html @@ -1 +1 @@ -

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 +

v3.1.700

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

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/MainActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/MainActivity.kt index 33ad7754..940f2c4c 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/MainActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/MainActivity.kt @@ -14,6 +14,7 @@ import androidx.core.app.ActivityCompat import androidx.fragment.app.Fragment import code.name.monkey.retromusic.R import code.name.monkey.retromusic.activities.base.AbsSlidingMusicPanelActivity +import code.name.monkey.retromusic.dialogs.OptionsSheetDialogFragment import code.name.monkey.retromusic.fragments.mainactivity.LibraryFragment import code.name.monkey.retromusic.fragments.mainactivity.folders.FoldersFragment import code.name.monkey.retromusic.fragments.mainactivity.home.BannerHomeFragment @@ -122,7 +123,7 @@ class MainActivity : AbsSlidingMusicPanelActivity(), SharedPreferences.OnSharedP PreferenceUtil.getInstance().unregisterOnSharedPreferenceChangedListener(this) } - fun setCurrentFragment(fragment: Fragment, b: Boolean) { + private fun setCurrentFragment(fragment: Fragment, b: Boolean) { val trans = supportFragmentManager.beginTransaction() trans.replace(R.id.fragment_container, fragment, null) if (b) { @@ -294,8 +295,7 @@ class MainActivity : AbsSlidingMusicPanelActivity(), SharedPreferences.OnSharedP override fun onOptionsItemSelected(item: MenuItem): Boolean { if (item.itemId == android.R.id.home) { - NavigationUtil.goToSearch(this); - return true + OptionsSheetDialogFragment.newInstance().show(supportFragmentManager, "Main_Menu") } return super.onOptionsItemSelected(item) } diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/SettingsActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/SettingsActivity.kt index 6beb8bb4..f99482e7 100755 --- a/app/src/main/java/code/name/monkey/retromusic/activities/SettingsActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/SettingsActivity.kt @@ -42,7 +42,7 @@ class SettingsActivity : AbsBaseActivity(), SharedPreferences.OnSharedPreference toolbar.apply { setBackgroundColor(ThemeStore.primaryColor(context)) setNavigationOnClickListener { onBackPressed() } - ToolbarContentTintHelper.colorBackButton(toolbar, ThemeStore.textColorSecondary(context)) + ToolbarContentTintHelper.colorBackButton(toolbar, ThemeStore.textColorSecondargit context)) } appBarLayout.setBackgroundColor(ThemeStore.primaryColor(this)) diff --git a/app/src/main/java/code/name/monkey/retromusic/dialogs/OptionsSheetDialogFragment.kt b/app/src/main/java/code/name/monkey/retromusic/dialogs/OptionsSheetDialogFragment.kt index ee5bcf93..c41ad3e0 100644 --- a/app/src/main/java/code/name/monkey/retromusic/dialogs/OptionsSheetDialogFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/dialogs/OptionsSheetDialogFragment.kt @@ -50,7 +50,7 @@ class OptionsSheetDialogFragment : DialogFragment(), View.OnClickListener { R.id.actionEqualizer -> NavigationUtil.openEqualizer(mainActivity) } - dismiss() + materialDialog?.dismiss() } private fun prepareBugReport() { @@ -77,6 +77,7 @@ class OptionsSheetDialogFragment : DialogFragment(), View.OnClickListener { private lateinit var actionShare: View private lateinit var actionBugReport: View private lateinit var buyProContainer: CardView + private lateinit var materialDialog: MaterialDialog override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { val layout = LayoutInflater.from(context).inflate(R.layout.fragment_main_options, null) @@ -106,11 +107,11 @@ class OptionsSheetDialogFragment : DialogFragment(), View.OnClickListener { NavigationUtil.goToProVersion(context) } } - - return MaterialDialog(activity!!, BottomSheet()) + materialDialog = MaterialDialog(activity!!, BottomSheet()) .show { customView(view = layout, scrollable = true) } + return materialDialog; } companion object { diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/base/AbsMainActivityFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/base/AbsMainActivityFragment.kt index 168f418f..0765d7bd 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/base/AbsMainActivityFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/base/AbsMainActivityFragment.kt @@ -3,13 +3,12 @@ package code.name.monkey.retromusic.fragments.base import android.os.Build import android.os.Bundle import android.view.View - import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.util.ColorUtil import code.name.monkey.appthemehelper.util.VersionUtils import code.name.monkey.retromusic.R -import code.name.monkey.retromusic.dialogs.OptionsSheetDialogFragment import code.name.monkey.retromusic.activities.MainActivity +import code.name.monkey.retromusic.dialogs.OptionsSheetDialogFragment abstract class AbsMainActivityFragment : AbsMusicServiceFragment() { @@ -50,6 +49,6 @@ abstract class AbsMainActivityFragment : AbsMusicServiceFragment() { } protected fun showMainMenu() { - OptionsSheetDialogFragment.newInstance().show(childFragmentManager, "Main Menu") + OptionsSheetDialogFragment.newInstance().show(childFragmentManager, "Main_Menu") } } 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 7c73171d..7819f304 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 @@ -139,11 +139,11 @@ 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.setNavigationIcon(R.drawable.ic_menu_white_24dp); toolbar.setOnClickListener(v -> { showMainMenu(); }); - toolbar.setBackgroundColor(primaryColor); - toolbar.setNavigationIcon(null); appBarLayout.setBackgroundColor(primaryColor); appBarLayout.addOnOffsetChangedListener((appBarLayout, verticalOffset) -> getMainActivity().setLightStatusbar(!ATHUtil.INSTANCE.isWindowBackgroundDark(getContext()))); 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 f20235a3..9a2b7876 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 @@ -1,6 +1,7 @@ package code.name.monkey.retromusic.fragments.mainactivity.folders; import android.app.Dialog; +import android.app.ProgressDialog; import android.content.Context; import android.media.MediaScannerConnection; import android.os.Bundle; @@ -14,7 +15,6 @@ import android.view.View; import android.view.ViewGroup; import android.webkit.MimeTypeMap; import android.widget.PopupMenu; -import android.widget.ProgressBar; import android.widget.Toast; import androidx.annotation.NonNull; @@ -26,8 +26,6 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.afollestad.materialcab.MaterialCab; -import com.afollestad.materialdialogs.MaterialDialog; -import com.afollestad.materialdialogs.bottomsheets.BottomSheet; import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.snackbar.Snackbar; import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView; @@ -91,7 +89,6 @@ public class FoldersFragment extends AbsMainActivityFragment implements private AppBarLayout appBarLayout; - private FastScrollRecyclerView recyclerView; private Comparator fileComparator = (lhs, rhs) -> { @@ -232,6 +229,7 @@ public class FoldersFragment extends AbsMainActivityFragment implements TintHelper.setTintAuto(container, primaryColor, true); appBarLayout.setBackgroundColor(primaryColor); toolbar.setBackgroundColor(primaryColor); + toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp); toolbar.setOnClickListener(v -> { showMainMenu(); }); @@ -328,10 +326,6 @@ public class FoldersFragment extends AbsMainActivityFragment implements @Override public boolean onOptionsItemSelected(@NonNull MenuItem item) { switch (item.getItemId()) { - case android.R.id.home: - //noinspection ConstantConditions - getActivity().onBackPressed(); - break; case R.id.action_go_to_start_directory: setCrumb(new BreadCrumbLayout.Crumb(tryGetCanonicalFile(PreferenceUtil.getInstance().getStartDirectory())), true); return true; @@ -469,8 +463,7 @@ public class FoldersFragment extends AbsMainActivityFragment implements private void checkIsEmpty() { if (empty != null) { - empty - .setVisibility(adapter == null || adapter.getItemCount() == 0 ? View.VISIBLE : View.GONE); + empty.setVisibility(adapter == null || adapter.getItemCount() == 0 ? View.VISIBLE : View.GONE); } } @@ -730,21 +723,13 @@ public class FoldersFragment extends AbsMainActivityFragment implements @Override protected Dialog createDialog(@NonNull Context context) { - View view = LayoutInflater.from(context).inflate(R.layout.progress_bar, null); - view.setBackgroundColor(ThemeStore.Companion.primaryColor(context)); - ProgressBar progressBar = view.findViewById(R.id.progressBar); - TintHelper.setTintAuto(progressBar, ThemeStore.Companion.accentColor(context), false); - - MaterialDialog materialDialog = new MaterialDialog(context, new BottomSheet()); - materialDialog.setContentView(view); - materialDialog.title(R.string.listing_files, ""); - materialDialog.setOnCancelListener(dialog -> cancel(false)); - materialDialog.setOnDismissListener(dialog -> cancel(false)); - materialDialog.negativeButton(android.R.string.cancel, "", materialDialog1 -> { - cancel(false); - return null; - }); - return materialDialog; + ProgressDialog dialog = new ProgressDialog(context); + dialog.setIndeterminate(true); + dialog.setTitle(R.string.listing_files); + dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); + dialog.setOnCancelListener(dialog1 -> cancel(false)); + dialog.setOnDismissListener(dialog1 -> cancel(false)); + return dialog; } } } 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 9ebf6bcb..e3525cb3 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 @@ -25,7 +25,7 @@ import code.name.monkey.retromusic.util.NavigationUtil import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.RetroUtil import io.reactivex.disposables.CompositeDisposable -import kotlinx.android.synthetic.main.fragment_banner_home.* +import kotlinx.android.synthetic.main.fragment_home.* class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallbacks, HomeContract.HomeView { override fun showEmpty() { @@ -111,9 +111,7 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba private fun setupToolbar() { toolbar.apply { setBackgroundColor(if (PreferenceUtil.getInstance().isHomeBanner) Color.TRANSPARENT else ThemeStore.primaryColor(context)) - setNavigationOnClickListener { - NavigationUtil.goToSearch(activity) - } + setNavigationIcon(R.drawable.ic_menu_white_24dp) setOnClickListener { showMainMenu() } } mainActivity.setSupportActionBar(toolbar) diff --git a/app/src/main/res/layout-land/fragment_banner_home.xml b/app/src/main/res/layout-land/fragment_banner_home.xml deleted file mode 100644 index 373f0b2a..00000000 --- a/app/src/main/res/layout-land/fragment_banner_home.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-xlarge-land/fragment_banner_home.xml b/app/src/main/res/layout-xlarge-land/fragment_banner_home.xml deleted file mode 100644 index 48310659..00000000 --- a/app/src/main/res/layout-xlarge-land/fragment_banner_home.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-xlarge/fragment_banner_home.xml b/app/src/main/res/layout-xlarge/fragment_banner_home.xml deleted file mode 100644 index 44404b36..00000000 --- a/app/src/main/res/layout-xlarge/fragment_banner_home.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_banner_home.xml b/app/src/main/res/layout/fragment_banner_home.xml deleted file mode 100644 index 3c249294..00000000 --- a/app/src/main/res/layout/fragment_banner_home.xml +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_folder.xml b/app/src/main/res/layout/fragment_folder.xml index da0b5b3c..750b8076 100644 --- a/app/src/main/res/layout/fragment_folder.xml +++ b/app/src/main/res/layout/fragment_folder.xml @@ -30,24 +30,33 @@ android:elevation="0dp" app:elevation="0dp"> - + app:cardCornerRadius="8dp" + app:cardElevation="6dp" + app:cardUseCompatPadding="true"> - - - - + android:layout_height="wrap_content" + app:layout_scrollFlags="scroll|enterAlways"> + + + + + + - + + + - - - - - + android:layout_height="wrap_content"> + + + + + + - + match_parent - ?actionBarSize + 50dp ?toolbarPopupTheme toolbar @style/ToolbarTextAppearance @@ -41,6 +41,9 @@