From 82e43ab87fe7157eadf9b9da5d3ec495d7d465c6 Mon Sep 17 00:00:00 2001 From: h4h13 Date: Tue, 19 Feb 2019 23:10:16 +0530 Subject: [PATCH] Favorite icon color change and Added more info on crash report --- app/build.gradle | 4 ++-- app/src/main/AndroidManifest.xml | 2 +- app/src/main/assets/retro-changelog.html | 2 +- .../AlbumCoverStylePreferenceDialog.kt | 6 ++---- .../NowPlayingScreenPreferenceDialog.kt | 16 +++++++--------- .../retromusic/ui/activities/AboutActivity.kt | 3 +-- .../activities/bugreport/model/DeviceInfo.java | 9 ++++++++- .../retromusic/ui/adapter/ContributorAdapter.kt | 2 +- .../ui/adapter/playlist/PlaylistAdapter.kt | 15 +++++++++------ .../mainactivity/home/BannerHomeFragment.kt | 2 -- .../fragments/settings/ThemeSettingsFragment.kt | 6 +++--- .../monkey/retromusic/util/PreferenceUtil.java | 4 ++++ app/src/main/res/layout/card_retro_info.xml | 2 ++ app/src/main/res/values/strings.xml | 4 ++-- app/src/main/res/values/styles_parents.xml | 4 ++-- 15 files changed, 45 insertions(+), 36 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 42625a14..16af02b0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,8 +32,8 @@ android { vectorDrawables.useSupportLibrary = true applicationId "code.name.monkey.retromusic" - versionCode 286 - versionName '3.0.570' + versionCode 289 + versionName '3.1.00' multiDexEnabled true diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 0ec25824..cc08aaec 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -21,7 +21,7 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme.RetroMusic.Light" - android:usesCleartextTraffic="true"> + android:usesCleartextTraffic="false"> diff --git a/app/src/main/assets/retro-changelog.html b/app/src/main/assets/retro-changelog.html index c11a922c..0ecd5017 100644 --- a/app/src/main/assets/retro-changelog.html +++ b/app/src/main/assets/retro-changelog.html @@ -1 +1 @@ -

v3.1.00

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.00

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/preferences/AlbumCoverStylePreferenceDialog.kt b/app/src/main/java/code/name/monkey/retromusic/preferences/AlbumCoverStylePreferenceDialog.kt index 534fe258..fc7df830 100644 --- a/app/src/main/java/code/name/monkey/retromusic/preferences/AlbumCoverStylePreferenceDialog.kt +++ b/app/src/main/java/code/name/monkey/retromusic/preferences/AlbumCoverStylePreferenceDialog.kt @@ -41,10 +41,8 @@ class AlbumCoverStylePreference : DialogPreference { class AlbumCoverStylePreferenceDialog : PreferenceDialogFragmentCompat(), ViewPager.OnPageChangeListener { override fun onDialogClosed(positiveResult: Boolean) { - if (positiveResult) { - val nowPlayingScreen = AlbumCoverStyle.values()[viewPagerPosition] - PreferenceUtil.getInstance().albumCoverStyle = nowPlayingScreen - } + val nowPlayingScreen = AlbumCoverStyle.values()[viewPagerPosition] + PreferenceUtil.getInstance().albumCoverStyle = nowPlayingScreen } private var viewPagerPosition: Int = 0 diff --git a/app/src/main/java/code/name/monkey/retromusic/preferences/NowPlayingScreenPreferenceDialog.kt b/app/src/main/java/code/name/monkey/retromusic/preferences/NowPlayingScreenPreferenceDialog.kt index 91021d22..0cc22adc 100644 --- a/app/src/main/java/code/name/monkey/retromusic/preferences/NowPlayingScreenPreferenceDialog.kt +++ b/app/src/main/java/code/name/monkey/retromusic/preferences/NowPlayingScreenPreferenceDialog.kt @@ -56,15 +56,13 @@ class NowPlayingScreenPreferenceDialog : PreferenceDialogFragmentCompat(), ViewP } override fun onDialogClosed(positiveResult: Boolean) { - if (positiveResult) { - val nowPlayingScreen = NowPlayingScreen.values()[viewPagerPosition] - if (isNowPlayingThemes(nowPlayingScreen)) { - val result = getString(nowPlayingScreen.titleRes) + " theme is Pro version feature." - Toast.makeText(context, result, Toast.LENGTH_SHORT).show() - NavigationUtil.goToProVersion(activity!!) - } else { - PreferenceUtil.getInstance().nowPlayingScreen = nowPlayingScreen - } + val nowPlayingScreen = NowPlayingScreen.values()[viewPagerPosition] + if (isNowPlayingThemes(nowPlayingScreen)) { + val result = getString(nowPlayingScreen.titleRes) + " theme is Pro version feature." + Toast.makeText(context, result, Toast.LENGTH_SHORT).show() + NavigationUtil.goToProVersion(activity!!) + } else { + PreferenceUtil.getInstance().nowPlayingScreen = nowPlayingScreen } } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/activities/AboutActivity.kt b/app/src/main/java/code/name/monkey/retromusic/ui/activities/AboutActivity.kt index e9346333..aba4d2df 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/activities/AboutActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/activities/AboutActivity.kt @@ -38,7 +38,6 @@ import kotlinx.android.synthetic.main.card_retro_info.* import kotlinx.android.synthetic.main.card_social.* import java.io.IOException import java.nio.charset.StandardCharsets -import java.util.* class AboutActivity : AbsBaseActivity(), View.OnClickListener { @@ -174,7 +173,7 @@ class AboutActivity : AbsBaseActivity(), View.OnClickListener { }.type val contributors = Gson().fromJson>(data, type) - val contributorAdapter = ContributorAdapter(contributors as ArrayList) + val contributorAdapter = ContributorAdapter(contributors) recyclerView.layoutManager = LinearLayoutManager(this) recyclerView.itemAnimator = DefaultItemAnimator() recyclerView.adapter = contributorAdapter diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/activities/bugreport/model/DeviceInfo.java b/app/src/main/java/code/name/monkey/retromusic/ui/activities/bugreport/model/DeviceInfo.java index a0b8aa21..2e989434 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/activities/bugreport/model/DeviceInfo.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/activities/bugreport/model/DeviceInfo.java @@ -9,6 +9,7 @@ import android.os.Build; import java.util.Arrays; import androidx.annotation.IntRange; +import code.name.monkey.retromusic.util.PreferenceUtil; public class DeviceInfo { private final int versionCode; @@ -24,6 +25,8 @@ public class DeviceInfo { private final String model = Build.MODEL; private final String product = Build.PRODUCT; private final String hardware = Build.HARDWARE; + private final String baseTheme; + private final String nowPlayingTheme; @SuppressLint("NewApi") @SuppressWarnings("deprecation") private final String[] abis = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ? @@ -50,6 +53,8 @@ public class DeviceInfo { versionCode = -1; versionName = null; } + baseTheme = PreferenceUtil.getInstance().getBaseTheme(); + nowPlayingTheme = context.getString(PreferenceUtil.getInstance().getNowPlayingScreen().getTitleRes()); } public String toMarkdown() { @@ -90,6 +95,8 @@ public class DeviceInfo { + "Device hardware name: " + hardware + "\n" + "ABIs: " + Arrays.toString(abis) + "\n" + "ABIs (32bit): " + Arrays.toString(abis32Bits) + "\n" - + "ABIs (64bit): " + Arrays.toString(abis64Bits); + + "ABIs (64bit): " + Arrays.toString(abis64Bits) + "\n" + + "Base theme: " + baseTheme + "\n" + + "Now playing theme: " + nowPlayingTheme; } } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/adapter/ContributorAdapter.kt b/app/src/main/java/code/name/monkey/retromusic/ui/adapter/ContributorAdapter.kt index b362892d..5c87da26 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/adapter/ContributorAdapter.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/adapter/ContributorAdapter.kt @@ -11,7 +11,7 @@ import code.name.monkey.retromusic.ui.adapter.base.MediaEntryViewHolder import code.name.monkey.retromusic.util.RetroUtil.openUrl import code.name.monkey.retromusic.views.NetworkImageView -class ContributorAdapter(private var contributors: ArrayList) : RecyclerView.Adapter() { +class ContributorAdapter(private var contributors: List) : RecyclerView.Adapter() { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { return ViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.item_contributor, parent, false)) diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/adapter/playlist/PlaylistAdapter.kt b/app/src/main/java/code/name/monkey/retromusic/ui/adapter/playlist/PlaylistAdapter.kt index fdecd389..c61cec7a 100755 --- a/app/src/main/java/code/name/monkey/retromusic/ui/adapter/playlist/PlaylistAdapter.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/adapter/playlist/PlaylistAdapter.kt @@ -1,6 +1,7 @@ package code.name.monkey.retromusic.ui.adapter.playlist import android.graphics.PorterDuff +import android.graphics.drawable.Drawable import android.view.LayoutInflater import android.view.MenuItem import android.view.View @@ -8,7 +9,9 @@ import android.view.ViewGroup import androidx.annotation.LayoutRes import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.widget.PopupMenu +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.R import code.name.monkey.retromusic.dialogs.ClearSmartPlaylistDialog import code.name.monkey.retromusic.dialogs.DeletePlaylistDialog @@ -81,7 +84,7 @@ class PlaylistAdapter(protected val activity: AppCompatActivity, dataSet: ArrayL holder.text!!.text = String.format(Locale.getDefault(), "%d Songs", songs!!.size) } if (holder.image != null) { - holder.image!!.setImageResource(getIconRes(playlist)) + holder.image!!.setImageDrawable(getIconRes(playlist)) } if (holder.adapterPosition == itemCount - 1) { if (holder.shortSeparator != null) { @@ -94,14 +97,14 @@ class PlaylistAdapter(protected val activity: AppCompatActivity, dataSet: ArrayL } } - private fun getIconRes(playlist: Playlist): Int { + private fun getIconRes(playlist: Playlist): Drawable { if (playlist is AbsSmartPlaylist) { - return playlist.iconRes + return TintHelper.createTintedDrawable(activity, playlist.iconRes, ATHUtil.resolveColor(activity, R.attr.iconColor))!! } return if (MusicUtil.isFavoritePlaylist(activity, playlist)) - R.drawable.ic_favorite_white_24dp + TintHelper.createTintedDrawable(activity, R.drawable.ic_favorite_white_24dp, ThemeStore.accentColor(activity))!! else - R.drawable.ic_playlist_play_white_24dp + TintHelper.createTintedDrawable(activity, R.drawable.ic_playlist_play_white_24dp, ATHUtil.resolveColor(activity, R.attr.iconColor))!! } override fun getItemViewType(position: Int): Int { @@ -175,7 +178,7 @@ class PlaylistAdapter(protected val activity: AppCompatActivity, dataSet: ArrayL image?.apply { val iconPadding = activity.resources.getDimensionPixelSize(R.dimen.list_item_image_icon_padding) setPadding(iconPadding, iconPadding, iconPadding, iconPadding) - setColorFilter(ATHUtil.resolveColor(activity, R.attr.iconColor), PorterDuff.Mode.SRC_IN) + //setColorFilter(ATHUtil.resolveColor(activity, R.attr.iconColor), PorterDuff.Mode.SRC_IN) } menu?.setOnClickListener { view -> diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/home/BannerHomeFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/home/BannerHomeFragment.kt index c1f2a77c..047b2bf8 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/home/BannerHomeFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/home/BannerHomeFragment.kt @@ -165,8 +165,6 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba contentContainerView = view.findViewById(R.id.contentContainer) contentContainerView.setBackgroundColor(ThemeStore.primaryColor(context!!)) - //bannerTitle.setTextColor(ThemeStore.textColorPrimary(context!!)) - setupToolbar() homePresenter.subscribe() diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/settings/ThemeSettingsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/settings/ThemeSettingsFragment.kt index 06a599de..409449e9 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/settings/ThemeSettingsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/settings/ThemeSettingsFragment.kt @@ -91,9 +91,9 @@ class ThemeSettingsFragment : AbsSettingsFragment() { accentColorPref.setOnPreferenceClickListener { MaterialDialog(activity!!).show { - title(code.name.monkey.retromusic.R.string.primary_color) + title(code.name.monkey.retromusic.R.string.accent_color) positiveButton(R.string.set) - colorChooser(colors = ACCENT_COLORS, subColors = ACCENT_COLORS_SUB) { _, color -> + colorChooser(colors = ACCENT_COLORS, allowCustomArgb = true, subColors = ACCENT_COLORS_SUB) { _, color -> ThemeStore.editTheme(context).accentColor(color).commit() if (VersionUtils.hasNougatMR()) DynamicShortcutManager(context).updateDynamicShortcuts() @@ -119,6 +119,6 @@ class ThemeSettingsFragment : AbsSettingsFragment() { } override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { - addPreferencesFromResource( R.xml.pref_general) + addPreferencesFromResource(R.xml.pref_general) } } diff --git a/app/src/main/java/code/name/monkey/retromusic/util/PreferenceUtil.java b/app/src/main/java/code/name/monkey/retromusic/util/PreferenceUtil.java index a8772f89..c0173043 100644 --- a/app/src/main/java/code/name/monkey/retromusic/util/PreferenceUtil.java +++ b/app/src/main/java/code/name/monkey/retromusic/util/PreferenceUtil.java @@ -516,6 +516,10 @@ public final class PreferenceUtil { editor.apply(); } + public String getBaseTheme() { + return mPreferences.getString(GENERAL_THEME, "dark"); + } + public long getLastAddedCutoff() { final CalendarUtil calendarUtil = new CalendarUtil(); long interval; diff --git a/app/src/main/res/layout/card_retro_info.xml b/app/src/main/res/layout/card_retro_info.xml index ce4d449a..a985b53c 100644 --- a/app/src/main/res/layout/card_retro_info.xml +++ b/app/src/main/res/layout/card_retro_info.xml @@ -202,6 +202,7 @@ android:background="?attr/rectSelector" android:clickable="true" android:focusable="true" + android:gravity="center_vertical" android:minHeight="@dimen/md_listitem_height" android:orientation="horizontal" tools:ignore="PrivateResource"> @@ -242,6 +243,7 @@ android:background="?attr/rectSelector" android:clickable="true" android:focusable="true" + android:gravity="center_vertical" android:minHeight="@dimen/md_listitem_height" android:orientation="horizontal" tools:ignore="PrivateResource"> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4dc4d245..31acda43 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -593,8 +593,8 @@ The content of blacklisted folders is hidden from your library. Send crash log Pinterest - Hmm - Filter song length + Follow Pintrest page for Retro Music design inspiration + Filter song duration Error Permission error diff --git a/app/src/main/res/values/styles_parents.xml b/app/src/main/res/values/styles_parents.xml index 498f10e2..55193cd5 100644 --- a/app/src/main/res/values/styles_parents.xml +++ b/app/src/main/res/values/styles_parents.xml @@ -3,7 +3,7 @@