Dark theme

This commit is contained in:
h4h13 2019-12-01 21:15:12 +05:30
parent 9f1e6cb98e
commit efa21c8c91
9 changed files with 110 additions and 125 deletions

View file

@ -246,7 +246,8 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsView, C
R.id.action_tag_editor -> { R.id.action_tag_editor -> {
val intent = Intent(this, AlbumTagEditorActivity::class.java) val intent = Intent(this, AlbumTagEditorActivity::class.java)
intent.putExtra(AbsTagEditorActivity.EXTRA_ID, album.id) intent.putExtra(AbsTagEditorActivity.EXTRA_ID, album.id)
startActivityForResult(intent, TAG_EDITOR_REQUEST) val options = ActivityOptions.makeSceneTransitionAnimation(this, image, getString(R.string.transition_album_art))
startActivityForResult(intent, TAG_EDITOR_REQUEST, options.toBundle())
return true return true
} }
/*Sort*/ /*Sort*/

View file

@ -2,20 +2,28 @@ package code.name.monkey.retromusic.activities.tageditor
import android.app.Activity import android.app.Activity
import android.content.res.ColorStateList import android.content.res.ColorStateList
import android.graphics.* import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.graphics.Color
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.net.Uri import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.text.* import android.text.Editable
import android.text.TextUtils
import android.text.TextWatcher
import android.widget.Toast import android.widget.Toast
import code.name.monkey.appthemehelper.util.* import code.name.monkey.appthemehelper.util.ATHUtil
import code.name.monkey.appthemehelper.util.MaterialUtil
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.extensions.appHandleColor import code.name.monkey.retromusic.extensions.appHandleColor
import code.name.monkey.retromusic.glide.palette.* import code.name.monkey.retromusic.extensions.applyToolbar
import code.name.monkey.retromusic.glide.palette.BitmapPaletteTranscoder
import code.name.monkey.retromusic.glide.palette.BitmapPaletteWrapper
import code.name.monkey.retromusic.loaders.AlbumLoader import code.name.monkey.retromusic.loaders.AlbumLoader
import code.name.monkey.retromusic.rest.LastFMRestClient import code.name.monkey.retromusic.rest.LastFMRestClient
import code.name.monkey.retromusic.rest.model.LastFmAlbum import code.name.monkey.retromusic.rest.model.LastFmAlbum
import code.name.monkey.retromusic.util.* import code.name.monkey.retromusic.util.ImageUtil
import code.name.monkey.retromusic.util.LastFMUtil
import code.name.monkey.retromusic.util.RetroColorUtil.generatePalette import code.name.monkey.retromusic.util.RetroColorUtil.generatePalette
import code.name.monkey.retromusic.util.RetroColorUtil.getColor import code.name.monkey.retromusic.util.RetroColorUtil.getColor
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
@ -43,16 +51,7 @@ class AlbumTagEditorActivity : AbsTagEditorActivity(), TextWatcher {
) { ) {
getColor(resource?.palette, Color.TRANSPARENT) getColor(resource?.palette, Color.TRANSPARENT)
albumArtBitmap = resource?.bitmap?.let { ImageUtil.resizeBitmap(it, 2048) } albumArtBitmap = resource?.bitmap?.let { ImageUtil.resizeBitmap(it, 2048) }
setImageBitmap( setImageBitmap(albumArtBitmap, getColor(resource?.palette, ATHUtil.resolveColor(this@AlbumTagEditorActivity, R.attr.defaultFooterColor)))
albumArtBitmap,
getColor(
resource?.palette,
ATHUtil.resolveColor(
this@AlbumTagEditorActivity,
R.attr.defaultFooterColor
)
)
)
deleteAlbumArt = false deleteAlbumArt = false
dataChanged() dataChanged()
setResult(Activity.RESULT_OK) setResult(Activity.RESULT_OK)
@ -72,8 +71,7 @@ class AlbumTagEditorActivity : AbsTagEditorActivity(), TextWatcher {
private val disposable = CompositeDisposable() private val disposable = CompositeDisposable()
private fun setupToolbar() { private fun setupToolbar() {
toolbar.setBackgroundColor(ATHUtil.resolveColor(this, R.attr.colorPrimary)) applyToolbar(toolbar)
setSupportActionBar(toolbar)
supportActionBar?.setDisplayShowHomeEnabled(true) supportActionBar?.setDisplayShowHomeEnabled(true)
} }

View file

@ -2,12 +2,12 @@ package code.name.monkey.retromusic.activities.tageditor
import android.net.Uri import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.text.* import android.text.Editable
import androidx.core.content.ContextCompat import android.text.TextWatcher
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.util.MaterialUtil
import code.name.monkey.appthemehelper.util.*
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.extensions.appHandleColor import code.name.monkey.retromusic.extensions.appHandleColor
import code.name.monkey.retromusic.extensions.applyToolbar
import code.name.monkey.retromusic.loaders.SongLoader import code.name.monkey.retromusic.loaders.SongLoader
import kotlinx.android.synthetic.main.activity_song_tag_editor.* import kotlinx.android.synthetic.main.activity_song_tag_editor.*
import org.jaudiotagger.tag.FieldKey import org.jaudiotagger.tag.FieldKey
@ -18,33 +18,13 @@ class SongTagEditorActivity : AbsTagEditorActivity(), TextWatcher {
override val contentViewLayout: Int override val contentViewLayout: Int
get() = R.layout.activity_song_tag_editor get() = R.layout.activity_song_tag_editor
private fun setupToolbar() {
appBarLayout.setBackgroundColor(ATHUtil.resolveColor(this, R.attr.colorPrimary))
toolbar.apply {
setBackgroundColor(
ATHUtil.resolveColor(
this@SongTagEditorActivity,
R.attr.colorPrimary
)
)
navigationIcon = TintHelper.createTintedDrawable(
ContextCompat.getDrawable(
context,
R.drawable.ic_keyboard_backspace_black_24dp
), ThemeStore.textColorPrimary(context)
)
setNavigationOnClickListener { onBackPressed() }
setSupportActionBar(toolbar)
}
title = null
}
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setNoImageMode() setNoImageMode()
setUpViews() setUpViews()
setupToolbar() applyToolbar(toolbar)
setStatusbarColorAuto() setStatusbarColorAuto()
} }

View file

@ -63,7 +63,7 @@ class MainSettingsFragment : Fragment(), View.OnClickListener {
aboutSettings.setOnClickListener(this) aboutSettings.setOnClickListener(this)
buyProContainer.apply { buyProContainer.apply {
if (App.isProVersion()) show() else hide() if (!App.isProVersion()) show() else hide()
setOnClickListener { setOnClickListener {
NavigationUtil.goToProVersion(requireContext()) NavigationUtil.goToProVersion(requireContext())
} }

View file

@ -2,6 +2,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/gradient_background" android:id="@+id/gradient_background"
android:background="?attr/colorSurface"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">

View file

@ -57,8 +57,7 @@
android:id="@+id/albumCoverContainer" android:id="@+id/albumCoverContainer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:layout_margin="16dp"
android:layout_marginEnd="16dp"
android:transitionName="@string/transition_album_art" android:transitionName="@string/transition_album_art"
app:cardCornerRadius="24dp" app:cardCornerRadius="24dp"
app:cardElevation="8dp" app:cardElevation="8dp"

View file

@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/colorSurface"
android:orientation="vertical" android:orientation="vertical"
tools:ignore="UnusedAttribute"> tools:ignore="UnusedAttribute">
@ -18,6 +19,9 @@
android:id="@+id/appBarLayout" android:id="@+id/appBarLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:elevation="0dp"
app:elevation="0dp"
app:liftOnScroll="true"> app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar <com.google.android.material.appbar.MaterialToolbar
@ -44,10 +48,10 @@
android:id="@+id/imageContainer" android:id="@+id/imageContainer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="16dp"
android:transitionName="@string/transition_album_art" android:transitionName="@string/transition_album_art"
app:cardCornerRadius="24dp" app:cardCornerRadius="24dp"
app:cardElevation="8dp" app:cardElevation="8dp"
app:cardUseCompatPadding="true"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">

View file

@ -56,8 +56,7 @@
android:id="@+id/albumCoverContainer" android:id="@+id/albumCoverContainer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:layout_margin="16dp"
android:layout_marginEnd="16dp"
android:transitionName="@string/transition_artist_image" android:transitionName="@string/transition_artist_image"
app:cardCornerRadius="24dp" app:cardCornerRadius="24dp"
app:cardElevation="8dp" app:cardElevation="8dp"

View file

@ -10,6 +10,9 @@
android:id="@+id/appBarLayout" android:id="@+id/appBarLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:elevation="0dp"
app:elevation="0dp"
app:liftOnScroll="true"> app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar <com.google.android.material.appbar.MaterialToolbar