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
applicationId "code.name.monkey.retromusic"
versionCode 286
versionName '3.0.570'
versionCode 289
versionName '3.1.00'
multiDexEnabled true

View file

@ -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">
<activity
android:name=".ui.activities.MainActivity"
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,11 +41,9 @@ class AlbumCoverStylePreference : DialogPreference {
class AlbumCoverStylePreferenceDialog : PreferenceDialogFragmentCompat(), ViewPager.OnPageChangeListener {
override fun onDialogClosed(positiveResult: Boolean) {
if (positiveResult) {
val nowPlayingScreen = AlbumCoverStyle.values()[viewPagerPosition]
PreferenceUtil.getInstance().albumCoverStyle = nowPlayingScreen
}
}
private var viewPagerPosition: Int = 0

View file

@ -56,7 +56,6 @@ 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."
@ -66,7 +65,6 @@ class NowPlayingScreenPreferenceDialog : PreferenceDialogFragmentCompat(), ViewP
PreferenceUtil.getInstance().nowPlayingScreen = nowPlayingScreen
}
}
}
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val view = LayoutInflater.from(activity).inflate(R.layout.preference_dialog_now_playing_screen, null)

View file

@ -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<List<Contributor>>(data, type)
val contributorAdapter = ContributorAdapter(contributors as ArrayList<Contributor>)
val contributorAdapter = ContributorAdapter(contributors)
recyclerView.layoutManager = LinearLayoutManager(this)
recyclerView.itemAnimator = DefaultItemAnimator()
recyclerView.adapter = contributorAdapter

View file

@ -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;
}
}

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

View file

@ -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()

View file

@ -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()

View file

@ -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;

View file

@ -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">

View file

@ -593,8 +593,8 @@
<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="pinterest_page">Pinterest</string>
<string name="pinterest_page_summary">Hmm</string>
<string name="pref_filter_song_title">Filter song length</string>
<string name="pinterest_page_summary">Follow Pintrest page for Retro Music design inspiration</string>
<string name="pref_filter_song_title">Filter song duration</string>
<string name="md_error_label">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">
<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_body">@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">
<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_body">@font/circular</item>
<item name="md_font_button">@font/circular</item>