From 1d7d40ba8ca17b8a08d96701976c11d4a72c7a26 Mon Sep 17 00:00:00 2001 From: Jay Date: Sun, 27 Oct 2019 22:46:26 -0700 Subject: [PATCH] Cleanup + fixes to preference category --- .../extension/util/ExtensionInstallReceiver.kt | 5 ----- .../tachiyomi/ui/reader/PageIndicatorTextView.kt | 10 ---------- .../eu/kanade/tachiyomi/ui/setting/PreferenceDSL.kt | 4 +++- .../main/res/values-sw360dp-v13/values-preference.xml | 6 ++++++ 4 files changed, 9 insertions(+), 16 deletions(-) create mode 100644 app/src/main/res/values-sw360dp-v13/values-preference.xml diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallReceiver.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallReceiver.kt index d94768dd43..f1d50ce4c3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallReceiver.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallReceiver.kt @@ -7,7 +7,6 @@ import android.content.IntentFilter import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.extension.model.LoadResult import eu.kanade.tachiyomi.util.launchNow -import kotlinx.coroutines.async /** * Broadcast receiver that listens for the system's packages installed, updated or removed, and only @@ -91,10 +90,6 @@ internal class ExtensionInstallReceiver(private val listener: Listener) : private suspend fun getExtensionFromIntent(context: Context, intent: Intent?): LoadResult { val pkgName = getPackageNameFromIntent(intent) ?: return LoadResult.Error("Package name not found") - /*var result:LoadResult = LoadResult.Error("") - launchNow { - result = async { ExtensionLoader.loadExtensionFromPkgName(context, pkgName) }.await() - }*/ return ExtensionLoader.loadExtensionFromPkgName(context, pkgName) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/PageIndicatorTextView.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/PageIndicatorTextView.kt index 028ec48488..600ed691de 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/PageIndicatorTextView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/PageIndicatorTextView.kt @@ -25,13 +25,11 @@ class PageIndicatorTextView( override fun onDraw(canvas: Canvas) { setTextColor(strokeColor) - //textColorField.set(this, strokeColor) paint.strokeWidth = 4f paint.style = Paint.Style.STROKE super.onDraw(canvas) setTextColor(fillColor) - //textColorField.set(this, fillColor) paint.strokeWidth = 0f paint.style = Paint.Style.FILL super.onDraw(canvas) @@ -52,12 +50,4 @@ class PageIndicatorTextView( super.setText(finalText, TextView.BufferType.SPANNABLE) } - - private companion object { - // We need to use reflection to set the text color instead of using [setTextColor], - // otherwise the view is invalidated inside [onDraw] and there's an infinite loop - /* val textColorField = TextView::class.java.getDeclaredField("mCurTextColor").apply { - isAccessible = true - }!!*/ - } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/PreferenceDSL.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/PreferenceDSL.kt index 6fc05d1af7..5d74a00f76 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/PreferenceDSL.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/PreferenceDSL.kt @@ -42,7 +42,9 @@ inline fun PreferenceGroup.multiSelectListPreference(block: (@DSL MultiSelectLis } inline fun PreferenceScreen.preferenceCategory(block: (@DSL PreferenceCategory).() -> Unit): PreferenceCategory { - return addThenInit(PreferenceCategory(context), block) + return addThenInit(PreferenceCategory(context).apply { + isIconSpaceReserved = false + }, block) } inline fun PreferenceScreen.preferenceScreen(block: (@DSL PreferenceScreen).() -> Unit): PreferenceScreen { diff --git a/app/src/main/res/values-sw360dp-v13/values-preference.xml b/app/src/main/res/values-sw360dp-v13/values-preference.xml new file mode 100644 index 0000000000..8ed48ca096 --- /dev/null +++ b/app/src/main/res/values-sw360dp-v13/values-preference.xml @@ -0,0 +1,6 @@ + + + + false + 0dp + \ No newline at end of file