diff --git a/src/debug/java/Previews.kt b/src/debug/java/Previews.kt index 2ac2d0c4..727b500f 100644 --- a/src/debug/java/Previews.kt +++ b/src/debug/java/Previews.kt @@ -5,10 +5,10 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import com.machiav3lli.fdroid.R import com.machiav3lli.fdroid.entity.LinkType -import com.machiav3lli.fdroid.ui.compose.pages.app_detail.components.AntiFeaturesGrid -import com.machiav3lli.fdroid.ui.compose.pages.app_detail.components.LinkItem -import com.machiav3lli.fdroid.ui.compose.pages.app_detail.components.PermissionGrid -import com.machiav3lli.fdroid.ui.compose.pages.app_detail.components.ReleaseItem +import com.machiav3lli.fdroid.ui.compose.components.appsheet.AntiFeaturesGrid +import com.machiav3lli.fdroid.ui.compose.components.appsheet.LinkItem +import com.machiav3lli.fdroid.ui.compose.components.appsheet.PermissionGrid +import com.machiav3lli.fdroid.ui.compose.components.appsheet.ReleaseItem import com.machiav3lli.fdroid.ui.compose.theme.AppTheme import com.machiav3lli.fdroid.ui.compose.utils.CustomChip import com.machiav3lli.fdroid.utility.SampleData diff --git a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/home/components/CategoryChipList.kt b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/CategoryChipList.kt similarity index 98% rename from src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/home/components/CategoryChipList.kt rename to src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/CategoryChipList.kt index 805c9efc..cf5f9a25 100644 --- a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/home/components/CategoryChipList.kt +++ b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/CategoryChipList.kt @@ -1,4 +1,4 @@ -package com.machiav3lli.fdroid.ui.compose.pages.home.components +package com.machiav3lli.fdroid.ui.compose.components import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.animateColor diff --git a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/app_detail/components/ChipGrid.kt b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/appsheet/ChipGrid.kt similarity index 94% rename from src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/app_detail/components/ChipGrid.kt rename to src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/appsheet/ChipGrid.kt index 9d77cd15..abf0330e 100644 --- a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/app_detail/components/ChipGrid.kt +++ b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/appsheet/ChipGrid.kt @@ -1,4 +1,4 @@ -package com.machiav3lli.fdroid.ui.compose.pages.app_detail.components +package com.machiav3lli.fdroid.ui.compose.components.appsheet import androidx.compose.foundation.horizontalScroll import androidx.compose.foundation.layout.padding diff --git a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/app_detail/components/Header.kt b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/appsheet/Header.kt similarity index 99% rename from src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/app_detail/components/Header.kt rename to src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/appsheet/Header.kt index 5583f2a5..5676a565 100644 --- a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/app_detail/components/Header.kt +++ b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/appsheet/Header.kt @@ -1,4 +1,4 @@ -package com.machiav3lli.fdroid.ui.compose.pages.app_detail.components +package com.machiav3lli.fdroid.ui.compose.components.appsheet import androidx.compose.animation.AnimatedVisibility import androidx.compose.foundation.ExperimentalFoundationApi diff --git a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/app_detail/components/LinkItem.kt b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/appsheet/LinkItem.kt similarity index 97% rename from src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/app_detail/components/LinkItem.kt rename to src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/appsheet/LinkItem.kt index 148a4fd1..67e00d78 100644 --- a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/app_detail/components/LinkItem.kt +++ b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/appsheet/LinkItem.kt @@ -1,4 +1,4 @@ -package com.machiav3lli.fdroid.ui.compose.pages.app_detail.components +package com.machiav3lli.fdroid.ui.compose.components.appsheet import android.net.Uri import androidx.compose.foundation.ExperimentalFoundationApi diff --git a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/app_detail/components/PermissionsItem.kt b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/appsheet/PermissionsItem.kt similarity index 97% rename from src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/app_detail/components/PermissionsItem.kt rename to src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/appsheet/PermissionsItem.kt index 7c6ee243..7b8b1b62 100644 --- a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/app_detail/components/PermissionsItem.kt +++ b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/appsheet/PermissionsItem.kt @@ -1,4 +1,4 @@ -package com.machiav3lli.fdroid.ui.compose.pages.app_detail.components +package com.machiav3lli.fdroid.ui.compose.components.appsheet import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement diff --git a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/app_detail/components/ReleaseItem.kt b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/appsheet/ReleaseItem.kt similarity index 99% rename from src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/app_detail/components/ReleaseItem.kt rename to src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/appsheet/ReleaseItem.kt index 4cacafa4..efdd00eb 100644 --- a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/app_detail/components/ReleaseItem.kt +++ b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/appsheet/ReleaseItem.kt @@ -1,4 +1,4 @@ -package com.machiav3lli.fdroid.ui.compose.pages.app_detail.components +package com.machiav3lli.fdroid.ui.compose.components.appsheet import android.os.Build import androidx.compose.animation.AnimatedVisibility diff --git a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/app_detail/components/TextBlock.kt b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/appsheet/TextBlock.kt similarity index 97% rename from src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/app_detail/components/TextBlock.kt rename to src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/appsheet/TextBlock.kt index 8dca2901..60bf061b 100644 --- a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/app_detail/components/TextBlock.kt +++ b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/appsheet/TextBlock.kt @@ -1,4 +1,4 @@ -package com.machiav3lli.fdroid.ui.compose.pages.app_detail.components +package com.machiav3lli.fdroid.ui.compose.components.appsheet import androidx.compose.animation.animateContentSize import androidx.compose.animation.core.animateIntAsState diff --git a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/app_detail/AppDetail.kt b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/app_detail/AppDetail.kt deleted file mode 100644 index fbb667d3..00000000 --- a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/app_detail/AppDetail.kt +++ /dev/null @@ -1,2 +0,0 @@ -package com.machiav3lli.fdroid.ui.compose.pages.app_detail - diff --git a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/settings/components/PreferenceSlider.kt b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/settings/components/PreferenceSlider.kt deleted file mode 100644 index c4b31615..00000000 --- a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/settings/components/PreferenceSlider.kt +++ /dev/null @@ -1,42 +0,0 @@ -package com.machiav3lli.fdroid.ui.compose.pages.settings.components - -import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.padding -import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.Slider -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import androidx.compose.ui.unit.dp - -@Composable -fun PreferenceSlider( - modifier: Modifier = Modifier, - title: String, - steps: Int = 20, - valueRange: ClosedFloatingPointRange = 10f..200f, - value: () -> Float, - onChange: (Float) -> Unit -) { - Column( - modifier = modifier - .fillMaxWidth() - .background(MaterialTheme.colorScheme.surface, MaterialTheme.shapes.extraLarge) - .padding(16.dp), - verticalArrangement = Arrangement.SpaceBetween, - horizontalAlignment = Alignment.Start - ) { - Text(text = title, style = MaterialTheme.typography.titleMedium) - Slider( - modifier = Modifier.fillMaxWidth(), - value = value(), - valueRange = valueRange, - steps = steps, - onValueChange = onChange - ) - } -} \ No newline at end of file diff --git a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/settings/components/PreferenceSwitch.kt b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/settings/components/PreferenceSwitch.kt deleted file mode 100644 index 72240652..00000000 --- a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/settings/components/PreferenceSwitch.kt +++ /dev/null @@ -1,42 +0,0 @@ -package com.machiav3lli.fdroid.ui.compose.pages.settings.components - -import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.padding -import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.Switch -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import androidx.compose.ui.unit.dp - -@Composable -fun PreferenceSwitch( - modifier: Modifier = Modifier, - switchTitle: String, - switchDescription: String, - checkedState: () -> Boolean, - onCheck: (Boolean) -> Unit -) { - Row( - modifier = modifier - .fillMaxWidth() - .background(MaterialTheme.colorScheme.surface, MaterialTheme.shapes.extraLarge) - .padding(16.dp), - verticalAlignment = Alignment.CenterVertically, - horizontalArrangement = Arrangement.SpaceBetween - ) { - Column( - horizontalAlignment = Alignment.Start, - verticalArrangement = Arrangement.spacedBy(6.dp) - ) { - Text(text = switchTitle, style = MaterialTheme.typography.titleSmall) - Text(text = switchDescription, style = MaterialTheme.typography.bodyMedium) - } - Switch(checked = checkedState(), onCheckedChange = onCheck) - } -} \ No newline at end of file diff --git a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/settings/components/PrefernceDataType.kt b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/settings/components/PrefernceDataType.kt deleted file mode 100644 index 06679d1d..00000000 --- a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/pages/settings/components/PrefernceDataType.kt +++ /dev/null @@ -1,35 +0,0 @@ -package com.machiav3lli.fdroid.ui.compose.pages.settings.components - -import androidx.compose.foundation.background -import androidx.compose.foundation.clickable -import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.padding -import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import androidx.compose.ui.unit.dp - -@Composable -fun PreferenceWithData( - modifier: Modifier = Modifier, - title: String, - description: String, - onClick: () -> Unit -) { - Column( - modifier = modifier - .fillMaxWidth() - .clickable(onClick = onClick) - .background(MaterialTheme.colorScheme.surface, MaterialTheme.shapes.extraLarge) - .padding(16.dp), - verticalArrangement = Arrangement.SpaceBetween, - horizontalAlignment = Alignment.Start - ) { - Text(text = title, style = MaterialTheme.typography.titleSmall) - Text(text = description, style = MaterialTheme.typography.bodyMedium) - } -} \ No newline at end of file diff --git a/src/main/kotlin/com/machiav3lli/fdroid/ui/fragments/AppSheetX.kt b/src/main/kotlin/com/machiav3lli/fdroid/ui/fragments/AppSheetX.kt index 2e845fd9..f5213fd9 100644 --- a/src/main/kotlin/com/machiav3lli/fdroid/ui/fragments/AppSheetX.kt +++ b/src/main/kotlin/com/machiav3lli/fdroid/ui/fragments/AppSheetX.kt @@ -66,12 +66,12 @@ import com.machiav3lli.fdroid.ui.compose.components.ExpandableBlock import com.machiav3lli.fdroid.ui.compose.components.ScreenshotItem import com.machiav3lli.fdroid.ui.compose.components.ScreenshotList import com.machiav3lli.fdroid.ui.compose.components.SwitchPreference -import com.machiav3lli.fdroid.ui.compose.pages.app_detail.components.AppInfoHeader -import com.machiav3lli.fdroid.ui.compose.pages.app_detail.components.HtmlTextBlock -import com.machiav3lli.fdroid.ui.compose.pages.app_detail.components.LinkItem -import com.machiav3lli.fdroid.ui.compose.pages.app_detail.components.PermissionsItem -import com.machiav3lli.fdroid.ui.compose.pages.app_detail.components.ReleaseItem -import com.machiav3lli.fdroid.ui.compose.pages.app_detail.components.TopBarHeader +import com.machiav3lli.fdroid.ui.compose.components.appsheet.AppInfoHeader +import com.machiav3lli.fdroid.ui.compose.components.appsheet.HtmlTextBlock +import com.machiav3lli.fdroid.ui.compose.components.appsheet.LinkItem +import com.machiav3lli.fdroid.ui.compose.components.appsheet.PermissionsItem +import com.machiav3lli.fdroid.ui.compose.components.appsheet.ReleaseItem +import com.machiav3lli.fdroid.ui.compose.components.appsheet.TopBarHeader import com.machiav3lli.fdroid.ui.compose.theme.AppTheme import com.machiav3lli.fdroid.ui.compose.utils.Callbacks import com.machiav3lli.fdroid.ui.viewmodels.AppViewModelX diff --git a/src/main/kotlin/com/machiav3lli/fdroid/ui/fragments/ExploreFragment.kt b/src/main/kotlin/com/machiav3lli/fdroid/ui/fragments/ExploreFragment.kt index 98bc7e00..59da8cea 100644 --- a/src/main/kotlin/com/machiav3lli/fdroid/ui/fragments/ExploreFragment.kt +++ b/src/main/kotlin/com/machiav3lli/fdroid/ui/fragments/ExploreFragment.kt @@ -33,7 +33,7 @@ import com.machiav3lli.fdroid.ui.compose.ProductsVerticalRecycler import com.machiav3lli.fdroid.ui.compose.components.ExpandableSearchAction import com.machiav3lli.fdroid.ui.compose.components.TopBar import com.machiav3lli.fdroid.ui.compose.components.TopBarAction -import com.machiav3lli.fdroid.ui.compose.pages.home.components.CategoryChipList +import com.machiav3lli.fdroid.ui.compose.components.CategoryChipList import com.machiav3lli.fdroid.ui.compose.theme.AppTheme import com.machiav3lli.fdroid.utility.isDarkTheme import com.machiav3lli.fdroid.utility.onLaunchClick diff --git a/src/main/kotlin/com/machiav3lli/fdroid/ui/pages/ExplorePage.kt b/src/main/kotlin/com/machiav3lli/fdroid/ui/pages/ExplorePage.kt index e8590a5f..57edb09d 100644 --- a/src/main/kotlin/com/machiav3lli/fdroid/ui/pages/ExplorePage.kt +++ b/src/main/kotlin/com/machiav3lli/fdroid/ui/pages/ExplorePage.kt @@ -19,7 +19,7 @@ import com.machiav3lli.fdroid.content.Preferences import com.machiav3lli.fdroid.entity.Section import com.machiav3lli.fdroid.ui.activities.MainActivityX import com.machiav3lli.fdroid.ui.compose.ProductsVerticalRecycler -import com.machiav3lli.fdroid.ui.compose.pages.home.components.CategoryChipList +import com.machiav3lli.fdroid.ui.compose.components.CategoryChipList import com.machiav3lli.fdroid.ui.compose.theme.AppTheme import com.machiav3lli.fdroid.ui.viewmodels.MainNavFragmentViewModelX import com.machiav3lli.fdroid.utility.isDarkTheme