diff --git a/app/src/main/java/me/ash/reader/data/preference/DarkThemePreference.kt b/app/src/main/java/me/ash/reader/data/preference/DarkThemePreference.kt index a5329df..4047372 100644 --- a/app/src/main/java/me/ash/reader/data/preference/DarkThemePreference.kt +++ b/app/src/main/java/me/ash/reader/data/preference/DarkThemePreference.kt @@ -3,6 +3,7 @@ package me.ash.reader.data.preference import android.content.Context import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.runtime.Composable +import androidx.compose.runtime.ReadOnlyComposable import androidx.datastore.preferences.core.Preferences import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch @@ -33,6 +34,7 @@ sealed class DarkThemePreference(val value: Int) : Preference() { } @Composable + @ReadOnlyComposable fun isDarkTheme(): Boolean = when (this) { UseDeviceTheme -> isSystemInDarkTheme() ON -> true diff --git a/app/src/main/java/me/ash/reader/data/preference/Preference.kt b/app/src/main/java/me/ash/reader/data/preference/Preference.kt index cd451da..0ea515e 100644 --- a/app/src/main/java/me/ash/reader/data/preference/Preference.kt +++ b/app/src/main/java/me/ash/reader/data/preference/Preference.kt @@ -1,8 +1,43 @@ package me.ash.reader.data.preference import android.content.Context +import androidx.datastore.preferences.core.Preferences import kotlinx.coroutines.CoroutineScope sealed class Preference { abstract fun put(context: Context, scope: CoroutineScope) +} + +fun Preferences.toSettings(): Settings { + return Settings( + themeIndex = ThemeIndexPreference.fromPreferences(this), + customPrimaryColor = CustomPrimaryColorPreference.fromPreferences(this), + darkTheme = DarkThemePreference.fromPreferences(this), + amoledDarkTheme = AmoledDarkThemePreference.fromPreferences(this), + + feedsFilterBarStyle = FeedsFilterBarStylePreference.fromPreferences(this), + feedsFilterBarFilled = FeedsFilterBarFilledPreference.fromPreferences(this), + feedsFilterBarPadding = FeedsFilterBarPaddingPreference.fromPreferences(this), + feedsFilterBarTonalElevation = FeedsFilterBarTonalElevationPreference.fromPreferences(this), + feedsTopBarTonalElevation = FeedsTopBarTonalElevationPreference.fromPreferences(this), + feedsGroupListExpand = FeedsGroupListExpandPreference.fromPreferences(this), + feedsGroupListTonalElevation = FeedsGroupListTonalElevationPreference.fromPreferences(this), + + flowFilterBarStyle = FlowFilterBarStylePreference.fromPreferences(this), + flowFilterBarFilled = FlowFilterBarFilledPreference.fromPreferences(this), + flowFilterBarPadding = FlowFilterBarPaddingPreference.fromPreferences(this), + flowFilterBarTonalElevation = FlowFilterBarTonalElevationPreference.fromPreferences(this), + flowTopBarTonalElevation = FlowTopBarTonalElevationPreference.fromPreferences(this), + flowArticleListFeedIcon = FlowArticleListFeedIconPreference.fromPreferences(this), + flowArticleListFeedName = FlowArticleListFeedNamePreference.fromPreferences(this), + flowArticleListImage = FlowArticleListImagePreference.fromPreferences(this), + flowArticleListDesc = FlowArticleListDescPreference.fromPreferences(this), + flowArticleListTime = FlowArticleListTimePreference.fromPreferences(this), + flowArticleListDateStickyHeader = FlowArticleListDateStickyHeaderPreference.fromPreferences( + this + ), + flowArticleListTonalElevation = FlowArticleListTonalElevationPreference.fromPreferences(this), + + languages = LanguagesPreference.fromPreferences(this), + ) } \ No newline at end of file diff --git a/app/src/main/java/me/ash/reader/data/preference/Settings.kt b/app/src/main/java/me/ash/reader/data/preference/Settings.kt index 70996c7..632662b 100644 --- a/app/src/main/java/me/ash/reader/data/preference/Settings.kt +++ b/app/src/main/java/me/ash/reader/data/preference/Settings.kt @@ -6,7 +6,6 @@ import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.compositionLocalOf import androidx.compose.runtime.remember import androidx.compose.ui.platform.LocalContext -import androidx.datastore.preferences.core.Preferences import kotlinx.coroutines.flow.map import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.dataStore @@ -41,40 +40,6 @@ data class Settings( val languages: LanguagesPreference = LanguagesPreference.default, ) -fun Preferences.toSettings(): Settings { - return Settings( - themeIndex = ThemeIndexPreference.fromPreferences(this), - customPrimaryColor = CustomPrimaryColorPreference.fromPreferences(this), - darkTheme = DarkThemePreference.fromPreferences(this), - amoledDarkTheme = AmoledDarkThemePreference.fromPreferences(this), - - feedsFilterBarStyle = FeedsFilterBarStylePreference.fromPreferences(this), - feedsFilterBarFilled = FeedsFilterBarFilledPreference.fromPreferences(this), - feedsFilterBarPadding = FeedsFilterBarPaddingPreference.fromPreferences(this), - feedsFilterBarTonalElevation = FeedsFilterBarTonalElevationPreference.fromPreferences(this), - feedsTopBarTonalElevation = FeedsTopBarTonalElevationPreference.fromPreferences(this), - feedsGroupListExpand = FeedsGroupListExpandPreference.fromPreferences(this), - feedsGroupListTonalElevation = FeedsGroupListTonalElevationPreference.fromPreferences(this), - - flowFilterBarStyle = FlowFilterBarStylePreference.fromPreferences(this), - flowFilterBarFilled = FlowFilterBarFilledPreference.fromPreferences(this), - flowFilterBarPadding = FlowFilterBarPaddingPreference.fromPreferences(this), - flowFilterBarTonalElevation = FlowFilterBarTonalElevationPreference.fromPreferences(this), - flowTopBarTonalElevation = FlowTopBarTonalElevationPreference.fromPreferences(this), - flowArticleListFeedIcon = FlowArticleListFeedIconPreference.fromPreferences(this), - flowArticleListFeedName = FlowArticleListFeedNamePreference.fromPreferences(this), - flowArticleListImage = FlowArticleListImagePreference.fromPreferences(this), - flowArticleListDesc = FlowArticleListDescPreference.fromPreferences(this), - flowArticleListTime = FlowArticleListTimePreference.fromPreferences(this), - flowArticleListDateStickyHeader = FlowArticleListDateStickyHeaderPreference.fromPreferences( - this - ), - flowArticleListTonalElevation = FlowArticleListTonalElevationPreference.fromPreferences(this), - - languages = LanguagesPreference.fromPreferences(this), - ) -} - @Composable fun SettingsProvider( content: @Composable () -> Unit, diff --git a/app/src/main/java/me/ash/reader/ui/page/home/FeedIcon.kt b/app/src/main/java/me/ash/reader/ui/component/FeedIcon.kt similarity index 97% rename from app/src/main/java/me/ash/reader/ui/page/home/FeedIcon.kt rename to app/src/main/java/me/ash/reader/ui/component/FeedIcon.kt index e52288c..d8b0030 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/FeedIcon.kt +++ b/app/src/main/java/me/ash/reader/ui/component/FeedIcon.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.page.home +package me.ash.reader.ui.component import androidx.compose.foundation.background import androidx.compose.foundation.layout.Row diff --git a/app/src/main/java/me/ash/reader/ui/page/home/FilterBar.kt b/app/src/main/java/me/ash/reader/ui/component/FilterBar.kt similarity index 99% rename from app/src/main/java/me/ash/reader/ui/page/home/FilterBar.kt rename to app/src/main/java/me/ash/reader/ui/component/FilterBar.kt index cb7dad0..ba30443 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/FilterBar.kt +++ b/app/src/main/java/me/ash/reader/ui/component/FilterBar.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.page.home +package me.ash.reader.ui.component import android.os.Build import android.view.SoundEffectConstants diff --git a/app/src/main/java/me/ash/reader/ui/component/AnimatedPopup.kt b/app/src/main/java/me/ash/reader/ui/component/base/AnimatedPopup.kt similarity index 97% rename from app/src/main/java/me/ash/reader/ui/component/AnimatedPopup.kt rename to app/src/main/java/me/ash/reader/ui/component/base/AnimatedPopup.kt index f294bf6..d70044e 100644 --- a/app/src/main/java/me/ash/reader/ui/component/AnimatedPopup.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/AnimatedPopup.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import androidx.compose.animation.* import androidx.compose.foundation.layout.WindowInsets diff --git a/app/src/main/java/me/ash/reader/ui/component/AnimatedText.kt b/app/src/main/java/me/ash/reader/ui/component/base/AnimatedText.kt similarity index 98% rename from app/src/main/java/me/ash/reader/ui/component/AnimatedText.kt rename to app/src/main/java/me/ash/reader/ui/component/base/AnimatedText.kt index 614543c..7c7e76c 100644 --- a/app/src/main/java/me/ash/reader/ui/component/AnimatedText.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/AnimatedText.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import androidx.compose.animation.* import androidx.compose.animation.core.FastOutSlowInEasing diff --git a/app/src/main/java/me/ash/reader/ui/component/AsyncImage.kt b/app/src/main/java/me/ash/reader/ui/component/base/AsyncImage.kt similarity index 98% rename from app/src/main/java/me/ash/reader/ui/component/AsyncImage.kt rename to app/src/main/java/me/ash/reader/ui/component/base/AsyncImage.kt index 8ac3cb9..039e2ce 100644 --- a/app/src/main/java/me/ash/reader/ui/component/AsyncImage.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/AsyncImage.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import androidx.annotation.DrawableRes import androidx.compose.material3.MaterialTheme diff --git a/app/src/main/java/me/ash/reader/ui/component/Banner.kt b/app/src/main/java/me/ash/reader/ui/component/base/Banner.kt similarity index 98% rename from app/src/main/java/me/ash/reader/ui/component/Banner.kt rename to app/src/main/java/me/ash/reader/ui/component/base/Banner.kt index 3e235bf..e9d2807 100644 --- a/app/src/main/java/me/ash/reader/ui/component/Banner.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/Banner.kt @@ -6,7 +6,7 @@ * @modifier Ashinch */ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import android.view.SoundEffectConstants import androidx.compose.animation.Crossfade diff --git a/app/src/main/java/me/ash/reader/ui/component/BlockButton.kt b/app/src/main/java/me/ash/reader/ui/component/base/BlockButton.kt similarity index 97% rename from app/src/main/java/me/ash/reader/ui/component/BlockButton.kt rename to app/src/main/java/me/ash/reader/ui/component/base/BlockButton.kt index 433b7e7..a73a361 100644 --- a/app/src/main/java/me/ash/reader/ui/component/BlockButton.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/BlockButton.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import androidx.compose.foundation.background import androidx.compose.foundation.clickable diff --git a/app/src/main/java/me/ash/reader/ui/component/BlockRadioButton.kt b/app/src/main/java/me/ash/reader/ui/component/base/BlockRadioButton.kt similarity index 97% rename from app/src/main/java/me/ash/reader/ui/component/BlockRadioButton.kt rename to app/src/main/java/me/ash/reader/ui/component/base/BlockRadioButton.kt index d1633bb..adc29f1 100644 --- a/app/src/main/java/me/ash/reader/ui/component/BlockRadioButton.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/BlockRadioButton.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import androidx.compose.foundation.layout.* import androidx.compose.runtime.Composable diff --git a/app/src/main/java/me/ash/reader/ui/component/BottomDrawer.kt b/app/src/main/java/me/ash/reader/ui/component/base/BottomDrawer.kt similarity index 98% rename from app/src/main/java/me/ash/reader/ui/component/BottomDrawer.kt rename to app/src/main/java/me/ash/reader/ui/component/base/BottomDrawer.kt index ff09f00..095f61c 100644 --- a/app/src/main/java/me/ash/reader/ui/component/BottomDrawer.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/BottomDrawer.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import androidx.compose.foundation.background import androidx.compose.foundation.layout.* diff --git a/app/src/main/java/me/ash/reader/ui/component/CanBeDisabledIconButton.kt b/app/src/main/java/me/ash/reader/ui/component/base/CanBeDisabledIconButton.kt similarity index 96% rename from app/src/main/java/me/ash/reader/ui/component/CanBeDisabledIconButton.kt rename to app/src/main/java/me/ash/reader/ui/component/base/CanBeDisabledIconButton.kt index 9d5852d..10388f9 100644 --- a/app/src/main/java/me/ash/reader/ui/component/CanBeDisabledIconButton.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/CanBeDisabledIconButton.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import androidx.compose.foundation.layout.size import androidx.compose.material3.Icon diff --git a/app/src/main/java/me/ash/reader/ui/component/ClipboardTextField.kt b/app/src/main/java/me/ash/reader/ui/component/base/ClipboardTextField.kt similarity index 98% rename from app/src/main/java/me/ash/reader/ui/component/ClipboardTextField.kt rename to app/src/main/java/me/ash/reader/ui/component/base/ClipboardTextField.kt index 90dcd00..e48d901 100644 --- a/app/src/main/java/me/ash/reader/ui/component/ClipboardTextField.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/ClipboardTextField.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import androidx.compose.foundation.horizontalScroll import androidx.compose.foundation.layout.Column diff --git a/app/src/main/java/me/ash/reader/ui/component/CurlyCornerShape.kt b/app/src/main/java/me/ash/reader/ui/component/base/CurlyCornerShape.kt similarity index 98% rename from app/src/main/java/me/ash/reader/ui/component/CurlyCornerShape.kt rename to app/src/main/java/me/ash/reader/ui/component/base/CurlyCornerShape.kt index 39821e3..0cf4df3 100644 --- a/app/src/main/java/me/ash/reader/ui/component/CurlyCornerShape.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/CurlyCornerShape.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import androidx.compose.foundation.shape.CornerBasedShape import androidx.compose.foundation.shape.CornerSize diff --git a/app/src/main/java/me/ash/reader/ui/component/Dialog.kt b/app/src/main/java/me/ash/reader/ui/component/base/Dialog.kt similarity index 95% rename from app/src/main/java/me/ash/reader/ui/component/Dialog.kt rename to app/src/main/java/me/ash/reader/ui/component/base/Dialog.kt index 5d90164..ff7f6c0 100644 --- a/app/src/main/java/me/ash/reader/ui/component/Dialog.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/Dialog.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import androidx.compose.material3.AlertDialog import androidx.compose.runtime.Composable diff --git a/app/src/main/java/me/ash/reader/ui/component/DisplayText.kt b/app/src/main/java/me/ash/reader/ui/component/base/DisplayText.kt similarity index 97% rename from app/src/main/java/me/ash/reader/ui/component/DisplayText.kt rename to app/src/main/java/me/ash/reader/ui/component/base/DisplayText.kt index a2fffee..965b22d 100644 --- a/app/src/main/java/me/ash/reader/ui/component/DisplayText.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/DisplayText.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import androidx.compose.animation.* import androidx.compose.foundation.layout.Column diff --git a/app/src/main/java/me/ash/reader/ui/component/DynamicSVGImage.kt b/app/src/main/java/me/ash/reader/ui/component/base/DynamicSVGImage.kt similarity index 97% rename from app/src/main/java/me/ash/reader/ui/component/DynamicSVGImage.kt rename to app/src/main/java/me/ash/reader/ui/component/base/DynamicSVGImage.kt index 5b93670..da97da5 100644 --- a/app/src/main/java/me/ash/reader/ui/component/DynamicSVGImage.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/DynamicSVGImage.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import android.graphics.drawable.PictureDrawable import androidx.compose.animation.Crossfade diff --git a/app/src/main/java/me/ash/reader/ui/component/FeedbackIconButton.kt b/app/src/main/java/me/ash/reader/ui/component/base/FeedbackIconButton.kt similarity index 98% rename from app/src/main/java/me/ash/reader/ui/component/FeedbackIconButton.kt rename to app/src/main/java/me/ash/reader/ui/component/base/FeedbackIconButton.kt index 9c2433d..20c8318 100644 --- a/app/src/main/java/me/ash/reader/ui/component/FeedbackIconButton.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/FeedbackIconButton.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import android.view.HapticFeedbackConstants import android.view.SoundEffectConstants diff --git a/app/src/main/java/me/ash/reader/ui/component/Menu.kt b/app/src/main/java/me/ash/reader/ui/component/base/Menu.kt similarity index 97% rename from app/src/main/java/me/ash/reader/ui/component/Menu.kt rename to app/src/main/java/me/ash/reader/ui/component/base/Menu.kt index 984b225..1b41382 100644 --- a/app/src/main/java/me/ash/reader/ui/component/Menu.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/Menu.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import androidx.compose.foundation.layout.Box import androidx.compose.material3.DropdownMenu diff --git a/app/src/main/java/me/ash/reader/ui/component/RadioDialog.kt b/app/src/main/java/me/ash/reader/ui/component/base/RadioDialog.kt similarity index 98% rename from app/src/main/java/me/ash/reader/ui/component/RadioDialog.kt rename to app/src/main/java/me/ash/reader/ui/component/base/RadioDialog.kt index 3b447a4..d7b7136 100644 --- a/app/src/main/java/me/ash/reader/ui/component/RadioDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/RadioDialog.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Row diff --git a/app/src/main/java/me/ash/reader/ui/component/SelectionChip.kt b/app/src/main/java/me/ash/reader/ui/component/base/SelectionChip.kt similarity index 98% rename from app/src/main/java/me/ash/reader/ui/component/SelectionChip.kt rename to app/src/main/java/me/ash/reader/ui/component/base/SelectionChip.kt index 5da94a1..dc9769b 100644 --- a/app/src/main/java/me/ash/reader/ui/component/SelectionChip.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/SelectionChip.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.interaction.MutableInteractionSource diff --git a/app/src/main/java/me/ash/reader/ui/component/SubTitle.kt b/app/src/main/java/me/ash/reader/ui/component/base/SubTitle.kt similarity index 94% rename from app/src/main/java/me/ash/reader/ui/component/SubTitle.kt rename to app/src/main/java/me/ash/reader/ui/component/base/SubTitle.kt index ec50ae2..f45a5cb 100644 --- a/app/src/main/java/me/ash/reader/ui/component/SubTitle.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/SubTitle.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding diff --git a/app/src/main/java/me/ash/reader/ui/component/SwipeRefresh.kt b/app/src/main/java/me/ash/reader/ui/component/base/SwipeRefresh.kt similarity index 96% rename from app/src/main/java/me/ash/reader/ui/component/SwipeRefresh.kt rename to app/src/main/java/me/ash/reader/ui/component/base/SwipeRefresh.kt index 0664f3a..5e2d311 100644 --- a/app/src/main/java/me/ash/reader/ui/component/SwipeRefresh.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/SwipeRefresh.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable diff --git a/app/src/main/java/me/ash/reader/ui/component/Switch.kt b/app/src/main/java/me/ash/reader/ui/component/base/Switch.kt similarity index 98% rename from app/src/main/java/me/ash/reader/ui/component/Switch.kt rename to app/src/main/java/me/ash/reader/ui/component/base/Switch.kt index 53b545c..ea2640a 100644 --- a/app/src/main/java/me/ash/reader/ui/component/Switch.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/Switch.kt @@ -6,7 +6,7 @@ * @modifier Ashinch */ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import androidx.compose.animation.animateColorAsState import androidx.compose.animation.core.animateDpAsState diff --git a/app/src/main/java/me/ash/reader/ui/component/TextField.kt b/app/src/main/java/me/ash/reader/ui/component/base/TextField.kt similarity index 98% rename from app/src/main/java/me/ash/reader/ui/component/TextField.kt rename to app/src/main/java/me/ash/reader/ui/component/base/TextField.kt index 63f11d2..a697795 100644 --- a/app/src/main/java/me/ash/reader/ui/component/TextField.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/TextField.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import androidx.compose.foundation.text.KeyboardActions import androidx.compose.foundation.text.KeyboardOptions diff --git a/app/src/main/java/me/ash/reader/ui/component/TextFieldDialog.kt b/app/src/main/java/me/ash/reader/ui/component/base/TextFieldDialog.kt similarity index 96% rename from app/src/main/java/me/ash/reader/ui/component/TextFieldDialog.kt rename to app/src/main/java/me/ash/reader/ui/component/base/TextFieldDialog.kt index 5f7adb3..b92d2e7 100644 --- a/app/src/main/java/me/ash/reader/ui/component/TextFieldDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/TextFieldDialog.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme @@ -13,7 +13,6 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.window.DialogProperties -import com.google.accompanist.pager.ExperimentalPagerApi import me.ash.reader.R @Composable diff --git a/app/src/main/java/me/ash/reader/ui/component/Tips.kt b/app/src/main/java/me/ash/reader/ui/component/base/Tips.kt similarity index 96% rename from app/src/main/java/me/ash/reader/ui/component/Tips.kt rename to app/src/main/java/me/ash/reader/ui/component/base/Tips.kt index bab7833..4f9d519 100644 --- a/app/src/main/java/me/ash/reader/ui/component/Tips.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/Tips.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import androidx.compose.foundation.layout.* import androidx.compose.material.icons.Icons diff --git a/app/src/main/java/me/ash/reader/ui/component/ViewPager.kt b/app/src/main/java/me/ash/reader/ui/component/base/ViewPager.kt similarity index 96% rename from app/src/main/java/me/ash/reader/ui/component/ViewPager.kt rename to app/src/main/java/me/ash/reader/ui/component/base/ViewPager.kt index 4836c07..599c027 100644 --- a/app/src/main/java/me/ash/reader/ui/component/ViewPager.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/ViewPager.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import androidx.compose.animation.animateContentSize import androidx.compose.foundation.layout.fillMaxWidth diff --git a/app/src/main/java/me/ash/reader/ui/component/WebView.kt b/app/src/main/java/me/ash/reader/ui/component/base/WebView.kt similarity index 99% rename from app/src/main/java/me/ash/reader/ui/component/WebView.kt rename to app/src/main/java/me/ash/reader/ui/component/base/WebView.kt index ea2634a..ae3cf06 100644 --- a/app/src/main/java/me/ash/reader/ui/component/WebView.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/WebView.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.component +package me.ash.reader.ui.component.base import android.content.Intent import android.net.Uri diff --git a/app/src/main/java/me/ash/reader/ui/component/reader/HtmlToComposable.kt b/app/src/main/java/me/ash/reader/ui/component/reader/HtmlToComposable.kt index 9e66174..4288193 100644 --- a/app/src/main/java/me/ash/reader/ui/component/reader/HtmlToComposable.kt +++ b/app/src/main/java/me/ash/reader/ui/component/reader/HtmlToComposable.kt @@ -51,7 +51,7 @@ import coil.size.Precision import coil.size.Size import coil.size.pxOrElse import me.ash.reader.R -import me.ash.reader.ui.component.AsyncImage +import me.ash.reader.ui.component.base.AsyncImage import org.jsoup.Jsoup import org.jsoup.helper.StringUtil import org.jsoup.nodes.Element diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/FeedItem.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/FeedItem.kt index 43e1814..f80a65d 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/FeedItem.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/FeedItem.kt @@ -20,9 +20,9 @@ import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import me.ash.reader.data.entity.Feed -import me.ash.reader.ui.page.home.FeedIcon -import me.ash.reader.ui.page.home.feeds.option.feed.FeedOptionViewAction -import me.ash.reader.ui.page.home.feeds.option.feed.FeedOptionViewModel +import me.ash.reader.ui.component.FeedIcon +import me.ash.reader.ui.page.home.feeds.drawer.feed.FeedOptionViewAction +import me.ash.reader.ui.page.home.feeds.drawer.feed.FeedOptionViewModel import kotlin.math.ln @OptIn( diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/FeedsPage.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/FeedsPage.kt index d522d5c..d13a200 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/FeedsPage.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/FeedsPage.kt @@ -1,6 +1,5 @@ package me.ash.reader.ui.page.home.feeds -import android.annotation.SuppressLint import androidx.activity.compose.BackHandler import androidx.activity.compose.rememberLauncherForActivityResult import androidx.activity.result.contract.ActivityResultContracts @@ -32,24 +31,23 @@ import me.ash.reader.data.model.getName import me.ash.reader.data.model.toVersion import me.ash.reader.data.preference.* import me.ash.reader.data.repository.SyncWorker.Companion.getIsSyncing -import me.ash.reader.ui.component.Banner -import me.ash.reader.ui.component.DisplayText -import me.ash.reader.ui.component.FeedbackIconButton -import me.ash.reader.ui.component.Subtitle +import me.ash.reader.ui.component.base.Banner +import me.ash.reader.ui.component.base.DisplayText +import me.ash.reader.ui.component.base.FeedbackIconButton +import me.ash.reader.ui.component.base.Subtitle import me.ash.reader.ui.ext.* import me.ash.reader.ui.page.common.RouteName -import me.ash.reader.ui.page.home.FilterBar +import me.ash.reader.ui.component.FilterBar import me.ash.reader.ui.page.home.FilterState import me.ash.reader.ui.page.home.HomeViewAction import me.ash.reader.ui.page.home.HomeViewModel -import me.ash.reader.ui.page.home.feeds.option.feed.FeedOptionDrawer -import me.ash.reader.ui.page.home.feeds.option.group.GroupOptionDrawer +import me.ash.reader.ui.page.home.feeds.drawer.feed.FeedOptionDrawer +import me.ash.reader.ui.page.home.feeds.drawer.group.GroupOptionDrawer import me.ash.reader.ui.page.home.feeds.subscribe.SubscribeDialog import me.ash.reader.ui.page.home.feeds.subscribe.SubscribeViewAction import me.ash.reader.ui.page.home.feeds.subscribe.SubscribeViewModel import me.ash.reader.ui.theme.palette.onDark -@SuppressLint("FlowOperatorInvokedInComposition") @OptIn( ExperimentalMaterial3Api::class, com.google.accompanist.pager.ExperimentalPagerApi::class, androidx.compose.foundation.ExperimentalFoundationApi::class diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/GroupItem.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/GroupItem.kt index 9d6559f..3afdd20 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/GroupItem.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/GroupItem.kt @@ -28,8 +28,8 @@ import me.ash.reader.R import me.ash.reader.data.entity.Feed import me.ash.reader.data.entity.Group import me.ash.reader.ui.ext.alphaLN -import me.ash.reader.ui.page.home.feeds.option.group.GroupOptionViewAction -import me.ash.reader.ui.page.home.feeds.option.group.GroupOptionViewModel +import me.ash.reader.ui.page.home.feeds.drawer.group.GroupOptionViewAction +import me.ash.reader.ui.page.home.feeds.drawer.group.GroupOptionViewModel @OptIn(androidx.compose.foundation.ExperimentalFoundationApi::class) @Composable diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/feed/ClearFeedDialog.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/feed/ClearFeedDialog.kt similarity index 94% rename from app/src/main/java/me/ash/reader/ui/page/home/feeds/option/feed/ClearFeedDialog.kt rename to app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/feed/ClearFeedDialog.kt index ef28388..0ead3a7 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/feed/ClearFeedDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/feed/ClearFeedDialog.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.page.home.feeds.option.feed +package me.ash.reader.ui.page.home.feeds.drawer.feed import androidx.compose.material.icons.Icons import androidx.compose.material.icons.outlined.DeleteForever @@ -11,9 +11,8 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.hilt.navigation.compose.hiltViewModel -import com.google.accompanist.pager.ExperimentalPagerApi import me.ash.reader.R -import me.ash.reader.ui.component.Dialog +import me.ash.reader.ui.component.base.Dialog import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.showToast diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/feed/DeleteFeedDialog.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/feed/DeleteFeedDialog.kt similarity index 94% rename from app/src/main/java/me/ash/reader/ui/page/home/feeds/option/feed/DeleteFeedDialog.kt rename to app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/feed/DeleteFeedDialog.kt index f0a5c5d..c977abe 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/feed/DeleteFeedDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/feed/DeleteFeedDialog.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.page.home.feeds.option.feed +package me.ash.reader.ui.page.home.feeds.drawer.feed import androidx.compose.material.icons.Icons import androidx.compose.material.icons.outlined.DeleteForever @@ -11,9 +11,8 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.hilt.navigation.compose.hiltViewModel -import com.google.accompanist.pager.ExperimentalPagerApi import me.ash.reader.R -import me.ash.reader.ui.component.Dialog +import me.ash.reader.ui.component.base.Dialog import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.showToast diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/feed/FeedOptionDrawer.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/feed/FeedOptionDrawer.kt similarity index 97% rename from app/src/main/java/me/ash/reader/ui/page/home/feeds/option/feed/FeedOptionDrawer.kt rename to app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/feed/FeedOptionDrawer.kt index 843b495..d3d03b0 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/feed/FeedOptionDrawer.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/feed/FeedOptionDrawer.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.page.home.feeds.option.feed +package me.ash.reader.ui.page.home.feeds.drawer.feed import androidx.activity.compose.BackHandler import androidx.compose.foundation.layout.* @@ -19,12 +19,12 @@ import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import kotlinx.coroutines.launch import me.ash.reader.R -import me.ash.reader.ui.component.BottomDrawer -import me.ash.reader.ui.component.TextFieldDialog +import me.ash.reader.ui.component.base.BottomDrawer +import me.ash.reader.ui.component.base.TextFieldDialog import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.roundClick import me.ash.reader.ui.ext.showToast -import me.ash.reader.ui.page.home.FeedIcon +import me.ash.reader.ui.component.FeedIcon import me.ash.reader.ui.page.home.feeds.subscribe.ResultView @OptIn(ExperimentalMaterialApi::class) diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/feed/FeedOptionViewModel.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/feed/FeedOptionViewModel.kt similarity index 99% rename from app/src/main/java/me/ash/reader/ui/page/home/feeds/option/feed/FeedOptionViewModel.kt rename to app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/feed/FeedOptionViewModel.kt index 0488eee..00db51a 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/feed/FeedOptionViewModel.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/feed/FeedOptionViewModel.kt @@ -1,11 +1,10 @@ -package me.ash.reader.ui.page.home.feeds.option.feed +package me.ash.reader.ui.page.home.feeds.drawer.feed import androidx.compose.material.ExperimentalMaterialApi import androidx.compose.material.ModalBottomSheetState import androidx.compose.material.ModalBottomSheetValue import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.google.accompanist.pager.ExperimentalPagerApi import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineScope diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/AllAllowNotificationDialog.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/AllAllowNotificationDialog.kt similarity index 94% rename from app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/AllAllowNotificationDialog.kt rename to app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/AllAllowNotificationDialog.kt index d3a7634..6ca6e7f 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/AllAllowNotificationDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/AllAllowNotificationDialog.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.page.home.feeds.option.group +package me.ash.reader.ui.page.home.feeds.drawer.group import androidx.compose.material.icons.Icons import androidx.compose.material.icons.outlined.Notifications @@ -11,9 +11,8 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.hilt.navigation.compose.hiltViewModel -import com.google.accompanist.pager.ExperimentalPagerApi import me.ash.reader.R -import me.ash.reader.ui.component.Dialog +import me.ash.reader.ui.component.base.Dialog import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.showToast diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/AllMoveToGroupDialog.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/AllMoveToGroupDialog.kt similarity index 94% rename from app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/AllMoveToGroupDialog.kt rename to app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/AllMoveToGroupDialog.kt index 2aa13ce..7e39a85 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/AllMoveToGroupDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/AllMoveToGroupDialog.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.page.home.feeds.option.group +package me.ash.reader.ui.page.home.feeds.drawer.group import androidx.compose.material.icons.Icons import androidx.compose.material.icons.outlined.DriveFileMove @@ -11,9 +11,8 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.hilt.navigation.compose.hiltViewModel -import com.google.accompanist.pager.ExperimentalPagerApi import me.ash.reader.R -import me.ash.reader.ui.component.Dialog +import me.ash.reader.ui.component.base.Dialog import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.showToast diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/AllParseFullContentDialog.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/AllParseFullContentDialog.kt similarity index 94% rename from app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/AllParseFullContentDialog.kt rename to app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/AllParseFullContentDialog.kt index 43d844c..bc8a92f 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/AllParseFullContentDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/AllParseFullContentDialog.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.page.home.feeds.option.group +package me.ash.reader.ui.page.home.feeds.drawer.group import androidx.compose.material.icons.Icons import androidx.compose.material.icons.outlined.Article @@ -11,9 +11,8 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.hilt.navigation.compose.hiltViewModel -import com.google.accompanist.pager.ExperimentalPagerApi import me.ash.reader.R -import me.ash.reader.ui.component.Dialog +import me.ash.reader.ui.component.base.Dialog import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.showToast diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/ClearGroupDialog.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/ClearGroupDialog.kt similarity index 94% rename from app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/ClearGroupDialog.kt rename to app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/ClearGroupDialog.kt index 00f26bb..ce02471 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/ClearGroupDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/ClearGroupDialog.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.page.home.feeds.option.group +package me.ash.reader.ui.page.home.feeds.drawer.group import androidx.compose.material.icons.Icons import androidx.compose.material.icons.outlined.DeleteForever @@ -11,9 +11,8 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.hilt.navigation.compose.hiltViewModel -import com.google.accompanist.pager.ExperimentalPagerApi import me.ash.reader.R -import me.ash.reader.ui.component.Dialog +import me.ash.reader.ui.component.base.Dialog import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.showToast diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/DeleteGroupDialog.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/DeleteGroupDialog.kt similarity index 94% rename from app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/DeleteGroupDialog.kt rename to app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/DeleteGroupDialog.kt index d9e96fb..ffa3a48 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/DeleteGroupDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/DeleteGroupDialog.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.page.home.feeds.option.group +package me.ash.reader.ui.page.home.feeds.drawer.group import androidx.compose.material.icons.Icons import androidx.compose.material.icons.outlined.DeleteForever @@ -11,9 +11,8 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.hilt.navigation.compose.hiltViewModel -import com.google.accompanist.pager.ExperimentalPagerApi import me.ash.reader.R -import me.ash.reader.ui.component.Dialog +import me.ash.reader.ui.component.base.Dialog import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.showToast diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/GroupOptionDrawer.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/GroupOptionDrawer.kt similarity index 97% rename from app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/GroupOptionDrawer.kt rename to app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/GroupOptionDrawer.kt index 480aa1f..ca30d36 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/GroupOptionDrawer.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/GroupOptionDrawer.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.page.home.feeds.option.group +package me.ash.reader.ui.page.home.feeds.drawer.group import android.content.Context import androidx.activity.compose.BackHandler @@ -33,10 +33,10 @@ import com.google.accompanist.flowlayout.MainAxisAlignment import kotlinx.coroutines.launch import me.ash.reader.R import me.ash.reader.data.entity.Group -import me.ash.reader.ui.component.BottomDrawer -import me.ash.reader.ui.component.SelectionChip -import me.ash.reader.ui.component.Subtitle -import me.ash.reader.ui.component.TextFieldDialog +import me.ash.reader.ui.component.base.BottomDrawer +import me.ash.reader.ui.component.base.SelectionChip +import me.ash.reader.ui.component.base.Subtitle +import me.ash.reader.ui.component.base.TextFieldDialog import me.ash.reader.ui.ext.* @OptIn(ExperimentalMaterialApi::class) diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/GroupOptionViewModel.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/GroupOptionViewModel.kt similarity index 99% rename from app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/GroupOptionViewModel.kt rename to app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/GroupOptionViewModel.kt index f86d43c..e3226c8 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/GroupOptionViewModel.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/GroupOptionViewModel.kt @@ -1,4 +1,4 @@ -package me.ash.reader.ui.page.home.feeds.option.group +package me.ash.reader.ui.page.home.feeds.drawer.group import androidx.compose.material.ExperimentalMaterialApi import androidx.compose.material.ModalBottomSheetState diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/subscribe/ResultView.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/subscribe/ResultView.kt index 65894e6..f6d6dce 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/subscribe/ResultView.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/subscribe/ResultView.kt @@ -30,8 +30,8 @@ import com.google.accompanist.flowlayout.FlowRow import com.google.accompanist.flowlayout.MainAxisAlignment import me.ash.reader.R import me.ash.reader.data.entity.Group -import me.ash.reader.ui.component.SelectionChip -import me.ash.reader.ui.component.Subtitle +import me.ash.reader.ui.component.base.SelectionChip +import me.ash.reader.ui.component.base.Subtitle import me.ash.reader.ui.ext.roundClick import me.ash.reader.ui.theme.palette.alwaysLight diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/subscribe/SubscribeDialog.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/subscribe/SubscribeDialog.kt index 522341b..02a6e6e 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/subscribe/SubscribeDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/subscribe/SubscribeDialog.kt @@ -25,9 +25,9 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.window.DialogProperties import androidx.hilt.navigation.compose.hiltViewModel import me.ash.reader.R -import me.ash.reader.ui.component.ClipboardTextField -import me.ash.reader.ui.component.Dialog -import me.ash.reader.ui.component.TextFieldDialog +import me.ash.reader.ui.component.base.ClipboardTextField +import me.ash.reader.ui.component.base.Dialog +import me.ash.reader.ui.component.base.TextFieldDialog import me.ash.reader.ui.ext.collectAsStateValue @OptIn( diff --git a/app/src/main/java/me/ash/reader/ui/page/home/flow/ArticleItem.kt b/app/src/main/java/me/ash/reader/ui/page/home/flow/ArticleItem.kt index 045f6cd..183265e 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/flow/ArticleItem.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/flow/ArticleItem.kt @@ -23,10 +23,10 @@ import coil.size.Scale import me.ash.reader.R import me.ash.reader.data.entity.ArticleWithFeed import me.ash.reader.data.preference.* -import me.ash.reader.ui.component.AsyncImage -import me.ash.reader.ui.component.Size_1000 +import me.ash.reader.ui.component.base.AsyncImage import me.ash.reader.ui.ext.formatAsString -import me.ash.reader.ui.page.home.FeedIcon +import me.ash.reader.ui.component.FeedIcon +import me.ash.reader.ui.component.base.Size_1000 @Composable fun ArticleItem( diff --git a/app/src/main/java/me/ash/reader/ui/page/home/flow/FlowPage.kt b/app/src/main/java/me/ash/reader/ui/page/home/flow/FlowPage.kt index 81dd07f..0c02b7e 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/flow/FlowPage.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/flow/FlowPage.kt @@ -28,13 +28,13 @@ import me.ash.reader.R import me.ash.reader.data.model.getName import me.ash.reader.data.preference.* import me.ash.reader.data.repository.SyncWorker.Companion.getIsSyncing -import me.ash.reader.ui.component.DisplayText -import me.ash.reader.ui.component.FeedbackIconButton -import me.ash.reader.ui.component.SwipeRefresh +import me.ash.reader.ui.component.FilterBar +import me.ash.reader.ui.component.base.DisplayText +import me.ash.reader.ui.component.base.FeedbackIconButton +import me.ash.reader.ui.component.base.SwipeRefresh import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.surfaceColorAtElevation import me.ash.reader.ui.page.common.RouteName -import me.ash.reader.ui.page.home.FilterBar import me.ash.reader.ui.page.home.FilterState import me.ash.reader.ui.page.home.HomeViewAction import me.ash.reader.ui.page.home.HomeViewModel diff --git a/app/src/main/java/me/ash/reader/ui/page/home/flow/MarkAsReadBar.kt b/app/src/main/java/me/ash/reader/ui/page/home/flow/MarkAsReadBar.kt index 9458e08..5393f19 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/flow/MarkAsReadBar.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/flow/MarkAsReadBar.kt @@ -23,7 +23,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import me.ash.reader.R -import me.ash.reader.ui.component.AnimatedPopup +import me.ash.reader.ui.component.base.AnimatedPopup import me.ash.reader.ui.theme.palette.alwaysLight @Composable diff --git a/app/src/main/java/me/ash/reader/ui/page/home/read/ReadBar.kt b/app/src/main/java/me/ash/reader/ui/page/home/read/ReadBar.kt index ec642b1..14c7ac4 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/read/ReadBar.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/read/ReadBar.kt @@ -23,7 +23,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.compose.ui.zIndex import me.ash.reader.R -import me.ash.reader.ui.component.CanBeDisabledIconButton +import me.ash.reader.ui.component.base.CanBeDisabledIconButton @Composable fun ReadBar( diff --git a/app/src/main/java/me/ash/reader/ui/page/home/read/ReadPage.kt b/app/src/main/java/me/ash/reader/ui/page/home/read/ReadPage.kt index 940819a..0acd12b 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/read/ReadPage.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/read/ReadPage.kt @@ -23,7 +23,7 @@ import androidx.hilt.navigation.compose.hiltViewModel import androidx.navigation.NavHostController import me.ash.reader.R import me.ash.reader.data.entity.ArticleWithFeed -import me.ash.reader.ui.component.FeedbackIconButton +import me.ash.reader.ui.component.base.FeedbackIconButton import me.ash.reader.ui.component.reader.reader import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.drawVerticalScrollbar diff --git a/app/src/main/java/me/ash/reader/ui/page/settings/SettingsPage.kt b/app/src/main/java/me/ash/reader/ui/page/settings/SettingsPage.kt index 620bc52..79d61f3 100644 --- a/app/src/main/java/me/ash/reader/ui/page/settings/SettingsPage.kt +++ b/app/src/main/java/me/ash/reader/ui/page/settings/SettingsPage.kt @@ -20,9 +20,9 @@ import androidx.navigation.NavHostController import kotlinx.coroutines.flow.map import me.ash.reader.R import me.ash.reader.data.model.toVersion -import me.ash.reader.ui.component.Banner -import me.ash.reader.ui.component.DisplayText -import me.ash.reader.ui.component.FeedbackIconButton +import me.ash.reader.ui.component.base.Banner +import me.ash.reader.ui.component.base.DisplayText +import me.ash.reader.ui.component.base.FeedbackIconButton import me.ash.reader.ui.ext.DataStoreKeys import me.ash.reader.ui.ext.dataStore import me.ash.reader.ui.ext.getCurrentVersion diff --git a/app/src/main/java/me/ash/reader/ui/page/settings/color/ColorAndStyle.kt b/app/src/main/java/me/ash/reader/ui/page/settings/color/ColorAndStyle.kt index 012a448..8b68ede 100644 --- a/app/src/main/java/me/ash/reader/ui/page/settings/color/ColorAndStyle.kt +++ b/app/src/main/java/me/ash/reader/ui/page/settings/color/ColorAndStyle.kt @@ -1,6 +1,5 @@ package me.ash.reader.ui.page.settings.color -import android.annotation.SuppressLint import android.content.Context import android.os.Build import androidx.compose.animation.* @@ -27,7 +26,7 @@ import androidx.compose.ui.unit.dp import androidx.navigation.NavHostController import me.ash.reader.R import me.ash.reader.data.preference.* -import me.ash.reader.ui.component.* +import me.ash.reader.ui.component.base.* import me.ash.reader.ui.page.common.RouteName import me.ash.reader.ui.page.settings.SettingItem import me.ash.reader.ui.svg.PALETTE @@ -36,7 +35,6 @@ import me.ash.reader.ui.theme.palette.* import me.ash.reader.ui.theme.palette.TonalPalettes.Companion.toTonalPalettes import me.ash.reader.ui.theme.palette.dynamic.extractTonalPalettesFromUserWallpaper -@SuppressLint("FlowOperatorInvokedInComposition") @OptIn(ExperimentalMaterial3Api::class) @Composable fun ColorAndStyle( @@ -157,7 +155,7 @@ fun ColorAndStyle( } }, ) { - Switch( + me.ash.reader.ui.component.base.Switch( activated = darkTheme.isDarkTheme() ) { darkThemeNot.put(context, scope) diff --git a/app/src/main/java/me/ash/reader/ui/page/settings/color/DarkTheme.kt b/app/src/main/java/me/ash/reader/ui/page/settings/color/DarkTheme.kt index 83c0d11..e8d25c3 100644 --- a/app/src/main/java/me/ash/reader/ui/page/settings/color/DarkTheme.kt +++ b/app/src/main/java/me/ash/reader/ui/page/settings/color/DarkTheme.kt @@ -20,10 +20,10 @@ import me.ash.reader.data.preference.DarkThemePreference import me.ash.reader.data.preference.LocalAmoledDarkTheme import me.ash.reader.data.preference.LocalDarkTheme import me.ash.reader.data.preference.not -import me.ash.reader.ui.component.DisplayText -import me.ash.reader.ui.component.FeedbackIconButton -import me.ash.reader.ui.component.Subtitle -import me.ash.reader.ui.component.Switch +import me.ash.reader.ui.component.base.DisplayText +import me.ash.reader.ui.component.base.FeedbackIconButton +import me.ash.reader.ui.component.base.Subtitle +import me.ash.reader.ui.component.base.Switch import me.ash.reader.ui.page.settings.SettingItem import me.ash.reader.ui.theme.palette.onLight diff --git a/app/src/main/java/me/ash/reader/ui/page/settings/color/feeds/FeedsPageStyle.kt b/app/src/main/java/me/ash/reader/ui/page/settings/color/feeds/FeedsPageStyle.kt index 2f7a95c..70d19c8 100644 --- a/app/src/main/java/me/ash/reader/ui/page/settings/color/feeds/FeedsPageStyle.kt +++ b/app/src/main/java/me/ash/reader/ui/page/settings/color/feeds/FeedsPageStyle.kt @@ -25,9 +25,9 @@ import me.ash.reader.data.entity.Feed import me.ash.reader.data.model.Filter import me.ash.reader.data.entity.Group import me.ash.reader.data.preference.* -import me.ash.reader.ui.component.* +import me.ash.reader.ui.component.base.* import me.ash.reader.ui.ext.surfaceColorAtElevation -import me.ash.reader.ui.page.home.FilterBar +import me.ash.reader.ui.component.FilterBar import me.ash.reader.ui.page.home.feeds.GroupItem import me.ash.reader.ui.page.settings.SettingItem import me.ash.reader.ui.theme.palette.onDark diff --git a/app/src/main/java/me/ash/reader/ui/page/settings/color/flow/FlowPageStyle.kt b/app/src/main/java/me/ash/reader/ui/page/settings/color/flow/FlowPageStyle.kt index 9471ece..ed8fb63 100644 --- a/app/src/main/java/me/ash/reader/ui/page/settings/color/flow/FlowPageStyle.kt +++ b/app/src/main/java/me/ash/reader/ui/page/settings/color/flow/FlowPageStyle.kt @@ -27,9 +27,9 @@ import me.ash.reader.data.entity.ArticleWithFeed import me.ash.reader.data.entity.Feed import me.ash.reader.data.model.Filter import me.ash.reader.data.preference.* -import me.ash.reader.ui.component.* +import me.ash.reader.ui.component.base.* import me.ash.reader.ui.ext.surfaceColorAtElevation -import me.ash.reader.ui.page.home.FilterBar +import me.ash.reader.ui.component.FilterBar import me.ash.reader.ui.page.home.flow.ArticleItem import me.ash.reader.ui.page.settings.SettingItem import me.ash.reader.ui.theme.palette.onDark @@ -158,7 +158,7 @@ fun FlowPageStyle( (!articleListFeedIcon).put(context, scope) }, ) { - Switch(activated = articleListFeedIcon.value) { + me.ash.reader.ui.component.base.Switch(activated = articleListFeedIcon.value) { (!articleListFeedIcon).put(context, scope) } } @@ -168,7 +168,7 @@ fun FlowPageStyle( (!articleListFeedName).put(context, scope) }, ) { - Switch(activated = articleListFeedName.value) { + me.ash.reader.ui.component.base.Switch(activated = articleListFeedName.value) { (!articleListFeedName).put(context, scope) } } @@ -178,7 +178,7 @@ fun FlowPageStyle( (!articleListImage).put(context, scope) }, ) { - Switch(activated = articleListImage.value) { + me.ash.reader.ui.component.base.Switch(activated = articleListImage.value) { (!articleListImage).put(context, scope) } } @@ -188,7 +188,7 @@ fun FlowPageStyle( (!articleListDesc).put(context, scope) }, ) { - Switch(activated = articleListDesc.value) { + me.ash.reader.ui.component.base.Switch(activated = articleListDesc.value) { (!articleListDesc).put(context, scope) } } @@ -198,7 +198,7 @@ fun FlowPageStyle( (!articleListTime).put(context, scope) }, ) { - Switch(activated = articleListTime.value) { + me.ash.reader.ui.component.base.Switch(activated = articleListTime.value) { (!articleListTime).put(context, scope) } } @@ -208,7 +208,7 @@ fun FlowPageStyle( (!articleListStickyDate).put(context, scope) }, ) { - Switch(activated = articleListStickyDate.value) { + me.ash.reader.ui.component.base.Switch(activated = articleListStickyDate.value) { (!articleListStickyDate).put(context, scope) } } @@ -242,7 +242,7 @@ fun FlowPageStyle( (!filterBarFilled).put(context, scope) }, ) { - Switch(activated = filterBarFilled.value) { + me.ash.reader.ui.component.base.Switch(activated = filterBarFilled.value) { (!filterBarFilled).put(context, scope) } } diff --git a/app/src/main/java/me/ash/reader/ui/page/settings/interaction/Interaction.kt b/app/src/main/java/me/ash/reader/ui/page/settings/interaction/Interaction.kt index ca362b6..144e432 100644 --- a/app/src/main/java/me/ash/reader/ui/page/settings/interaction/Interaction.kt +++ b/app/src/main/java/me/ash/reader/ui/page/settings/interaction/Interaction.kt @@ -1,6 +1,5 @@ package me.ash.reader.ui.page.settings.interaction -import android.annotation.SuppressLint import androidx.compose.foundation.background import androidx.compose.foundation.layout.* import androidx.compose.foundation.lazy.LazyColumn @@ -17,13 +16,13 @@ import kotlinx.coroutines.flow.map import kotlinx.coroutines.launch import me.ash.reader.R import me.ash.reader.ui.component.* +import me.ash.reader.ui.component.base.* import me.ash.reader.ui.ext.DataStoreKeys import me.ash.reader.ui.ext.dataStore import me.ash.reader.ui.ext.put import me.ash.reader.ui.page.settings.SettingItem import me.ash.reader.ui.theme.palette.onLight -@SuppressLint("FlowOperatorInvokedInComposition") @OptIn(ExperimentalMaterial3Api::class) @Composable fun Interaction( diff --git a/app/src/main/java/me/ash/reader/ui/page/settings/languages/Languages.kt b/app/src/main/java/me/ash/reader/ui/page/settings/languages/Languages.kt index 66edf01..927f1d2 100644 --- a/app/src/main/java/me/ash/reader/ui/page/settings/languages/Languages.kt +++ b/app/src/main/java/me/ash/reader/ui/page/settings/languages/Languages.kt @@ -23,9 +23,9 @@ import androidx.navigation.NavHostController import me.ash.reader.R import me.ash.reader.data.preference.LanguagesPreference import me.ash.reader.data.preference.LocalLanguages -import me.ash.reader.ui.component.Banner -import me.ash.reader.ui.component.DisplayText -import me.ash.reader.ui.component.FeedbackIconButton +import me.ash.reader.ui.component.base.Banner +import me.ash.reader.ui.component.base.DisplayText +import me.ash.reader.ui.component.base.FeedbackIconButton import me.ash.reader.ui.page.settings.SettingItem import me.ash.reader.ui.theme.palette.onLight diff --git a/app/src/main/java/me/ash/reader/ui/page/settings/tips/TipsAndSupport.kt b/app/src/main/java/me/ash/reader/ui/page/settings/tips/TipsAndSupport.kt index b9f0b76..2da3e1d 100644 --- a/app/src/main/java/me/ash/reader/ui/page/settings/tips/TipsAndSupport.kt +++ b/app/src/main/java/me/ash/reader/ui/page/settings/tips/TipsAndSupport.kt @@ -36,8 +36,8 @@ import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import androidx.navigation.NavHostController import me.ash.reader.R -import me.ash.reader.ui.component.CurlyCornerShape -import me.ash.reader.ui.component.FeedbackIconButton +import me.ash.reader.ui.component.base.CurlyCornerShape +import me.ash.reader.ui.component.base.FeedbackIconButton import me.ash.reader.ui.ext.* import me.ash.reader.ui.theme.palette.alwaysLight import me.ash.reader.ui.theme.palette.onLight diff --git a/app/src/main/java/me/ash/reader/ui/page/settings/tips/UpdateDialog.kt b/app/src/main/java/me/ash/reader/ui/page/settings/tips/UpdateDialog.kt index d1e1cf1..2dcd32b 100644 --- a/app/src/main/java/me/ash/reader/ui/page/settings/tips/UpdateDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/page/settings/tips/UpdateDialog.kt @@ -35,7 +35,7 @@ import kotlinx.coroutines.flow.map import kotlinx.coroutines.launch import me.ash.reader.R import me.ash.reader.data.source.Download -import me.ash.reader.ui.component.Dialog +import me.ash.reader.ui.component.base.Dialog import me.ash.reader.ui.ext.* @SuppressLint("FlowOperatorInvokedInComposition") diff --git a/app/src/main/java/me/ash/reader/ui/page/startup/StartupPage.kt b/app/src/main/java/me/ash/reader/ui/page/startup/StartupPage.kt index cc30fbd..88d96b0 100644 --- a/app/src/main/java/me/ash/reader/ui/page/startup/StartupPage.kt +++ b/app/src/main/java/me/ash/reader/ui/page/startup/StartupPage.kt @@ -18,9 +18,9 @@ import androidx.navigation.NavHostController import com.ireward.htmlcompose.HtmlText import kotlinx.coroutines.launch import me.ash.reader.R -import me.ash.reader.ui.component.DisplayText -import me.ash.reader.ui.component.DynamicSVGImage -import me.ash.reader.ui.component.Tips +import me.ash.reader.ui.component.base.DisplayText +import me.ash.reader.ui.component.base.DynamicSVGImage +import me.ash.reader.ui.component.base.Tips import me.ash.reader.ui.ext.DataStoreKeys import me.ash.reader.ui.ext.dataStore import me.ash.reader.ui.ext.put