Handle experimental API opt-ins at module level
This commit is contained in:
parent
ff5868dfe7
commit
042c0e2040
@ -30,6 +30,17 @@ android {
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
freeCompilerArgs = listOf(
|
||||
"-opt-in=androidx.compose.ui.ExperimentalComposeUiApi",
|
||||
"-opt-in=androidx.compose.foundation.ExperimentalFoundationApi",
|
||||
"-opt-in=androidx.compose.ui.text.ExperimentalTextApi",
|
||||
"-opt-in=androidx.compose.ui.unit.ExperimentalUnitApi",
|
||||
"-opt-in=androidx.compose.material.ExperimentalMaterialApi",
|
||||
"-opt-in=androidx.compose.material3.ExperimentalMaterial3Api",
|
||||
"-opt-in=androidx.compose.animation.graphics.ExperimentalAnimationGraphicsApi",
|
||||
"-opt-in=androidx.compose.animation.ExperimentalAnimationApi",
|
||||
"-opt-in=com.google.accompanist.pager.ExperimentalPagerApi",
|
||||
)
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
|
||||
@ -8,7 +8,6 @@ import androidx.compose.ui.unit.TextUnit
|
||||
import androidx.compose.ui.unit.TextUnitType
|
||||
|
||||
object TextUnitConverter : TwoWayConverter<TextUnit, AnimationVector2D> {
|
||||
@OptIn(ExperimentalUnitApi::class)
|
||||
override val convertFromVector: (AnimationVector2D) -> TextUnit
|
||||
get() = {
|
||||
TextUnit(
|
||||
|
||||
@ -27,7 +27,6 @@ import de.mm20.launcher2.ui.component.BottomSheetDialog
|
||||
import de.mm20.launcher2.ui.component.LargeMessage
|
||||
import de.mm20.launcher2.ui.component.SmallMessage
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun RestoreBackupSheet(
|
||||
uri: Uri,
|
||||
|
||||
@ -23,7 +23,6 @@ import de.mm20.launcher2.ui.component.BottomSheetDialog
|
||||
import de.mm20.launcher2.ui.component.SmallMessage
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun WeatherLocationSearchDialog(
|
||||
onDismissRequest: () -> Unit
|
||||
|
||||
@ -10,7 +10,6 @@ import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun Banner(
|
||||
modifier: Modifier = Modifier,
|
||||
|
||||
@ -29,9 +29,6 @@ import de.mm20.launcher2.ui.ktx.toDp
|
||||
import de.mm20.launcher2.ui.ktx.toPixels
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
@OptIn(ExperimentalComposeUiApi::class, ExperimentalMaterialApi::class,
|
||||
ExperimentalMaterial3Api::class
|
||||
)
|
||||
@Composable
|
||||
fun BottomSheetDialog(
|
||||
onDismissRequest: () -> Unit,
|
||||
|
||||
@ -16,7 +16,6 @@ import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun Chip(
|
||||
modifier: Modifier = Modifier,
|
||||
|
||||
@ -50,7 +50,6 @@ import kotlin.math.abs
|
||||
import kotlin.math.pow
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
@OptIn(ExperimentalFoundationApi::class)
|
||||
@Composable
|
||||
fun ShapedLauncherIcon(
|
||||
modifier: Modifier = Modifier,
|
||||
|
||||
@ -11,7 +11,6 @@ import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun SmallMessage(
|
||||
modifier: Modifier = Modifier,
|
||||
|
||||
@ -11,7 +11,6 @@ import androidx.compose.ui.unit.dp
|
||||
import com.godaddy.android.colorpicker.ClassicColorPicker
|
||||
import de.mm20.launcher2.ui.ktx.toHexString
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun ColorPreference(
|
||||
title: String,
|
||||
|
||||
@ -13,7 +13,6 @@ import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.window.Dialog
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun <T> ListPreference(
|
||||
title: String,
|
||||
|
||||
@ -19,7 +19,6 @@ import com.google.accompanist.systemuicontroller.rememberSystemUiController
|
||||
import de.mm20.launcher2.ui.locals.LocalNavController
|
||||
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun PreferenceScreen(
|
||||
title: String,
|
||||
|
||||
@ -4,7 +4,6 @@ import androidx.compose.material3.*
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.res.stringResource
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun TextPreference(
|
||||
title: String,
|
||||
|
||||
@ -60,7 +60,6 @@ fun AnimatedWeatherIcon(
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalAnimationGraphicsApi::class)
|
||||
@Composable
|
||||
private fun SunMoon(icon: WeatherIcon, night: Boolean) {
|
||||
val sunMoonIcon = AnimatedImageVector.animatedVectorResource(R.drawable.anim_weather_sun_moon)
|
||||
|
||||
@ -47,10 +47,6 @@ import de.mm20.launcher2.ui.launcher.widgets.WidgetColumn
|
||||
import de.mm20.launcher2.ui.utils.rememberNotificationShadeController
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
@OptIn(
|
||||
ExperimentalMaterialApi::class, ExperimentalFoundationApi::class,
|
||||
ExperimentalMaterial3Api::class
|
||||
)
|
||||
@Composable
|
||||
fun PagerScaffold(
|
||||
modifier: Modifier = Modifier,
|
||||
|
||||
@ -45,7 +45,6 @@ import de.mm20.launcher2.ui.modifier.verticalFadingEdges
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
@OptIn(ExperimentalFoundationApi::class, ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun PullDownScaffold(
|
||||
modifier: Modifier = Modifier,
|
||||
|
||||
@ -148,7 +148,6 @@ fun SearchBar(
|
||||
)
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalAnimationGraphicsApi::class)
|
||||
@Composable
|
||||
fun SearchBar(
|
||||
modifier: Modifier = Modifier,
|
||||
|
||||
@ -320,7 +320,6 @@ fun AppItem(
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalAnimationApi::class)
|
||||
@Composable
|
||||
fun AppItemGridPopup(
|
||||
app: Application,
|
||||
|
||||
@ -261,7 +261,6 @@ fun CalendarItem(
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalAnimationApi::class)
|
||||
@Composable
|
||||
fun CalendarItemGridPopup(
|
||||
calendar: CalendarEvent,
|
||||
|
||||
@ -35,7 +35,6 @@ import de.mm20.launcher2.ui.ktx.toPixels
|
||||
import de.mm20.launcher2.ui.locals.LocalGridColumns
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun CustomizeSearchableSheet(
|
||||
searchable: Searchable,
|
||||
|
||||
@ -111,7 +111,6 @@ fun GridItem(modifier: Modifier = Modifier, item: Searchable, showLabels: Boolea
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalComposeUiApi::class)
|
||||
@Composable
|
||||
fun ItemPopup(origin: Rect, searchable: Searchable, onDismissRequest: () -> Unit) {
|
||||
var show by remember { mutableStateOf(false) }
|
||||
|
||||
@ -16,7 +16,6 @@ import de.mm20.launcher2.ui.launcher.search.contacts.ContactItem
|
||||
import de.mm20.launcher2.ui.launcher.search.files.FileItem
|
||||
import de.mm20.launcher2.ui.launcher.search.shortcut.AppShortcutItem
|
||||
|
||||
@OptIn(androidx.compose.foundation.ExperimentalFoundationApi::class)
|
||||
@Composable
|
||||
fun ListItem(modifier: Modifier = Modifier, item: Searchable) {
|
||||
var showDetails by remember { mutableStateOf(false) }
|
||||
|
||||
@ -318,7 +318,6 @@ fun ContactItem(
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalAnimationApi::class)
|
||||
@Composable
|
||||
fun ContactItemGridPopup(
|
||||
contact: Contact,
|
||||
|
||||
@ -285,7 +285,6 @@ fun FileItem(
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalAnimationApi::class)
|
||||
@Composable
|
||||
fun FileItemGridPopup(
|
||||
file: File,
|
||||
|
||||
@ -18,7 +18,6 @@ import de.mm20.launcher2.ui.launcher.LauncherActivityVM
|
||||
import de.mm20.launcher2.ui.launcher.modals.HiddenItemsSheet
|
||||
import de.mm20.launcher2.ui.launcher.search.SearchVM
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun ColumnScope.HiddenResults() {
|
||||
val viewModel: SearchVM = viewModel()
|
||||
|
||||
@ -224,7 +224,6 @@ fun AppShortcutItem(
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalAnimationApi::class)
|
||||
@Composable
|
||||
fun ShortcutItemGridPopup(
|
||||
shortcut: AppShortcut,
|
||||
|
||||
@ -127,7 +127,6 @@ fun WebsiteItem(
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalAnimationApi::class)
|
||||
@Composable
|
||||
fun WebsiteItemGridPopup(
|
||||
website: Website,
|
||||
|
||||
@ -134,7 +134,6 @@ fun WikipediaItem(
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalAnimationApi::class)
|
||||
@Composable
|
||||
fun WikipediaItemGridPopup(
|
||||
wikipedia: Wikipedia,
|
||||
|
||||
@ -43,7 +43,6 @@ import de.mm20.launcher2.widgets.ExternalWidget
|
||||
import kotlinx.coroutines.awaitCancellation
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@OptIn(ExperimentalAnimationGraphicsApi::class)
|
||||
@Composable
|
||||
fun WidgetColumn(
|
||||
modifier: Modifier = Modifier,
|
||||
|
||||
@ -30,7 +30,6 @@ import de.mm20.launcher2.ui.launcher.search.common.list.SearchResultList
|
||||
import java.time.LocalDate
|
||||
import java.time.ZoneId
|
||||
|
||||
@OptIn(ExperimentalComposeUiApi::class)
|
||||
@Composable
|
||||
fun CalendarWidget() {
|
||||
val viewModel: CalendarWidgetVM = viewModel()
|
||||
|
||||
@ -53,7 +53,6 @@ class BatteryPartProvider : PartProvider {
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalComposeUiApi::class)
|
||||
@Composable
|
||||
override fun Component(layout: Settings.ClockWidgetSettings.ClockWidgetLayout) {
|
||||
|
||||
|
||||
@ -48,10 +48,6 @@ class MusicPartProvider : PartProvider, KoinComponent {
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(
|
||||
ExperimentalAnimationGraphicsApi::class,
|
||||
ExperimentalFoundationApi::class
|
||||
)
|
||||
@Composable
|
||||
override fun Component(layout: ClockWidgetLayout) {
|
||||
val context = LocalContext.current
|
||||
|
||||
@ -37,10 +37,6 @@ import de.mm20.launcher2.ui.R
|
||||
import de.mm20.launcher2.ui.component.MissingPermissionBanner
|
||||
import de.mm20.launcher2.ui.ktx.conditional
|
||||
|
||||
@OptIn(
|
||||
ExperimentalFoundationApi::class,
|
||||
ExperimentalAnimationGraphicsApi::class
|
||||
)
|
||||
@Composable
|
||||
fun MusicWidget() {
|
||||
|
||||
|
||||
@ -32,7 +32,6 @@ class PickAppWidgetActivity : BaseActivity() {
|
||||
private lateinit var appWidgetManager: AppWidgetManager
|
||||
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
widgetHost = AppWidgetHost(this, 44203)
|
||||
|
||||
@ -54,7 +54,6 @@ class SettingsActivity : BaseActivity() {
|
||||
|
||||
private val dataStore: LauncherDataStore by inject()
|
||||
|
||||
@OptIn(ExperimentalAnimationApi::class)
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
|
||||
@ -279,7 +279,6 @@ fun AppearanceSettingsScreen() {
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalPagerApi::class)
|
||||
@Composable
|
||||
fun SearchBarStylePreference(
|
||||
title: String,
|
||||
@ -446,7 +445,6 @@ fun IconShapePreference(
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalPagerApi::class)
|
||||
@Composable
|
||||
fun LayoutPreference(
|
||||
title: String,
|
||||
|
||||
@ -175,7 +175,6 @@ fun CreateBackupSheet(
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun BackupableComponent(
|
||||
title: String,
|
||||
|
||||
@ -67,7 +67,6 @@ fun CalendarWidgetSettingsScreen() {
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class, ExperimentalComposeUiApi::class)
|
||||
@Composable
|
||||
fun ExcludedCalendarsPreference(
|
||||
calendars: List<UserCalendar>,
|
||||
|
||||
@ -115,7 +115,6 @@ fun ClockWidgetSettingsScreen() {
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalPagerApi::class)
|
||||
@Composable
|
||||
fun ClockStylePreference(
|
||||
layout: ClockWidgetLayout,
|
||||
|
||||
@ -28,7 +28,6 @@ import de.mm20.launcher2.ui.component.preferences.PreferenceScreen
|
||||
import de.mm20.launcher2.ui.locals.LocalNavController
|
||||
import java.net.URLEncoder
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun CrashReporterScreen() {
|
||||
val viewModel: CrashReporterScreenVM = viewModel()
|
||||
|
||||
@ -25,7 +25,6 @@ import androidx.lifecycle.viewmodel.compose.viewModel
|
||||
import de.mm20.launcher2.ui.R
|
||||
import de.mm20.launcher2.ui.component.preferences.PreferenceScreen
|
||||
|
||||
@OptIn(ExperimentalAnimationApi::class)
|
||||
@Composable
|
||||
fun EasterEggSettingsScreen() {
|
||||
val viewModel: EasterEggSettingsScreenVM = viewModel()
|
||||
|
||||
@ -26,7 +26,6 @@ import de.mm20.launcher2.ui.R
|
||||
import de.mm20.launcher2.ui.component.ShapedLauncherIcon
|
||||
import de.mm20.launcher2.ui.component.preferences.PreferenceScreen
|
||||
|
||||
@OptIn(ExperimentalFoundationApi::class)
|
||||
@Composable
|
||||
fun HiddenItemsSettingsScreen() {
|
||||
val viewModel: HiddenItemsSettingsScreenVM = viewModel()
|
||||
|
||||
@ -26,7 +26,6 @@ import de.mm20.launcher2.ui.R
|
||||
import de.mm20.launcher2.ui.component.preferences.PreferenceCategory
|
||||
import de.mm20.launcher2.ui.locals.LocalNavController
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun LicenseScreen(library: OpenSourceLibrary) {
|
||||
val context = LocalContext.current
|
||||
|
||||
@ -132,7 +132,6 @@ fun WebsearchPreference(
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun EditWebsearchDialog(
|
||||
title: String,
|
||||
@ -431,7 +430,6 @@ fun EditWebsearchDialog(
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
private fun ColorPicker(
|
||||
value: Int,
|
||||
|
||||
@ -4,7 +4,6 @@ import android.content.Context
|
||||
import androidx.compose.ui.text.ExperimentalTextApi
|
||||
import androidx.compose.ui.text.font.*
|
||||
|
||||
@OptIn(ExperimentalTextApi::class)
|
||||
fun getDeviceHeadlineFontFamily(context: Context): FontFamily {
|
||||
val configResId = context.resources
|
||||
.getIdentifier("config_headlineFontFamily", "string", "android")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user