From 647ef7a0bd33f716fbe77f502bfd3167e620b4d1 Mon Sep 17 00:00:00 2001 From: Ash Date: Sat, 21 May 2022 18:42:27 +0800 Subject: [PATCH] Rename RY component --- .../2.json | 321 ++++++++++++++++++ app/src/main/AndroidManifest.xml | 2 +- .../java/me/ash/reader/{App.kt => RYApp.kt} | 14 +- .../ash/reader/data/module/DatabaseModule.kt | 22 +- .../ash/reader/data/module/RetrofitModule.kt | 6 +- .../{AppRepository.kt => RYRepository.kt} | 10 +- .../{ReaderDatabase.kt => RYDatabase.kt} | 10 +- ...rkDataSource.kt => RYNetworkDataSource.kt} | 8 +- .../ui/component/base/BlockRadioButton.kt | 2 +- .../ui/component/base/ClipboardTextField.kt | 2 +- .../ui/component/base/DynamicSVGImage.kt | 2 +- .../base/{AsyncImage.kt => RYAsyncImage.kt} | 2 +- .../component/base/{Dialog.kt => RYDialog.kt} | 2 +- .../base/{Scaffold.kt => RYScaffold.kt} | 2 +- .../component/base/{Switch.kt => RYSwitch.kt} | 4 +- .../base/{TextField.kt => RYTextField.kt} | 2 +- .../reader/ui/component/base/RadioDialog.kt | 2 +- .../ui/component/base/TextFieldDialog.kt | 2 +- .../ui/component/reader/HtmlToComposable.kt | 6 +- .../reader/ui/page/home/feeds/FeedsPage.kt | 7 +- .../home/feeds/drawer/feed/ClearFeedDialog.kt | 4 +- .../feeds/drawer/feed/DeleteFeedDialog.kt | 4 +- .../group/AllAllowNotificationDialog.kt | 4 +- .../drawer/group/AllMoveToGroupDialog.kt | 4 +- .../drawer/group/AllParseFullContentDialog.kt | 4 +- .../feeds/drawer/group/ClearGroupDialog.kt | 4 +- .../feeds/drawer/group/DeleteGroupDialog.kt | 4 +- .../home/feeds/subscribe/SubscribeDialog.kt | 4 +- .../reader/ui/page/home/flow/ArticleItem.kt | 4 +- .../ash/reader/ui/page/home/flow/FlowPage.kt | 3 +- .../ui/page/home/reading/ReadingPage.kt | 3 +- .../reader/ui/page/settings/SettingsPage.kt | 3 +- .../page/settings/color/ColorAndStylePage.kt | 6 +- .../ui/page/settings/color/DarkThemePage.kt | 9 +- .../color/feeds/FeedsPageStylePage.kt | 6 +- .../settings/color/flow/FlowPageStylePage.kt | 17 +- .../settings/interaction/InteractionPage.kt | 2 +- .../page/settings/languages/LanguagesPage.kt | 3 +- .../page/settings/tips/TipsAndSupportPage.kt | 3 +- .../ui/page/settings/tips/UpdateDialog.kt | 4 +- .../ui/page/settings/tips/UpdateViewModel.kt | 8 +- .../ash/reader/ui/page/startup/StartupPage.kt | 3 +- 42 files changed, 427 insertions(+), 107 deletions(-) create mode 100644 app/schemas/me.ash.reader.data.source.RYDatabase/2.json rename app/src/main/java/me/ash/reader/{App.kt => RYApp.kt} (89%) rename app/src/main/java/me/ash/reader/data/repository/{AppRepository.kt => RYRepository.kt} (92%) rename app/src/main/java/me/ash/reader/data/source/{ReaderDatabase.kt => RYDatabase.kt} (86%) rename app/src/main/java/me/ash/reader/data/source/{AppNetworkDataSource.kt => RYNetworkDataSource.kt} (93%) rename app/src/main/java/me/ash/reader/ui/component/base/{AsyncImage.kt => RYAsyncImage.kt} (99%) rename app/src/main/java/me/ash/reader/ui/component/base/{Dialog.kt => RYDialog.kt} (98%) rename app/src/main/java/me/ash/reader/ui/component/base/{Scaffold.kt => RYScaffold.kt} (99%) rename app/src/main/java/me/ash/reader/ui/component/base/{Switch.kt => RYSwitch.kt} (98%) rename app/src/main/java/me/ash/reader/ui/component/base/{TextField.kt => RYTextField.kt} (99%) diff --git a/app/schemas/me.ash.reader.data.source.RYDatabase/2.json b/app/schemas/me.ash.reader.data.source.RYDatabase/2.json new file mode 100644 index 0000000..5690ca5 --- /dev/null +++ b/app/schemas/me.ash.reader.data.source.RYDatabase/2.json @@ -0,0 +1,321 @@ +{ + "formatVersion": 1, + "database": { + "version": 2, + "identityHash": "98462c2e9c32394054102313366e7262", + "entities": [ + { + "tableName": "account", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `name` TEXT NOT NULL, `type` INTEGER NOT NULL, `updateAt` INTEGER)", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "updateAt", + "columnName": "updateAt", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "id" + ] + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "feed", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `icon` TEXT, `url` TEXT NOT NULL, `groupId` TEXT NOT NULL, `accountId` INTEGER NOT NULL, `isNotification` INTEGER NOT NULL DEFAULT false, `isFullContent` INTEGER NOT NULL DEFAULT false, PRIMARY KEY(`id`), FOREIGN KEY(`groupId`) REFERENCES `group`(`id`) ON UPDATE CASCADE ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "icon", + "columnName": "icon", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "url", + "columnName": "url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "groupId", + "columnName": "groupId", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "accountId", + "columnName": "accountId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isNotification", + "columnName": "isNotification", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "false" + }, + { + "fieldPath": "isFullContent", + "columnName": "isFullContent", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "false" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_feed_groupId", + "unique": false, + "columnNames": [ + "groupId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_feed_groupId` ON `${TABLE_NAME}` (`groupId`)" + }, + { + "name": "index_feed_accountId", + "unique": false, + "columnNames": [ + "accountId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_feed_accountId` ON `${TABLE_NAME}` (`accountId`)" + } + ], + "foreignKeys": [ + { + "table": "group", + "onDelete": "CASCADE", + "onUpdate": "CASCADE", + "columns": [ + "groupId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "article", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `date` INTEGER NOT NULL, `title` TEXT NOT NULL, `author` TEXT, `rawDescription` TEXT NOT NULL, `shortDescription` TEXT NOT NULL, `fullContent` TEXT, `img` TEXT, `link` TEXT NOT NULL, `feedId` TEXT NOT NULL, `accountId` INTEGER NOT NULL, `isUnread` INTEGER NOT NULL DEFAULT true, `isStarred` INTEGER NOT NULL DEFAULT false, `isReadLater` INTEGER NOT NULL DEFAULT false, PRIMARY KEY(`id`), FOREIGN KEY(`feedId`) REFERENCES `feed`(`id`) ON UPDATE CASCADE ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "date", + "columnName": "date", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "title", + "columnName": "title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "author", + "columnName": "author", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "rawDescription", + "columnName": "rawDescription", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "shortDescription", + "columnName": "shortDescription", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "fullContent", + "columnName": "fullContent", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "img", + "columnName": "img", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "link", + "columnName": "link", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "feedId", + "columnName": "feedId", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "accountId", + "columnName": "accountId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isUnread", + "columnName": "isUnread", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "true" + }, + { + "fieldPath": "isStarred", + "columnName": "isStarred", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "false" + }, + { + "fieldPath": "isReadLater", + "columnName": "isReadLater", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "false" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_article_feedId", + "unique": false, + "columnNames": [ + "feedId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_article_feedId` ON `${TABLE_NAME}` (`feedId`)" + }, + { + "name": "index_article_accountId", + "unique": false, + "columnNames": [ + "accountId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_article_accountId` ON `${TABLE_NAME}` (`accountId`)" + } + ], + "foreignKeys": [ + { + "table": "feed", + "onDelete": "CASCADE", + "onUpdate": "CASCADE", + "columns": [ + "feedId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "group", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `accountId` INTEGER NOT NULL, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "accountId", + "columnName": "accountId", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_group_accountId", + "unique": false, + "columnNames": [ + "accountId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_group_accountId` ON `${TABLE_NAME}` (`accountId`)" + } + ], + "foreignKeys": [] + } + ], + "views": [], + "setupQueries": [ + "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '98462c2e9c32394054102313366e7262')" + ] + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 5830478..9976f51 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -6,7 +6,7 @@ { withContext(dispatcherMain) { @@ -85,7 +85,7 @@ class AppRepository @Inject constructor( withContext(dispatcherIO) { Log.i("RLog", "downloadFile start: $url") try { - return@withContext appNetworkDataSource.downloadFile(url) + return@withContext RYNetworkDataSource.downloadFile(url) .downloadToFileWithProgress(context.getLatestApk()) } catch (e: Exception) { e.printStackTrace() diff --git a/app/src/main/java/me/ash/reader/data/source/ReaderDatabase.kt b/app/src/main/java/me/ash/reader/data/source/RYDatabase.kt similarity index 86% rename from app/src/main/java/me/ash/reader/data/source/ReaderDatabase.kt rename to app/src/main/java/me/ash/reader/data/source/RYDatabase.kt index 2fa0971..e3cf064 100644 --- a/app/src/main/java/me/ash/reader/data/source/ReaderDatabase.kt +++ b/app/src/main/java/me/ash/reader/data/source/RYDatabase.kt @@ -18,21 +18,21 @@ import java.util.* entities = [Account::class, Feed::class, Article::class, Group::class], version = 2, ) -@TypeConverters(ReaderDatabase.Converters::class) -abstract class ReaderDatabase : RoomDatabase() { +@TypeConverters(RYDatabase.Converters::class) +abstract class RYDatabase : RoomDatabase() { abstract fun accountDao(): AccountDao abstract fun feedDao(): FeedDao abstract fun articleDao(): ArticleDao abstract fun groupDao(): GroupDao companion object { - private var instance: ReaderDatabase? = null + private var instance: RYDatabase? = null - fun getInstance(context: Context): ReaderDatabase { + fun getInstance(context: Context): RYDatabase { return instance ?: synchronized(this) { instance ?: Room.databaseBuilder( context.applicationContext, - ReaderDatabase::class.java, + RYDatabase::class.java, "Reader" ).addMigrations(*allMigrations).build().also { instance = it diff --git a/app/src/main/java/me/ash/reader/data/source/AppNetworkDataSource.kt b/app/src/main/java/me/ash/reader/data/source/RYNetworkDataSource.kt similarity index 93% rename from app/src/main/java/me/ash/reader/data/source/AppNetworkDataSource.kt rename to app/src/main/java/me/ash/reader/data/source/RYNetworkDataSource.kt index df0709e..f1e4fdc 100644 --- a/app/src/main/java/me/ash/reader/data/source/AppNetworkDataSource.kt +++ b/app/src/main/java/me/ash/reader/data/source/RYNetworkDataSource.kt @@ -14,7 +14,7 @@ import retrofit2.http.Streaming import retrofit2.http.Url import java.io.File -interface AppNetworkDataSource { +interface RYNetworkDataSource { @GET suspend fun getReleaseLatest(@Url url: String): Response @@ -23,14 +23,14 @@ interface AppNetworkDataSource { suspend fun downloadFile(@Url url: String): ResponseBody companion object { - private var instance: AppNetworkDataSource? = null + private var instance: RYNetworkDataSource? = null - fun getInstance(): AppNetworkDataSource { + fun getInstance(): RYNetworkDataSource { return instance ?: synchronized(this) { instance ?: Retrofit.Builder() .baseUrl("https://api.github.com/") .addConverterFactory(GsonConverterFactory.create()) - .build().create(AppNetworkDataSource::class.java).also { + .build().create(RYNetworkDataSource::class.java).also { instance = it } } diff --git a/app/src/main/java/me/ash/reader/ui/component/base/BlockRadioButton.kt b/app/src/main/java/me/ash/reader/ui/component/base/BlockRadioButton.kt index adc29f1..533f643 100644 --- a/app/src/main/java/me/ash/reader/ui/component/base/BlockRadioButton.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/BlockRadioButton.kt @@ -7,7 +7,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp @Composable -fun BlockRadioGroupButton( +fun BlockRadioButton( modifier: Modifier = Modifier, selected: Int = 0, onSelected: (Int) -> Unit, diff --git a/app/src/main/java/me/ash/reader/ui/component/base/ClipboardTextField.kt b/app/src/main/java/me/ash/reader/ui/component/base/ClipboardTextField.kt index e48d901..cff26ee 100644 --- a/app/src/main/java/me/ash/reader/ui/component/base/ClipboardTextField.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/ClipboardTextField.kt @@ -32,7 +32,7 @@ fun ClipboardTextField( ) { Column(modifier = modifier) { Spacer(modifier = Modifier.height(10.dp)) - TextField( + RYTextField( readOnly = readOnly, value = value, onValueChange = onValueChange, diff --git a/app/src/main/java/me/ash/reader/ui/component/base/DynamicSVGImage.kt b/app/src/main/java/me/ash/reader/ui/component/base/DynamicSVGImage.kt index da97da5..1240cd5 100644 --- a/app/src/main/java/me/ash/reader/ui/component/base/DynamicSVGImage.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/DynamicSVGImage.kt @@ -41,7 +41,7 @@ fun DynamicSVGImage( }, ) { Crossfade(targetState = pic) { - AsyncImage( + RYAsyncImage( contentDescription = contentDescription, data = it, placeholder = null, diff --git a/app/src/main/java/me/ash/reader/ui/component/base/AsyncImage.kt b/app/src/main/java/me/ash/reader/ui/component/base/RYAsyncImage.kt similarity index 99% rename from app/src/main/java/me/ash/reader/ui/component/base/AsyncImage.kt rename to app/src/main/java/me/ash/reader/ui/component/base/RYAsyncImage.kt index 039e2ce..c33cd0c 100644 --- a/app/src/main/java/me/ash/reader/ui/component/base/AsyncImage.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/RYAsyncImage.kt @@ -22,7 +22,7 @@ import me.ash.reader.R val Size_1000 = Size(1000, 1000) @Composable -fun AsyncImage( +fun RYAsyncImage( modifier: Modifier = Modifier, data: Any? = null, size: Size = Size.ORIGINAL, diff --git a/app/src/main/java/me/ash/reader/ui/component/base/Dialog.kt b/app/src/main/java/me/ash/reader/ui/component/base/RYDialog.kt similarity index 98% rename from app/src/main/java/me/ash/reader/ui/component/base/Dialog.kt rename to app/src/main/java/me/ash/reader/ui/component/base/RYDialog.kt index ff7f6c0..00d70f0 100644 --- a/app/src/main/java/me/ash/reader/ui/component/base/Dialog.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/RYDialog.kt @@ -6,7 +6,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.window.DialogProperties @Composable -fun Dialog( +fun RYDialog( modifier: Modifier = Modifier, visible: Boolean, properties: DialogProperties = DialogProperties(), diff --git a/app/src/main/java/me/ash/reader/ui/component/base/Scaffold.kt b/app/src/main/java/me/ash/reader/ui/component/base/RYScaffold.kt similarity index 99% rename from app/src/main/java/me/ash/reader/ui/component/base/Scaffold.kt rename to app/src/main/java/me/ash/reader/ui/component/base/RYScaffold.kt index d3a7856..c2c3ffe 100644 --- a/app/src/main/java/me/ash/reader/ui/component/base/Scaffold.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/RYScaffold.kt @@ -18,7 +18,7 @@ import me.ash.reader.ui.theme.palette.onDark @OptIn(ExperimentalMaterial3Api::class) @Composable -fun Scaffold( +fun RYScaffold( containerColor: Color = MaterialTheme.colorScheme.surface, topBarTonalElevation: Dp = 0.dp, containerTonalElevation: Dp = 0.dp, diff --git a/app/src/main/java/me/ash/reader/ui/component/base/Switch.kt b/app/src/main/java/me/ash/reader/ui/component/base/RYSwitch.kt similarity index 98% rename from app/src/main/java/me/ash/reader/ui/component/base/Switch.kt rename to app/src/main/java/me/ash/reader/ui/component/base/RYSwitch.kt index ea2640a..ce9b972 100644 --- a/app/src/main/java/me/ash/reader/ui/component/base/Switch.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/RYSwitch.kt @@ -31,7 +31,7 @@ import me.ash.reader.ui.theme.palette.onDark // TODO: ripple & swipe @Composable -fun Switch( +fun RYSwitch( modifier: Modifier = Modifier, activated: Boolean, enable: Boolean = true, @@ -101,7 +101,7 @@ fun SwitchHeadline( ) } Box(Modifier.padding(start = 20.dp)) { - Switch(activated = activated) + RYSwitch(activated = activated) } } } diff --git a/app/src/main/java/me/ash/reader/ui/component/base/TextField.kt b/app/src/main/java/me/ash/reader/ui/component/base/RYTextField.kt similarity index 99% rename from app/src/main/java/me/ash/reader/ui/component/base/TextField.kt rename to app/src/main/java/me/ash/reader/ui/component/base/RYTextField.kt index a697795..12dad9e 100644 --- a/app/src/main/java/me/ash/reader/ui/component/base/TextField.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/RYTextField.kt @@ -19,7 +19,7 @@ import kotlinx.coroutines.delay import me.ash.reader.R @Composable -fun TextField( +fun RYTextField( readOnly: Boolean, value: String, onValueChange: (String) -> Unit, diff --git a/app/src/main/java/me/ash/reader/ui/component/base/RadioDialog.kt b/app/src/main/java/me/ash/reader/ui/component/base/RadioDialog.kt index d7b7136..8363208 100644 --- a/app/src/main/java/me/ash/reader/ui/component/base/RadioDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/RadioDialog.kt @@ -29,7 +29,7 @@ fun RadioDialog( options: List = emptyList(), onDismissRequest: () -> Unit = {}, ) { - Dialog( + RYDialog( modifier = modifier, visible = visible, onDismissRequest = onDismissRequest, diff --git a/app/src/main/java/me/ash/reader/ui/component/base/TextFieldDialog.kt b/app/src/main/java/me/ash/reader/ui/component/base/TextFieldDialog.kt index b92d2e7..4646188 100644 --- a/app/src/main/java/me/ash/reader/ui/component/base/TextFieldDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/component/base/TextFieldDialog.kt @@ -35,7 +35,7 @@ fun TextFieldDialog( ) { val focusManager = LocalFocusManager.current - Dialog( + RYDialog( modifier = modifier, visible = visible, onDismissRequest = onDismissRequest, 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 4288193..e5262ed 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.base.AsyncImage +import me.ash.reader.ui.component.base.RYAsyncImage import org.jsoup.Jsoup import org.jsoup.helper.StringUtil import org.jsoup.nodes.Element @@ -465,7 +465,7 @@ private fun TextComposer.appendTextChildren( // } ) { val imageSize = maxImageSize() - AsyncImage( + RYAsyncImage( modifier = Modifier.fillMaxWidth(), data = imageCandidates.getBestImageForMaxSize( pixelDensity = pixelDensity(), @@ -591,7 +591,7 @@ private fun TextComposer.appendTextChildren( BoxWithConstraints( modifier = Modifier.fillMaxWidth() ) { - AsyncImage( + RYAsyncImage( modifier = Modifier .clickable { onLinkClick(video.link) 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 4feb513..d05e283 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 @@ -30,10 +30,7 @@ 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.FilterBar -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.component.base.* import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.findActivity import me.ash.reader.ui.ext.getCurrentVersion @@ -113,7 +110,7 @@ fun FeedsPage( context.findActivity()?.moveTaskToBack(false) } - me.ash.reader.ui.component.base.Scaffold( + RYScaffold( topBarTonalElevation = topBarTonalElevation.value.dp, containerTonalElevation = groupListTonalElevation.value.dp, navigationIcon = { diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/feed/ClearFeedDialog.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/feed/ClearFeedDialog.kt index 412c76a..5014237 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/feed/ClearFeedDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/feed/ClearFeedDialog.kt @@ -11,7 +11,7 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.hilt.navigation.compose.hiltViewModel import me.ash.reader.R -import me.ash.reader.ui.component.base.Dialog +import me.ash.reader.ui.component.base.RYDialog import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.showToast @@ -25,7 +25,7 @@ fun ClearFeedDialog( val scope = rememberCoroutineScope() val toastString = stringResource(R.string.clear_articles_in_feed_toast, feedName) - Dialog( + RYDialog( visible = feedOptionUiState.clearDialogVisible, onDismissRequest = { feedOptionViewModel.hideClearDialog() diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/feed/DeleteFeedDialog.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/feed/DeleteFeedDialog.kt index 564d529..1bd1f1d 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/feed/DeleteFeedDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/feed/DeleteFeedDialog.kt @@ -11,7 +11,7 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.hilt.navigation.compose.hiltViewModel import me.ash.reader.R -import me.ash.reader.ui.component.base.Dialog +import me.ash.reader.ui.component.base.RYDialog import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.showToast @@ -25,7 +25,7 @@ fun DeleteFeedDialog( val scope = rememberCoroutineScope() val toastString = stringResource(R.string.delete_toast, feedName) - Dialog( + RYDialog( visible = feedOptionUiState.deleteDialogVisible, onDismissRequest = { feedOptionViewModel.hideDeleteDialog() diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/AllAllowNotificationDialog.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/AllAllowNotificationDialog.kt index d9c5094..afe1068 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/AllAllowNotificationDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/AllAllowNotificationDialog.kt @@ -11,7 +11,7 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.hilt.navigation.compose.hiltViewModel import me.ash.reader.R -import me.ash.reader.ui.component.base.Dialog +import me.ash.reader.ui.component.base.RYDialog import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.showToast @@ -26,7 +26,7 @@ fun AllAllowNotificationDialog( val allowToastString = stringResource(R.string.all_allow_notification_toast, groupName) val denyToastString = stringResource(R.string.all_deny_notification_toast, groupName) - Dialog( + RYDialog( visible = groupOptionUiState.allAllowNotificationDialogVisible, onDismissRequest = { groupOptionViewModel.hideAllAllowNotificationDialog() diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/AllMoveToGroupDialog.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/AllMoveToGroupDialog.kt index 79c2f53..408c225 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/AllMoveToGroupDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/AllMoveToGroupDialog.kt @@ -11,7 +11,7 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.hilt.navigation.compose.hiltViewModel import me.ash.reader.R -import me.ash.reader.ui.component.base.Dialog +import me.ash.reader.ui.component.base.RYDialog import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.showToast @@ -28,7 +28,7 @@ fun AllMoveToGroupDialog( groupOptionUiState.targetGroup?.name ?: "" ) - Dialog( + RYDialog( visible = groupOptionUiState.allMoveToGroupDialogVisible, onDismissRequest = { groupOptionViewModel.hideAllMoveToGroupDialog() diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/AllParseFullContentDialog.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/AllParseFullContentDialog.kt index 00e5abc..7a5b747 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/AllParseFullContentDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/AllParseFullContentDialog.kt @@ -11,7 +11,7 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.hilt.navigation.compose.hiltViewModel import me.ash.reader.R -import me.ash.reader.ui.component.base.Dialog +import me.ash.reader.ui.component.base.RYDialog import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.showToast @@ -26,7 +26,7 @@ fun AllParseFullContentDialog( val allowToastString = stringResource(R.string.all_parse_full_content_toast, groupName) val denyToastString = stringResource(R.string.all_deny_parse_full_content_toast, groupName) - Dialog( + RYDialog( visible = groupOptionUiState.allParseFullContentDialogVisible, onDismissRequest = { groupOptionViewModel.hideAllParseFullContentDialog() diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/ClearGroupDialog.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/ClearGroupDialog.kt index 44b81b9..fadd2a2 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/ClearGroupDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/ClearGroupDialog.kt @@ -11,7 +11,7 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.hilt.navigation.compose.hiltViewModel import me.ash.reader.R -import me.ash.reader.ui.component.base.Dialog +import me.ash.reader.ui.component.base.RYDialog import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.showToast @@ -25,7 +25,7 @@ fun ClearGroupDialog( val scope = rememberCoroutineScope() val toastString = stringResource(R.string.clear_articles_in_group_toast, groupName) - Dialog( + RYDialog( visible = groupOptionUiState.clearDialogVisible, onDismissRequest = { groupOptionViewModel.hideClearDialog() diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/DeleteGroupDialog.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/DeleteGroupDialog.kt index f9593dc..9809fec 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/DeleteGroupDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/DeleteGroupDialog.kt @@ -11,7 +11,7 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.hilt.navigation.compose.hiltViewModel import me.ash.reader.R -import me.ash.reader.ui.component.base.Dialog +import me.ash.reader.ui.component.base.RYDialog import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.showToast @@ -25,7 +25,7 @@ fun DeleteGroupDialog( val scope = rememberCoroutineScope() val toastString = stringResource(R.string.delete_toast, groupName) - Dialog( + RYDialog( visible = groupOptionUiState.deleteDialogVisible, onDismissRequest = { groupOptionViewModel.hideDeleteDialog() 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 675d160..4e44430 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 @@ -26,7 +26,7 @@ import androidx.compose.ui.window.DialogProperties import androidx.hilt.navigation.compose.hiltViewModel import me.ash.reader.R import me.ash.reader.ui.component.base.ClipboardTextField -import me.ash.reader.ui.component.base.Dialog +import me.ash.reader.ui.component.base.RYDialog import me.ash.reader.ui.component.base.TextFieldDialog import me.ash.reader.ui.ext.collectAsStateValue @@ -60,7 +60,7 @@ fun SubscribeDialog( } } - Dialog( + RYDialog( modifier = Modifier.padding(horizontal = 44.dp), visible = subscribeUiState.visible, properties = DialogProperties(usePlatformDefaultWidth = false), 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 183265e..819b0ca 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,7 +23,7 @@ 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.base.AsyncImage +import me.ash.reader.ui.component.base.RYAsyncImage import me.ash.reader.ui.ext.formatAsString import me.ash.reader.ui.component.FeedIcon import me.ash.reader.ui.component.base.Size_1000 @@ -139,7 +139,7 @@ fun ArticleItem( // Image if (articleWithFeed.article.img != null && articleListImage.value) { - AsyncImage( + RYAsyncImage( modifier = Modifier .padding(start = 10.dp) .size(80.dp) 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 0aebc58..b67e8f5 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 @@ -30,6 +30,7 @@ import me.ash.reader.data.repository.SyncWorker.Companion.getIsSyncing 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.RYScaffold import me.ash.reader.ui.component.base.SwipeRefresh import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.page.common.RouteName @@ -100,7 +101,7 @@ fun FlowPage( onSearch = false } - me.ash.reader.ui.component.base.Scaffold( + RYScaffold( topBarTonalElevation = topBarTonalElevation.value.dp, containerTonalElevation = articleListTonalElevation.value.dp, navigationIcon = { diff --git a/app/src/main/java/me/ash/reader/ui/page/home/reading/ReadingPage.kt b/app/src/main/java/me/ash/reader/ui/page/home/reading/ReadingPage.kt index b856446..e1bf4e6 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/reading/ReadingPage.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/reading/ReadingPage.kt @@ -27,6 +27,7 @@ import androidx.navigation.NavHostController import me.ash.reader.R import me.ash.reader.data.entity.ArticleWithFeed import me.ash.reader.ui.component.base.FeedbackIconButton +import me.ash.reader.ui.component.base.RYScaffold import me.ash.reader.ui.component.reader.reader import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.drawVerticalScrollbar @@ -56,7 +57,7 @@ fun ReadingPage( } } - me.ash.reader.ui.component.base.Scaffold( + RYScaffold( content = { Box(Modifier.fillMaxSize()) { Box( 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 a643c41..9d13f7f 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 @@ -25,6 +25,7 @@ import me.ash.reader.data.preference.LocalSkipVersionNumber 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.RYScaffold import me.ash.reader.ui.ext.getCurrentVersion import me.ash.reader.ui.page.common.RouteName import me.ash.reader.ui.page.settings.tips.UpdateDialog @@ -41,7 +42,7 @@ fun SettingsPage( val skipVersion = LocalSkipVersionNumber.current val currentVersion by remember { mutableStateOf(context.getCurrentVersion()) } - me.ash.reader.ui.component.base.Scaffold( + RYScaffold( containerColor = MaterialTheme.colorScheme.surface onLight MaterialTheme.colorScheme.inverseOnSurface, navigationIcon = { FeedbackIconButton( diff --git a/app/src/main/java/me/ash/reader/ui/page/settings/color/ColorAndStylePage.kt b/app/src/main/java/me/ash/reader/ui/page/settings/color/ColorAndStylePage.kt index 09645b7..818498e 100644 --- a/app/src/main/java/me/ash/reader/ui/page/settings/color/ColorAndStylePage.kt +++ b/app/src/main/java/me/ash/reader/ui/page/settings/color/ColorAndStylePage.kt @@ -50,7 +50,7 @@ fun ColorAndStylePage( val wallpaperTonalPalettes = extractTonalPalettesFromUserWallpaper() var radioButtonSelected by remember { mutableStateOf(if (themeIndex > 4) 0 else 1) } - me.ash.reader.ui.component.base.Scaffold( + RYScaffold( containerColor = MaterialTheme.colorScheme.surface onLight MaterialTheme.colorScheme.inverseOnSurface, navigationIcon = { FeedbackIconButton( @@ -90,7 +90,7 @@ fun ColorAndStylePage( Spacer(modifier = Modifier.height(24.dp)) } item { - BlockRadioGroupButton( + BlockRadioButton( selected = radioButtonSelected, onSelected = { radioButtonSelected = it }, itemRadioGroups = listOf( @@ -142,7 +142,7 @@ fun ColorAndStylePage( } }, ) { - me.ash.reader.ui.component.base.Switch( + RYSwitch( activated = darkTheme.isDarkTheme() ) { darkThemeNot.put(context, scope) diff --git a/app/src/main/java/me/ash/reader/ui/page/settings/color/DarkThemePage.kt b/app/src/main/java/me/ash/reader/ui/page/settings/color/DarkThemePage.kt index 588ac2d..88b7441 100644 --- a/app/src/main/java/me/ash/reader/ui/page/settings/color/DarkThemePage.kt +++ b/app/src/main/java/me/ash/reader/ui/page/settings/color/DarkThemePage.kt @@ -19,10 +19,7 @@ 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.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.component.base.* import me.ash.reader.ui.page.settings.SettingItem import me.ash.reader.ui.theme.palette.onLight @@ -36,7 +33,7 @@ fun DarkThemePage( val amoledDarkTheme = LocalAmoledDarkTheme.current val scope = rememberCoroutineScope() - me.ash.reader.ui.component.base.Scaffold( + RYScaffold( containerColor = MaterialTheme.colorScheme.surface onLight MaterialTheme.colorScheme.inverseOnSurface, navigationIcon = { FeedbackIconButton( @@ -75,7 +72,7 @@ fun DarkThemePage( (!amoledDarkTheme).put(context, scope) }, ) { - Switch(activated = amoledDarkTheme.value) { + RYSwitch(activated = amoledDarkTheme.value) { (!amoledDarkTheme).put(context, scope) } } diff --git a/app/src/main/java/me/ash/reader/ui/page/settings/color/feeds/FeedsPageStylePage.kt b/app/src/main/java/me/ash/reader/ui/page/settings/color/feeds/FeedsPageStylePage.kt index 361b283..108e0c3 100644 --- a/app/src/main/java/me/ash/reader/ui/page/settings/color/feeds/FeedsPageStylePage.kt +++ b/app/src/main/java/me/ash/reader/ui/page/settings/color/feeds/FeedsPageStylePage.kt @@ -58,7 +58,7 @@ fun FeedsPageStylePage( var filterBarPaddingValue: Int? by remember { mutableStateOf(filterBarPadding) } - me.ash.reader.ui.component.base.Scaffold( + RYScaffold( containerColor = MaterialTheme.colorScheme.surface onLight MaterialTheme.colorScheme.inverseOnSurface, navigationIcon = { FeedbackIconButton( @@ -132,7 +132,7 @@ fun FeedsPageStylePage( (!groupListExpand).put(context, scope) }, ) { - Switch(activated = groupListExpand.value) { + RYSwitch(activated = groupListExpand.value) { (!groupListExpand).put(context, scope) } } @@ -166,7 +166,7 @@ fun FeedsPageStylePage( (!filterBarFilled).put(context, scope) }, ) { - Switch(activated = filterBarFilled.value) { + RYSwitch(activated = filterBarFilled.value) { (!filterBarFilled).put(context, scope) } } diff --git a/app/src/main/java/me/ash/reader/ui/page/settings/color/flow/FlowPageStylePage.kt b/app/src/main/java/me/ash/reader/ui/page/settings/color/flow/FlowPageStylePage.kt index d437012..0161668 100644 --- a/app/src/main/java/me/ash/reader/ui/page/settings/color/flow/FlowPageStylePage.kt +++ b/app/src/main/java/me/ash/reader/ui/page/settings/color/flow/FlowPageStylePage.kt @@ -10,7 +10,6 @@ import androidx.compose.material.icons.Icons import androidx.compose.material.icons.rounded.ArrowBack import androidx.compose.material.icons.rounded.DoneAll import androidx.compose.material.icons.rounded.Search -import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.MaterialTheme import androidx.compose.material3.SmallTopAppBar import androidx.compose.material3.TopAppBarDefaults @@ -66,7 +65,7 @@ fun FlowPageStylePage( var filterBarPaddingValue: Int? by remember { mutableStateOf(filterBarPadding) } - me.ash.reader.ui.component.base.Scaffold( + RYScaffold( containerColor = MaterialTheme.colorScheme.surface onLight MaterialTheme.colorScheme.inverseOnSurface, navigationIcon = { FeedbackIconButton( @@ -145,7 +144,7 @@ fun FlowPageStylePage( (!articleListFeedIcon).put(context, scope) }, ) { - me.ash.reader.ui.component.base.Switch(activated = articleListFeedIcon.value) { + RYSwitch(activated = articleListFeedIcon.value) { (!articleListFeedIcon).put(context, scope) } } @@ -155,7 +154,7 @@ fun FlowPageStylePage( (!articleListFeedName).put(context, scope) }, ) { - me.ash.reader.ui.component.base.Switch(activated = articleListFeedName.value) { + RYSwitch(activated = articleListFeedName.value) { (!articleListFeedName).put(context, scope) } } @@ -165,7 +164,7 @@ fun FlowPageStylePage( (!articleListImage).put(context, scope) }, ) { - me.ash.reader.ui.component.base.Switch(activated = articleListImage.value) { + RYSwitch(activated = articleListImage.value) { (!articleListImage).put(context, scope) } } @@ -175,7 +174,7 @@ fun FlowPageStylePage( (!articleListDesc).put(context, scope) }, ) { - me.ash.reader.ui.component.base.Switch(activated = articleListDesc.value) { + RYSwitch(activated = articleListDesc.value) { (!articleListDesc).put(context, scope) } } @@ -185,7 +184,7 @@ fun FlowPageStylePage( (!articleListTime).put(context, scope) }, ) { - me.ash.reader.ui.component.base.Switch(activated = articleListTime.value) { + RYSwitch(activated = articleListTime.value) { (!articleListTime).put(context, scope) } } @@ -195,7 +194,7 @@ fun FlowPageStylePage( (!articleListStickyDate).put(context, scope) }, ) { - me.ash.reader.ui.component.base.Switch(activated = articleListStickyDate.value) { + RYSwitch(activated = articleListStickyDate.value) { (!articleListStickyDate).put(context, scope) } } @@ -229,7 +228,7 @@ fun FlowPageStylePage( (!filterBarFilled).put(context, scope) }, ) { - me.ash.reader.ui.component.base.Switch(activated = filterBarFilled.value) { + RYSwitch(activated = filterBarFilled.value) { (!filterBarFilled).put(context, scope) } } diff --git a/app/src/main/java/me/ash/reader/ui/page/settings/interaction/InteractionPage.kt b/app/src/main/java/me/ash/reader/ui/page/settings/interaction/InteractionPage.kt index a532ba3..6ca2abc 100644 --- a/app/src/main/java/me/ash/reader/ui/page/settings/interaction/InteractionPage.kt +++ b/app/src/main/java/me/ash/reader/ui/page/settings/interaction/InteractionPage.kt @@ -33,7 +33,7 @@ fun InteractionPage( var initialPageDialogVisible by remember { mutableStateOf(false) } var initialFilterDialogVisible by remember { mutableStateOf(false) } - me.ash.reader.ui.component.base.Scaffold( + RYScaffold( containerColor = MaterialTheme.colorScheme.surface onLight MaterialTheme.colorScheme.inverseOnSurface, navigationIcon = { FeedbackIconButton( diff --git a/app/src/main/java/me/ash/reader/ui/page/settings/languages/LanguagesPage.kt b/app/src/main/java/me/ash/reader/ui/page/settings/languages/LanguagesPage.kt index 8b2fc9c..f7dddc1 100644 --- a/app/src/main/java/me/ash/reader/ui/page/settings/languages/LanguagesPage.kt +++ b/app/src/main/java/me/ash/reader/ui/page/settings/languages/LanguagesPage.kt @@ -26,6 +26,7 @@ import me.ash.reader.data.preference.LocalLanguages 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.RYScaffold import me.ash.reader.ui.page.settings.SettingItem import me.ash.reader.ui.theme.palette.onLight @@ -38,7 +39,7 @@ fun LanguagesPage( val languages = LocalLanguages.current val scope = rememberCoroutineScope() - me.ash.reader.ui.component.base.Scaffold( + RYScaffold( containerColor = MaterialTheme.colorScheme.surface onLight MaterialTheme.colorScheme.inverseOnSurface, navigationIcon = { FeedbackIconButton( diff --git a/app/src/main/java/me/ash/reader/ui/page/settings/tips/TipsAndSupportPage.kt b/app/src/main/java/me/ash/reader/ui/page/settings/tips/TipsAndSupportPage.kt index f8f7752..c2d7b9a 100644 --- a/app/src/main/java/me/ash/reader/ui/page/settings/tips/TipsAndSupportPage.kt +++ b/app/src/main/java/me/ash/reader/ui/page/settings/tips/TipsAndSupportPage.kt @@ -38,6 +38,7 @@ import androidx.navigation.NavHostController import me.ash.reader.R import me.ash.reader.ui.component.base.CurlyCornerShape import me.ash.reader.ui.component.base.FeedbackIconButton +import me.ash.reader.ui.component.base.RYScaffold import me.ash.reader.ui.ext.* import me.ash.reader.ui.theme.palette.alwaysLight import me.ash.reader.ui.theme.palette.onLight @@ -61,7 +62,7 @@ fun TipsAndSupportPage( currentVersion = context.getCurrentVersion().toString() } - me.ash.reader.ui.component.base.Scaffold( + RYScaffold( containerColor = MaterialTheme.colorScheme.surface onLight MaterialTheme.colorScheme.inverseOnSurface, navigationIcon = { FeedbackIconButton( 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 8080431..5bce517 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 @@ -33,7 +33,7 @@ import kotlinx.coroutines.Dispatchers import me.ash.reader.R import me.ash.reader.data.preference.* import me.ash.reader.data.source.Download -import me.ash.reader.ui.component.base.Dialog +import me.ash.reader.ui.component.base.RYDialog import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.installLatestApk @@ -71,7 +71,7 @@ fun UpdateDialog( } } - Dialog( + RYDialog( modifier = Modifier.heightIn(max = 400.dp), visible = updateUiState.updateDialogVisible, onDismissRequest = { updateViewModel.hideDialog() }, diff --git a/app/src/main/java/me/ash/reader/ui/page/settings/tips/UpdateViewModel.kt b/app/src/main/java/me/ash/reader/ui/page/settings/tips/UpdateViewModel.kt index a90405e..502759e 100644 --- a/app/src/main/java/me/ash/reader/ui/page/settings/tips/UpdateViewModel.kt +++ b/app/src/main/java/me/ash/reader/ui/page/settings/tips/UpdateViewModel.kt @@ -5,14 +5,14 @@ import androidx.lifecycle.viewModelScope import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.flow.* import kotlinx.coroutines.launch -import me.ash.reader.data.repository.AppRepository +import me.ash.reader.data.repository.RYRepository import me.ash.reader.data.source.Download import me.ash.reader.ui.ext.notFdroid import javax.inject.Inject @HiltViewModel class UpdateViewModel @Inject constructor( - private val appRepository: AppRepository, + private val ryRepository: RYRepository, ) : ViewModel() { private val _updateUiState = MutableStateFlow(UpdateUiState()) val updateUiState: StateFlow = _updateUiState.asStateFlow() @@ -24,7 +24,7 @@ class UpdateViewModel @Inject constructor( if (notFdroid) { viewModelScope.launch { preProcessor() - appRepository.checkUpdate().let { + ryRepository.checkUpdate().let { it?.let { if (it) { showDialog() @@ -63,7 +63,7 @@ class UpdateViewModel @Inject constructor( } _updateUiState.update { it.copy( - downloadFlow = appRepository.downloadFile(url) + downloadFlow = ryRepository.downloadFile(url) ) } } 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 cc955d9..36ac290 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 @@ -21,6 +21,7 @@ import kotlinx.coroutines.launch import me.ash.reader.R import me.ash.reader.ui.component.base.DisplayText import me.ash.reader.ui.component.base.DynamicSVGImage +import me.ash.reader.ui.component.base.RYScaffold import me.ash.reader.ui.component.base.Tips import me.ash.reader.ui.ext.DataStoreKeys import me.ash.reader.ui.ext.dataStore @@ -36,7 +37,7 @@ fun StartupPage( val context = LocalContext.current val scope = rememberCoroutineScope() - me.ash.reader.ui.component.base.Scaffold( + RYScaffold( content = { LazyColumn { item {