code refactor
This commit is contained in:
parent
41d965968f
commit
4470a66fb2
5 changed files with 17 additions and 13 deletions
|
@ -14,6 +14,8 @@
|
|||
|
||||
package code.name.monkey.retromusic.glide;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.bumptech.glide.GenericTransitionOptions;
|
||||
import com.bumptech.glide.Priority;
|
||||
import com.bumptech.glide.RequestBuilder;
|
||||
|
@ -26,7 +28,6 @@ import com.bumptech.glide.request.RequestOptions;
|
|||
import com.bumptech.glide.request.target.Target;
|
||||
import com.bumptech.glide.signature.MediaStoreSignature;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import code.name.monkey.retromusic.App;
|
||||
import code.name.monkey.retromusic.R;
|
||||
import code.name.monkey.retromusic.glide.artistimage.ArtistImage;
|
||||
|
@ -44,13 +45,14 @@ public final class RetroGlideExtension {
|
|||
private RetroGlideExtension() {
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@GlideType(BitmapPaletteWrapper.class)
|
||||
public static void asBitmapPalette(RequestBuilder<BitmapPaletteWrapper> requestBuilder) {
|
||||
public static void asBitmapPalette(@NonNull RequestBuilder<BitmapPaletteWrapper> requestBuilder) {
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@GlideOption
|
||||
public static RequestOptions artistOptions(@NonNull RequestOptions requestOptions, Artist artist) {
|
||||
public static RequestOptions artistOptions(@NonNull RequestOptions requestOptions, @NonNull Artist artist) {
|
||||
return requestOptions
|
||||
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
|
||||
.error(R.drawable.default_artist_art)
|
||||
|
@ -62,7 +64,7 @@ public final class RetroGlideExtension {
|
|||
|
||||
@GlideOption
|
||||
@NonNull
|
||||
public static RequestOptions songOptions(@NonNull RequestOptions requestOptions, Song song) {
|
||||
public static RequestOptions songOptions(@NonNull RequestOptions requestOptions, @NonNull Song song) {
|
||||
return requestOptions
|
||||
.diskCacheStrategy(DiskCacheStrategy.NONE)
|
||||
.error(R.drawable.default_album_art)
|
||||
|
|
|
@ -51,7 +51,7 @@ import kotlin.collections.ArrayList
|
|||
class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailContract.ArtistsDetailsView {
|
||||
|
||||
private var biography: Spanned? = null
|
||||
private var artist: Artist? = null
|
||||
private lateinit var artist: Artist
|
||||
private var lastFMRestClient: LastFMRestClient? = null
|
||||
private var artistDetailsPresenter: ArtistDetailsPresenter? = null
|
||||
private lateinit var songAdapter: SimpleSongAdapter
|
||||
|
|
|
@ -64,7 +64,7 @@ class AlbumCoverPagerAdapter(fm: FragmentManager, private val dataSet: ArrayList
|
|||
lateinit var albumCover: ImageView
|
||||
private var isColorReady: Boolean = false
|
||||
private var color: Int = 0
|
||||
private var song: Song? = null
|
||||
private lateinit var song: Song
|
||||
private var colorReceiver: ColorReceiver? = null
|
||||
private var request: Int = 0
|
||||
|
||||
|
@ -85,7 +85,7 @@ class AlbumCoverPagerAdapter(fm: FragmentManager, private val dataSet: ArrayList
|
|||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
if (arguments != null) {
|
||||
song = arguments!!.getParcelable(SONG_ARG)
|
||||
song = arguments!!.getParcelable(SONG_ARG)!!
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,11 @@ class ThemeSettingsFragment : AbsSettingsFragment() {
|
|||
title(code.name.monkey.retromusic.R.string.accent_color)
|
||||
positiveButton(R.string.set)
|
||||
colorChooser(colors = ACCENT_COLORS, allowCustomArgb = true, subColors = ACCENT_COLORS_SUB) { _, color ->
|
||||
ThemeStore.editTheme(context).accentColor(color).commit()
|
||||
var colorFinal = Color.BLACK;
|
||||
if (!ColorUtil.isColorSaturated(color)) {
|
||||
colorFinal = color;
|
||||
}
|
||||
ThemeStore.editTheme(context).accentColor(colorFinal).commit()
|
||||
if (VersionUtils.hasNougatMR())
|
||||
DynamicShortcutManager(context).updateDynamicShortcuts()
|
||||
activity!!.recreate()
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
|
@ -114,11 +114,10 @@
|
|||
android:id="@+id/name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:hint="@string/my_name"
|
||||
tools:text="@string/song"
|
||||
android:inputType="textPersonName|textCapWords|text"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||
tools:text="@string/song" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
|
@ -136,7 +135,6 @@
|
|||
android:id="@+id/bio"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:hint="@string/bio"
|
||||
android:inputType="textPersonName|textCapWords|text"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
|
||||
|
|
Loading…
Reference in a new issue