From b010fe940b975c30a46e656ff997ea81c27d433f Mon Sep 17 00:00:00 2001 From: Ash Date: Mon, 16 May 2022 11:04:51 +0800 Subject: [PATCH] Remove invalid @OptIn --- app/src/main/java/me/ash/reader/ui/component/RadioDialog.kt | 3 +-- .../main/java/me/ash/reader/ui/component/TextFieldDialog.kt | 1 - .../me/ash/reader/ui/component/reader/HtmlToComposable.kt | 4 ---- .../ui/page/home/feeds/option/feed/ClearFeedDialog.kt | 1 - .../ui/page/home/feeds/option/feed/DeleteFeedDialog.kt | 1 - .../ui/page/home/feeds/option/feed/FeedOptionViewModel.kt | 1 - .../home/feeds/option/group/AllAllowNotificationDialog.kt | 1 - .../ui/page/home/feeds/option/group/AllMoveToGroupDialog.kt | 1 - .../home/feeds/option/group/AllParseFullContentDialog.kt | 1 - .../ui/page/home/feeds/option/group/ClearGroupDialog.kt | 1 - .../ui/page/home/feeds/option/group/DeleteGroupDialog.kt | 1 - .../ui/page/home/feeds/option/group/GroupOptionViewModel.kt | 6 +----- .../ui/page/home/feeds/subscribe/SubscribeViewModel.kt | 2 -- .../me/ash/reader/ui/page/settings/tips/UpdateDialog.kt | 2 -- 14 files changed, 2 insertions(+), 24 deletions(-) diff --git a/app/src/main/java/me/ash/reader/ui/component/RadioDialog.kt b/app/src/main/java/me/ash/reader/ui/component/RadioDialog.kt index ff1608c..3b447a4 100644 --- a/app/src/main/java/me/ash/reader/ui/component/RadioDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/component/RadioDialog.kt @@ -19,9 +19,8 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.text.style.BaselineShift import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp -import com.google.accompanist.pager.ExperimentalPagerApi -@OptIn(ExperimentalPagerApi::class, ExperimentalMaterial3Api::class) +@OptIn(ExperimentalMaterial3Api::class) @Composable fun RadioDialog( modifier: Modifier = Modifier, diff --git a/app/src/main/java/me/ash/reader/ui/component/TextFieldDialog.kt b/app/src/main/java/me/ash/reader/ui/component/TextFieldDialog.kt index 4609764..5f7adb3 100644 --- a/app/src/main/java/me/ash/reader/ui/component/TextFieldDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/component/TextFieldDialog.kt @@ -16,7 +16,6 @@ import androidx.compose.ui.window.DialogProperties import com.google.accompanist.pager.ExperimentalPagerApi import me.ash.reader.R -@OptIn(ExperimentalPagerApi::class) @Composable fun TextFieldDialog( modifier: Modifier = Modifier, 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 da8c1f1..9e66174 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 @@ -33,7 +33,6 @@ import androidx.compose.foundation.text.selection.DisableSelection import androidx.compose.material.Text import androidx.compose.material3.Surface import androidx.compose.runtime.Composable -import androidx.compose.runtime.ExperimentalComposeApi import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.RectangleShape @@ -48,7 +47,6 @@ import androidx.compose.ui.text.style.BaselineShift import androidx.compose.ui.text.style.TextDecoration import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import coil.annotation.ExperimentalCoilApi import coil.size.Precision import coil.size.Size import coil.size.pxOrElse @@ -178,7 +176,6 @@ private fun LazyListScope.formatCodeBlock( composer.terminateCurrentText() } -@OptIn(ExperimentalComposeApi::class, ExperimentalCoilApi::class) private fun TextComposer.appendTextChildren( nodes: List, preFormatted: Boolean = false, @@ -646,7 +643,6 @@ private fun TextComposer.appendTextChildren( } } -@OptIn(ExperimentalStdlibApi::class) private fun String.asFontFamily(): FontFamily? = when (this.lowercase()) { "monospace" -> FontFamily.Monospace "serif" -> FontFamily.Serif diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/feed/ClearFeedDialog.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/feed/ClearFeedDialog.kt index cad233b..ef28388 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/feed/ClearFeedDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/feed/ClearFeedDialog.kt @@ -17,7 +17,6 @@ import me.ash.reader.ui.component.Dialog import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.showToast -@OptIn(ExperimentalPagerApi::class) @Composable fun ClearFeedDialog( modifier: Modifier = Modifier, diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/feed/DeleteFeedDialog.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/feed/DeleteFeedDialog.kt index 22c8a8e..f0a5c5d 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/feed/DeleteFeedDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/feed/DeleteFeedDialog.kt @@ -17,7 +17,6 @@ import me.ash.reader.ui.component.Dialog import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.showToast -@OptIn(ExperimentalPagerApi::class) @Composable fun DeleteFeedDialog( modifier: Modifier = Modifier, diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/feed/FeedOptionViewModel.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/feed/FeedOptionViewModel.kt index bbe0aef..0488eee 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/feed/FeedOptionViewModel.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/feed/FeedOptionViewModel.kt @@ -23,7 +23,6 @@ import me.ash.reader.data.repository.RssRepository import javax.inject.Inject @OptIn( - ExperimentalPagerApi::class, ExperimentalMaterialApi::class ) @HiltViewModel diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/AllAllowNotificationDialog.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/AllAllowNotificationDialog.kt index 32b599d..d3a7634 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/AllAllowNotificationDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/AllAllowNotificationDialog.kt @@ -17,7 +17,6 @@ import me.ash.reader.ui.component.Dialog import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.showToast -@OptIn(ExperimentalPagerApi::class) @Composable fun AllAllowNotificationDialog( modifier: Modifier = Modifier, diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/AllMoveToGroupDialog.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/AllMoveToGroupDialog.kt index e5ddb62..2aa13ce 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/AllMoveToGroupDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/AllMoveToGroupDialog.kt @@ -17,7 +17,6 @@ import me.ash.reader.ui.component.Dialog import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.showToast -@OptIn(ExperimentalPagerApi::class) @Composable fun AllMoveToGroupDialog( modifier: Modifier = Modifier, diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/AllParseFullContentDialog.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/AllParseFullContentDialog.kt index c5db1da..43d844c 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/AllParseFullContentDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/AllParseFullContentDialog.kt @@ -17,7 +17,6 @@ import me.ash.reader.ui.component.Dialog import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.showToast -@OptIn(ExperimentalPagerApi::class) @Composable fun AllParseFullContentDialog( modifier: Modifier = Modifier, diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/ClearGroupDialog.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/ClearGroupDialog.kt index b02403a..00f26bb 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/ClearGroupDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/ClearGroupDialog.kt @@ -17,7 +17,6 @@ import me.ash.reader.ui.component.Dialog import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.showToast -@OptIn(ExperimentalPagerApi::class) @Composable fun ClearGroupDialog( modifier: Modifier = Modifier, diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/DeleteGroupDialog.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/DeleteGroupDialog.kt index 8c39dc4..d9e96fb 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/DeleteGroupDialog.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/DeleteGroupDialog.kt @@ -17,7 +17,6 @@ import me.ash.reader.ui.component.Dialog import me.ash.reader.ui.ext.collectAsStateValue import me.ash.reader.ui.ext.showToast -@OptIn(ExperimentalPagerApi::class) @Composable fun DeleteGroupDialog( modifier: Modifier = Modifier, diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/GroupOptionViewModel.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/GroupOptionViewModel.kt index 59415b4..f86d43c 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/GroupOptionViewModel.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/option/group/GroupOptionViewModel.kt @@ -5,7 +5,6 @@ import androidx.compose.material.ModalBottomSheetState import androidx.compose.material.ModalBottomSheetValue import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.google.accompanist.pager.ExperimentalPagerApi import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineScope @@ -21,10 +20,7 @@ import me.ash.reader.data.module.DispatcherMain import me.ash.reader.data.repository.RssRepository import javax.inject.Inject -@OptIn( - ExperimentalPagerApi::class, - ExperimentalMaterialApi::class -) +@OptIn(ExperimentalMaterialApi::class) @HiltViewModel class GroupOptionViewModel @Inject constructor( private val rssRepository: RssRepository, diff --git a/app/src/main/java/me/ash/reader/ui/page/home/feeds/subscribe/SubscribeViewModel.kt b/app/src/main/java/me/ash/reader/ui/page/home/feeds/subscribe/SubscribeViewModel.kt index 9bdc1f1..243ed9c 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/feeds/subscribe/SubscribeViewModel.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/feeds/subscribe/SubscribeViewModel.kt @@ -23,7 +23,6 @@ import me.ash.reader.ui.ext.formatUrl import java.io.InputStream import javax.inject.Inject -@OptIn(ExperimentalPagerApi::class) @HiltViewModel class SubscribeViewModel @Inject constructor( private val opmlRepository: OpmlRepository, @@ -245,7 +244,6 @@ class SubscribeViewModel @Inject constructor( } } -@OptIn(ExperimentalPagerApi::class) data class SubscribeViewState( val visible: Boolean = false, val title: String = "", 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 081058b..d1e1cf1 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 @@ -30,7 +30,6 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel -import com.google.accompanist.pager.ExperimentalPagerApi import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.map import kotlinx.coroutines.launch @@ -40,7 +39,6 @@ import me.ash.reader.ui.component.Dialog import me.ash.reader.ui.ext.* @SuppressLint("FlowOperatorInvokedInComposition") -@OptIn(ExperimentalPagerApi::class) @Composable fun UpdateDialog( updateViewModel: UpdateViewModel = hiltViewModel(),