mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-29 01:29:02 +03:00
Merge branch 'tachiyomiorg:master' into master
This commit is contained in:
commit
24ff9d36c3
28 changed files with 431 additions and 61 deletions
|
@ -74,9 +74,6 @@ open class App : Application(), LifecycleObserver, ImageLoaderFactory {
|
|||
|
||||
ProcessLifecycleOwner.get().lifecycle.addObserver(this)
|
||||
|
||||
// Reset Incognito Mode on relaunch
|
||||
preferences.incognitoMode().set(false)
|
||||
|
||||
// Show notification to disable Incognito Mode when it's enabled
|
||||
preferences.incognitoMode().asFlow()
|
||||
.onEach { enabled ->
|
||||
|
|
|
@ -24,7 +24,9 @@ object PreferenceValues {
|
|||
enum class DarkThemeVariant {
|
||||
default,
|
||||
blue,
|
||||
midnightdusk,
|
||||
amoled,
|
||||
hotpink,
|
||||
}
|
||||
|
||||
/* ktlint-enable experimental:enum-entry-name-case */
|
||||
|
|
|
@ -11,6 +11,7 @@ import eu.kanade.tachiyomi.data.track.model.AnimeTrackSearch
|
|||
import eu.kanade.tachiyomi.data.track.model.TrackSearch
|
||||
import eu.kanade.tachiyomi.network.POST
|
||||
import eu.kanade.tachiyomi.network.await
|
||||
import eu.kanade.tachiyomi.network.interceptor.RateLimitInterceptor
|
||||
import eu.kanade.tachiyomi.network.jsonMime
|
||||
import eu.kanade.tachiyomi.network.parseAs
|
||||
import eu.kanade.tachiyomi.util.lang.withIOContext
|
||||
|
@ -29,10 +30,14 @@ import kotlinx.serialization.json.putJsonObject
|
|||
import okhttp3.OkHttpClient
|
||||
import okhttp3.RequestBody.Companion.toRequestBody
|
||||
import java.util.Calendar
|
||||
import java.util.concurrent.TimeUnit.MINUTES
|
||||
|
||||
class AnilistApi(val client: OkHttpClient, interceptor: AnilistInterceptor) {
|
||||
|
||||
private val authClient = client.newBuilder().addInterceptor(interceptor).build()
|
||||
private val authClient = client.newBuilder()
|
||||
.addInterceptor(interceptor)
|
||||
.addInterceptor(RateLimitInterceptor(85, 1, MINUTES))
|
||||
.build()
|
||||
|
||||
suspend fun addLibManga(track: Track): Track {
|
||||
return withIOContext {
|
||||
|
|
|
@ -4,6 +4,8 @@ import android.content.Context
|
|||
import coil.util.CoilUtils
|
||||
import eu.kanade.tachiyomi.BuildConfig
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.network.interceptor.CloudflareInterceptor
|
||||
import eu.kanade.tachiyomi.network.interceptor.UserAgentInterceptor
|
||||
import okhttp3.Cache
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.logging.HttpLoggingInterceptor
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package eu.kanade.tachiyomi.network
|
||||
package eu.kanade.tachiyomi.network.interceptor
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
|
@ -8,6 +8,7 @@ import android.webkit.WebSettings
|
|||
import android.webkit.WebView
|
||||
import android.widget.Toast
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.network.NetworkHelper
|
||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||
import eu.kanade.tachiyomi.util.lang.launchUI
|
||||
import eu.kanade.tachiyomi.util.system.WebViewClientCompat
|
|
@ -0,0 +1,58 @@
|
|||
package eu.kanade.tachiyomi.network.interceptor
|
||||
|
||||
import android.os.SystemClock
|
||||
import okhttp3.Interceptor
|
||||
import okhttp3.Response
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
/**
|
||||
* An OkHttp interceptor that handles rate limiting.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* permits = 5, period = 1, unit = seconds => 5 requests per second
|
||||
* permits = 10, period = 2, unit = minutes => 10 requests per 2 minutes
|
||||
*
|
||||
* @param permits {Int} Number of requests allowed within a period of units.
|
||||
* @param period {Long} The limiting duration. Defaults to 1.
|
||||
* @param unit {TimeUnit} The unit of time for the period. Defaults to seconds.
|
||||
*/
|
||||
class RateLimitInterceptor(
|
||||
private val permits: Int,
|
||||
private val period: Long = 1,
|
||||
private val unit: TimeUnit = TimeUnit.SECONDS
|
||||
) : Interceptor {
|
||||
|
||||
private val requestQueue = ArrayList<Long>(permits)
|
||||
private val rateLimitMillis = unit.toMillis(period)
|
||||
|
||||
override fun intercept(chain: Interceptor.Chain): Response {
|
||||
synchronized(requestQueue) {
|
||||
val now = SystemClock.elapsedRealtime()
|
||||
val waitTime = if (requestQueue.size < permits) {
|
||||
0
|
||||
} else {
|
||||
val oldestReq = requestQueue[0]
|
||||
val newestReq = requestQueue[permits - 1]
|
||||
|
||||
if (newestReq - oldestReq > rateLimitMillis) {
|
||||
0
|
||||
} else {
|
||||
oldestReq + rateLimitMillis - now // Remaining time
|
||||
}
|
||||
}
|
||||
|
||||
if (requestQueue.size == permits) {
|
||||
requestQueue.removeAt(0)
|
||||
}
|
||||
if (waitTime > 0) {
|
||||
requestQueue.add(now + waitTime)
|
||||
Thread.sleep(waitTime) // Sleep inside synchronized to pause queued requests
|
||||
} else {
|
||||
requestQueue.add(now)
|
||||
}
|
||||
}
|
||||
|
||||
return chain.proceed(chain.request())
|
||||
}
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package eu.kanade.tachiyomi.network.interceptor
|
||||
|
||||
import android.os.SystemClock
|
||||
import okhttp3.HttpUrl
|
||||
import okhttp3.Interceptor
|
||||
import okhttp3.Response
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
/**
|
||||
* An OkHttp interceptor that handles given url host's rate limiting.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* httpUrl = "api.manga.com".toHttpUrlOrNull(), permits = 5, period = 1, unit = seconds => 5 requests per second to api.manga.com
|
||||
* httpUrl = "imagecdn.manga.com".toHttpUrlOrNull(), permits = 10, period = 2, unit = minutes => 10 requests per 2 minutes to imagecdn.manga.com
|
||||
*
|
||||
* @param httpUrl {HttpUrl} The url host that this interceptor should handle. Will get url's host by using HttpUrl.host()
|
||||
* @param permits {Int} Number of requests allowed within a period of units.
|
||||
* @param period {Long} The limiting duration. Defaults to 1.
|
||||
* @param unit {TimeUnit} The unit of time for the period. Defaults to seconds.
|
||||
*/
|
||||
class SpecificHostRateLimitInterceptor(
|
||||
private val httpUrl: HttpUrl,
|
||||
private val permits: Int,
|
||||
private val period: Long = 1,
|
||||
private val unit: TimeUnit = TimeUnit.SECONDS
|
||||
) : Interceptor {
|
||||
|
||||
private val requestQueue = ArrayList<Long>(permits)
|
||||
private val rateLimitMillis = unit.toMillis(period)
|
||||
private val host = httpUrl.host
|
||||
|
||||
override fun intercept(chain: Interceptor.Chain): Response {
|
||||
if (chain.request().url.host != host) {
|
||||
return chain.proceed(chain.request())
|
||||
}
|
||||
synchronized(requestQueue) {
|
||||
val now = SystemClock.elapsedRealtime()
|
||||
val waitTime = if (requestQueue.size < permits) {
|
||||
0
|
||||
} else {
|
||||
val oldestReq = requestQueue[0]
|
||||
val newestReq = requestQueue[permits - 1]
|
||||
|
||||
if (newestReq - oldestReq > rateLimitMillis) {
|
||||
0
|
||||
} else {
|
||||
oldestReq + rateLimitMillis - now // Remaining time
|
||||
}
|
||||
}
|
||||
|
||||
if (requestQueue.size == permits) {
|
||||
requestQueue.removeAt(0)
|
||||
}
|
||||
if (waitTime > 0) {
|
||||
requestQueue.add(now + waitTime)
|
||||
Thread.sleep(waitTime) // Sleep inside synchronized to pause queued requests
|
||||
} else {
|
||||
requestQueue.add(now)
|
||||
}
|
||||
}
|
||||
|
||||
return chain.proceed(chain.request())
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package eu.kanade.tachiyomi.network
|
||||
package eu.kanade.tachiyomi.network.interceptor
|
||||
|
||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||
import okhttp3.Interceptor
|
|
@ -25,7 +25,9 @@ abstract class BaseThemedActivity : AppCompatActivity() {
|
|||
when (preferences.themeDark().get()) {
|
||||
DarkThemeVariant.default -> R.style.Theme_Tachiyomi_Dark
|
||||
DarkThemeVariant.blue -> R.style.Theme_Tachiyomi_Dark_Blue
|
||||
DarkThemeVariant.amoled -> R.style.Theme_Tachiyomi_Dark_Amoled
|
||||
DarkThemeVariant.midnightdusk -> R.style.Theme_Tachiyomi_Dark_MidnightDusk
|
||||
DarkThemeVariant.amoled -> R.style.Theme_Tachiyomi_Amoled
|
||||
DarkThemeVariant.hotpink -> R.style.Theme_Tachiyomi_Amoled_HotPink
|
||||
}
|
||||
} else {
|
||||
when (preferences.themeLight().get()) {
|
||||
|
|
|
@ -11,7 +11,7 @@ import eu.davidea.flexibleadapter.items.IFlexible
|
|||
import eu.davidea.viewholders.FlexibleViewHolder
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.source.model.Filter
|
||||
import eu.kanade.tachiyomi.widget.IgnoreFirstSpinnerListener
|
||||
import eu.kanade.tachiyomi.widget.listener.IgnoreFirstSpinnerListener
|
||||
|
||||
open class SelectItem(val filter: Filter.Select<*>) : AbstractFlexibleItem<SelectItem.Holder>() {
|
||||
|
||||
|
|
|
@ -232,6 +232,9 @@ class MainActivity : BaseViewBindingActivity<MainActivityBinding>() {
|
|||
syncActivityViewWithController(router.backstack.lastOrNull()?.controller())
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
// Reset Incognito Mode on relaunch
|
||||
preferences.incognitoMode().set(false)
|
||||
|
||||
// Show changelog prompt on update
|
||||
if (Migrations.upgrade(preferences) && !BuildConfig.DEBUG) {
|
||||
WhatsNewDialogController().showDialog(router)
|
||||
|
|
|
@ -61,8 +61,8 @@ import eu.kanade.tachiyomi.util.view.isDefaultBar
|
|||
import eu.kanade.tachiyomi.util.view.popupMenu
|
||||
import eu.kanade.tachiyomi.util.view.setTooltip
|
||||
import eu.kanade.tachiyomi.util.view.showBar
|
||||
import eu.kanade.tachiyomi.widget.SimpleAnimationListener
|
||||
import eu.kanade.tachiyomi.widget.SimpleSeekBarListener
|
||||
import eu.kanade.tachiyomi.widget.listener.SimpleAnimationListener
|
||||
import eu.kanade.tachiyomi.widget.listener.SimpleSeekBarListener
|
||||
import kotlinx.coroutines.flow.drop
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
|
|
|
@ -15,7 +15,7 @@ import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
|||
import eu.kanade.tachiyomi.databinding.ReaderColorFilterSettingsBinding
|
||||
import eu.kanade.tachiyomi.ui.reader.ReaderActivity
|
||||
import eu.kanade.tachiyomi.util.preference.bindToPreference
|
||||
import eu.kanade.tachiyomi.widget.SimpleSeekBarListener
|
||||
import eu.kanade.tachiyomi.widget.listener.SimpleSeekBarListener
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
import kotlinx.coroutines.flow.sample
|
||||
|
|
|
@ -4,7 +4,7 @@ import android.os.Bundle
|
|||
import com.google.android.material.tabs.TabLayout
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.ui.reader.ReaderActivity
|
||||
import eu.kanade.tachiyomi.widget.SimpleTabSelectedListener
|
||||
import eu.kanade.tachiyomi.widget.listener.SimpleTabSelectedListener
|
||||
import eu.kanade.tachiyomi.widget.sheet.TabbedBottomSheetDialog
|
||||
|
||||
class ReaderSettingsSheet(
|
||||
|
|
|
@ -141,12 +141,16 @@ class SettingsGeneralController : SettingsController() {
|
|||
entriesRes = arrayOf(
|
||||
R.string.theme_dark_default,
|
||||
R.string.theme_dark_blue,
|
||||
R.string.theme_dark_amoled
|
||||
R.string.theme_dark_midnightdusk,
|
||||
R.string.theme_dark_amoled,
|
||||
R.string.theme_dark_amoled_hotpink
|
||||
)
|
||||
entryValues = arrayOf(
|
||||
Values.DarkThemeVariant.default.name,
|
||||
Values.DarkThemeVariant.blue.name,
|
||||
Values.DarkThemeVariant.amoled.name
|
||||
Values.DarkThemeVariant.midnightdusk.name,
|
||||
Values.DarkThemeVariant.amoled.name,
|
||||
Values.DarkThemeVariant.hotpink.name
|
||||
)
|
||||
defaultValue = Values.DarkThemeVariant.default.name
|
||||
summary = "%s"
|
||||
|
|
|
@ -16,6 +16,7 @@ import androidx.preference.PreferenceScreen
|
|||
import androidx.preference.SwitchPreferenceCompat
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.util.system.getResourceColor
|
||||
import eu.kanade.tachiyomi.widget.preference.AdaptiveTitlePreferenceCategory
|
||||
import eu.kanade.tachiyomi.widget.preference.IntListPreference
|
||||
import eu.kanade.tachiyomi.widget.preference.SwitchPreferenceCategory
|
||||
import eu.kanade.tachiyomi.widget.preference.SwitchSettingsPreference
|
||||
|
@ -77,7 +78,7 @@ inline fun PreferenceGroup.multiSelectListPreference(block: (@DSL MultiSelectLis
|
|||
}
|
||||
|
||||
inline fun PreferenceScreen.preferenceCategory(block: (@DSL PreferenceCategory).() -> Unit): PreferenceCategory {
|
||||
return addThenInit(PreferenceCategory(context), block)
|
||||
return addThenInit(AdaptiveTitlePreferenceCategory(context), block)
|
||||
}
|
||||
|
||||
inline fun PreferenceScreen.preferenceScreen(block: (@DSL PreferenceScreen).() -> Unit): PreferenceScreen {
|
||||
|
|
|
@ -13,6 +13,7 @@ import androidx.appcompat.view.ActionMode
|
|||
import androidx.core.view.isVisible
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.databinding.ActionToolbarBinding
|
||||
import eu.kanade.tachiyomi.widget.listener.SimpleAnimationListener
|
||||
|
||||
/**
|
||||
* A toolbar holding only menu items.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package eu.kanade.tachiyomi.widget
|
||||
package eu.kanade.tachiyomi.widget.listener
|
||||
|
||||
import android.view.View
|
||||
import android.widget.AdapterView
|
|
@ -1,4 +1,4 @@
|
|||
package eu.kanade.tachiyomi.widget
|
||||
package eu.kanade.tachiyomi.widget.listener
|
||||
|
||||
import android.view.animation.Animation
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package eu.kanade.tachiyomi.widget
|
||||
package eu.kanade.tachiyomi.widget.listener
|
||||
|
||||
import android.widget.SeekBar
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package eu.kanade.tachiyomi.widget
|
||||
package eu.kanade.tachiyomi.widget.listener
|
||||
|
||||
import com.google.android.material.tabs.TabLayout
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package eu.kanade.tachiyomi.widget.preference
|
||||
|
||||
import android.content.Context
|
||||
import androidx.core.view.updateLayoutParams
|
||||
import androidx.preference.PreferenceCategory
|
||||
import androidx.preference.PreferenceViewHolder
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
|
||||
/**
|
||||
* PreferenceCategory that hides the title placeholder layout if the title is unset
|
||||
*/
|
||||
class AdaptiveTitlePreferenceCategory(context: Context) : PreferenceCategory(context) {
|
||||
override fun onBindViewHolder(holder: PreferenceViewHolder) {
|
||||
super.onBindViewHolder(holder)
|
||||
if (title.isNullOrBlank()) {
|
||||
holder.itemView.updateLayoutParams<RecyclerView.LayoutParams> {
|
||||
height = 0
|
||||
topMargin = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -33,7 +33,8 @@
|
|||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/chapters_recycler"
|
||||
app:layout_constraintWidth_percent="0.4"
|
||||
app:layout_constraintWidth_percent="0.5"
|
||||
app:layout_constraintWidth_max="450dp"
|
||||
tools:itemCount="1"
|
||||
tools:listitem="@layout/manga_info_header" />
|
||||
|
||||
|
|
|
@ -8,8 +8,11 @@
|
|||
<!-- Dark Application Colors -->
|
||||
<color name="colorDarkPrimary">#242529</color>
|
||||
<color name="colorDarkPrimaryDark">#202125</color>
|
||||
|
||||
<!-- AMOLED Application Colors -->
|
||||
<color name="colorAmoledPrimary">@color/md_black_1000</color>
|
||||
|
||||
<!-- Splash Color -->
|
||||
<color name="splashBackgroundColor">@color/colorPrimary</color>
|
||||
|
||||
<!-- Light Theme -->
|
||||
|
@ -38,6 +41,38 @@
|
|||
<color name="dialogDark">@color/colorDarkPrimary</color>
|
||||
<color name="selectorColorDark">@color/md_blue_A200_50</color>
|
||||
|
||||
<!-- Midnight Dusk Theme -->
|
||||
<color name="colorAccentDusk">#F02475</color>
|
||||
<color name="textColorPrimaryDusk">@color/md_white_1000</color>
|
||||
<color name="textColorSecondaryDusk">@color/md_white_1000_70</color>
|
||||
<color name="textColorHintDusk">@color/md_white_1000_50</color>
|
||||
<color name="dividerDusk">#12ffffff</color>
|
||||
<color name="rippleSecondaryColorDusk">#0FF02475</color>
|
||||
<color name="backgroundDusk">#16151D</color>
|
||||
<color name="dialogDusk">#201F27</color>
|
||||
<color name="selectorColorDusk">#80F02475</color>
|
||||
|
||||
<!-- AMOLED Theme -->
|
||||
<color name="colorAccentAmoled">#3399FF</color>
|
||||
<color name="textColorPrimaryAmoled">@color/md_white_1000</color>
|
||||
<color name="textColorSecondaryAmoled">@color/md_white_1000_70</color>
|
||||
<color name="textColorHintAmoled">@color/md_white_1000_50</color>
|
||||
<color name="dividerAmoled">@android:color/transparent</color>
|
||||
<color name="rippleColorAmoled">@color/md_white_1000_8</color>
|
||||
<color name="rippleSecondaryColorAmoled">#0A3399FF</color>
|
||||
<color name="rippleToolbarColorAmoled">@color/rippleColorAmoled</color>
|
||||
<color name="backgroundAmoled">@color/colorAmoledPrimary</color>
|
||||
<color name="dialogAmoled">@color/colorAmoledPrimary</color>
|
||||
<color name="selectorColorAmoled">@color/md_blue_A200_50</color>
|
||||
|
||||
<!-- Hot Pink Theme -->
|
||||
<color name="colorAccentPink">#FF3399</color>
|
||||
<color name="textColorPrimaryPink">@color/md_white_1000</color>
|
||||
<color name="textColorSecondaryPink">@color/md_white_1000_70</color>
|
||||
<color name="textColorHintPink">@color/md_white_1000_50</color>
|
||||
<color name="rippleSecondaryColorPink">#0AFF3399</color>
|
||||
<color name="selectorColorPink">#80FF69B4</color>
|
||||
|
||||
<!-- Reader Theme -->
|
||||
<color name="readerColorDarkPrimary">@color/colorDarkPrimary</color>
|
||||
<color name="pageNumberBackgroundLight">@color/md_grey_50_75</color>
|
||||
|
@ -45,12 +80,14 @@
|
|||
|
||||
<color name="filterColorLight">#FFC107</color>
|
||||
<color name="filterColorDark">#FFEB3B</color>
|
||||
<color name="filterColorAmoled">#FFEB3B</color>
|
||||
|
||||
<!-- Text Colors -->
|
||||
<color name="md_black_1000_87">#DE000000</color>
|
||||
<color name="md_black_1000_54">#8A000000</color>
|
||||
<color name="md_black_1000_38">#61000000</color>
|
||||
<color name="md_black_1000_12">#1F000000</color>
|
||||
<color name="md_black_1000_8">#14000000</color>
|
||||
<color name="md_black_1000_6">#0F000000</color>
|
||||
|
||||
<color name="md_white_1000">#FFFFFFFF</color>
|
||||
|
@ -59,6 +96,7 @@
|
|||
<color name="md_white_1000_50">#80FFFFFF</color>
|
||||
<color name="md_white_1000_20">#33FFFFFF</color>
|
||||
<color name="md_white_1000_12">#1FFFFFFF</color>
|
||||
<color name="md_white_1000_8">#14FFFFFF</color>
|
||||
<color name="md_white_1000_6">#0FFFFFFF</color>
|
||||
|
||||
<!-- Material Design Colors -->
|
||||
|
|
|
@ -168,7 +168,9 @@
|
|||
<string name="pref_theme_dark">Dark theme</string>
|
||||
<string name="theme_dark_default">Default</string>
|
||||
<string name="theme_dark_blue">Dark blue</string>
|
||||
<string name="theme_dark_midnightdusk">Midnight dusk</string>
|
||||
<string name="theme_dark_amoled">AMOLED black</string>
|
||||
<string name="theme_dark_amoled_hotpink">Hot pink</string>
|
||||
<string name="pref_start_screen">Start screen</string>
|
||||
<string name="pref_language">Language</string>
|
||||
<string name="system_default">Default</string>
|
||||
|
|
|
@ -6,11 +6,7 @@
|
|||
<!--========-->
|
||||
<style name="Theme.Toolbar" parent="@style/ThemeOverlay.MaterialComponents.ActionBar" />
|
||||
|
||||
<style name="Theme.Toolbar.Light" parent="Theme.Toolbar.Custom.Dark">
|
||||
<item name="popupTheme">@style/ThemeOverlay.MaterialComponents.Light</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Toolbar.Custom" parent="@style/ThemeOverlay.MaterialComponents.ActionBar">
|
||||
<style name="Theme.Toolbar.Custom.Light" parent="@style/ThemeOverlay.MaterialComponents.ActionBar">
|
||||
<item name="android:colorControlHighlight">?attr/rippleToolbarColor</item>
|
||||
</style>
|
||||
|
||||
|
@ -18,6 +14,14 @@
|
|||
<item name="android:colorControlHighlight">?attr/rippleToolbarColor</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Toolbar.Custom.Amoled" parent="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar">
|
||||
<item name="android:colorControlHighlight">?attr/rippleToolbarColor</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Toolbar.Custom.PopupTheme" parent="Theme.Toolbar.Custom.Dark">
|
||||
<item name="popupTheme">@style/ThemeOverlay.MaterialComponents.Light</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Toolbar.Navigation" parent="Widget.AppCompat.Toolbar.Button.Navigation">
|
||||
<item name="tint">?attr/colorOnPrimary</item>
|
||||
</style>
|
||||
|
@ -68,6 +72,10 @@
|
|||
<item name="colorAccent">@color/colorAccentDark</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.AlertDialog.Amoled" parent="Theme.AlertDialog">
|
||||
<item name="colorAccent">@color/colorAccentAmoled</item>
|
||||
</style>
|
||||
|
||||
|
||||
<!--===========-->
|
||||
<!--BottomSheet-->
|
||||
|
|
|
@ -4,16 +4,16 @@
|
|||
<!--============-->
|
||||
<!-- Base Theme -->
|
||||
<!--============-->
|
||||
<style name="Theme"/>
|
||||
|
||||
<!--==============-->
|
||||
<!-- Light Themes -->
|
||||
<!--=======-======-->
|
||||
<!--== Theme ==-->
|
||||
<style name="Theme" />
|
||||
|
||||
<!--== Theme base ==-->
|
||||
<style name="Theme.Base" parent="Theme.MaterialComponents.Light.NoActionBar">
|
||||
<!-- AppBar -->
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
|
||||
<!-- Disallow 'Force dark theme' -->
|
||||
<item name="android:forceDarkAllowed" tools:targetApi="Q">false</item>
|
||||
|
||||
<!-- Theme colors -->
|
||||
|
@ -60,7 +60,7 @@
|
|||
<item name="actionModeStyle">@style/Theme.ActionMode</item>
|
||||
<item name="actionModeCloseButtonStyle">@style/Theme.ActionMode.CloseButton</item>
|
||||
<item name="actionModeCloseDrawable">@drawable/ic_close_24dp</item>
|
||||
<item name="actionBarTheme">@style/Theme.Toolbar.Custom</item>
|
||||
<item name="actionBarTheme">@style/Theme.Toolbar.Custom.Light</item>
|
||||
<item name="actionBarPopupTheme">@style/ThemeOverlay.MaterialComponents</item>
|
||||
<item name="toolbarNavigationButtonStyle">@style/Theme.Toolbar.Navigation</item>
|
||||
<item name="preferenceTheme">@style/PreferenceThemeCustom</item>
|
||||
|
@ -93,24 +93,41 @@
|
|||
<item name="colorFilterActive">@color/filterColorLight</item>
|
||||
</style>
|
||||
|
||||
<!--===========-->
|
||||
<!-- Main Theme-->
|
||||
<!--===========-->
|
||||
<!--==============-->
|
||||
<!-- Light Themes -->
|
||||
<!--==============-->
|
||||
|
||||
<!--== Light base ==-->
|
||||
<style name="Base.Theme.Tachiyomi.Light" parent="Theme.Base">
|
||||
<!-- Base background/text colors -->
|
||||
<item name="android:statusBarColor">?attr/colorPrimary</item>
|
||||
<item name="android:windowLightStatusBar">true</item>
|
||||
<item name="background">@color/dialogLight</item>
|
||||
</style>
|
||||
|
||||
<!--== Light theme ==-->
|
||||
<style name="Theme.Tachiyomi.Light" parent="Base.Theme.Tachiyomi.Light" />
|
||||
|
||||
<!--== Light Blue theme ==-->
|
||||
<style name="Theme.Tachiyomi.Light.Blue">
|
||||
<!-- Theme colors -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorOnPrimary">@color/textColorPrimaryDark</item>
|
||||
<item name="colorAccentOnPrimary">@color/textColorPrimaryDark</item>
|
||||
<item name="colorPrimaryVariant">@color/colorPrimaryDark</item>
|
||||
<item name="colorFilterActive">@color/filterColorDark</item>
|
||||
|
||||
<!-- Base background/text colors -->
|
||||
<item name="background">@color/colorPrimary</item>
|
||||
|
||||
<!-- Ripples -->
|
||||
<item name="rippleSecondaryColor">@color/md_white_1000_6</item>
|
||||
<item name="rippleToolbarColor">@color/md_white_1000_12</item>
|
||||
<item name="actionBarTheme">@style/Theme.Toolbar.Light</item>
|
||||
|
||||
<!-- Themes -->
|
||||
<item name="actionBarTheme">@style/Theme.Toolbar.Custom.PopupTheme</item>
|
||||
|
||||
<!-- Status/Navigation bar -->
|
||||
<item name="android:windowLightStatusBar" tools:targetApi="m">false</item>
|
||||
<item name="android:windowLightNavigationBar" tools:targetApi="o_mr1">false</item>
|
||||
</style>
|
||||
|
@ -118,6 +135,8 @@
|
|||
<!--=============-->
|
||||
<!-- Dark Themes -->
|
||||
<!--=============-->
|
||||
|
||||
<!--== Dark base ==-->
|
||||
<style name="Theme.Base.Dark" parent="Theme.MaterialComponents.NoActionBar">
|
||||
<!-- Theme colors -->
|
||||
<item name="colorPrimary">@color/colorDarkPrimary</item>
|
||||
|
@ -144,6 +163,7 @@
|
|||
<item name="android:textColorSecondaryInverse">@color/textColorSecondaryLight</item>
|
||||
<item name="android:textColorHintInverse">@color/textColorHintLight</item>
|
||||
<item name="android:colorEdgeEffect">?attr/colorAccent</item>
|
||||
<item name="background">@color/colorDarkPrimaryDark</item>
|
||||
|
||||
<item name="android:divider">@color/dividerDark</item>
|
||||
<item name="android:listDivider">@drawable/line_divider</item>
|
||||
|
@ -196,81 +216,219 @@
|
|||
<item name="colorFilterActive">@color/filterColorDark</item>
|
||||
</style>
|
||||
|
||||
<!--== Dark theme ==-->
|
||||
<style name="Theme.Tachiyomi.Dark" parent="Theme.Base.Dark" />
|
||||
|
||||
<!--== Dark Blue theme ==-->
|
||||
<style name="Theme.Tachiyomi.Dark.Blue">
|
||||
<!-- Theme colors -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorAccentOnPrimary">@color/textColorPrimaryDark</item>
|
||||
<item name="colorPrimaryVariant">@color/colorPrimary</item>
|
||||
|
||||
<!-- Base background/text colors -->
|
||||
<item name="background">@color/colorPrimary</item>
|
||||
|
||||
<!-- Ripples -->
|
||||
<item name="rippleSecondaryColor">@color/md_black_1000_6</item>
|
||||
<item name="rippleToolbarColor">@color/md_black_1000_12</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Tachiyomi.Dark.Amoled">
|
||||
<item name="colorPrimary">@color/colorAmoledPrimary</item>
|
||||
<item name="colorPrimaryVariant">@color/colorAmoledPrimary</item>
|
||||
<item name="colorSurface">@color/colorAmoledPrimary</item>
|
||||
<!--== Midnight Dusk theme ==-->
|
||||
<style name="Theme.Tachiyomi.Dark.MidnightDusk" parent="Theme.Base.Dark">
|
||||
<!-- Theme colors -->
|
||||
<item name="colorPrimary">@color/dialogDusk</item>
|
||||
<item name="colorOnPrimary">@color/textColorPrimaryDusk</item>
|
||||
<item name="colorAccentOnPrimary">@color/colorAccentDusk</item>
|
||||
<item name="colorPrimaryVariant">@color/dialogDusk</item>
|
||||
<item name="colorSecondary">@color/colorAccentDusk</item>
|
||||
<item name="colorOnSecondary">@color/textColorPrimaryDusk</item>
|
||||
<item name="colorSurface">@color/dialogDusk</item>
|
||||
<item name="colorOnSurface">@color/textColorPrimaryDusk</item>
|
||||
<item name="colorOnBackground">@color/textColorPrimaryDusk</item>
|
||||
<item name="colorAccent">@color/colorAccentDusk</item>
|
||||
|
||||
<item name="android:colorBackground">@color/colorAmoledPrimary</item>
|
||||
<!-- Base background/text colors -->
|
||||
<item name="android:colorBackground">@color/backgroundDusk</item>
|
||||
<item name="background">@color/backgroundDusk</item>
|
||||
|
||||
<!-- Some ROMs make black navbars white (e.g. OxygenOS) -->
|
||||
<item name="android:navigationBarColor">#000001</item>
|
||||
<!-- Ripples -->
|
||||
<item name="rippleSecondaryColor">@color/rippleSecondaryColorDusk</item>
|
||||
|
||||
<!-- Custom Attributes-->
|
||||
<!-- Custom Attributes -->
|
||||
<item name="colorLibrarySelection">@color/selectorColorDark</item>
|
||||
<item name="colorLibrarySelectionActive">@color/selectorColorDark</item>
|
||||
</style>
|
||||
|
||||
<!--==============-->
|
||||
<!-- Reader Theme -->
|
||||
<!--==============-->
|
||||
<style name="Theme.Base.Reader.Dark" parent="Theme.Base.Dark">
|
||||
<item name="colorPrimary">@color/readerColorDarkPrimary</item>
|
||||
<item name="colorOnPrimary">@color/textColorPrimaryDark</item>
|
||||
<item name="colorPrimaryVariant">@color/readerColorDarkPrimary</item>
|
||||
<item name="colorSurface">@color/md_black_1000</item>
|
||||
<!--===============-->
|
||||
<!-- AMOLED Themes -->
|
||||
<!--===============-->
|
||||
|
||||
<item name="android:colorBackground">@color/md_black_1000</item>
|
||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
||||
<item name="android:navigationBarColor">?attr/colorPrimaryVariant</item>
|
||||
<!--== AMOLED base ==-->
|
||||
<style name="Theme.Base.Amoled" parent="Theme.MaterialComponents.NoActionBar">
|
||||
<!-- Theme colors -->
|
||||
<item name="colorPrimary">@color/colorAmoledPrimary</item>
|
||||
<item name="colorOnPrimary">@color/textColorPrimaryAmoled</item>
|
||||
<item name="colorAccentOnPrimary">@color/colorAccentAmoled</item>
|
||||
<item name="colorPrimaryVariant">@color/colorAmoledPrimary</item>
|
||||
<item name="colorSecondary">@color/colorAccentAmoled</item>
|
||||
<item name="colorOnSecondary">@color/textColorPrimaryAmoled</item>
|
||||
<item name="colorSurface">@color/dialogAmoled</item>
|
||||
<item name="colorOnSurface">@color/textColorPrimaryAmoled</item>
|
||||
<item name="colorOnBackground">@color/textColorPrimaryAmoled</item>
|
||||
<item name="colorAccent">@color/colorAccentAmoled</item>
|
||||
|
||||
<item name="actionBarTheme">@style/Theme.Toolbar.Custom.Dark</item>
|
||||
<!-- Handles RTL text -->
|
||||
<item name="android:textAlignment">gravity</item>
|
||||
<item name="android:textDirection">locale</item>
|
||||
|
||||
<!-- Base background/text colors -->
|
||||
<item name="android:colorBackground">@color/colorAmoledPrimary</item>
|
||||
<item name="android:textColorPrimary">@color/textColorPrimaryAmoled</item>
|
||||
<item name="android:textColorSecondary">@color/textColorSecondaryAmoled</item>
|
||||
<item name="android:textColorHint">@color/textColorHintAmoled</item>
|
||||
<item name="android:textColorPrimaryInverse">@color/textColorPrimaryLight</item>
|
||||
<item name="android:textColorSecondaryInverse">@color/textColorSecondaryLight</item>
|
||||
<item name="android:textColorHintInverse">@color/textColorHintLight</item>
|
||||
<item name="android:colorEdgeEffect">?attr/colorAccent</item>
|
||||
<item name="background">@color/colorAmoledPrimary</item>
|
||||
|
||||
<item name="android:divider">@color/dividerAmoled</item>
|
||||
<item name="android:listDivider">@drawable/line_divider</item>
|
||||
|
||||
<!-- Ripples -->
|
||||
<item name="rippleColor">@color/rippleColorAmoled</item>
|
||||
<item name="rippleSecondaryColor">@color/rippleSecondaryColorAmoled</item>
|
||||
<item name="rippleToolbarColor">@color/rippleToolbarColorAmoled</item>
|
||||
|
||||
<!-- Themes -->
|
||||
<item name="android:statusBarColor">?attr/colorPrimary</item>
|
||||
<item name="android:navigationBarDividerColor" tools:targetApi="o_mr1">@null</item>
|
||||
<item name="android:enforceNavigationBarContrast" tools:targetApi="Q">false</item>
|
||||
<item name="windowActionModeOverlay">true</item>
|
||||
<item name="elevationOverlayEnabled">false</item>
|
||||
<item name="actionModeStyle">@style/Theme.ActionMode</item>
|
||||
<item name="actionModeCloseButtonStyle">@style/Theme.ActionMode.CloseButton</item>
|
||||
<item name="actionModeCloseDrawable">@drawable/ic_close_24dp</item>
|
||||
<item name="actionBarTheme">@style/Theme.Toolbar.Custom.Amoled</item>
|
||||
<item name="actionBarPopupTheme">@style/ThemeOverlay.MaterialComponents</item>
|
||||
<item name="switchStyle">@style/Theme.Widget.BasicSwitch</item>
|
||||
<item name="toolbarNavigationButtonStyle">@style/Theme.Toolbar.Navigation</item>
|
||||
<item name="preferenceTheme">@style/PreferenceThemeCustom</item>
|
||||
<item name="dialogTheme">@style/Theme.AlertDialog.Amoled</item>
|
||||
<item name="materialAlertDialogTheme">@style/Theme.AlertDialog.Amoled</item>
|
||||
<item name="bottomSheetDialogTheme">@style/Theme.BottomSheet</item>
|
||||
<item name="chipStyle">@style/Theme.Widget.Chip</item>
|
||||
<item name="buttonStyle">@style/Theme.Widget.Button</item>
|
||||
<item name="snackbarStyle">@style/Theme.Widget.Snackbar</item>
|
||||
<item name="snackbarButtonStyle">@style/Theme.Widget.Button</item>
|
||||
<item name="snackbarTextViewStyle">@style/Theme.Widget.Snackbar.TextView</item>
|
||||
<item name="textAppearanceButton">@style/TextAppearance.Widget.Button</item>
|
||||
<item name="textInputStyle">@style/Theme.Widget.TextInputLayout.OutlinedBox</item>
|
||||
<item name="android:itemTextAppearance">@style/TextAppearance.Widget.Menu</item>
|
||||
<item name="swipeRefreshLayoutProgressSpinnerBackgroundColor">?attr/colorAccent</item>
|
||||
<item name="circularProgressIndicatorStyle">@style/Theme.Widget.CircularProgressIndicator</item>
|
||||
<item name="linearProgressIndicatorStyle">@style/Theme.Widget.LinearProgressIndicator</item>
|
||||
|
||||
<!-- Material Dialogs -->
|
||||
<item name="md_background_color">?attr/colorSurface</item>
|
||||
<item name="md_color_title">?attr/colorOnSurface</item>
|
||||
<item name="md_color_content">?attr/colorOnSurface</item>
|
||||
<item name="md_color_button_text">?attr/colorAccent</item>
|
||||
<item name="md_button_casing">literal</item>
|
||||
<item name="md_corner_radius">@dimen/dialog_radius</item>
|
||||
|
||||
<!-- Custom Attributes-->
|
||||
<item name="colorLibrarySelection">@color/selectorColorAmoled</item>
|
||||
<item name="colorLibrarySelectionActive">@color/selectorColorAmoled</item>
|
||||
<item name="colorFilterActive">@color/filterColorAmoled</item>
|
||||
|
||||
<!-- Some ROMs make black navbars white (e.g. OxygenOS) -->
|
||||
<item name="android:navigationBarColor">#000001</item>
|
||||
</style>
|
||||
|
||||
<!--== AMOLED theme ==-->
|
||||
<style name="Theme.Tachiyomi.Amoled" parent="Theme.Base.Amoled" />
|
||||
|
||||
<!--== Hot Pink theme ==-->
|
||||
<style name="Theme.Tachiyomi.Amoled.HotPink">
|
||||
<!-- Theme colors -->
|
||||
<item name="colorOnPrimary">@color/textColorPrimaryPink</item>
|
||||
<item name="colorAccentOnPrimary">@color/colorAccentPink</item>
|
||||
<item name="colorSecondary">@color/colorAccentPink</item>
|
||||
<item name="colorOnSecondary">@color/textColorPrimaryPink</item>
|
||||
<item name="colorOnSurface">@color/textColorPrimaryPink</item>
|
||||
<item name="colorOnBackground">@color/textColorPrimaryPink</item>
|
||||
<item name="colorAccent">@color/colorAccentPink</item>
|
||||
|
||||
<!-- Ripples -->
|
||||
<item name="rippleSecondaryColor">@color/rippleSecondaryColorPink</item>
|
||||
</style>
|
||||
|
||||
<!--===============-->
|
||||
<!-- Reader Themes -->
|
||||
<!--===============-->
|
||||
|
||||
<!--== Light Reader base ==-->
|
||||
<style name="Theme.Base.Reader.Light" parent="Theme.Base">
|
||||
<!-- Theme colors -->
|
||||
<item name="colorPrimary">@color/readerColorDarkPrimary</item>
|
||||
<item name="colorOnPrimary">@color/textColorPrimaryDark</item>
|
||||
<item name="colorPrimaryVariant">@color/readerColorDarkPrimary</item>
|
||||
<item name="colorSurface">@color/md_white_1000</item>
|
||||
|
||||
<!-- Base background/text colors -->
|
||||
<item name="android:colorBackground">@color/md_white_1000</item>
|
||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
||||
<item name="android:navigationBarColor">?attr/colorPrimaryVariant</item>
|
||||
|
||||
<!-- Themes -->
|
||||
<item name="actionBarTheme">@style/Theme.Toolbar.Custom.Dark</item>
|
||||
<item name="actionBarPopupTheme">@style/ThemeOverlay.MaterialComponents</item>
|
||||
<item name="switchStyle">@style/Theme.Widget.BasicSwitch</item>
|
||||
<item name="bottomSheetDialogTheme">@style/Theme.BottomSheet</item>
|
||||
</style>
|
||||
|
||||
<!--== Light Reader ==-->
|
||||
<style name="Theme.Reader.Light" parent="Theme.Base.Reader.Light" />
|
||||
|
||||
<!--== Dark Reader base ==-->
|
||||
<style name="Theme.Base.Reader.Dark" parent="Theme.Base.Dark">
|
||||
<!-- Theme colors -->
|
||||
<item name="colorPrimary">@color/readerColorDarkPrimary</item>
|
||||
<item name="colorOnPrimary">@color/textColorPrimaryDark</item>
|
||||
<item name="colorPrimaryVariant">@color/readerColorDarkPrimary</item>
|
||||
<item name="colorSurface">@color/md_black_1000</item>
|
||||
|
||||
<!-- Base background/text colors -->
|
||||
<item name="android:colorBackground">@color/md_black_1000</item>
|
||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
||||
<item name="android:navigationBarColor">?attr/colorPrimaryVariant</item>
|
||||
|
||||
<!-- Themes -->
|
||||
<item name="actionBarTheme">@style/Theme.Toolbar.Custom.Dark</item>
|
||||
<item name="actionBarPopupTheme">@style/ThemeOverlay.MaterialComponents</item>
|
||||
<item name="switchStyle">@style/Theme.Widget.BasicSwitch</item>
|
||||
<item name="bottomSheetDialogTheme">@style/Theme.BottomSheet</item>
|
||||
</style>
|
||||
|
||||
<!--== Dark Reader ==-->
|
||||
<style name="Theme.Reader.Dark" parent="Theme.Base.Reader.Dark" />
|
||||
|
||||
<!--== Dark Grey Reader ==-->
|
||||
<style name="Theme.Reader.Dark.Grey" parent="Theme.Base.Reader.Dark">
|
||||
<item name="android:colorBackground">@color/backgroundDark</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Reader.Light" parent="Theme.Base.Reader.Light" />
|
||||
|
||||
|
||||
<!--===============-->
|
||||
<!-- Launch Screen -->
|
||||
<!--===============-->
|
||||
|
||||
<!--== Splash theme ==-->
|
||||
<style name="Theme.Splash" parent="Theme.Tachiyomi.Light.Blue">
|
||||
<!-- Theme colors -->
|
||||
<item name="colorBackgroundSplash">@color/colorPrimary</item>
|
||||
|
||||
<!-- Base background/text colors -->
|
||||
<item name="android:windowBackground">@drawable/splash_background</item>
|
||||
<item name="android:statusBarColor">?attr/colorBackgroundSplash</item>
|
||||
<item name="android:navigationBarColor">?attr/colorBackgroundSplash</item>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
object BuildPluginsVersion {
|
||||
const val AGP = "4.2.0"
|
||||
const val AGP = "4.2.1"
|
||||
const val KOTLIN = "1.4.32"
|
||||
const val KOTLINTER = "3.4.0"
|
||||
const val VERSIONS_PLUGIN = "0.38.0"
|
||||
const val ABOUTLIB_PLUGIN = "8.8.5"
|
||||
const val ABOUTLIB_PLUGIN = "8.8.6"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue