Favorite icon color change and Added more info on crash report

This commit is contained in:
h4h13 2019-02-19 23:10:16 +05:30
parent bb748e41de
commit 82e43ab87f
15 changed files with 45 additions and 36 deletions

View file

@ -32,8 +32,8 @@ android {
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
applicationId "code.name.monkey.retromusic" applicationId "code.name.monkey.retromusic"
versionCode 286 versionCode 289
versionName '3.0.570' versionName '3.1.00'
multiDexEnabled true multiDexEnabled true

View file

@ -21,7 +21,7 @@
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/Theme.RetroMusic.Light" android:theme="@style/Theme.RetroMusic.Light"
android:usesCleartextTraffic="true"> android:usesCleartextTraffic="false">
<activity <activity
android:name=".ui.activities.MainActivity" android:name=".ui.activities.MainActivity"
android:label="@string/app_name"> android:label="@string/app_name">

View file

@ -1 +1 @@
<html> <head> <style type="text/css"> * { word-wrap: break-word; } {style-placeholder} a { color: #{link-color}; } a:active { color: #{link-color-active}; } ul { list-style-position: outside; padding-left: 0; padding-right: 0; margin-left: 1em; } li { padding-top: 8px; } </style> </head> <body> <h4>v3.1.00</h4> <ul> <li>Added filter song length</li> <li>Added colorful settings icons</li> </ul> <h4>v3.0.570</h4> <ul> <li>Fix Album/Artist square image</li> <li>Fix Delete dialog text format</li> <li>Fix Profile picture not showing after coming back from folders</li> <li>Fix Play button color i Simple and Plain themes</li> <li>Fix Sleep timer dialog crashing</li> <li>Fix Share song dialog title and text</li> </ul> <p>If you see entire app white or dark or black select same theme in settings to fix </p> <p style="line-height:150%"><a href="https://github.com/h4h13/RetroMusicPlayer/wiki/FAQ">FAQ's</a> </p> <p style="line-height:150%">*If you face any UI related issues you clear app data and cache, if its not working try to uninstall and install again. </p> </body> <html> <head> <style type="text/css"> * { word-wrap: break-word; } {style-placeholder} a { color: #{link-color}; } a:active { color: #{link-color-active}; } ul { list-style-position: outside; padding-left: 0; padding-right: 0; margin-left: 1em; } li { padding-top: 8px; } </style> </head> <body> <h4>v3.1.00</h4> <ul> <li>Added Filter song length</li> <li>Added Colorful settings icons</li> <li>Added Corners for dialog</li> </ul> <h4>v3.0.570</h4> <ul> <li>Fix Album/Artist square image</li> <li>Fix Delete dialog text format</li> <li>Fix Profile picture not showing after coming back from folders</li> <li>Fix Play button color i Simple and Plain themes</li> <li>Fix Sleep timer dialog crashing</li> <li>Fix Share song dialog title and text</li> </ul> <p>If you see entire app white or dark or black select same theme in settings to fix </p> <p style="line-height:150%"><a href="https://github.com/h4h13/RetroMusicPlayer/wiki/FAQ">FAQ's</a> </p> <p style="line-height:150%">*If you face any UI related issues you clear app data and cache, if its not working try to uninstall and install again. </p> </body>

View file

@ -41,10 +41,8 @@ class AlbumCoverStylePreference : DialogPreference {
class AlbumCoverStylePreferenceDialog : PreferenceDialogFragmentCompat(), ViewPager.OnPageChangeListener { class AlbumCoverStylePreferenceDialog : PreferenceDialogFragmentCompat(), ViewPager.OnPageChangeListener {
override fun onDialogClosed(positiveResult: Boolean) { override fun onDialogClosed(positiveResult: Boolean) {
if (positiveResult) { val nowPlayingScreen = AlbumCoverStyle.values()[viewPagerPosition]
val nowPlayingScreen = AlbumCoverStyle.values()[viewPagerPosition] PreferenceUtil.getInstance().albumCoverStyle = nowPlayingScreen
PreferenceUtil.getInstance().albumCoverStyle = nowPlayingScreen
}
} }
private var viewPagerPosition: Int = 0 private var viewPagerPosition: Int = 0

View file

@ -56,15 +56,13 @@ class NowPlayingScreenPreferenceDialog : PreferenceDialogFragmentCompat(), ViewP
} }
override fun onDialogClosed(positiveResult: Boolean) { override fun onDialogClosed(positiveResult: Boolean) {
if (positiveResult) { val nowPlayingScreen = NowPlayingScreen.values()[viewPagerPosition]
val nowPlayingScreen = NowPlayingScreen.values()[viewPagerPosition] if (isNowPlayingThemes(nowPlayingScreen)) {
if (isNowPlayingThemes(nowPlayingScreen)) { val result = getString(nowPlayingScreen.titleRes) + " theme is Pro version feature."
val result = getString(nowPlayingScreen.titleRes) + " theme is Pro version feature." Toast.makeText(context, result, Toast.LENGTH_SHORT).show()
Toast.makeText(context, result, Toast.LENGTH_SHORT).show() NavigationUtil.goToProVersion(activity!!)
NavigationUtil.goToProVersion(activity!!) } else {
} else { PreferenceUtil.getInstance().nowPlayingScreen = nowPlayingScreen
PreferenceUtil.getInstance().nowPlayingScreen = nowPlayingScreen
}
} }
} }

View file

@ -38,7 +38,6 @@ import kotlinx.android.synthetic.main.card_retro_info.*
import kotlinx.android.synthetic.main.card_social.* import kotlinx.android.synthetic.main.card_social.*
import java.io.IOException import java.io.IOException
import java.nio.charset.StandardCharsets import java.nio.charset.StandardCharsets
import java.util.*
class AboutActivity : AbsBaseActivity(), View.OnClickListener { class AboutActivity : AbsBaseActivity(), View.OnClickListener {
@ -174,7 +173,7 @@ class AboutActivity : AbsBaseActivity(), View.OnClickListener {
}.type }.type
val contributors = Gson().fromJson<List<Contributor>>(data, type) val contributors = Gson().fromJson<List<Contributor>>(data, type)
val contributorAdapter = ContributorAdapter(contributors as ArrayList<Contributor>) val contributorAdapter = ContributorAdapter(contributors)
recyclerView.layoutManager = LinearLayoutManager(this) recyclerView.layoutManager = LinearLayoutManager(this)
recyclerView.itemAnimator = DefaultItemAnimator() recyclerView.itemAnimator = DefaultItemAnimator()
recyclerView.adapter = contributorAdapter recyclerView.adapter = contributorAdapter

View file

@ -9,6 +9,7 @@ import android.os.Build;
import java.util.Arrays; import java.util.Arrays;
import androidx.annotation.IntRange; import androidx.annotation.IntRange;
import code.name.monkey.retromusic.util.PreferenceUtil;
public class DeviceInfo { public class DeviceInfo {
private final int versionCode; private final int versionCode;
@ -24,6 +25,8 @@ public class DeviceInfo {
private final String model = Build.MODEL; private final String model = Build.MODEL;
private final String product = Build.PRODUCT; private final String product = Build.PRODUCT;
private final String hardware = Build.HARDWARE; private final String hardware = Build.HARDWARE;
private final String baseTheme;
private final String nowPlayingTheme;
@SuppressLint("NewApi") @SuppressLint("NewApi")
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
private final String[] abis = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ? private final String[] abis = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ?
@ -50,6 +53,8 @@ public class DeviceInfo {
versionCode = -1; versionCode = -1;
versionName = null; versionName = null;
} }
baseTheme = PreferenceUtil.getInstance().getBaseTheme();
nowPlayingTheme = context.getString(PreferenceUtil.getInstance().getNowPlayingScreen().getTitleRes());
} }
public String toMarkdown() { public String toMarkdown() {
@ -90,6 +95,8 @@ public class DeviceInfo {
+ "Device hardware name: " + hardware + "\n" + "Device hardware name: " + hardware + "\n"
+ "ABIs: " + Arrays.toString(abis) + "\n" + "ABIs: " + Arrays.toString(abis) + "\n"
+ "ABIs (32bit): " + Arrays.toString(abis32Bits) + "\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;
} }
} }

View file

@ -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.util.RetroUtil.openUrl
import code.name.monkey.retromusic.views.NetworkImageView import code.name.monkey.retromusic.views.NetworkImageView
class ContributorAdapter(private var contributors: ArrayList<Contributor>) : RecyclerView.Adapter<ContributorAdapter.ViewHolder>() { class ContributorAdapter(private var contributors: List<Contributor>) : RecyclerView.Adapter<ContributorAdapter.ViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.item_contributor, parent, false)) return ViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.item_contributor, parent, false))

