UI Cleanup v0.4

This commit is contained in:
Gezim
2025-10-01 15:31:36 +03:00
parent b5727ff27b
commit f700ec5cb4
2 changed files with 1 additions and 18 deletions

View File

@@ -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?,

View File

@@ -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"
},