Move the package

This commit is contained in:
Ash 2022-05-18 02:58:30 +08:00
parent b33e0a7ac5
commit 140cb3ed0a
62 changed files with 147 additions and 159 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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.*

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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(

View File

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

View File

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

View File

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

View File

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

View File

@ -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)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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)

View File

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

View File

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

View File

@ -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(

View File

@ -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(

View File

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

View File

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

View File

@ -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(

View File

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

View File

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

View File

@ -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)

View File

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

View File

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

View File

@ -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)
}
}

View File

@ -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(

View File

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

View File

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

View File

@ -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")

View File

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