Fix brightness reset when leaving filter tab

This commit is contained in:
Jays2Kings 2021-03-30 02:18:32 -04:00
parent a1e69e7194
commit 7796243017
2 changed files with 3 additions and 2 deletions

View File

@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.ui.reader.settings
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
import androidx.core.content.ContextCompat
import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.tabs.TabLayout
@ -90,7 +91,7 @@ class TabbedReaderSettingsSheet(val readerActivity: ReaderActivity) :
} else {
sheetBehavior.expand()
sheetBehavior.skipCollapsed = true
window?.attributes = window?.attributes?.apply { screenBrightness = 0.01f }
window?.attributes = window?.attributes?.apply { screenBrightness = WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_NONE }
}
}

View File

@ -86,7 +86,7 @@ class MaterialSpinnerView @JvmOverloads constructor(context: Context, attrs: Att
this.pref = pref
prefOffset = 0
val intValues = resources.getStringArray(intValuesResource).map { it.toIntOrNull() }
setSelection(max(0,intValues.indexOf(pref.get())))
setSelection(max(0, intValues.indexOf(pref.get())))
popup = makeSettingsPopup(pref, intValues, block)
setOnTouchListener(popup?.dragToOpenListener)
setOnClickListener {