Increase Glide cache size, Fixed extension/broswe catalogue filter buttons

This commit is contained in:
Jay 2020-02-14 00:27:55 -08:00
parent 743893f8c2
commit dea8e18eda
8 changed files with 22 additions and 17 deletions

View File

@ -27,9 +27,9 @@ import java.io.InputStream
class TachiGlideModule : AppGlideModule() { class TachiGlideModule : AppGlideModule() {
override fun applyOptions(context: Context, builder: GlideBuilder) { override fun applyOptions(context: Context, builder: GlideBuilder) {
builder.setDiskCache(InternalCacheDiskCacheFactory(context, 50 * 1024 * 1024)) builder.setDiskCache(InternalCacheDiskCacheFactory(context, 100 * 1024 * 1024))
builder.setDefaultRequestOptions(RequestOptions().format(DecodeFormat.PREFER_RGB_565)) builder.setDefaultRequestOptions(RequestOptions().format(DecodeFormat.PREFER_RGB_565))
val memoryCacheSizeBytes = 1024 * 1024 * 100 // 1000mb val memoryCacheSizeBytes = 1024 * 1024 * 100 // 100mb
builder.setMemoryCache(LruResourceCache(memoryCacheSizeBytes.toLong())) builder.setMemoryCache(LruResourceCache(memoryCacheSizeBytes.toLong()))
/* builder.setDefaultTransitionOptions( /* builder.setDefaultTransitionOptions(

View File

@ -6,7 +6,9 @@ import android.view.ViewGroup
import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.FlexibleAdapter
import eu.davidea.flexibleadapter.items.IFlexible import eu.davidea.flexibleadapter.items.IFlexible
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.util.view.RecyclerWindowInsetsListener
import eu.kanade.tachiyomi.util.view.inflate import eu.kanade.tachiyomi.util.view.inflate
import eu.kanade.tachiyomi.util.view.updatePaddingRelative
import eu.kanade.tachiyomi.widget.SimpleNavigationView import eu.kanade.tachiyomi.widget.SimpleNavigationView
import kotlinx.android.synthetic.main.catalogue_drawer_content.view.* import kotlinx.android.synthetic.main.catalogue_drawer_content.view.*
@ -31,6 +33,10 @@ class CatalogueNavigationView @JvmOverloads constructor(context: Context, attrs:
title.text = context.getString(R.string.source_search_options) title.text = context.getString(R.string.source_search_options)
search_btn.setOnClickListener { onSearchClicked() } search_btn.setOnClickListener { onSearchClicked() }
reset_btn.setOnClickListener { onResetClicked() } reset_btn.setOnClickListener { onResetClicked() }
view.search_layout.setOnApplyWindowInsetsListener { v, insets ->
view.updatePaddingRelative(bottom = insets.systemWindowInsetBottom)
insets
}
} }
fun setFilters(items: List<IFlexible<*>>) { fun setFilters(items: List<IFlexible<*>>) {

View File

@ -61,9 +61,8 @@ class ExtensionHolder(view: View, override val adapter: ExtensionAdapter) :
isClickable = true isClickable = true
isActivated = false isActivated = false
//background = VectorDrawableCompat.create(resources!!, R.drawable.button_bg_transparent, null)
setTextColor(ContextCompat.getColorStateList(context, R.drawable.button_text_state)) setTextColor(ContextCompat.getColorStateList(context, R.drawable.button_text_state))
backgroundTintList = ContextCompat.getColorStateList(context, R.color.button_bg) backgroundTintList = ContextCompat.getColorStateList(context, android.R.color.transparent)
val extension = item.extension val extension = item.extension

View File

@ -1,11 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_activated="true" android:color="?attr/colorAccent"> <item android:state_activated="true">
<shape android:shape="rectangle">
<corners android:radius="2dp" />
<solid android:color="?attr/colorAccent" />
<padding android:left="8dp" android:right="8dp" />
</shape>
</item> </item>
<item android:state_enabled="false" android:color="@color/textColorHint"> <item android:state_enabled="false" android:color="@color/textColorHint">
<shape android:shape="rectangle"> <shape android:shape="rectangle">

View File

@ -27,7 +27,7 @@
android:maxLines="1" android:maxLines="1"
tools:text="Title" tools:text="Title"
android:textAppearance="@style/TextAppearance.AppCompat.Body2" android:textAppearance="@style/TextAppearance.AppCompat.Body2"
android:textColor="@color/md_white_1000"/> android:textColor="?attr/actionBarTintColor"/>
</LinearLayout> </LinearLayout>
@ -44,10 +44,14 @@
android:background="?android:attr/divider"/> android:background="?android:attr/divider"/>
<LinearLayout <LinearLayout
android:id="@+id/search_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0" android:layout_weight="0"
android:padding="8dp"> android:paddingStart="8dp"
android:paddingEnd="8dp"
android:paddingTop="8dp"
tools:paddingBottom="20dp">
<Button <Button
android:id="@+id/reset_btn" android:id="@+id/reset_btn"
@ -62,6 +66,7 @@
style="@style/Theme.Widget.Button.Colored" style="@style/Theme.Widget.Button.Colored"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/action_search"/> android:text="@string/action_search"/>

View File

@ -72,9 +72,8 @@
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp"
android:backgroundTint="@drawable/button_bg_transparent"
android:textColor="@drawable/button_text_state" android:textColor="@drawable/button_text_state"
style="@style/Widget.MaterialComponents.Button" style="@style/Widget.MaterialComponents.Button.OutlinedButton"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"

View File

@ -83,6 +83,7 @@
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:textColor="@android:color/white"
android:text="@string/ext_uninstall" android:text="@string/ext_uninstall"
style="@style/Theme.Widget.Button.Colored" style="@style/Theme.Widget.Button.Colored"
app:layout_constraintStart_toStartOf="@id/guideline" app:layout_constraintStart_toStartOf="@id/guideline"

View File

@ -2,7 +2,7 @@
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/listPreferredItemHeightSmall" android:layout_height="wrap_content"
android:paddingStart="?attr/listPreferredItemPaddingStart" android:paddingStart="?attr/listPreferredItemPaddingStart"
android:paddingEnd="?attr/listPreferredItemPaddingEnd" android:paddingEnd="?attr/listPreferredItemPaddingEnd"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
@ -11,14 +11,14 @@
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/nav_view_item_wrapper" android:id="@+id/nav_view_item_wrapper"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_vertical|start"> android:gravity="center_vertical|start">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/nav_view_item" android:id="@+id/nav_view_item"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:maxLines="1" android:maxLines="1"
android:inputType="text" android:inputType="text"
android:imeOptions="actionDone" android:imeOptions="actionDone"