mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 16:31:50 +01:00
Cleanup + fixes to preference category
This commit is contained in:
parent
2ec46a7098
commit
1d7d40ba8c
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}!!*/
|
||||
}
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<bool name="config_materialPreferenceIconSpaceReserved" tools:ignore="MissingDefaultResource,PrivateResource">false</bool>
|
||||
<dimen name="preference_category_padding_start" tools:ignore="MissingDefaultResource,PrivateResource">0dp</dimen>
|
||||
</resources>
|
Loading…
Reference in New Issue
Block a user