From 5b5239c5eb640608b751b9be2bff17c628a19aee Mon Sep 17 00:00:00 2001 From: Jay Date: Sun, 19 Apr 2020 17:28:59 -0400 Subject: [PATCH] Reader now using app theme, clean up of unused drawables; attrs; colors --- .../ui/base/activity/BaseActivity.kt | 8 +- .../tachiyomi/ui/download/DownloadHolder.kt | 2 +- .../kanade/tachiyomi/ui/main/MainActivity.kt | 2 - .../manga/process/MigrationProcessHolder.kt | 4 +- .../tachiyomi/ui/reader/ReaderActivity.kt | 34 ++++-- .../tachiyomi/ui/reader/ReaderChapterSheet.kt | 27 +++-- .../ui/reader/ReaderSettingsSheet.kt | 6 +- .../ui/reader/loader/HttpPageLoader.kt | 14 +-- .../ui/reader/viewer/pager/PagerConfig.kt | 2 +- .../ui/reader/viewer/pager/PagerPageHolder.kt | 8 +- .../ui/reader/viewer/webtoon/WebtoonConfig.kt | 6 + .../viewer/webtoon/WebtoonTransitionHolder.kt | 2 +- .../kanade/tachiyomi/util/system/ImageUtil.kt | 6 +- .../kanade/tachiyomi/util/system/ThemeUtil.kt | 17 +++ .../tachiyomi/util/view/ViewExtensions.kt | 39 +------ .../widget/DialogCustomDownloadView.kt | 108 ------------------ .../res/drawable/bg_bottom_sheet_black.xml | 8 -- .../res/drawable/bg_bottom_sheet_primary.xml | 8 -- app/src/main/res/drawable/bg_snackbar.xml | 6 - ...ml => bottom_sheet_rounded_background.xml} | 0 app/src/main/res/drawable/dialog_selector.xml | 19 --- .../drawable/ic_brightness_4_white_24dp.xml | 3 +- .../res/drawable/image_border_background.xml | 2 +- .../drawable/library_item_selector_amoled.xml | 19 --- .../drawable/library_item_selector_dark.xml | 19 --- .../drawable/library_item_selector_light.xml | 19 --- ...line_divider_dark.xml => line_divider.xml} | 0 .../main/res/drawable/line_divider_light.xml | 11 -- .../res/drawable/list_item_selector_dark.xml | 22 ---- .../drawable/round_textview_background.xml | 2 +- .../res/drawable/round_textview_border.xml | 2 +- .../res/layout/chapter_sort_bottom_sheet.xml | 2 +- .../main/res/layout/display_bottom_sheet.xml | 2 +- .../main/res/layout/download_bottom_sheet.xml | 4 +- .../res/layout/download_custom_amount.xml | 55 --------- .../main/res/layout/extension_card_item.xml | 1 + .../res/layout/extensions_bottom_sheet.xml | 4 +- .../main/res/layout/filter_bottom_sheet.xml | 2 +- .../res/layout/library_list_controller.xml | 1 - .../res/layout/manga_details_controller.xml | 1 - .../res/layout/migration_bottom_sheet.xml | 2 +- app/src/main/res/layout/reader_activity.xml | 4 +- .../main/res/layout/reader_chapters_sheet.xml | 4 +- .../res/layout/reader_color_filter_sheet.xml | 2 +- app/src/main/res/layout/reader_page_sheet.xml | 2 +- .../main/res/layout/reader_settings_sheet.xml | 2 +- .../main/res/layout/source_filter_sheet.xml | 4 +- .../main/res/layout/tracking_bottom_sheet.xml | 2 +- app/src/main/res/values-night/colors.xml | 7 -- app/src/main/res/values-night/themes.xml | 13 --- app/src/main/res/values-v26/colors.xml | 4 - app/src/main/res/values/attrs.xml | 7 -- app/src/main/res/values/colors.xml | 19 +-- app/src/main/res/values/styles.xml | 11 +- app/src/main/res/values/themes.xml | 107 +---------------- 55 files changed, 124 insertions(+), 563 deletions(-) delete mode 100644 app/src/main/java/eu/kanade/tachiyomi/widget/DialogCustomDownloadView.kt delete mode 100644 app/src/main/res/drawable/bg_bottom_sheet_black.xml delete mode 100644 app/src/main/res/drawable/bg_bottom_sheet_primary.xml delete mode 100644 app/src/main/res/drawable/bg_snackbar.xml rename app/src/main/res/drawable/{bg_bottom_sheet_dialog_fragment.xml => bottom_sheet_rounded_background.xml} (100%) delete mode 100644 app/src/main/res/drawable/dialog_selector.xml delete mode 100644 app/src/main/res/drawable/library_item_selector_amoled.xml delete mode 100644 app/src/main/res/drawable/library_item_selector_dark.xml delete mode 100644 app/src/main/res/drawable/library_item_selector_light.xml rename app/src/main/res/drawable/{line_divider_dark.xml => line_divider.xml} (100%) delete mode 100644 app/src/main/res/drawable/line_divider_light.xml delete mode 100644 app/src/main/res/drawable/list_item_selector_dark.xml delete mode 100644 app/src/main/res/layout/download_custom_amount.xml delete mode 100644 app/src/main/res/values-v26/colors.xml diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/activity/BaseActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/activity/BaseActivity.kt index 11a2ed4f04..369c201130 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/activity/BaseActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/activity/BaseActivity.kt @@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.ui.base.activity import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatDelegate -import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.ui.main.SearchActivity import eu.kanade.tachiyomi.ui.security.BiometricActivity @@ -23,12 +22,7 @@ abstract class BaseActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { AppCompatDelegate.setDefaultNightMode(ThemeUtil.nightMode(preferences.theme())) - val theme = preferences.theme() - setTheme(when { - ThemeUtil.isAMOLEDTheme(theme) -> R.style.Theme_Tachiyomi_Amoled - ThemeUtil.isBlueTheme(theme) -> R.style.Theme_Tachiyomi_AllBlue - else -> R.style.Theme_Tachiyomi - }) + setTheme(ThemeUtil.theme(preferences.theme())) super.onCreate(savedInstanceState) SecureActivityDelegate.setSecure(this) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadHolder.kt index 580c6da4cc..f7342ba9a9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadHolder.kt @@ -55,7 +55,7 @@ class DownloadHolder(private val view: View, val adapter: DownloadAdapter) : migration_menu.visibleIf(adapterPosition != 0 || adapterPosition != adapter.itemCount - 1) migration_menu.setVectorCompat( R.drawable.ic_more_vert_black_24dp, view.context - .getResourceColor(R.attr.icon_color)) + .getResourceColor(android.R.attr.textColorPrimary)) } /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index 79765ff8f3..52bba3b284 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -314,8 +314,6 @@ open class MainActivity : BaseActivity(), DownloadServiceListener { if (updates > 0) { val badge = bottom_nav.getOrCreateBadge(R.id.nav_browse) badge.number = updates - badge.backgroundColor = getResourceColor(R.attr.badgeColor) - badge.badgeTextColor = Color.WHITE } else { bottom_nav.removeBadge(R.id.nav_browse) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/process/MigrationProcessHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/process/MigrationProcessHolder.kt index 888b30e4b5..006f9f2700 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/process/MigrationProcessHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/process/MigrationProcessHolder.kt @@ -53,11 +53,11 @@ class MigrationProcessHolder( val source = item.manga.mangaSource() migration_menu.setVectorCompat( - R.drawable.ic_more_vert_black_24dp, view.context.getResourceColor(R.attr.icon_color) + R.drawable.ic_more_vert_black_24dp, view.context.getResourceColor(android.R.attr.textColorPrimary) ) skip_manga.setVectorCompat( R.drawable.ic_close_white_24dp, view.context.getResourceColor( - R.attr.icon_color + android.R.attr.textColorPrimary ) ) migration_menu.invisible() diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index 9ce460eaa4..aa3430a679 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt @@ -22,6 +22,7 @@ import android.view.animation.Animation import android.view.animation.AnimationUtils import android.widget.SeekBar import androidx.appcompat.app.AppCompatDelegate +import androidx.core.graphics.ColorUtils import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView import com.google.android.material.bottomsheet.BottomSheetBehavior import com.google.android.material.bottomsheet.BottomSheetDialog @@ -130,6 +131,8 @@ class ReaderActivity : BaseRxActivity(), var sheetManageNavColor = false + var lightStatusBar = false + /** * Progress dialog used when switching chapters from the menu buttons. */ @@ -162,15 +165,24 @@ class ReaderActivity : BaseRxActivity(), */ override fun onCreate(savedInstanceState: Bundle?) { AppCompatDelegate.setDefaultNightMode(ThemeUtil.nightMode(preferences.theme())) - setTheme(when (preferences.readerTheme().getOrDefault()) { - 0 -> R.style.Theme_Base_Reader_Light - 1 -> R.style.Theme_Base_Reader_Dark - else -> R.style.Theme_Base_Reader - }) + setTheme(ThemeUtil.theme(preferences.theme())) super.onCreate(savedInstanceState) setContentView(R.layout.reader_activity) - + val a = obtainStyledAttributes(intArrayOf(android.R.attr.windowLightStatusBar)) + lightStatusBar = a.getBoolean(0, false) + a.recycle() setNotchCutoutMode() + if (lightStatusBar) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) reader_layout.systemUiVisibility = + reader_layout.systemUiVisibility.or(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR) + reader_layout.systemUiVisibility = + reader_layout.systemUiVisibility.or(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR) + } else { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) reader_layout.systemUiVisibility = + reader_layout.systemUiVisibility.rem(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR) + reader_layout.systemUiVisibility = + reader_layout.systemUiVisibility.rem(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR) + } if (presenter.needsInit()) { val manga = intent.extras!!.getLong("manga", -1) @@ -300,6 +312,10 @@ class ReaderActivity : BaseRxActivity(), private fun initializeMenu() { // Set toolbar setSupportActionBar(toolbar) + val primaryColor = ColorUtils.setAlphaComponent(getResourceColor(R.attr.colorSecondary), + 200) + toolbar.setBackgroundColor(primaryColor) + window.statusBarColor = primaryColor supportActionBar?.setDisplayHomeAsUpEnabled(true) toolbar.setNavigationOnClickListener { onBackPressed() @@ -327,7 +343,7 @@ class ReaderActivity : BaseRxActivity(), } // if in landscape with 2/3 button mode, fully opaque nav bar else if (insets.systemWindowInsetLeft > 0 || insets.systemWindowInsetRight > 0) { - window.navigationBarColor = getResourceColor(R.attr.colorPrimary) + window.navigationBarColor = getResourceColor(R.attr.colorSecondary) false } // if in portrait with 2/3 button mode, translucent nav bar @@ -702,10 +718,6 @@ class ReaderActivity : BaseRxActivity(), subscriptions += Observable.merge(initialRotation, rotationUpdates) .subscribe { setOrientation(it) } - subscriptions += preferences.readerTheme().asObservable() - .skip(1) // We only care about updates - .subscribe { recreate() } - subscriptions += preferences.showPageNumber().asObservable() .subscribe { setPageNumberVisibility(it) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderChapterSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderChapterSheet.kt index 1741d84753..3746b5df0f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderChapterSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderChapterSheet.kt @@ -6,9 +6,7 @@ import android.graphics.Color import android.os.Build import android.util.AttributeSet import android.view.View -import android.view.ViewGroup import android.widget.LinearLayout -import androidx.core.content.ContextCompat import androidx.core.graphics.ColorUtils import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView @@ -40,8 +38,12 @@ class ReaderChapterSheet @JvmOverloads constructor(context: Context, attrs: Attr fun setup(activity: ReaderActivity) { presenter = activity.presenter - val primary = activity.getResourceColor(R.attr.colorPrimary) - val fullPrimary = ContextCompat.getColor(activity, R.color.darkPrimaryColor) + val primary = ColorUtils.setAlphaComponent( + activity.getResourceColor( + R.attr.colorSecondary + ), 200 + ) + val fullPrimary = activity.getResourceColor(R.attr.colorSecondary) sheetBehavior = BottomSheetBehavior.from(this) chapters_button.setOnClickListener { if (sheetBehavior?.state == BottomSheetBehavior.STATE_EXPANDED) sheetBehavior?.state = @@ -58,7 +60,7 @@ class ReaderChapterSheet @JvmOverloads constructor(context: Context, attrs: Attr sheetBehavior?.peekHeight = peek + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) insets.mandatorySystemGestureInsets.bottom else insets.systemWindowInsetBottom - chapters_bottom_sheet.updateLayoutParams { + chapters_bottom_sheet.updateLayoutParams { height = 280.dpToPx + insets.systemWindowInsetBottom } chapter_recycler.updatePaddingRelative(bottom = insets.systemWindowInsetBottom) @@ -66,7 +68,8 @@ class ReaderChapterSheet @JvmOverloads constructor(context: Context, attrs: Attr sheetBehavior?.addBottomSheetCallback(object : BottomSheetBehavior.BottomSheetCallback() { override fun onSlide(bottomSheet: View, progress: Float) { val trueProgress = max(progress, 0f) - backgroundTintList = ColorStateList.valueOf(lerpColor(primary, fullPrimary, trueProgress)) + backgroundTintList = + ColorStateList.valueOf(lerpColor(primary, fullPrimary, trueProgress)) chapter_recycler.alpha = trueProgress if (activity.sheetManageNavColor) activity.window.navigationBarColor = lerpColor(ColorUtils.setAlphaComponent(primary, 0), primary, trueProgress) @@ -106,12 +109,22 @@ class ReaderChapterSheet @JvmOverloads constructor(context: Context, attrs: Attr } } - override fun onClick(v: View, position: Int, fastAdapter: FastAdapter, item: ReaderChapterItem) { + override fun onClick( + v: View, + position: Int, + fastAdapter: FastAdapter, + item: ReaderChapterItem + ) { presenter.toggleBookmark(item.chapter) refreshList() } }) + backgroundTintList = ColorStateList.valueOf( + if (sheetBehavior?.state != BottomSheetBehavior.STATE_EXPANDED) primary + else fullPrimary + ) + chapter_recycler.layoutManager = LinearLayoutManager(context) refreshList() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt index 2f109615c1..1c45799c85 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt @@ -113,7 +113,7 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) : viewer.setSelection(activity.presenter.manga?.viewer ?: 0, false) rotation_mode.bindToPreference(preferences.rotation(), 1) - background_color.bindToPreference(preferences.readerTheme(), 0, true) + background_color.bindToPreference(preferences.readerTheme(), 0) show_page_number.bindToPreference(preferences.showPageNumber()) fullscreen.bindToPreference(preferences.fullscreen()) keepscreen.bindToPreference(preferences.keepScreenOn()) @@ -155,12 +155,10 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) : */ private fun Spinner.bindToPreference( pref: Preference, - offset: Int = 0, - shouldDismiss: Boolean = false + offset: Int = 0 ) { onItemSelectedListener = IgnoreFirstSpinnerListener { position -> pref.set(position + offset) - if (shouldDismiss) dismiss() } setSelection(pref.getOrDefault() - offset, false) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/HttpPageLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/HttpPageLoader.kt index 11cbf6b1b6..9b6248b8bd 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/HttpPageLoader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/HttpPageLoader.kt @@ -219,28 +219,26 @@ class HttpPageLoader( private fun HttpSource.getCachedImage(page: ReaderPage): Observable { val imageUrl = page.imageUrl ?: return Observable.just(page) - return Observable.just(page) - .flatMap { + return Observable.just(page).flatMap { if (!chapterCache.isImageInCache(imageUrl)) { cacheImage(page) } else { Observable.just(page) } - } - .doOnNext { + }.doOnNext { val readerTheme = preferences.readerTheme().getOrDefault() if (readerTheme >= 2) { val stream = chapterCache.getImageFile(imageUrl).inputStream() val image = BitmapFactory.decodeStream(stream) - page.bg = ImageUtil.autoSetBackground(image, readerTheme == 2) + page.bg = ImageUtil.autoSetBackground( + image, readerTheme == 2, preferences.context + ) page.bgAlwaysWhite = readerTheme == 2 stream.close() } page.stream = { chapterCache.getImageFile(imageUrl).inputStream() } page.status = Page.READY - } - .doOnError { page.status = Page.ERROR } - .onErrorReturn { page } + }.doOnError { page.status = Page.ERROR }.onErrorReturn { page } } /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerConfig.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerConfig.kt index 62a970ec76..2f303e15e8 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerConfig.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerConfig.kt @@ -78,7 +78,7 @@ class PagerConfig(private val viewer: PagerViewer, preferences: PreferencesHelpe .register({ volumeKeysInverted = it }) preferences.readerTheme() - .register({ readerTheme = it }) + .register({ readerTheme = it }, { imagePropertyChangedListener?.invoke() }) preferences.alwaysShowChapterTransition() .register({ alwaysShowChapterTransition = it }) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt index 6c9f7c0cc9..4a7cfcaae5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt @@ -4,6 +4,7 @@ import android.annotation.SuppressLint import android.content.Intent import android.graphics.BitmapFactory import android.graphics.PointF +import android.graphics.drawable.ColorDrawable import android.graphics.drawable.Drawable import android.net.Uri import android.view.GestureDetector @@ -36,6 +37,7 @@ import eu.kanade.tachiyomi.ui.reader.model.ReaderPage import eu.kanade.tachiyomi.ui.reader.viewer.ReaderProgressBar import eu.kanade.tachiyomi.ui.reader.viewer.pager.PagerConfig.ZoomType import eu.kanade.tachiyomi.util.system.ImageUtil +import eu.kanade.tachiyomi.util.system.ThemeUtil import eu.kanade.tachiyomi.util.system.dpToPx import eu.kanade.tachiyomi.util.system.launchUI import eu.kanade.tachiyomi.util.view.gone @@ -272,7 +274,9 @@ class PagerPageHolder( } } } else { - initSubsamplingImageView().setImage(ImageSource.inputStream(openStream!!)) + val imageView = initSubsamplingImageView() + imageView.setImage(ImageSource.inputStream(openStream!!)) + imageView.background = ColorDrawable(ThemeUtil.readerBackgroundColor(viewer.config.readerTheme)) } } else { val imageView = initImageView() @@ -292,7 +296,7 @@ class PagerPageHolder( val preferences by injectLazy() ImageUtil.autoSetBackground(BitmapFactory.decodeByteArray( bytesArray, 0, bytesArray.size - ), preferences.readerTheme().getOrDefault() == 2) + ), preferences.readerTheme().getOrDefault() == 2, context) } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonConfig.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonConfig.kt index 1c8dc66f03..f4b822958a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonConfig.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonConfig.kt @@ -40,6 +40,9 @@ class WebtoonConfig(preferences: PreferencesHelper = Injekt.get()) { var sidePadding = 0 private set + var readerTheme = 0 + private set + init { preferences.readWithTapping() .register({ tappingEnabled = it }) @@ -64,6 +67,9 @@ class WebtoonConfig(preferences: PreferencesHelper = Injekt.get()) { preferences.webtoonSidePadding() .register({ sidePadding = it }, { imagePropertyChangedListener?.invoke() }) + + preferences.readerTheme() + .register({ readerTheme = it }, { imagePropertyChangedListener?.invoke() }) } fun unsubscribe() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonTransitionHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonTransitionHolder.kt index 3604274903..47996f2e21 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonTransitionHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonTransitionHolder.kt @@ -152,7 +152,7 @@ class WebtoonTransitionHolder( is ReaderChapter.State.Error -> setError(state.error, transition) is ReaderChapter.State.Loaded -> setLoaded() } - pagesContainer.visibleIf { pagesContainer.childCount > 0 } + pagesContainer.visibleIf(pagesContainer.childCount > 0) } addSubscription(statusSubscription) diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/ImageUtil.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/ImageUtil.kt index 44e4a98f04..7f6161cb8f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/system/ImageUtil.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/ImageUtil.kt @@ -1,5 +1,6 @@ package eu.kanade.tachiyomi.util.system +import android.content.Context import android.graphics.Bitmap import android.graphics.Color import android.graphics.drawable.ColorDrawable @@ -55,8 +56,9 @@ object ImageUtil { return null } - fun autoSetBackground(image: Bitmap?, useWhiteAlways: Boolean): Drawable { - val backgroundColor = if (useWhiteAlways) Color.WHITE else android.R.attr.colorBackground + fun autoSetBackground(image: Bitmap?, useWhiteAlways: Boolean, context: Context): Drawable { + val backgroundColor = if (useWhiteAlways) Color.WHITE else + context.getResourceColor(android.R.attr.colorBackground) if (image == null) return ColorDrawable(backgroundColor) if (image.width < 50 || image.height < 50) return ColorDrawable(backgroundColor) diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/ThemeUtil.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/ThemeUtil.kt index 6671eb2584..ec9403b921 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/system/ThemeUtil.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/ThemeUtil.kt @@ -1,6 +1,8 @@ package eu.kanade.tachiyomi.util.system +import android.graphics.Color import androidx.appcompat.app.AppCompatDelegate +import eu.kanade.tachiyomi.R object ThemeUtil { fun isBlueTheme(theme: Int): Boolean { @@ -11,6 +13,21 @@ object ThemeUtil { return theme == 3 || theme == 6 } + fun theme(theme: Int): Int { + return when { + isAMOLEDTheme(theme) -> R.style.Theme_Tachiyomi_Amoled + isBlueTheme(theme) -> R.style.Theme_Tachiyomi_AllBlue + else -> R.style.Theme_Tachiyomi + } + } + + fun readerBackgroundColor(theme: Int): Int { + return when (theme) { + 1 -> Color.BLACK + else -> Color.WHITE + } + } + fun nightMode(theme: Int): Int { return when (theme) { 1, 8 -> AppCompatDelegate.MODE_NIGHT_NO diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt index bbacdc5bb3..08965dbb13 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt @@ -24,7 +24,6 @@ import androidx.annotation.Px import androidx.appcompat.widget.SearchView import androidx.core.graphics.ColorUtils import androidx.core.math.MathUtils.clamp -import androidx.core.view.ViewCompat import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import androidx.swiperefreshlayout.widget.SwipeRefreshLayout @@ -38,6 +37,7 @@ import com.google.android.material.button.MaterialButton import com.google.android.material.snackbar.Snackbar import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.PreferencesHelper +import eu.kanade.tachiyomi.util.system.ThemeUtil import eu.kanade.tachiyomi.util.system.dpToPx import eu.kanade.tachiyomi.util.system.getResourceColor import kotlinx.android.synthetic.main.main_activity.* @@ -67,28 +67,19 @@ fun View.snack( f: (Snackbar.() -> Unit)? = null ): Snackbar { val snack = Snackbar.make(this, message, length) - /* when { - Build.VERSION.SDK_INT >= 23 -> { - val leftM = if (this is CoordinatorLayout) 0 else rootWindowInsets.systemWindowInsetLeft - val rightM = if (this is CoordinatorLayout) 0 - else rootWindowInsets.systemWindowInsetRight - snack.config(context, rootWindowInsets - .systemWindowInsetBottom, rightM, leftM) - } - else -> snack.config(context) - }*/ if (f != null) { snack.f() } val theme = Injekt.get().theme() - if (theme == 3) { + val currentNightMode = resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK + if (ThemeUtil.isAMOLEDTheme(theme) && currentNightMode == Configuration.UI_MODE_NIGHT_YES) { val textView: TextView = snack.view.findViewById(com.google.android.material.R.id.snackbar_text) val button: Button? = snack.view.findViewById(com.google.android.material.R.id.snackbar_action) - textView.setTextColor(context.getResourceColor(R.attr.snackbar_text)) - button?.setTextColor(context.getResourceColor(R.attr.snackbar_text)) - snack.config(context) + textView.setTextColor(Color.WHITE) + button?.setTextColor(Color.WHITE) + snack.view.backgroundTintList = ColorStateList.valueOf(Color.DKGRAY) } snack.show() return snack @@ -102,20 +93,6 @@ fun View.snack( return snack(context.getString(resource), length, f) } -fun Snackbar.config( - context: Context, - bottomMargin: Int = 0, - rightMargin: Int = 0, - leftMargin: Int = 0 -) { - val params = this.view.layoutParams as ViewGroup.MarginLayoutParams - params.setMargins(12 + leftMargin, 12, 12 + rightMargin, 12 + bottomMargin) - this.view.layoutParams = params - this.view.background = context.getDrawable(R.drawable.bg_snackbar) - - ViewCompat.setElevation(this.view, 6f) -} - fun Snackbar.getText(): CharSequence { val textView: TextView = view.findViewById(com.google.android.material.R.id.snackbar_text) return textView.text @@ -133,10 +110,6 @@ inline fun View.gone() { visibility = View.GONE } -inline fun View.visibleIf(block: () -> Boolean) { - visibility = if (block()) View.VISIBLE else View.GONE -} - inline fun View.visibleIf(show: Boolean) { visibility = if (show) View.VISIBLE else View.GONE } diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/DialogCustomDownloadView.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/DialogCustomDownloadView.kt deleted file mode 100644 index 5e05cdb5c9..0000000000 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/DialogCustomDownloadView.kt +++ /dev/null @@ -1,108 +0,0 @@ -package eu.kanade.tachiyomi.widget - -import android.content.Context -import android.text.SpannableStringBuilder -import android.util.AttributeSet -import android.view.View -import android.widget.LinearLayout -import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.util.view.inflate -import kotlinx.android.synthetic.main.download_custom_amount.view.* -import timber.log.Timber - -/** - * Custom dialog to select how many chapters to download. - */ -class DialogCustomDownloadView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : - LinearLayout(context, attrs) { - - /** - * Current amount of custom download chooser. - */ - var amount: Int = 0 - private set - - /** - * Minimal value of custom download chooser. - */ - private var min = 0 - - /** - * Maximal value of custom download chooser. - */ - private var max = 0 - - init { - // Add view to stack - addView(inflate(R.layout.download_custom_amount)) - } - - /** - * Called when view is added - * - * @param child - */ - override fun onViewAdded(child: View) { - super.onViewAdded(child) - - // Set download count to 0. - myNumber.text = SpannableStringBuilder(getAmount(0).toString()) - - // When user presses button decrease amount by 10. - btn_decrease_10.setOnClickListener { - myNumber.text = SpannableStringBuilder(getAmount(amount - 10).toString()) - } - - // When user presses button increase amount by 10. - btn_increase_10.setOnClickListener { - myNumber.text = SpannableStringBuilder(getAmount(amount + 10).toString()) - } - - // When user presses button decrease amount by 1. - btn_decrease.setOnClickListener { - myNumber.text = SpannableStringBuilder(getAmount(amount - 1).toString()) - } - - // When user presses button increase amount by 1. - btn_increase.setOnClickListener { - myNumber.text = SpannableStringBuilder(getAmount(amount + 1).toString()) - } - - // When user inputs custom number set amount equal to input. - myNumber.addTextChangedListener(object : SimpleTextWatcher() { - override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) { - try { - amount = getAmount(Integer.parseInt(s.toString())) - } catch (error: NumberFormatException) { - // Catch NumberFormatException to prevent parse exception when input is empty. - Timber.e(error) - } - } - }) - } - - /** - * Set min max of custom download amount chooser. - * @param min minimal downloads - * @param max maximal downloads - */ - fun setMinMax(min: Int, max: Int) { - this.min = min - this.max = max - } - - /** - * Returns amount to download. - * if minimal downloads is less than input return minimal downloads. - * if Maximal downloads is more than input return maximal downloads. - * - * @return amount to download. - */ - private fun getAmount(input: Int): Int { - return when { - input > max -> max - input < min -> min - else -> input - } - } -} diff --git a/app/src/main/res/drawable/bg_bottom_sheet_black.xml b/app/src/main/res/drawable/bg_bottom_sheet_black.xml deleted file mode 100644 index 78d8b682e7..0000000000 --- a/app/src/main/res/drawable/bg_bottom_sheet_black.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_bottom_sheet_primary.xml b/app/src/main/res/drawable/bg_bottom_sheet_primary.xml deleted file mode 100644 index 76060c00a3..0000000000 --- a/app/src/main/res/drawable/bg_bottom_sheet_primary.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_snackbar.xml b/app/src/main/res/drawable/bg_snackbar.xml deleted file mode 100644 index 31128e1590..0000000000 --- a/app/src/main/res/drawable/bg_snackbar.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_bottom_sheet_dialog_fragment.xml b/app/src/main/res/drawable/bottom_sheet_rounded_background.xml similarity index 100% rename from app/src/main/res/drawable/bg_bottom_sheet_dialog_fragment.xml rename to app/src/main/res/drawable/bottom_sheet_rounded_background.xml diff --git a/app/src/main/res/drawable/dialog_selector.xml b/app/src/main/res/drawable/dialog_selector.xml deleted file mode 100644 index 831d0f5d38..0000000000 --- a/app/src/main/res/drawable/dialog_selector.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_brightness_4_white_24dp.xml b/app/src/main/res/drawable/ic_brightness_4_white_24dp.xml index 09f16c1d37..5afa71c71f 100644 --- a/app/src/main/res/drawable/ic_brightness_4_white_24dp.xml +++ b/app/src/main/res/drawable/ic_brightness_4_white_24dp.xml @@ -2,7 +2,8 @@ android:width="24dp" android:height="24dp" android:viewportWidth="24.0" - android:viewportHeight="24.0"> + android:viewportHeight="24.0" + android:tint="?attr/actionBarTintColor"> diff --git a/app/src/main/res/drawable/image_border_background.xml b/app/src/main/res/drawable/image_border_background.xml index 3bd493d4a1..880fc924f1 100644 --- a/app/src/main/res/drawable/image_border_background.xml +++ b/app/src/main/res/drawable/image_border_background.xml @@ -1,7 +1,7 @@ - + \ No newline at end of file diff --git a/app/src/main/res/drawable/library_item_selector_amoled.xml b/app/src/main/res/drawable/library_item_selector_amoled.xml deleted file mode 100644 index c7e57d6548..0000000000 --- a/app/src/main/res/drawable/library_item_selector_amoled.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable/library_item_selector_dark.xml b/app/src/main/res/drawable/library_item_selector_dark.xml deleted file mode 100644 index aa427b5fca..0000000000 --- a/app/src/main/res/drawable/library_item_selector_dark.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable/library_item_selector_light.xml b/app/src/main/res/drawable/library_item_selector_light.xml deleted file mode 100644 index aa427b5fca..0000000000 --- a/app/src/main/res/drawable/library_item_selector_light.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable/line_divider_dark.xml b/app/src/main/res/drawable/line_divider.xml similarity index 100% rename from app/src/main/res/drawable/line_divider_dark.xml rename to app/src/main/res/drawable/line_divider.xml diff --git a/app/src/main/res/drawable/line_divider_light.xml b/app/src/main/res/drawable/line_divider_light.xml deleted file mode 100644 index 7c873bd96f..0000000000 --- a/app/src/main/res/drawable/line_divider_light.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/list_item_selector_dark.xml b/app/src/main/res/drawable/list_item_selector_dark.xml deleted file mode 100644 index 48af7d3484..0000000000 --- a/app/src/main/res/drawable/list_item_selector_dark.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable/round_textview_background.xml b/app/src/main/res/drawable/round_textview_background.xml index 698ec6ff0e..75a5ee898c 100644 --- a/app/src/main/res/drawable/round_textview_background.xml +++ b/app/src/main/res/drawable/round_textview_background.xml @@ -5,5 +5,5 @@ - + \ No newline at end of file diff --git a/app/src/main/res/drawable/round_textview_border.xml b/app/src/main/res/drawable/round_textview_border.xml index f8aae133d2..f08b2610f3 100644 --- a/app/src/main/res/drawable/round_textview_border.xml +++ b/app/src/main/res/drawable/round_textview_border.xml @@ -16,7 +16,7 @@ android:height="32dp" android:width="32dp" /> - + \ No newline at end of file diff --git a/app/src/main/res/layout/chapter_sort_bottom_sheet.xml b/app/src/main/res/layout/chapter_sort_bottom_sheet.xml index 11ad1260a2..3b49719aea 100644 --- a/app/src/main/res/layout/chapter_sort_bottom_sheet.xml +++ b/app/src/main/res/layout/chapter_sort_bottom_sheet.xml @@ -3,7 +3,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/display_bottom_sheet" android:layout_width="match_parent" - android:background="@drawable/bg_bottom_sheet_dialog_fragment" + android:background="@drawable/bottom_sheet_rounded_background" android:layout_height="wrap_content"> diff --git a/app/src/main/res/layout/download_bottom_sheet.xml b/app/src/main/res/layout/download_bottom_sheet.xml index 6909af61a9..31a0934b9f 100644 --- a/app/src/main/res/layout/download_bottom_sheet.xml +++ b/app/src/main/res/layout/download_bottom_sheet.xml @@ -6,7 +6,7 @@ style="@style/BottomSheetDialogTheme" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@drawable/bg_bottom_sheet_dialog_fragment" + android:background="@drawable/bottom_sheet_rounded_background" android:backgroundTint="?android:attr/colorBackground" android:orientation="vertical" app:behavior_peekHeight="48sp" @@ -17,7 +17,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:background="@drawable/bg_bottom_sheet_dialog_fragment" + android:background="@drawable/bottom_sheet_rounded_background" android:backgroundTint="?attr/colorPrimaryVariant" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/main/res/layout/download_custom_amount.xml b/app/src/main/res/layout/download_custom_amount.xml deleted file mode 100644 index 3feea3e50a..0000000000 --- a/app/src/main/res/layout/download_custom_amount.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/extension_card_item.xml b/app/src/main/res/layout/extension_card_item.xml index e7fb0104ea..b79ca9e2d6 100644 --- a/app/src/main/res/layout/extension_card_item.xml +++ b/app/src/main/res/layout/extension_card_item.xml @@ -67,6 +67,7 @@ diff --git a/app/src/main/res/layout/library_list_controller.xml b/app/src/main/res/layout/library_list_controller.xml index 1501a63f8d..28c7421a8c 100644 --- a/app/src/main/res/layout/library_list_controller.xml +++ b/app/src/main/res/layout/library_list_controller.xml @@ -55,7 +55,6 @@ tools:alpha="1" android:layout_marginEnd="50dp" android:background="@drawable/round_textview_background" - android:backgroundTint="@color/md_grey_800_85" android:padding="10dp" android:textColor="@android:color/white" app:layout_constraintEnd_toStartOf="@id/fast_scroller" diff --git a/app/src/main/res/layout/manga_details_controller.xml b/app/src/main/res/layout/manga_details_controller.xml index ddc3d27c0a..df2fb4e5cd 100644 --- a/app/src/main/res/layout/manga_details_controller.xml +++ b/app/src/main/res/layout/manga_details_controller.xml @@ -59,7 +59,6 @@ android:layout_marginEnd="50dp" android:alpha="0" android:background="@drawable/round_textview_background" - android:backgroundTint="@color/md_grey_800_85" android:padding="8dp" android:textColor="@android:color/white" app:layout_constraintEnd_toStartOf="@id/fast_scroller" diff --git a/app/src/main/res/layout/migration_bottom_sheet.xml b/app/src/main/res/layout/migration_bottom_sheet.xml index 451e9e279f..b478e2fe25 100644 --- a/app/src/main/res/layout/migration_bottom_sheet.xml +++ b/app/src/main/res/layout/migration_bottom_sheet.xml @@ -16,7 +16,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="32dp" - android:background="@drawable/bg_bottom_sheet_dialog_fragment" + android:background="@drawable/bottom_sheet_rounded_background" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" diff --git a/app/src/main/res/layout/reader_activity.xml b/app/src/main/res/layout/reader_activity.xml index 69c2bce49e..391761f49f 100644 --- a/app/src/main/res/layout/reader_activity.xml +++ b/app/src/main/res/layout/reader_activity.xml @@ -38,7 +38,7 @@ android:id="@+id/reader_menu" android:layout_width="match_parent" android:layout_height="match_parent" - android:theme="?attr/actionBarTheme" + android:background="@android:color/transparent" android:visibility="invisible" tools:visibility="visible"> @@ -46,7 +46,7 @@ android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" - android:background="?colorPrimary" /> + android:background="?colorSecondary" /> diff --git a/app/src/main/res/layout/reader_chapters_sheet.xml b/app/src/main/res/layout/reader_chapters_sheet.xml index 134556e8bd..85ef1aedb7 100644 --- a/app/src/main/res/layout/reader_chapters_sheet.xml +++ b/app/src/main/res/layout/reader_chapters_sheet.xml @@ -5,8 +5,8 @@ android:id="@+id/chapters_bottom_sheet" android:layout_width="match_parent" android:layout_height="300dp" - android:background="@drawable/bg_bottom_sheet_black" - android:backgroundTint="@color/darkPrimaryTranslucent" + android:background="@drawable/bottom_sheet_rounded_background" + android:backgroundTint="?colorSecondary" android:orientation="vertical" app:behavior_peekHeight="?attr/actionBarSize" app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"> diff --git a/app/src/main/res/layout/reader_color_filter_sheet.xml b/app/src/main/res/layout/reader_color_filter_sheet.xml index 23e7ce23d4..f6c40f06d4 100644 --- a/app/src/main/res/layout/reader_color_filter_sheet.xml +++ b/app/src/main/res/layout/reader_color_filter_sheet.xml @@ -3,7 +3,7 @@ style="@style/BottomSheetDialogTheme" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@drawable/bg_bottom_sheet_dialog_fragment" + android:background="@drawable/bottom_sheet_rounded_background" android:clipToPadding="false" android:orientation="vertical"> diff --git a/app/src/main/res/layout/reader_page_sheet.xml b/app/src/main/res/layout/reader_page_sheet.xml index b944fb840e..6d58ef28b3 100644 --- a/app/src/main/res/layout/reader_page_sheet.xml +++ b/app/src/main/res/layout/reader_page_sheet.xml @@ -3,7 +3,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" style="@style/BottomSheetDialogTheme" - android:background="@drawable/bg_bottom_sheet_dialog_fragment" + android:background="@drawable/bottom_sheet_rounded_background" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> diff --git a/app/src/main/res/layout/reader_settings_sheet.xml b/app/src/main/res/layout/reader_settings_sheet.xml index 3c211e4df3..00e85d8d8e 100644 --- a/app/src/main/res/layout/reader_settings_sheet.xml +++ b/app/src/main/res/layout/reader_settings_sheet.xml @@ -5,7 +5,7 @@ android:id="@+id/bottom_sheet" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@drawable/bg_bottom_sheet_dialog_fragment" + android:background="@drawable/bottom_sheet_rounded_background" android:forceDarkAllowed="false"> @@ -21,7 +21,7 @@ android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:layout_gravity="top" - android:background="@drawable/bg_bottom_sheet_primary" + android:background="@drawable/bottom_sheet_rounded_background" android:backgroundTint="?attr/colorSecondary" android:clickable="true" android:elevation="0dp" diff --git a/app/src/main/res/layout/tracking_bottom_sheet.xml b/app/src/main/res/layout/tracking_bottom_sheet.xml index 83aae85657..d7d304c35d 100644 --- a/app/src/main/res/layout/tracking_bottom_sheet.xml +++ b/app/src/main/res/layout/tracking_bottom_sheet.xml @@ -3,7 +3,7 @@ xmlns:tools="http://schemas.android.com/tools" android:id="@+id/display_bottom_sheet" android:layout_width="match_parent" - android:background="@drawable/bg_bottom_sheet_dialog_fragment" + android:background="@drawable/bottom_sheet_rounded_background" android:layout_height="match_parent"> #212121 @color/md_white_1000_76 - @color/md_white_1000_12 - #3399FF - #FFFFFF - #212121 @color/md_white_1000_20 #707070 #171717 @@ -28,8 +24,5 @@ #1C1C1D #212121 - - @color/md_blue_A200_50 - @color/md_white_1000_54 #BFBFBF \ No newline at end of file diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index e3dcb775b8..717082b1fb 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -6,16 +6,6 @@ false - - @@ -27,12 +17,9 @@ @color/colorAmoledPrimary @color/md_black_1000 @color/blackStatus - @color/trueSnackbarBackground - @color/textColorPrimary @drawable/list_item_selector - @drawable/library_item_selector_amoled @color/colorAmoledPrimary diff --git a/app/src/main/res/values-v26/colors.xml b/app/src/main/res/values-v26/colors.xml deleted file mode 100644 index c203a7553c..0000000000 --- a/app/src/main/res/values-v26/colors.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - #BF212121 - \ No newline at end of file diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index 3004ed6801..a02c43f713 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -20,16 +20,9 @@ - - - - - - - diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index b99976b863..9ba9c84210 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -4,26 +4,19 @@ @color/md_white_1000 #C2424242 @color/md_white_1000 - @color/md_black_1000_12 - @color/bluePrimary #54759E #AFFAFAFA #AF54759E #AF000000 - #FFFFFF @color/bluePrimary - #323232 - #323232 @color/md_white_1000 #C2C2C2 @color/md_black_1000_12 @color/md_blue_A400 @color/md_black_1000_38 - - @color/md_black_1000 - #1C1C1D #404040 - @color/darkPrimaryColor + + @color/md_black_1000 @color/md_black_1000_87 @color/md_black_1000_54 @@ -35,17 +28,9 @@ @color/material_red_accent_700 @color/material_green_800 - @color/colorAccent - #212121 - @color/md_grey_50 @color/md_white_1000 - @color/md_blue_A400_38 - @color/md_black_1000_54 - - - #DE000000 #8A000000 diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index ff41a78955..103bd2c91f 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -30,15 +30,6 @@ @color/colorAccent - - - - - - @@ -186,7 +177,7 @@ diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 591d8ea919..ff45ac41e9 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -24,7 +24,7 @@ @color/background ?colorAccent @color/divider - @drawable/line_divider_light + @drawable/line_divider @style/CustomActionModeStyle ?colorAccent @color/colorPrimaryInactive @@ -34,20 +34,10 @@ true @style/ThemeOverlay.AppCompat.DayNight.ActionBar @style/PreferenceThemeOverlay - @style/Theme.AlertDialog.DayNight - - @style/Theme.Widget.NavigationView @drawable/list_item_selector - @drawable/library_item_selector_light - @color/textColorPrimary - @color/cardBackground - @color/iconColor - @color/snackbarBackground - @color/textColorPrimaryInverse @color/textColorPrimary - @color/badgeColor @color/mainStatus #B3000000 @@ -77,101 +67,6 @@ false - - - -