More themes cleanup (#5410), remove AMOLED Blue

* More themes cleanup

* Tweak some things

* Fix 'Clear History' icon

* Split out ripple colored to its own drawable

* Tidy up things

* Unify background dim amount

* Use primaryColor for Account login button

* More colored ripples

* use colorOnPrimary for selected comfortable library item title

Co-authored-by: Soitora <simon.mattila@protonmail.com>
(cherry picked from commit 932c92412c)

# Conflicts:
#	app/src/main/res/layout-sw720dp/manga_info_header.xml
#	app/src/main/res/layout/manga_info_header.xml
#	app/src/main/res/layout/reader_activity.xml
#	app/src/main/res/menu/library_selection.xml
#	app/src/main/res/menu/reader.xml
#	app/src/main/res/values/colors.xml
#	app/src/main/res/values/dimens.xml
This commit is contained in:
Ivan Iskandar
2021-06-20 02:45:16 +07:00
committed by Jobobby04
parent 6283754ce5
commit f61bbfa77a
144 changed files with 670 additions and 1030 deletions
@@ -35,7 +35,8 @@ abstract class BaseThemedActivity : AppCompatActivity() {
DarkThemeVariant.midnightdusk -> R.style.Theme_Tachiyomi_Dark_MidnightDusk
DarkThemeVariant.amoled -> R.style.Theme_Tachiyomi_Amoled
DarkThemeVariant.hotpink -> R.style.Theme_Tachiyomi_Amoled_HotPink
DarkThemeVariant.amoledblue -> R.style.Theme_Tachiyomi_Amoled_Blue
// Hide AMOLED blue for now, so we don't crash the fuck out
DarkThemeVariant.amoledblue -> R.style.Theme_Tachiyomi_Amoled
DarkThemeVariant.red -> R.style.Theme_Tachiyomi_Amoled_Red
}
} else {
@@ -101,12 +101,13 @@ abstract class SettingsController : PreferenceController() {
private fun animatePreferenceHighlight(view: View) {
val origBackground = view.background
ValueAnimator
.ofObject(ArgbEvaluator(), Color.TRANSPARENT, view.context.getResourceColor(R.attr.rippleColor))
.ofObject(ArgbEvaluator(), Color.TRANSPARENT, view.context.getResourceColor(R.attr.colorControlHighlight))
.apply {
duration = 500L
repeatCount = 2
duration = 200L
repeatCount = 5
repeatMode = ValueAnimator.REVERSE
addUpdateListener { animator -> view.setBackgroundColor(animator.animatedValue as Int) }
reverse()
start()
}
.doOnEnd {
// Restore original ripple
@@ -171,7 +171,6 @@ class SettingsGeneralController : SettingsController() {
R.string.theme_dark_midnightdusk,
R.string.theme_dark_amoled,
R.string.theme_dark_amoled_hotpink,
R.string.theme_dark_amoledblue,
R.string.theme_dark_red
)
entryValues = arrayOf(
@@ -181,7 +180,6 @@ class SettingsGeneralController : SettingsController() {
Values.DarkThemeVariant.midnightdusk.name,
Values.DarkThemeVariant.amoled.name,
Values.DarkThemeVariant.hotpink.name,
Values.DarkThemeVariant.amoledblue.name,
Values.DarkThemeVariant.red.name
)
defaultValue = Values.DarkThemeVariant.default.name
@@ -157,7 +157,7 @@ class WebViewActivity : BaseViewBindingActivity<WebviewActivityBinding>() {
backItem?.isEnabled = binding.webview.canGoBack()
forwardItem?.isEnabled = binding.webview.canGoForward()
val iconTintColor = getResourceColor(R.attr.colorOnPrimary)
val iconTintColor = getResourceColor(R.attr.colorOnToolbar)
val translucentIconTintColor = ColorUtils.setAlphaComponent(iconTintColor, 127)
backItem?.icon?.setTint(if (binding.webview.canGoBack()) iconTintColor else translucentIconTintColor)
forwardItem?.icon?.setTint(if (binding.webview.canGoForward()) iconTintColor else translucentIconTintColor)
@@ -93,7 +93,7 @@ fun Context.copyToClipboard(label: String, content: String) {
*/
fun Context.notificationBuilder(channelId: String, block: (NotificationCompat.Builder.() -> Unit)? = null): NotificationCompat.Builder {
val builder = NotificationCompat.Builder(this, channelId)
.setColor(ContextCompat.getColor(this, R.color.colorPrimary))
.setColor(ContextCompat.getColor(this, R.color.accent_lightblue))
if (block != null) {
builder.block()
}
@@ -2,7 +2,6 @@ package eu.kanade.tachiyomi.widget
import android.content.Context
import android.content.res.ColorStateList
import android.graphics.Color
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.LinearLayout
@@ -12,6 +11,7 @@ import androidx.annotation.StringRes
import androidx.appcompat.view.ContextThemeWrapper
import androidx.core.view.isVisible
import com.google.android.material.button.MaterialButton
import com.mikepenz.aboutlibraries.util.getThemeColor
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.databinding.CommonViewEmptyBinding
import kotlin.random.Random
@@ -42,17 +42,22 @@ class EmptyView @JvmOverloads constructor(context: Context, attrs: AttributeSet?
binding.textLabel.text = message
binding.actionsContainer.removeAllViews()
val buttonContext = ContextThemeWrapper(context, R.style.Widget_Tachiyomi_Button_ActionButton)
val buttonColor = ColorStateList.valueOf(context.getThemeColor(R.attr.colorOnBackground))
actions?.forEach {
val button = MaterialButton(ContextThemeWrapper(context, R.style.Theme_Widget_Button_Action)).apply {
val button = MaterialButton(
buttonContext,
null,
R.attr.borderlessButtonStyle
).apply {
layoutParams = LinearLayout.LayoutParams(
0,
LinearLayout.LayoutParams.WRAP_CONTENT,
1f / actions.size
)
backgroundTintList = ColorStateList.valueOf(Color.TRANSPARENT)
stateListAnimator = null
elevation = 0f
setTextColor(buttonColor)
iconTint = buttonColor
setIconResource(it.iconResId)
setText(it.stringResId)
@@ -2,22 +2,18 @@ package eu.kanade.tachiyomi.widget
import android.content.Context
import android.util.AttributeSet
import androidx.core.content.ContextCompat
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import com.mikepenz.aboutlibraries.util.getThemeColor
import eu.kanade.tachiyomi.R
class ThemedSwipeRefreshLayout @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) :
SwipeRefreshLayout(context, attrs) {
class ThemedSwipeRefreshLayout @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null
) : SwipeRefreshLayout(context, attrs) {
init {
setColors()
}
private fun setColors() {
// Background is controlled with "swipeRefreshLayoutProgressSpinnerBackgroundColor" in XML
// Background
setProgressBackgroundColorSchemeColor(context.getThemeColor(R.attr.colorPrimary))
// This updates the progress arrow color
val white = ContextCompat.getColor(context, R.color.md_white_1000)
setColorSchemeColors(white, white, white)
setColorSchemeColors(context.getThemeColor(R.attr.colorOnPrimary))
}
}
+8
View File
@@ -286,6 +286,14 @@ object EXHMigrations {
LibraryUpdateJob.setupTask(context, 3)
}
}
if (oldVersion under 20) {
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
if (prefs.getString(PreferenceKeys.themeDark, null) == "amoledblue") {
prefs.edit {
putString(PreferenceKeys.themeDark, "amoled")
}
}
}
// if (oldVersion under 1) { } (1 is current release version)
// do stuff here when releasing changed crap