"fixed" the light blue theme

there's no real fixing it, but it's at least mostly readable
This commit is contained in:
Jay 2020-03-11 19:33:29 -07:00
parent 0631b57795
commit 25492e0db8
6 changed files with 14 additions and 33 deletions

View File

@ -23,7 +23,7 @@ class ExtensionUpdateJob : Job() {
override fun onRunJob(params: Params): Result { override fun onRunJob(params: Params): Result {
GlobalScope.launch(Dispatchers.IO) { GlobalScope.launch(Dispatchers.IO) {
val pendingUpdates = ExtensionGithubApi().checkforUpdates(context) val pendingUpdates = ExtensionGithubApi().checkForUpdates(context)
if (pendingUpdates.isNotEmpty()) { if (pendingUpdates.isNotEmpty()) {
val names = pendingUpdates.map { it.name } val names = pendingUpdates.map { it.name }
val preferences: PreferencesHelper by injectLazy() val preferences: PreferencesHelper by injectLazy()

View File

@ -7,18 +7,16 @@ import com.github.salomonbrys.kotson.int
import com.github.salomonbrys.kotson.string import com.github.salomonbrys.kotson.string
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.JsonArray import com.google.gson.JsonArray
import eu.kanade.tachiyomi.extension.ExtensionManager
import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.extension.model.Extension
import eu.kanade.tachiyomi.extension.model.LoadResult import eu.kanade.tachiyomi.extension.model.LoadResult
import eu.kanade.tachiyomi.extension.util.ExtensionLoader import eu.kanade.tachiyomi.extension.util.ExtensionLoader
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.NetworkHelper import eu.kanade.tachiyomi.network.NetworkHelper
import eu.kanade.tachiyomi.network.await
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
import eu.kanade.tachiyomi.network.await
import okhttp3.Response import okhttp3.Response
import uy.kohesive.injekt.injectLazy import uy.kohesive.injekt.injectLazy
import java.lang.Exception
internal class ExtensionGithubApi { internal class ExtensionGithubApi {
@ -34,7 +32,7 @@ internal class ExtensionGithubApi {
} }
} }
suspend fun checkforUpdates(context: Context): List<Extension.Installed> { suspend fun checkForUpdates(context: Context): List<Extension.Installed> {
return withContext(Dispatchers.IO) { return withContext(Dispatchers.IO) {
val call = GET("$REPO_URL/index.json") val call = GET("$REPO_URL/index.json")
val response = network.client.newCall(call).await() val response = network.client.newCall(call).await()

View File

@ -17,6 +17,7 @@ import eu.kanade.tachiyomi.data.preference.getOrDefault
import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.extension.model.Extension
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
import eu.kanade.tachiyomi.ui.catalogue.CatalogueController import eu.kanade.tachiyomi.ui.catalogue.CatalogueController
import eu.kanade.tachiyomi.util.system.getResourceColor
import eu.kanade.tachiyomi.util.view.RecyclerWindowInsetsListener import eu.kanade.tachiyomi.util.view.RecyclerWindowInsetsListener
import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsets import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsets
import eu.kanade.tachiyomi.util.view.updateLayoutParams import eu.kanade.tachiyomi.util.view.updateLayoutParams
@ -53,10 +54,7 @@ ExtensionAdapter.OnButtonClickListener,
ext_recycler.adapter = adapter ext_recycler.adapter = adapter
ext_recycler.addItemDecoration(ExtensionDividerItemDecoration(context)) ext_recycler.addItemDecoration(ExtensionDividerItemDecoration(context))
ext_recycler.setOnApplyWindowInsetsListener(RecyclerWindowInsetsListener) ext_recycler.setOnApplyWindowInsetsListener(RecyclerWindowInsetsListener)
// scrollViewWith(ext_recycler, true, ext_swipe_refresh)
this.controller = controller this.controller = controller
//ext_swipe_refresh.refreshes().subscribeUntilDestroy {
// presenter.findAvailableExtensions()
presenter.onCreate() presenter.onCreate()
updateExtTitle() updateExtTitle()
@ -85,6 +83,9 @@ ExtensionAdapter.OnButtonClickListener,
title_text.text = if (extCount == 0) context.getString(R.string.label_extensions) title_text.text = if (extCount == 0) context.getString(R.string.label_extensions)
else resources.getQuantityString(R.plurals.extensions_updates_available, extCount, else resources.getQuantityString(R.plurals.extensions_updates_available, extCount,
extCount) extCount)
title_text.setTextColor(context.getResourceColor(
if (extCount == 0) R.attr.actionBarTintColor else R.attr.colorAccent))
} }
override fun onButtonClick(position: Int) { override fun onButtonClick(position: Int) {

View File

@ -316,7 +316,6 @@ class LibraryListController(bundle: Bundle? = null) : LibraryController(bundle),
activity!!.theme.resolveAttribute(R.attr.actionBarTintColor, tv, true) activity!!.theme.resolveAttribute(R.attr.actionBarTintColor, tv, true)
customTitleSpinner = library_layout.inflate(R.layout.spinner_title) as ViewGroup customTitleSpinner = library_layout.inflate(R.layout.spinner_title) as ViewGroup
// (activity as MainActivity).supportActionBar?.setDisplayShowCustomEnabled(false)
spinnerAdapter = SpinnerAdapter( spinnerAdapter = SpinnerAdapter(
view.context, view.context,
R.layout.library_spinner_textview, R.layout.library_spinner_textview,
@ -331,7 +330,6 @@ class LibraryListController(bundle: Bundle? = null) : LibraryController(bundle),
scrollToHeader(item.itemId) scrollToHeader(item.itemId)
true true
} }
//(activity as MainActivity).supportActionBar?.customView = customTitleSpinner
scrollViewWith(recycler) { insets -> scrollViewWith(recycler) { insets ->
fast_scroller.updateLayoutParams<CoordinatorLayout.LayoutParams> { fast_scroller.updateLayoutParams<CoordinatorLayout.LayoutParams> {
topMargin = insets.systemWindowInsetTop topMargin = insets.systemWindowInsetTop
@ -348,29 +346,15 @@ class LibraryListController(bundle: Bundle? = null) : LibraryController(bundle),
activity?.toolbar?.removeSpinner() activity?.toolbar?.removeSpinner()
} }
} }
/*if (type.isEnter) {
(activity as MainActivity).supportActionBar
?.setDisplayShowCustomEnabled(router?.backstack?.lastOrNull()?.controller() ==
this && spinnerAdapter?.array?.size ?: 0 > 1)
}
else if (type == ControllerChangeType.PUSH_EXIT) {
(activity as MainActivity).toolbar.menu.findItem(R.id
.action_search)?.collapseActionView()
(activity as MainActivity).supportActionBar?.setDisplayShowCustomEnabled(false)
}*/
} }
override fun onActivityResumed(activity: Activity) { override fun onActivityResumed(activity: Activity) {
super.onActivityResumed(activity) super.onActivityResumed(activity)
if (view == null) return
resetScrollingValues() resetScrollingValues()
resetRecyclerY() resetRecyclerY()
} }
override fun onDestroy() {
// (activity as MainActivity).supportActionBar?.setDisplayShowCustomEnabled(false)
super.onDestroy()
}
override fun onNextLibraryUpdate(mangaMap: List<LibraryItem>, freshStart: Boolean) { override fun onNextLibraryUpdate(mangaMap: List<LibraryItem>, freshStart: Boolean) {
val recyclerLayout = view ?: return val recyclerLayout = view ?: return
destroyActionModeIfNeeded() destroyActionModeIfNeeded()
@ -393,8 +377,6 @@ class LibraryListController(bundle: Bundle? = null) : LibraryController(bundle),
val isCurrentController = router?.backstack?.lastOrNull()?.controller() == val isCurrentController = router?.backstack?.lastOrNull()?.controller() ==
this this
// (activity as AppCompatActivity).supportActionBar
// ?.setDisplayShowCustomEnabled(isCurrentController && presenter.categories.size > 1)
customTitleSpinner.category_title.text = customTitleSpinner.category_title.text =
presenter.categories[clamp(activeCategory, presenter.categories[clamp(activeCategory,

View File

@ -301,7 +301,7 @@ open class MainActivity : BaseActivity(), DownloadServiceListener {
.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR) .SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR)
} }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && currentNightMode == Configuration if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && currentNightMode == Configuration
.UI_MODE_NIGHT_NO && preferences.theme() >= 8) .UI_MODE_NIGHT_NO)
content.systemUiVisibility = content.systemUiVisibility.or(View content.systemUiVisibility = content.systemUiVisibility.or(View
.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR) .SYSTEM_UI_FLAG_LIGHT_STATUS_BAR)
@ -424,7 +424,7 @@ open class MainActivity : BaseActivity(), DownloadServiceListener {
GlobalScope.launch(Dispatchers.IO) { GlobalScope.launch(Dispatchers.IO) {
val preferences: PreferencesHelper by injectLazy() val preferences: PreferencesHelper by injectLazy()
try { try {
val pendingUpdates = ExtensionGithubApi().checkforUpdates(this@MainActivity) val pendingUpdates = ExtensionGithubApi().checkForUpdates(this@MainActivity)
preferences.extensionUpdatesCount().set(pendingUpdates.size) preferences.extensionUpdatesCount().set(pendingUpdates.size)
preferences.lastExtCheck().set(Date().time) preferences.lastExtCheck().set(Date().time)
} catch (e: java.lang.Exception) { } } catch (e: java.lang.Exception) { }

View File

@ -30,7 +30,7 @@
<!-- Themes --> <!-- Themes -->
<item name="windowActionModeOverlay">true</item> <item name="windowActionModeOverlay">true</item>
<item name="actionBarTheme">@style/Theme.ActionBar.DayNight</item> <item name="actionBarTheme">@style/ThemeOverlay.AppCompat.DayNight.ActionBar</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay</item> <item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
<item name="alertDialogTheme">@style/Theme.AlertDialog.DayNight</item> <item name="alertDialogTheme">@style/Theme.AlertDialog.DayNight</item>
@ -44,7 +44,7 @@
<item name="icon_color">@color/iconColor</item> <item name="icon_color">@color/iconColor</item>
<item name="snackbar_background">@color/snackbarBackground</item> <item name="snackbar_background">@color/snackbarBackground</item>
<item name="snackbar_text">@color/textColorPrimaryInverse</item> <item name="snackbar_text">@color/textColorPrimaryInverse</item>
<item name="actionBarTintColor">@color/md_white_1000</item> <item name="actionBarTintColor">@color/textColorPrimary</item>
<item name="badgeColor">@color/badgeColor</item> <item name="badgeColor">@color/badgeColor</item>
<item name="android:statusBarColor">@android:color/transparent</item> <item name="android:statusBarColor">@android:color/transparent</item>
@ -64,8 +64,6 @@
<item name="colorPrimary">@color/purePrimary</item> <item name="colorPrimary">@color/purePrimary</item>
<item name="colorPrimaryDark">@color/purePrimary</item> <item name="colorPrimaryDark">@color/purePrimary</item>
<item name="colorOnPrimary">@color/colorPrimary</item> <item name="colorOnPrimary">@color/colorPrimary</item>
<item name="actionBarTintColor">@color/textColorPrimary</item>
<item name="actionBarTheme">@style/ThemeOverlay.AppCompat.DayNight.ActionBar</item>
<item name="tabBarIconColor">@color/colorPrimary</item> <item name="tabBarIconColor">@color/colorPrimary</item>
<item name="tabBarIconInactive">@color/colorPrimaryInactive</item> <item name="tabBarIconInactive">@color/colorPrimaryInactive</item>
<item name="android:statusBarColor">@color/md_black_1000_54</item> <item name="android:statusBarColor">@color/md_black_1000_54</item>
@ -80,6 +78,8 @@
<item name="colorPrimary">@color/darkPrimaryTranslucent</item> <item name="colorPrimary">@color/darkPrimaryTranslucent</item>
<item name="colorPrimaryDark">@color/darkPrimaryTranslucent</item> <item name="colorPrimaryDark">@color/darkPrimaryTranslucent</item>
<item name="android:colorBackground">@android:color/white</item> <item name="android:colorBackground">@android:color/white</item>
<item name="actionBarTheme">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
<item name="actionBarTintColor">@color/md_white_1000</item>
<item name="android:statusBarColor">?colorPrimaryDark</item> <item name="android:statusBarColor">?colorPrimaryDark</item>
<item name="android:navigationBarColor">?colorPrimaryDark</item> <item name="android:navigationBarColor">?colorPrimaryDark</item>
</style> </style>