Removed library fragment

This commit is contained in:
h4h13 2020-02-19 12:38:12 +05:30
parent 1174cbb477
commit 8a58021deb
31 changed files with 1079 additions and 1206 deletions

View file

@ -34,7 +34,7 @@ object AppRater {
private const val DAYS_UNTIL_PROMPT = 3//Min number of days
private const val LAUNCHES_UNTIL_PROMPT = 5//Min number of launches
@JvmStatic
fun appLaunched(context: Context) {
val prefs = context.getSharedPreferences(APP_RATING, 0)
if (prefs.getBoolean(DO_NOT_SHOW_AGAIN, false)) {
@ -66,26 +66,31 @@ object AppRater {
private fun showRateDialog(context: Context, editor: SharedPreferences.Editor) {
MaterialDialog(context, BottomSheet(LayoutMode.WRAP_CONTENT))
.show {
.show {
cornerRadius(PreferenceUtil.getInstance(context).dialogCorner)
title(text = "Rate this App")
message(text = "If you enjoy using Retro Music, please take a moment to rate it. Thanks for your support!")
positiveButton(R.string.app_name) {
context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=${context.packageName}")))
editor.putBoolean(DO_NOT_SHOW_AGAIN, true)
editor.commit()
dismiss()
}
negativeButton(text = "Later") {
dismiss()
}
neutralButton(text = " No thanks") {
editor.putBoolean(DO_NOT_SHOW_AGAIN, true)
editor.commit()
dismiss()
}
getActionButton(WhichButton.POSITIVE).updateTextColor(Color.RED)
cornerRadius(PreferenceUtil.getInstance(context).dialogCorner)
title(text = "Rate this App")
message(text = "If you enjoy using Retro Music, please take a moment to rate it. Thanks for your support!")
positiveButton(R.string.app_name) {
context.startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse("market://details?id=${context.packageName}")
)
)
editor.putBoolean(DO_NOT_SHOW_AGAIN, true)
editor.commit()
dismiss()
}
negativeButton(text = "Later") {
dismiss()
}
neutralButton(text = " No thanks") {
editor.putBoolean(DO_NOT_SHOW_AGAIN, true)
editor.commit()
dismiss()
}
getActionButton(WhichButton.POSITIVE).updateTextColor(Color.RED)
}
}
}

View file

@ -29,7 +29,6 @@ import androidx.annotation.NonNull;
import androidx.annotation.StyleRes;
import androidx.viewpager.widget.ViewPager;
import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.activities.MainActivity;
import code.name.monkey.retromusic.fragments.AlbumCoverStyle;
import code.name.monkey.retromusic.fragments.NowPlayingScreen;
import code.name.monkey.retromusic.fragments.mainactivity.folders.FoldersFragment;
@ -585,14 +584,6 @@ public final class PreferenceUtil {
return mPreferences.getInt(LAST_CHANGELOG_VERSION, -1);
}
public final int getLastMusicChooser() {
return mPreferences.getInt(LAST_MUSIC_CHOOSER, MainActivity.HOME);
}
public void setLastMusicChooser(int value) {
mPreferences.edit().putInt(LAST_MUSIC_CHOOSER, value).apply();
}
public final int getLastPage() {
return mPreferences.getInt(LAST_PAGE, R.id.action_song);
}