mirror of
https://github.com/gezimos/inkOS.git
synced 2026-04-18 13:00:44 -04:00
UI Cleanup v0.4
This commit is contained in:
@@ -51,7 +51,6 @@ import com.github.gezimos.inkos.helper.isSystemInDarkMode
|
||||
import com.github.gezimos.inkos.helper.utils.EinkScrollBehavior
|
||||
import com.github.gezimos.inkos.style.SettingsTheme
|
||||
import com.github.gezimos.inkos.ui.compose.SettingsComposable.DashedSeparator
|
||||
import com.github.gezimos.inkos.ui.compose.SettingsComposable.DashedSeparator
|
||||
import com.github.gezimos.inkos.ui.compose.SettingsComposable.PageHeader
|
||||
import com.github.gezimos.inkos.ui.compose.SettingsComposable.SettingsSelect
|
||||
import com.github.gezimos.inkos.ui.compose.SettingsComposable.SettingsSwitch
|
||||
@@ -67,21 +66,6 @@ class FontsFragment : Fragment() {
|
||||
private val PICK_FONT_FILE_REQUEST_CODE = 1001
|
||||
private var onCustomFontSelected: ((Typeface, String) -> Unit)? = null
|
||||
|
||||
private fun getCurrentPageIndex(
|
||||
scrollY: Int,
|
||||
viewportHeight: Int,
|
||||
contentHeight: Int,
|
||||
pageCount: Int
|
||||
): Int {
|
||||
if (contentHeight <= viewportHeight) return 0
|
||||
val overlap = (viewportHeight * 0.2).toInt()
|
||||
val scrollStep = viewportHeight - overlap
|
||||
val maxScroll = (contentHeight - viewportHeight).coerceAtLeast(1)
|
||||
val clampedScrollY = scrollY.coerceIn(0, maxScroll)
|
||||
val page = Math.round(clampedScrollY.toFloat() / scrollStep)
|
||||
return page.coerceIn(0, pageCount - 1)
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
|
||||
@@ -58,7 +58,6 @@ import com.github.gezimos.inkos.ui.compose.SettingsComposable.SettingsSelect
|
||||
import com.github.gezimos.inkos.ui.compose.SettingsComposable.SettingsSelectWithColorPreview
|
||||
import com.github.gezimos.inkos.ui.compose.SettingsComposable.SettingsSwitch
|
||||
import com.github.gezimos.inkos.ui.compose.SettingsComposable.SettingsTitle
|
||||
import com.github.gezimos.inkos.ui.compose.SettingsComposable.SolidSeparator
|
||||
import com.github.gezimos.inkos.ui.dialogs.DialogManager
|
||||
|
||||
class LookFeelFragment : Fragment() {
|
||||
@@ -291,7 +290,7 @@ class LookFeelFragment : Fragment() {
|
||||
SettingsSelect(
|
||||
title = stringResource(id = R.string.theme_mode),
|
||||
option = when (selectedTheme.value) {
|
||||
Constants.Theme.System -> "System"
|
||||
System -> "System"
|
||||
Constants.Theme.Light -> "Light"
|
||||
Constants.Theme.Dark -> "Dark"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user