View file

@ -1,6 +1,7 @@
package code.name.monkey.retromusic.ui.adapter.playlist package code.name.monkey.retromusic.ui.adapter.playlist
import android.graphics.PorterDuff import android.graphics.PorterDuff
import android.graphics.drawable.Drawable
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.MenuItem import android.view.MenuItem
import android.view.View import android.view.View
@ -8,7 +9,9 @@ import android.view.ViewGroup
import androidx.annotation.LayoutRes import androidx.annotation.LayoutRes
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.PopupMenu import androidx.appcompat.widget.PopupMenu
import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.ATHUtil 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.R
import code.name.monkey.retromusic.dialogs.ClearSmartPlaylistDialog import code.name.monkey.retromusic.dialogs.ClearSmartPlaylistDialog
import code.name.monkey.retromusic.dialogs.DeletePlaylistDialog 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) holder.text!!.text = String.format(Locale.getDefault(), "%d Songs", songs!!.size)
} }
if (holder.image != null) { if (holder.image != null) {
holder.image!!.setImageResource(getIconRes(playlist)) holder.image!!.setImageDrawable(getIconRes(playlist))
} }
if (holder.adapterPosition == itemCount - 1) { if (holder.adapterPosition == itemCount - 1) {
if (holder.shortSeparator != null) { 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) { 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)) 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 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 { override fun getItemViewType(position: Int): Int {
@ -175,7 +178,7 @@ class PlaylistAdapter(protected val activity: AppCompatActivity, dataSet: ArrayL
image?.apply { image?.apply {
val iconPadding = activity.resources.getDimensionPixelSize(R.dimen.list_item_image_icon_padding) val iconPadding = activity.resources.getDimensionPixelSize(R.dimen.list_item_image_icon_padding)
setPadding(iconPadding, iconPadding, iconPadding, iconPadding) 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 -> menu?.setOnClickListener { view ->

View file

@ -165,8 +165,6 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
contentContainerView = view.findViewById(R.id.contentContainer) contentContainerView = view.findViewById(R.id.contentContainer)
contentContainerView.setBackgroundColor(ThemeStore.primaryColor(context!!)) contentContainerView.setBackgroundColor(ThemeStore.primaryColor(context!!))
//bannerTitle.setTextColor(ThemeStore.textColorPrimary(context!!))
setupToolbar() setupToolbar()
homePresenter.subscribe() homePresenter.subscribe()

View file

@ -91,9 +91,9 @@ class ThemeSettingsFragment : AbsSettingsFragment() {
accentColorPref.setOnPreferenceClickListener { accentColorPref.setOnPreferenceClickListener {
MaterialDialog(activity!!).show { 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) 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() ThemeStore.editTheme(context).accentColor(color).commit()
if (VersionUtils.hasNougatMR()) if (VersionUtils.hasNougatMR())
DynamicShortcutManager(context).updateDynamicShortcuts() DynamicShortcutManager(context).updateDynamicShortcuts()
@ -119,6 +119,6 @@ class ThemeSettingsFragment : AbsSettingsFragment() {
} }
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
addPreferencesFromResource( R.xml.pref_general) addPreferencesFromResource(R.xml.pref_general)
} }
} }

View file

@ -516,6 +516,10 @@ public final class PreferenceUtil {
editor.apply(); editor.apply();
} }
public String getBaseTheme() {
return mPreferences.getString(GENERAL_THEME, "dark");
}
public long getLastAddedCutoff() { public long getLastAddedCutoff() {
final CalendarUtil calendarUtil = new CalendarUtil(); final CalendarUtil calendarUtil = new CalendarUtil();
long interval; long interval;

View file

@ -202,6 +202,7 @@
android:background="?attr/rectSelector" android:background="?attr/rectSelector"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:gravity="center_vertical"
android:minHeight="@dimen/md_listitem_height" android:minHeight="@dimen/md_listitem_height"
android:orientation="horizontal" android:orientation="horizontal"
tools:ignore="PrivateResource"> tools:ignore="PrivateResource">
@ -242,6 +243,7 @@
android:background="?attr/rectSelector" android:background="?attr/rectSelector"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:gravity="center_vertical"
android:minHeight="@dimen/md_listitem_height" android:minHeight="@dimen/md_listitem_height"
android:orientation="horizontal" android:orientation="horizontal"
tools:ignore="PrivateResource"> tools:ignore="PrivateResource">

View file

@ -593,8 +593,8 @@
<string name="pref_summary_blacklist">The content of blacklisted folders is hidden from your library.</string> <string name="pref_summary_blacklist">The content of blacklisted folders is hidden from your library.</string>
<string name="send_crash_log">Send crash log</string> <string name="send_crash_log">Send crash log</string>
<string name="pinterest_page">Pinterest</string> <string name="pinterest_page">Pinterest</string>
<string name="pinterest_page_summary">Hmm</string> <string name="pinterest_page_summary">Follow Pintrest page for Retro Music design inspiration</string>
<string name="pref_filter_song_title">Filter song length</string> <string name="pref_filter_song_title">Filter song duration</string>
<string name="md_error_label">Error</string> <string name="md_error_label">Error</string>
<string name="md_storage_perm_error">Permission error</string> <string name="md_storage_perm_error">Permission error</string>

View file

@ -3,7 +3,7 @@
<style name="Theme.RetroMusic.Base" parent="Theme.MaterialComponents.NoActionBar"> <style name="Theme.RetroMusic.Base" parent="Theme.MaterialComponents.NoActionBar">
<item name="md_corner_radius">16dp</item> <item name="md_corner_radius">12dp</item>
<item name="md_font_title">@font/circular</item> <item name="md_font_title">@font/circular</item>
<item name="md_font_body">@font/circular</item> <item name="md_font_body">@font/circular</item>
<item name="md_font_button">@font/circular</item> <item name="md_font_button">@font/circular</item>
@ -82,7 +82,7 @@
<style name="Theme.RetroMusic.Base.Light" parent="Theme.MaterialComponents.Light.NoActionBar"> <style name="Theme.RetroMusic.Base.Light" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="md_corner_radius">16dp</item> <item name="md_corner_radius">12dp</item>
<item name="md_font_title">@font/circular</item> <item name="md_font_title">@font/circular</item>
<item name="md_font_body">@font/circular</item> <item name="md_font_body">@font/circular</item>
<item name="md_font_button">@font/circular</item> <item name="md_font_button">@font/circular</item>