From f700ec5cb45bc2a82ba9cf62b2cafeb017bb3aed Mon Sep 17 00:00:00 2001 From: Gezim Date: Wed, 1 Oct 2025 15:31:36 +0300 Subject: [PATCH] UI Cleanup v0.4 --- .../gezimos/inkos/ui/settings/FontsFragment.kt | 16 ---------------- .../inkos/ui/settings/LookFeelFragment.kt | 3 +-- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/app/src/main/java/com/github/gezimos/inkos/ui/settings/FontsFragment.kt b/app/src/main/java/com/github/gezimos/inkos/ui/settings/FontsFragment.kt index 2d44ecc..42fa7ef 100644 --- a/app/src/main/java/com/github/gezimos/inkos/ui/settings/FontsFragment.kt +++ b/app/src/main/java/com/github/gezimos/inkos/ui/settings/FontsFragment.kt @@ -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?, diff --git a/app/src/main/java/com/github/gezimos/inkos/ui/settings/LookFeelFragment.kt b/app/src/main/java/com/github/gezimos/inkos/ui/settings/LookFeelFragment.kt index 71de75d..4fd9b9e 100644 --- a/app/src/main/java/com/github/gezimos/inkos/ui/settings/LookFeelFragment.kt +++ b/app/src/main/java/com/github/gezimos/inkos/ui/settings/LookFeelFragment.kt @@ -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" },