Rename RY component
This commit is contained in:
parent
efdff0e49c
commit
647ef7a0bd
321
app/schemas/me.ash.reader.data.source.RYDatabase/2.json
Normal file
321
app/schemas/me.ash.reader.data.source.RYDatabase/2.json
Normal file
|
@ -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')"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,7 +6,7 @@
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".App"
|
android:name=".RYApp"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/read_you"
|
android:label="@string/read_you"
|
||||||
|
|
|
@ -12,9 +12,9 @@ import kotlinx.coroutines.launch
|
||||||
import me.ash.reader.data.module.ApplicationScope
|
import me.ash.reader.data.module.ApplicationScope
|
||||||
import me.ash.reader.data.module.DispatcherDefault
|
import me.ash.reader.data.module.DispatcherDefault
|
||||||
import me.ash.reader.data.repository.*
|
import me.ash.reader.data.repository.*
|
||||||
import me.ash.reader.data.source.AppNetworkDataSource
|
|
||||||
import me.ash.reader.data.source.OpmlLocalDataSource
|
import me.ash.reader.data.source.OpmlLocalDataSource
|
||||||
import me.ash.reader.data.source.ReaderDatabase
|
import me.ash.reader.data.source.RYDatabase
|
||||||
|
import me.ash.reader.data.source.RYNetworkDataSource
|
||||||
import me.ash.reader.ui.ext.*
|
import me.ash.reader.ui.ext.*
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import org.conscrypt.Conscrypt
|
import org.conscrypt.Conscrypt
|
||||||
|
@ -22,7 +22,7 @@ import java.security.Security
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@HiltAndroidApp
|
@HiltAndroidApp
|
||||||
class App : Application(), Configuration.Provider {
|
class RYApp : Application(), Configuration.Provider {
|
||||||
init {
|
init {
|
||||||
// From: https://gitlab.com/spacecowboy/Feeder
|
// From: https://gitlab.com/spacecowboy/Feeder
|
||||||
// Install Conscrypt to handle TLSv1.3 pre Android10
|
// Install Conscrypt to handle TLSv1.3 pre Android10
|
||||||
|
@ -30,7 +30,7 @@ class App : Application(), Configuration.Provider {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
lateinit var readerDatabase: ReaderDatabase
|
lateinit var RYDatabase: RYDatabase
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
lateinit var workerFactory: HiltWorkerFactory
|
lateinit var workerFactory: HiltWorkerFactory
|
||||||
|
@ -39,7 +39,7 @@ class App : Application(), Configuration.Provider {
|
||||||
lateinit var workManager: WorkManager
|
lateinit var workManager: WorkManager
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
lateinit var appNetworkDataSource: AppNetworkDataSource
|
lateinit var RYNetworkDataSource: RYNetworkDataSource
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
lateinit var opmlLocalDataSource: OpmlLocalDataSource
|
lateinit var opmlLocalDataSource: OpmlLocalDataSource
|
||||||
|
@ -51,7 +51,7 @@ class App : Application(), Configuration.Provider {
|
||||||
lateinit var notificationHelper: NotificationHelper
|
lateinit var notificationHelper: NotificationHelper
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
lateinit var appRepository: AppRepository
|
lateinit var ryRepository: RYRepository
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
lateinit var stringsRepository: StringsRepository
|
lateinit var stringsRepository: StringsRepository
|
||||||
|
@ -116,7 +116,7 @@ class App : Application(), Configuration.Provider {
|
||||||
it.del()
|
it.del()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
appRepository.checkUpdate(showToast = false)
|
ryRepository.checkUpdate(showToast = false)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getWorkManagerConfiguration(): Configuration =
|
override fun getWorkManagerConfiguration(): Configuration =
|
|
@ -10,7 +10,7 @@ import me.ash.reader.data.dao.AccountDao
|
||||||
import me.ash.reader.data.dao.ArticleDao
|
import me.ash.reader.data.dao.ArticleDao
|
||||||
import me.ash.reader.data.dao.FeedDao
|
import me.ash.reader.data.dao.FeedDao
|
||||||
import me.ash.reader.data.dao.GroupDao
|
import me.ash.reader.data.dao.GroupDao
|
||||||
import me.ash.reader.data.source.ReaderDatabase
|
import me.ash.reader.data.source.RYDatabase
|
||||||
import javax.inject.Singleton
|
import javax.inject.Singleton
|
||||||
|
|
||||||
@Module
|
@Module
|
||||||
|
@ -19,26 +19,26 @@ object DatabaseModule {
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
fun provideArticleDao(readerDatabase: ReaderDatabase): ArticleDao =
|
fun provideArticleDao(RYDatabase: RYDatabase): ArticleDao =
|
||||||
readerDatabase.articleDao()
|
RYDatabase.articleDao()
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
fun provideFeedDao(readerDatabase: ReaderDatabase): FeedDao =
|
fun provideFeedDao(RYDatabase: RYDatabase): FeedDao =
|
||||||
readerDatabase.feedDao()
|
RYDatabase.feedDao()
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
fun provideGroupDao(readerDatabase: ReaderDatabase): GroupDao =
|
fun provideGroupDao(RYDatabase: RYDatabase): GroupDao =
|
||||||
readerDatabase.groupDao()
|
RYDatabase.groupDao()
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
fun provideAccountDao(readerDatabase: ReaderDatabase): AccountDao =
|
fun provideAccountDao(RYDatabase: RYDatabase): AccountDao =
|
||||||
readerDatabase.accountDao()
|
RYDatabase.accountDao()
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
fun provideReaderDatabase(@ApplicationContext context: Context): ReaderDatabase =
|
fun provideReaderDatabase(@ApplicationContext context: Context): RYDatabase =
|
||||||
ReaderDatabase.getInstance(context)
|
RYDatabase.getInstance(context)
|
||||||
}
|
}
|
|
@ -4,7 +4,7 @@ import dagger.Module
|
||||||
import dagger.Provides
|
import dagger.Provides
|
||||||
import dagger.hilt.InstallIn
|
import dagger.hilt.InstallIn
|
||||||
import dagger.hilt.components.SingletonComponent
|
import dagger.hilt.components.SingletonComponent
|
||||||
import me.ash.reader.data.source.AppNetworkDataSource
|
import me.ash.reader.data.source.RYNetworkDataSource
|
||||||
import me.ash.reader.data.source.FeverApiDataSource
|
import me.ash.reader.data.source.FeverApiDataSource
|
||||||
import me.ash.reader.data.source.GoogleReaderApiDataSource
|
import me.ash.reader.data.source.GoogleReaderApiDataSource
|
||||||
import javax.inject.Singleton
|
import javax.inject.Singleton
|
||||||
|
@ -15,8 +15,8 @@ object RetrofitModule {
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
fun provideAppNetworkDataSource(): AppNetworkDataSource =
|
fun provideAppNetworkDataSource(): RYNetworkDataSource =
|
||||||
AppNetworkDataSource.getInstance()
|
RYNetworkDataSource.getInstance()
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
|
|
|
@ -13,8 +13,8 @@ import me.ash.reader.data.module.DispatcherIO
|
||||||
import me.ash.reader.data.module.DispatcherMain
|
import me.ash.reader.data.module.DispatcherMain
|
||||||
import me.ash.reader.data.preference.*
|
import me.ash.reader.data.preference.*
|
||||||
import me.ash.reader.data.preference.NewVersionSizePreference.formatSize
|
import me.ash.reader.data.preference.NewVersionSizePreference.formatSize
|
||||||
import me.ash.reader.data.source.AppNetworkDataSource
|
|
||||||
import me.ash.reader.data.source.Download
|
import me.ash.reader.data.source.Download
|
||||||
|
import me.ash.reader.data.source.RYNetworkDataSource
|
||||||
import me.ash.reader.data.source.downloadToFileWithProgress
|
import me.ash.reader.data.source.downloadToFileWithProgress
|
||||||
import me.ash.reader.ui.ext.getCurrentVersion
|
import me.ash.reader.ui.ext.getCurrentVersion
|
||||||
import me.ash.reader.ui.ext.getLatestApk
|
import me.ash.reader.ui.ext.getLatestApk
|
||||||
|
@ -22,10 +22,10 @@ import me.ash.reader.ui.ext.showToast
|
||||||
import me.ash.reader.ui.ext.skipVersionNumber
|
import me.ash.reader.ui.ext.skipVersionNumber
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
class AppRepository @Inject constructor(
|
class RYRepository @Inject constructor(
|
||||||
@ApplicationContext
|
@ApplicationContext
|
||||||
private val context: Context,
|
private val context: Context,
|
||||||
private val appNetworkDataSource: AppNetworkDataSource,
|
private val RYNetworkDataSource: RYNetworkDataSource,
|
||||||
@DispatcherIO
|
@DispatcherIO
|
||||||
private val dispatcherIO: CoroutineDispatcher,
|
private val dispatcherIO: CoroutineDispatcher,
|
||||||
@DispatcherMain
|
@DispatcherMain
|
||||||
|
@ -34,7 +34,7 @@ class AppRepository @Inject constructor(
|
||||||
suspend fun checkUpdate(showToast: Boolean = true): Boolean? = withContext(dispatcherIO) {
|
suspend fun checkUpdate(showToast: Boolean = true): Boolean? = withContext(dispatcherIO) {
|
||||||
try {
|
try {
|
||||||
val response =
|
val response =
|
||||||
appNetworkDataSource.getReleaseLatest(context.getString(R.string.update_link))
|
RYNetworkDataSource.getReleaseLatest(context.getString(R.string.update_link))
|
||||||
when {
|
when {
|
||||||
response.code() == 403 -> {
|
response.code() == 403 -> {
|
||||||
withContext(dispatcherMain) {
|
withContext(dispatcherMain) {
|
||||||
|
@ -85,7 +85,7 @@ class AppRepository @Inject constructor(
|
||||||
withContext(dispatcherIO) {
|
withContext(dispatcherIO) {
|
||||||
Log.i("RLog", "downloadFile start: $url")
|
Log.i("RLog", "downloadFile start: $url")
|
||||||
try {
|
try {
|
||||||
return@withContext appNetworkDataSource.downloadFile(url)
|
return@withContext RYNetworkDataSource.downloadFile(url)
|
||||||
.downloadToFileWithProgress(context.getLatestApk())
|
.downloadToFileWithProgress(context.getLatestApk())
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
|
@ -18,21 +18,21 @@ import java.util.*
|
||||||
entities = [Account::class, Feed::class, Article::class, Group::class],
|
entities = [Account::class, Feed::class, Article::class, Group::class],
|
||||||
version = 2,
|
version = 2,
|
||||||
)
|
)
|
||||||
@TypeConverters(ReaderDatabase.Converters::class)
|
@TypeConverters(RYDatabase.Converters::class)
|
||||||
abstract class ReaderDatabase : RoomDatabase() {
|
abstract class RYDatabase : RoomDatabase() {
|
||||||
abstract fun accountDao(): AccountDao
|
abstract fun accountDao(): AccountDao
|
||||||
abstract fun feedDao(): FeedDao
|
abstract fun feedDao(): FeedDao
|
||||||
abstract fun articleDao(): ArticleDao
|
abstract fun articleDao(): ArticleDao
|
||||||
abstract fun groupDao(): GroupDao
|
abstract fun groupDao(): GroupDao
|
||||||
|
|
||||||
companion object {
|
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) {
|
return instance ?: synchronized(this) {
|
||||||
instance ?: Room.databaseBuilder(
|
instance ?: Room.databaseBuilder(
|
||||||
context.applicationContext,
|
context.applicationContext,
|
||||||
ReaderDatabase::class.java,
|
RYDatabase::class.java,
|
||||||
"Reader"
|
"Reader"
|
||||||
).addMigrations(*allMigrations).build().also {
|
).addMigrations(*allMigrations).build().also {
|
||||||
instance = it
|
instance = it
|
|
@ -14,7 +14,7 @@ import retrofit2.http.Streaming
|
||||||
import retrofit2.http.Url
|
import retrofit2.http.Url
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
interface AppNetworkDataSource {
|
interface RYNetworkDataSource {
|
||||||
@GET
|
@GET
|
||||||
suspend fun getReleaseLatest(@Url url: String): Response<LatestRelease>
|
suspend fun getReleaseLatest(@Url url: String): Response<LatestRelease>
|
||||||
|
|
||||||
|
@ -23,14 +23,14 @@ interface AppNetworkDataSource {
|
||||||
suspend fun downloadFile(@Url url: String): ResponseBody
|
suspend fun downloadFile(@Url url: String): ResponseBody
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private var instance: AppNetworkDataSource? = null
|
private var instance: RYNetworkDataSource? = null
|
||||||
|
|
||||||
fun getInstance(): AppNetworkDataSource {
|
fun getInstance(): RYNetworkDataSource {
|
||||||
return instance ?: synchronized(this) {
|
return instance ?: synchronized(this) {
|
||||||
instance ?: Retrofit.Builder()
|
instance ?: Retrofit.Builder()
|
||||||
.baseUrl("https://api.github.com/")
|
.baseUrl("https://api.github.com/")
|
||||||
.addConverterFactory(GsonConverterFactory.create())
|
.addConverterFactory(GsonConverterFactory.create())
|
||||||
.build().create(AppNetworkDataSource::class.java).also {
|
.build().create(RYNetworkDataSource::class.java).also {
|
||||||
instance = it
|
instance = it
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -7,7 +7,7 @@ import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun BlockRadioGroupButton(
|
fun BlockRadioButton(
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
selected: Int = 0,
|
selected: Int = 0,
|
||||||
onSelected: (Int) -> Unit,
|
onSelected: (Int) -> Unit,
|
||||||
|
|
|
@ -32,7 +32,7 @@ fun ClipboardTextField(
|
||||||
) {
|
) {
|
||||||
Column(modifier = modifier) {
|
Column(modifier = modifier) {
|
||||||
Spacer(modifier = Modifier.height(10.dp))
|
Spacer(modifier = Modifier.height(10.dp))
|
||||||
TextField(
|
RYTextField(
|
||||||
readOnly = readOnly,
|
readOnly = readOnly,
|
||||||
value = value,
|
value = value,
|
||||||
onValueChange = onValueChange,
|
onValueChange = onValueChange,
|
||||||
|
|
|
@ -41,7 +41,7 @@ fun DynamicSVGImage(
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
Crossfade(targetState = pic) {
|
Crossfade(targetState = pic) {
|
||||||
AsyncImage(
|
RYAsyncImage(
|
||||||
contentDescription = contentDescription,
|
contentDescription = contentDescription,
|
||||||
data = it,
|
data = it,
|
||||||
placeholder = null,
|
placeholder = null,
|
||||||
|
|
|
@ -22,7 +22,7 @@ import me.ash.reader.R
|
||||||
val Size_1000 = Size(1000, 1000)
|
val Size_1000 = Size(1000, 1000)
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun AsyncImage(
|
fun RYAsyncImage(
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
data: Any? = null,
|
data: Any? = null,
|
||||||
size: Size = Size.ORIGINAL,
|
size: Size = Size.ORIGINAL,
|
|
@ -6,7 +6,7 @@ import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.window.DialogProperties
|
import androidx.compose.ui.window.DialogProperties
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun Dialog(
|
fun RYDialog(
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
visible: Boolean,
|
visible: Boolean,
|
||||||
properties: DialogProperties = DialogProperties(),
|
properties: DialogProperties = DialogProperties(),
|
|
@ -18,7 +18,7 @@ import me.ash.reader.ui.theme.palette.onDark
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun Scaffold(
|
fun RYScaffold(
|
||||||
containerColor: Color = MaterialTheme.colorScheme.surface,
|
containerColor: Color = MaterialTheme.colorScheme.surface,
|
||||||
topBarTonalElevation: Dp = 0.dp,
|
topBarTonalElevation: Dp = 0.dp,
|
||||||
containerTonalElevation: Dp = 0.dp,
|
containerTonalElevation: Dp = 0.dp,
|
|
@ -31,7 +31,7 @@ import me.ash.reader.ui.theme.palette.onDark
|
||||||
|
|
||||||
// TODO: ripple & swipe
|
// TODO: ripple & swipe
|
||||||
@Composable
|
@Composable
|
||||||
fun Switch(
|
fun RYSwitch(
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
activated: Boolean,
|
activated: Boolean,
|
||||||
enable: Boolean = true,
|
enable: Boolean = true,
|
||||||
|
@ -101,7 +101,7 @@ fun SwitchHeadline(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Box(Modifier.padding(start = 20.dp)) {
|
Box(Modifier.padding(start = 20.dp)) {
|
||||||
Switch(activated = activated)
|
RYSwitch(activated = activated)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -19,7 +19,7 @@ import kotlinx.coroutines.delay
|
||||||
import me.ash.reader.R
|
import me.ash.reader.R
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun TextField(
|
fun RYTextField(
|
||||||
readOnly: Boolean,
|
readOnly: Boolean,
|
||||||
value: String,
|
value: String,
|
||||||
onValueChange: (String) -> Unit,
|
onValueChange: (String) -> Unit,
|
|
@ -29,7 +29,7 @@ fun RadioDialog(
|
||||||
options: List<RadioDialogOption> = emptyList(),
|
options: List<RadioDialogOption> = emptyList(),
|
||||||
onDismissRequest: () -> Unit = {},
|
onDismissRequest: () -> Unit = {},
|
||||||
) {
|
) {
|
||||||
Dialog(
|
RYDialog(
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
visible = visible,
|
visible = visible,
|
||||||
onDismissRequest = onDismissRequest,
|
onDismissRequest = onDismissRequest,
|
||||||
|
|
|
@ -35,7 +35,7 @@ fun TextFieldDialog(
|
||||||
) {
|
) {
|
||||||
val focusManager = LocalFocusManager.current
|
val focusManager = LocalFocusManager.current
|
||||||
|
|
||||||
Dialog(
|
RYDialog(
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
visible = visible,
|
visible = visible,
|
||||||
onDismissRequest = onDismissRequest,
|
onDismissRequest = onDismissRequest,
|
||||||
|
|
|
@ -51,7 +51,7 @@ import coil.size.Precision
|
||||||
import coil.size.Size
|
import coil.size.Size
|
||||||
import coil.size.pxOrElse
|
import coil.size.pxOrElse
|
||||||
import me.ash.reader.R
|
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.Jsoup
|
||||||
import org.jsoup.helper.StringUtil
|
import org.jsoup.helper.StringUtil
|
||||||
import org.jsoup.nodes.Element
|
import org.jsoup.nodes.Element
|
||||||
|
@ -465,7 +465,7 @@ private fun TextComposer.appendTextChildren(
|
||||||
// }
|
// }
|
||||||
) {
|
) {
|
||||||
val imageSize = maxImageSize()
|
val imageSize = maxImageSize()
|
||||||
AsyncImage(
|
RYAsyncImage(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
data = imageCandidates.getBestImageForMaxSize(
|
data = imageCandidates.getBestImageForMaxSize(
|
||||||
pixelDensity = pixelDensity(),
|
pixelDensity = pixelDensity(),
|
||||||
|
@ -591,7 +591,7 @@ private fun TextComposer.appendTextChildren(
|
||||||
BoxWithConstraints(
|
BoxWithConstraints(
|
||||||
modifier = Modifier.fillMaxWidth()
|
modifier = Modifier.fillMaxWidth()
|
||||||
) {
|
) {
|
||||||
AsyncImage(
|
RYAsyncImage(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.clickable {
|
.clickable {
|
||||||
onLinkClick(video.link)
|
onLinkClick(video.link)
|
||||||
|
|
|
@ -30,10 +30,7 @@ import me.ash.reader.data.model.getName
|
||||||
import me.ash.reader.data.preference.*
|
import me.ash.reader.data.preference.*
|
||||||
import me.ash.reader.data.repository.SyncWorker.Companion.getIsSyncing
|
import me.ash.reader.data.repository.SyncWorker.Companion.getIsSyncing
|
||||||
import me.ash.reader.ui.component.FilterBar
|
import me.ash.reader.ui.component.FilterBar
|
||||||
import me.ash.reader.ui.component.base.Banner
|
import me.ash.reader.ui.component.base.*
|
||||||
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.collectAsStateValue
|
import me.ash.reader.ui.ext.collectAsStateValue
|
||||||
import me.ash.reader.ui.ext.findActivity
|
import me.ash.reader.ui.ext.findActivity
|
||||||
import me.ash.reader.ui.ext.getCurrentVersion
|
import me.ash.reader.ui.ext.getCurrentVersion
|
||||||
|
@ -113,7 +110,7 @@ fun FeedsPage(
|
||||||
context.findActivity()?.moveTaskToBack(false)
|
context.findActivity()?.moveTaskToBack(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
me.ash.reader.ui.component.base.Scaffold(
|
RYScaffold(
|
||||||
topBarTonalElevation = topBarTonalElevation.value.dp,
|
topBarTonalElevation = topBarTonalElevation.value.dp,
|
||||||
containerTonalElevation = groupListTonalElevation.value.dp,
|
containerTonalElevation = groupListTonalElevation.value.dp,
|
||||||
navigationIcon = {
|
navigationIcon = {
|
||||||
|
|
|
@ -11,7 +11,7 @@ import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.hilt.navigation.compose.hiltViewModel
|
import androidx.hilt.navigation.compose.hiltViewModel
|
||||||
import me.ash.reader.R
|
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.collectAsStateValue
|
||||||
import me.ash.reader.ui.ext.showToast
|
import me.ash.reader.ui.ext.showToast
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ fun ClearFeedDialog(
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
val toastString = stringResource(R.string.clear_articles_in_feed_toast, feedName)
|
val toastString = stringResource(R.string.clear_articles_in_feed_toast, feedName)
|
||||||
|
|
||||||
Dialog(
|
RYDialog(
|
||||||
visible = feedOptionUiState.clearDialogVisible,
|
visible = feedOptionUiState.clearDialogVisible,
|
||||||
onDismissRequest = {
|
onDismissRequest = {
|
||||||
feedOptionViewModel.hideClearDialog()
|
feedOptionViewModel.hideClearDialog()
|
||||||
|
|
|
@ -11,7 +11,7 @@ import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.hilt.navigation.compose.hiltViewModel
|
import androidx.hilt.navigation.compose.hiltViewModel
|
||||||
import me.ash.reader.R
|
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.collectAsStateValue
|
||||||
import me.ash.reader.ui.ext.showToast
|
import me.ash.reader.ui.ext.showToast
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ fun DeleteFeedDialog(
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
val toastString = stringResource(R.string.delete_toast, feedName)
|
val toastString = stringResource(R.string.delete_toast, feedName)
|
||||||
|
|
||||||
Dialog(
|
RYDialog(
|
||||||
visible = feedOptionUiState.deleteDialogVisible,
|
visible = feedOptionUiState.deleteDialogVisible,
|
||||||
onDismissRequest = {
|
onDismissRequest = {
|
||||||
feedOptionViewModel.hideDeleteDialog()
|
feedOptionViewModel.hideDeleteDialog()
|
||||||
|
|
|
@ -11,7 +11,7 @@ import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.hilt.navigation.compose.hiltViewModel
|
import androidx.hilt.navigation.compose.hiltViewModel
|
||||||
import me.ash.reader.R
|
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.collectAsStateValue
|
||||||
import me.ash.reader.ui.ext.showToast
|
import me.ash.reader.ui.ext.showToast
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ fun AllAllowNotificationDialog(
|
||||||
val allowToastString = stringResource(R.string.all_allow_notification_toast, groupName)
|
val allowToastString = stringResource(R.string.all_allow_notification_toast, groupName)
|
||||||
val denyToastString = stringResource(R.string.all_deny_notification_toast, groupName)
|
val denyToastString = stringResource(R.string.all_deny_notification_toast, groupName)
|
||||||
|
|
||||||
Dialog(
|
RYDialog(
|
||||||
visible = groupOptionUiState.allAllowNotificationDialogVisible,
|
visible = groupOptionUiState.allAllowNotificationDialogVisible,
|
||||||
onDismissRequest = {
|
onDismissRequest = {
|
||||||
groupOptionViewModel.hideAllAllowNotificationDialog()
|
groupOptionViewModel.hideAllAllowNotificationDialog()
|
||||||
|
|
|
@ -11,7 +11,7 @@ import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.hilt.navigation.compose.hiltViewModel
|
import androidx.hilt.navigation.compose.hiltViewModel
|
||||||
import me.ash.reader.R
|
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.collectAsStateValue
|
||||||
import me.ash.reader.ui.ext.showToast
|
import me.ash.reader.ui.ext.showToast
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ fun AllMoveToGroupDialog(
|
||||||
groupOptionUiState.targetGroup?.name ?: ""
|
groupOptionUiState.targetGroup?.name ?: ""
|
||||||
)
|
)
|
||||||
|
|
||||||
Dialog(
|
RYDialog(
|
||||||
visible = groupOptionUiState.allMoveToGroupDialogVisible,
|
visible = groupOptionUiState.allMoveToGroupDialogVisible,
|
||||||
onDismissRequest = {
|
onDismissRequest = {
|
||||||
groupOptionViewModel.hideAllMoveToGroupDialog()
|
groupOptionViewModel.hideAllMoveToGroupDialog()
|
||||||
|
|
|
@ -11,7 +11,7 @@ import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.hilt.navigation.compose.hiltViewModel
|
import androidx.hilt.navigation.compose.hiltViewModel
|
||||||
import me.ash.reader.R
|
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.collectAsStateValue
|
||||||
import me.ash.reader.ui.ext.showToast
|
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 allowToastString = stringResource(R.string.all_parse_full_content_toast, groupName)
|
||||||
val denyToastString = stringResource(R.string.all_deny_parse_full_content_toast, groupName)
|
val denyToastString = stringResource(R.string.all_deny_parse_full_content_toast, groupName)
|
||||||
|
|
||||||
Dialog(
|
RYDialog(
|
||||||
visible = groupOptionUiState.allParseFullContentDialogVisible,
|
visible = groupOptionUiState.allParseFullContentDialogVisible,
|
||||||
onDismissRequest = {
|
onDismissRequest = {
|
||||||
groupOptionViewModel.hideAllParseFullContentDialog()
|
groupOptionViewModel.hideAllParseFullContentDialog()
|
||||||
|
|
|
@ -11,7 +11,7 @@ import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.hilt.navigation.compose.hiltViewModel
|
import androidx.hilt.navigation.compose.hiltViewModel
|
||||||
import me.ash.reader.R
|
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.collectAsStateValue
|
||||||
import me.ash.reader.ui.ext.showToast
|
import me.ash.reader.ui.ext.showToast
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ fun ClearGroupDialog(
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
val toastString = stringResource(R.string.clear_articles_in_group_toast, groupName)
|
val toastString = stringResource(R.string.clear_articles_in_group_toast, groupName)
|
||||||
|
|
||||||
Dialog(
|
RYDialog(
|
||||||
visible = groupOptionUiState.clearDialogVisible,
|
visible = groupOptionUiState.clearDialogVisible,
|
||||||
onDismissRequest = {
|
onDismissRequest = {
|
||||||
groupOptionViewModel.hideClearDialog()
|
groupOptionViewModel.hideClearDialog()
|
||||||
|
|
|
@ -11,7 +11,7 @@ import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.hilt.navigation.compose.hiltViewModel
|
import androidx.hilt.navigation.compose.hiltViewModel
|
||||||
import me.ash.reader.R
|
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.collectAsStateValue
|
||||||
import me.ash.reader.ui.ext.showToast
|
import me.ash.reader.ui.ext.showToast
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ fun DeleteGroupDialog(
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
val toastString = stringResource(R.string.delete_toast, groupName)
|
val toastString = stringResource(R.string.delete_toast, groupName)
|
||||||
|
|
||||||
Dialog(
|
RYDialog(
|
||||||
visible = groupOptionUiState.deleteDialogVisible,
|
visible = groupOptionUiState.deleteDialogVisible,
|
||||||
onDismissRequest = {
|
onDismissRequest = {
|
||||||
groupOptionViewModel.hideDeleteDialog()
|
groupOptionViewModel.hideDeleteDialog()
|
||||||
|
|
|
@ -26,7 +26,7 @@ import androidx.compose.ui.window.DialogProperties
|
||||||
import androidx.hilt.navigation.compose.hiltViewModel
|
import androidx.hilt.navigation.compose.hiltViewModel
|
||||||
import me.ash.reader.R
|
import me.ash.reader.R
|
||||||
import me.ash.reader.ui.component.base.ClipboardTextField
|
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.component.base.TextFieldDialog
|
||||||
import me.ash.reader.ui.ext.collectAsStateValue
|
import me.ash.reader.ui.ext.collectAsStateValue
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ fun SubscribeDialog(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Dialog(
|
RYDialog(
|
||||||
modifier = Modifier.padding(horizontal = 44.dp),
|
modifier = Modifier.padding(horizontal = 44.dp),
|
||||||
visible = subscribeUiState.visible,
|
visible = subscribeUiState.visible,
|
||||||
properties = DialogProperties(usePlatformDefaultWidth = false),
|
properties = DialogProperties(usePlatformDefaultWidth = false),
|
||||||
|
|
|
@ -23,7 +23,7 @@ import coil.size.Scale
|
||||||
import me.ash.reader.R
|
import me.ash.reader.R
|
||||||
import me.ash.reader.data.entity.ArticleWithFeed
|
import me.ash.reader.data.entity.ArticleWithFeed
|
||||||
import me.ash.reader.data.preference.*
|
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.ext.formatAsString
|
||||||
import me.ash.reader.ui.component.FeedIcon
|
import me.ash.reader.ui.component.FeedIcon
|
||||||
import me.ash.reader.ui.component.base.Size_1000
|
import me.ash.reader.ui.component.base.Size_1000
|
||||||
|
@ -139,7 +139,7 @@ fun ArticleItem(
|
||||||
|
|
||||||
// Image
|
// Image
|
||||||
if (articleWithFeed.article.img != null && articleListImage.value) {
|
if (articleWithFeed.article.img != null && articleListImage.value) {
|
||||||
AsyncImage(
|
RYAsyncImage(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(start = 10.dp)
|
.padding(start = 10.dp)
|
||||||
.size(80.dp)
|
.size(80.dp)
|
||||||
|
|
|
@ -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.FilterBar
|
||||||
import me.ash.reader.ui.component.base.DisplayText
|
import me.ash.reader.ui.component.base.DisplayText
|
||||||
import me.ash.reader.ui.component.base.FeedbackIconButton
|
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.component.base.SwipeRefresh
|
||||||
import me.ash.reader.ui.ext.collectAsStateValue
|
import me.ash.reader.ui.ext.collectAsStateValue
|
||||||
import me.ash.reader.ui.page.common.RouteName
|
import me.ash.reader.ui.page.common.RouteName
|
||||||
|
@ -100,7 +101,7 @@ fun FlowPage(
|
||||||
onSearch = false
|
onSearch = false
|
||||||
}
|
}
|
||||||
|
|
||||||
me.ash.reader.ui.component.base.Scaffold(
|
RYScaffold(
|
||||||
topBarTonalElevation = topBarTonalElevation.value.dp,
|
topBarTonalElevation = topBarTonalElevation.value.dp,
|
||||||
containerTonalElevation = articleListTonalElevation.value.dp,
|
containerTonalElevation = articleListTonalElevation.value.dp,
|
||||||
navigationIcon = {
|
navigationIcon = {
|
||||||
|
|
|
@ -27,6 +27,7 @@ import androidx.navigation.NavHostController
|
||||||
import me.ash.reader.R
|
import me.ash.reader.R
|
||||||
import me.ash.reader.data.entity.ArticleWithFeed
|
import me.ash.reader.data.entity.ArticleWithFeed
|
||||||
import me.ash.reader.ui.component.base.FeedbackIconButton
|
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.component.reader.reader
|
||||||
import me.ash.reader.ui.ext.collectAsStateValue
|
import me.ash.reader.ui.ext.collectAsStateValue
|
||||||
import me.ash.reader.ui.ext.drawVerticalScrollbar
|
import me.ash.reader.ui.ext.drawVerticalScrollbar
|
||||||
|
@ -56,7 +57,7 @@ fun ReadingPage(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
me.ash.reader.ui.component.base.Scaffold(
|
RYScaffold(
|
||||||
content = {
|
content = {
|
||||||
Box(Modifier.fillMaxSize()) {
|
Box(Modifier.fillMaxSize()) {
|
||||||
Box(
|
Box(
|
||||||
|
|
|
@ -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.Banner
|
||||||
import me.ash.reader.ui.component.base.DisplayText
|
import me.ash.reader.ui.component.base.DisplayText
|
||||||
import me.ash.reader.ui.component.base.FeedbackIconButton
|
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.ext.getCurrentVersion
|
||||||
import me.ash.reader.ui.page.common.RouteName
|
import me.ash.reader.ui.page.common.RouteName
|
||||||
import me.ash.reader.ui.page.settings.tips.UpdateDialog
|
import me.ash.reader.ui.page.settings.tips.UpdateDialog
|
||||||
|
@ -41,7 +42,7 @@ fun SettingsPage(
|
||||||
val skipVersion = LocalSkipVersionNumber.current
|
val skipVersion = LocalSkipVersionNumber.current
|
||||||
val currentVersion by remember { mutableStateOf(context.getCurrentVersion()) }
|
val currentVersion by remember { mutableStateOf(context.getCurrentVersion()) }
|
||||||
|
|
||||||
me.ash.reader.ui.component.base.Scaffold(
|
RYScaffold(
|
||||||
containerColor = MaterialTheme.colorScheme.surface onLight MaterialTheme.colorScheme.inverseOnSurface,
|
containerColor = MaterialTheme.colorScheme.surface onLight MaterialTheme.colorScheme.inverseOnSurface,
|
||||||
navigationIcon = {
|
navigationIcon = {
|
||||||
FeedbackIconButton(
|
FeedbackIconButton(
|
||||||
|
|
|
@ -50,7 +50,7 @@ fun ColorAndStylePage(
|
||||||
val wallpaperTonalPalettes = extractTonalPalettesFromUserWallpaper()
|
val wallpaperTonalPalettes = extractTonalPalettesFromUserWallpaper()
|
||||||
var radioButtonSelected by remember { mutableStateOf(if (themeIndex > 4) 0 else 1) }
|
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,
|
containerColor = MaterialTheme.colorScheme.surface onLight MaterialTheme.colorScheme.inverseOnSurface,
|
||||||
navigationIcon = {
|
navigationIcon = {
|
||||||
FeedbackIconButton(
|
FeedbackIconButton(
|
||||||
|
@ -90,7 +90,7 @@ fun ColorAndStylePage(
|
||||||
Spacer(modifier = Modifier.height(24.dp))
|
Spacer(modifier = Modifier.height(24.dp))
|
||||||
}
|
}
|
||||||
item {
|
item {
|
||||||
BlockRadioGroupButton(
|
BlockRadioButton(
|
||||||
selected = radioButtonSelected,
|
selected = radioButtonSelected,
|
||||||
onSelected = { radioButtonSelected = it },
|
onSelected = { radioButtonSelected = it },
|
||||||
itemRadioGroups = listOf(
|
itemRadioGroups = listOf(
|
||||||
|
@ -142,7 +142,7 @@ fun ColorAndStylePage(
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
me.ash.reader.ui.component.base.Switch(
|
RYSwitch(
|
||||||
activated = darkTheme.isDarkTheme()
|
activated = darkTheme.isDarkTheme()
|
||||||
) {
|
) {
|
||||||
darkThemeNot.put(context, scope)
|
darkThemeNot.put(context, scope)
|
||||||
|
|
|
@ -19,10 +19,7 @@ import me.ash.reader.data.preference.DarkThemePreference
|
||||||
import me.ash.reader.data.preference.LocalAmoledDarkTheme
|
import me.ash.reader.data.preference.LocalAmoledDarkTheme
|
||||||
import me.ash.reader.data.preference.LocalDarkTheme
|
import me.ash.reader.data.preference.LocalDarkTheme
|
||||||
import me.ash.reader.data.preference.not
|
import me.ash.reader.data.preference.not
|
||||||
import me.ash.reader.ui.component.base.DisplayText
|
import me.ash.reader.ui.component.base.*
|
||||||
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.page.settings.SettingItem
|
||||||
import me.ash.reader.ui.theme.palette.onLight
|
import me.ash.reader.ui.theme.palette.onLight
|
||||||
|
|
||||||
|
@ -36,7 +33,7 @@ fun DarkThemePage(
|
||||||
val amoledDarkTheme = LocalAmoledDarkTheme.current
|
val amoledDarkTheme = LocalAmoledDarkTheme.current
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
|
|
||||||
me.ash.reader.ui.component.base.Scaffold(
|
RYScaffold(
|
||||||
containerColor = MaterialTheme.colorScheme.surface onLight MaterialTheme.colorScheme.inverseOnSurface,
|
containerColor = MaterialTheme.colorScheme.surface onLight MaterialTheme.colorScheme.inverseOnSurface,
|
||||||
navigationIcon = {
|
navigationIcon = {
|
||||||
FeedbackIconButton(
|
FeedbackIconButton(
|
||||||
|
@ -75,7 +72,7 @@ fun DarkThemePage(
|
||||||
(!amoledDarkTheme).put(context, scope)
|
(!amoledDarkTheme).put(context, scope)
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
Switch(activated = amoledDarkTheme.value) {
|
RYSwitch(activated = amoledDarkTheme.value) {
|
||||||
(!amoledDarkTheme).put(context, scope)
|
(!amoledDarkTheme).put(context, scope)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ fun FeedsPageStylePage(
|
||||||
|
|
||||||
var filterBarPaddingValue: Int? by remember { mutableStateOf(filterBarPadding) }
|
var filterBarPaddingValue: Int? by remember { mutableStateOf(filterBarPadding) }
|
||||||
|
|
||||||
me.ash.reader.ui.component.base.Scaffold(
|
RYScaffold(
|
||||||
containerColor = MaterialTheme.colorScheme.surface onLight MaterialTheme.colorScheme.inverseOnSurface,
|
containerColor = MaterialTheme.colorScheme.surface onLight MaterialTheme.colorScheme.inverseOnSurface,
|
||||||
navigationIcon = {
|
navigationIcon = {
|
||||||
FeedbackIconButton(
|
FeedbackIconButton(
|
||||||
|
@ -132,7 +132,7 @@ fun FeedsPageStylePage(
|
||||||
(!groupListExpand).put(context, scope)
|
(!groupListExpand).put(context, scope)
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
Switch(activated = groupListExpand.value) {
|
RYSwitch(activated = groupListExpand.value) {
|
||||||
(!groupListExpand).put(context, scope)
|
(!groupListExpand).put(context, scope)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -166,7 +166,7 @@ fun FeedsPageStylePage(
|
||||||
(!filterBarFilled).put(context, scope)
|
(!filterBarFilled).put(context, scope)
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
Switch(activated = filterBarFilled.value) {
|
RYSwitch(activated = filterBarFilled.value) {
|
||||||
(!filterBarFilled).put(context, scope)
|
(!filterBarFilled).put(context, scope)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,6 @@ import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.rounded.ArrowBack
|
import androidx.compose.material.icons.rounded.ArrowBack
|
||||||
import androidx.compose.material.icons.rounded.DoneAll
|
import androidx.compose.material.icons.rounded.DoneAll
|
||||||
import androidx.compose.material.icons.rounded.Search
|
import androidx.compose.material.icons.rounded.Search
|
||||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.SmallTopAppBar
|
import androidx.compose.material3.SmallTopAppBar
|
||||||
import androidx.compose.material3.TopAppBarDefaults
|
import androidx.compose.material3.TopAppBarDefaults
|
||||||
|
@ -66,7 +65,7 @@ fun FlowPageStylePage(
|
||||||
|
|
||||||
var filterBarPaddingValue: Int? by remember { mutableStateOf(filterBarPadding) }
|
var filterBarPaddingValue: Int? by remember { mutableStateOf(filterBarPadding) }
|
||||||
|
|
||||||
me.ash.reader.ui.component.base.Scaffold(
|
RYScaffold(
|
||||||
containerColor = MaterialTheme.colorScheme.surface onLight MaterialTheme.colorScheme.inverseOnSurface,
|
containerColor = MaterialTheme.colorScheme.surface onLight MaterialTheme.colorScheme.inverseOnSurface,
|
||||||
navigationIcon = {
|
navigationIcon = {
|
||||||
FeedbackIconButton(
|
FeedbackIconButton(
|
||||||
|
@ -145,7 +144,7 @@ fun FlowPageStylePage(
|
||||||
(!articleListFeedIcon).put(context, scope)
|
(!articleListFeedIcon).put(context, scope)
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
me.ash.reader.ui.component.base.Switch(activated = articleListFeedIcon.value) {
|
RYSwitch(activated = articleListFeedIcon.value) {
|
||||||
(!articleListFeedIcon).put(context, scope)
|
(!articleListFeedIcon).put(context, scope)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -155,7 +154,7 @@ fun FlowPageStylePage(
|
||||||
(!articleListFeedName).put(context, scope)
|
(!articleListFeedName).put(context, scope)
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
me.ash.reader.ui.component.base.Switch(activated = articleListFeedName.value) {
|
RYSwitch(activated = articleListFeedName.value) {
|
||||||
(!articleListFeedName).put(context, scope)
|
(!articleListFeedName).put(context, scope)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -165,7 +164,7 @@ fun FlowPageStylePage(
|
||||||
(!articleListImage).put(context, scope)
|
(!articleListImage).put(context, scope)
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
me.ash.reader.ui.component.base.Switch(activated = articleListImage.value) {
|
RYSwitch(activated = articleListImage.value) {
|
||||||
(!articleListImage).put(context, scope)
|
(!articleListImage).put(context, scope)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -175,7 +174,7 @@ fun FlowPageStylePage(
|
||||||
(!articleListDesc).put(context, scope)
|
(!articleListDesc).put(context, scope)
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
me.ash.reader.ui.component.base.Switch(activated = articleListDesc.value) {
|
RYSwitch(activated = articleListDesc.value) {
|
||||||
(!articleListDesc).put(context, scope)
|
(!articleListDesc).put(context, scope)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -185,7 +184,7 @@ fun FlowPageStylePage(
|
||||||
(!articleListTime).put(context, scope)
|
(!articleListTime).put(context, scope)
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
me.ash.reader.ui.component.base.Switch(activated = articleListTime.value) {
|
RYSwitch(activated = articleListTime.value) {
|
||||||
(!articleListTime).put(context, scope)
|
(!articleListTime).put(context, scope)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -195,7 +194,7 @@ fun FlowPageStylePage(
|
||||||
(!articleListStickyDate).put(context, scope)
|
(!articleListStickyDate).put(context, scope)
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
me.ash.reader.ui.component.base.Switch(activated = articleListStickyDate.value) {
|
RYSwitch(activated = articleListStickyDate.value) {
|
||||||
(!articleListStickyDate).put(context, scope)
|
(!articleListStickyDate).put(context, scope)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -229,7 +228,7 @@ fun FlowPageStylePage(
|
||||||
(!filterBarFilled).put(context, scope)
|
(!filterBarFilled).put(context, scope)
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
me.ash.reader.ui.component.base.Switch(activated = filterBarFilled.value) {
|
RYSwitch(activated = filterBarFilled.value) {
|
||||||
(!filterBarFilled).put(context, scope)
|
(!filterBarFilled).put(context, scope)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ fun InteractionPage(
|
||||||
var initialPageDialogVisible by remember { mutableStateOf(false) }
|
var initialPageDialogVisible by remember { mutableStateOf(false) }
|
||||||
var initialFilterDialogVisible 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,
|
containerColor = MaterialTheme.colorScheme.surface onLight MaterialTheme.colorScheme.inverseOnSurface,
|
||||||
navigationIcon = {
|
navigationIcon = {
|
||||||
FeedbackIconButton(
|
FeedbackIconButton(
|
||||||
|
|
|
@ -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.Banner
|
||||||
import me.ash.reader.ui.component.base.DisplayText
|
import me.ash.reader.ui.component.base.DisplayText
|
||||||
import me.ash.reader.ui.component.base.FeedbackIconButton
|
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.page.settings.SettingItem
|
||||||
import me.ash.reader.ui.theme.palette.onLight
|
import me.ash.reader.ui.theme.palette.onLight
|
||||||
|
|
||||||
|
@ -38,7 +39,7 @@ fun LanguagesPage(
|
||||||
val languages = LocalLanguages.current
|
val languages = LocalLanguages.current
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
|
|
||||||
me.ash.reader.ui.component.base.Scaffold(
|
RYScaffold(
|
||||||
containerColor = MaterialTheme.colorScheme.surface onLight MaterialTheme.colorScheme.inverseOnSurface,
|
containerColor = MaterialTheme.colorScheme.surface onLight MaterialTheme.colorScheme.inverseOnSurface,
|
||||||
navigationIcon = {
|
navigationIcon = {
|
||||||
FeedbackIconButton(
|
FeedbackIconButton(
|
||||||
|
|
|
@ -38,6 +38,7 @@ import androidx.navigation.NavHostController
|
||||||
import me.ash.reader.R
|
import me.ash.reader.R
|
||||||
import me.ash.reader.ui.component.base.CurlyCornerShape
|
import me.ash.reader.ui.component.base.CurlyCornerShape
|
||||||
import me.ash.reader.ui.component.base.FeedbackIconButton
|
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.ext.*
|
||||||
import me.ash.reader.ui.theme.palette.alwaysLight
|
import me.ash.reader.ui.theme.palette.alwaysLight
|
||||||
import me.ash.reader.ui.theme.palette.onLight
|
import me.ash.reader.ui.theme.palette.onLight
|
||||||
|
@ -61,7 +62,7 @@ fun TipsAndSupportPage(
|
||||||
currentVersion = context.getCurrentVersion().toString()
|
currentVersion = context.getCurrentVersion().toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
me.ash.reader.ui.component.base.Scaffold(
|
RYScaffold(
|
||||||
containerColor = MaterialTheme.colorScheme.surface onLight MaterialTheme.colorScheme.inverseOnSurface,
|
containerColor = MaterialTheme.colorScheme.surface onLight MaterialTheme.colorScheme.inverseOnSurface,
|
||||||
navigationIcon = {
|
navigationIcon = {
|
||||||
FeedbackIconButton(
|
FeedbackIconButton(
|
||||||
|
|
|
@ -33,7 +33,7 @@ import kotlinx.coroutines.Dispatchers
|
||||||
import me.ash.reader.R
|
import me.ash.reader.R
|
||||||
import me.ash.reader.data.preference.*
|
import me.ash.reader.data.preference.*
|
||||||
import me.ash.reader.data.source.Download
|
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.collectAsStateValue
|
||||||
import me.ash.reader.ui.ext.installLatestApk
|
import me.ash.reader.ui.ext.installLatestApk
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ fun UpdateDialog(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Dialog(
|
RYDialog(
|
||||||
modifier = Modifier.heightIn(max = 400.dp),
|
modifier = Modifier.heightIn(max = 400.dp),
|
||||||
visible = updateUiState.updateDialogVisible,
|
visible = updateUiState.updateDialogVisible,
|
||||||
onDismissRequest = { updateViewModel.hideDialog() },
|
onDismissRequest = { updateViewModel.hideDialog() },
|
||||||
|
|
|
@ -5,14 +5,14 @@ import androidx.lifecycle.viewModelScope
|
||||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||||
import kotlinx.coroutines.flow.*
|
import kotlinx.coroutines.flow.*
|
||||||
import kotlinx.coroutines.launch
|
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.data.source.Download
|
||||||
import me.ash.reader.ui.ext.notFdroid
|
import me.ash.reader.ui.ext.notFdroid
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@HiltViewModel
|
@HiltViewModel
|
||||||
class UpdateViewModel @Inject constructor(
|
class UpdateViewModel @Inject constructor(
|
||||||
private val appRepository: AppRepository,
|
private val ryRepository: RYRepository,
|
||||||
) : ViewModel() {
|
) : ViewModel() {
|
||||||
private val _updateUiState = MutableStateFlow(UpdateUiState())
|
private val _updateUiState = MutableStateFlow(UpdateUiState())
|
||||||
val updateUiState: StateFlow<UpdateUiState> = _updateUiState.asStateFlow()
|
val updateUiState: StateFlow<UpdateUiState> = _updateUiState.asStateFlow()
|
||||||
|
@ -24,7 +24,7 @@ class UpdateViewModel @Inject constructor(
|
||||||
if (notFdroid) {
|
if (notFdroid) {
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
preProcessor()
|
preProcessor()
|
||||||
appRepository.checkUpdate().let {
|
ryRepository.checkUpdate().let {
|
||||||
it?.let {
|
it?.let {
|
||||||
if (it) {
|
if (it) {
|
||||||
showDialog()
|
showDialog()
|
||||||
|
@ -63,7 +63,7 @@ class UpdateViewModel @Inject constructor(
|
||||||
}
|
}
|
||||||
_updateUiState.update {
|
_updateUiState.update {
|
||||||
it.copy(
|
it.copy(
|
||||||
downloadFlow = appRepository.downloadFile(url)
|
downloadFlow = ryRepository.downloadFile(url)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ import kotlinx.coroutines.launch
|
||||||
import me.ash.reader.R
|
import me.ash.reader.R
|
||||||
import me.ash.reader.ui.component.base.DisplayText
|
import me.ash.reader.ui.component.base.DisplayText
|
||||||
import me.ash.reader.ui.component.base.DynamicSVGImage
|
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.component.base.Tips
|
||||||
import me.ash.reader.ui.ext.DataStoreKeys
|
import me.ash.reader.ui.ext.DataStoreKeys
|
||||||
import me.ash.reader.ui.ext.dataStore
|
import me.ash.reader.ui.ext.dataStore
|
||||||
|
@ -36,7 +37,7 @@ fun StartupPage(
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
|
|
||||||
me.ash.reader.ui.component.base.Scaffold(
|
RYScaffold(
|
||||||
content = {
|
content = {
|
||||||
LazyColumn {
|
LazyColumn {
|
||||||
item {
|
item {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user