Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ExperimentalWearMaterialApi opt-in and suppress in code #2513

Merged
merged 3 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions auth/composables/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ android {
jvmTarget = JavaVersion.VERSION_17.majorVersion
freeCompilerArgs += listOf(
"-opt-in=com.google.android.horologist.annotations.ExperimentalHorologistApi",
"-opt-in=androidx.compose.foundation.ExperimentalFoundationApi",
"-opt-in=androidx.wear.compose.material.ExperimentalWearMaterialApi",
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ fun HorologistTheme(
if (!view.isInEditMode) {
SideEffect {
val window = (view.context as Activity).window
@Suppress("DEPRECATION")
window.statusBarColor = colorScheme.primary.toArgb()
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme
}
Expand Down
2 changes: 0 additions & 2 deletions composables/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ android {
jvmTarget = JavaVersion.VERSION_17.majorVersion
freeCompilerArgs += listOf(
"-opt-in=com.google.android.horologist.annotations.ExperimentalHorologistApi",
"-opt-in=androidx.compose.foundation.ExperimentalFoundationApi",
"-opt-in=androidx.wear.compose.material.ExperimentalWearMaterialApi",
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@
* limitations under the License.
*/

@file:OptIn(ExperimentalWearMaterialApi::class)

package com.google.android.horologist.composables

import androidx.compose.runtime.Composable
import androidx.wear.compose.material.ChipDefaults
import androidx.wear.compose.material.ExperimentalWearMaterialApi
import com.google.android.horologist.compose.tools.WearPreview

@WearPreview
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

@file:OptIn(ExperimentalWearMaterialApi::class)

package com.google.android.horologist.composables

import androidx.compose.foundation.layout.padding
Expand All @@ -29,6 +31,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.wear.compose.material.ChipDefaults
import androidx.wear.compose.material.ExperimentalWearMaterialApi
import androidx.wear.compose.material.Icon
import androidx.wear.compose.material.MaterialTheme
import androidx.wear.compose.material.Text
Expand Down
2 changes: 0 additions & 2 deletions compose-material/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ android {
jvmTarget = JavaVersion.VERSION_17.majorVersion
freeCompilerArgs += listOf(
"-opt-in=com.google.android.horologist.annotations.ExperimentalHorologistApi",
"-opt-in=androidx.compose.foundation.ExperimentalFoundationApi",
"-opt-in=androidx.wear.compose.material.ExperimentalWearMaterialApi",
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import android.content.Intent
import android.net.Uri
import android.os.Bundle
import androidx.core.content.ContextCompat
import androidx.core.net.toUri

private const val PLAY_STORE_APP_URI_PREFIX = "market://details?id="
private const val PLAY_STORE_WEB_URL_PREFIX = "https://play.google.com/store/apps/details?id="
Expand All @@ -31,21 +32,19 @@ private const val PLAY_STORE_WEB_URL_PREFIX = "https://play.google.com/store/app
*/
public fun Context.launchPlay(packageName: String) {
try {
ContextCompat.startActivity(
this,
startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse(PLAY_STORE_APP_URI_PREFIX + packageName),
(PLAY_STORE_APP_URI_PREFIX + packageName).toUri(),
),
Bundle(),
)
} catch (anfe: ActivityNotFoundException) {
// Handle scenario where Google Play app is not installed
ContextCompat.startActivity(
this,
startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse(PLAY_STORE_WEB_URL_PREFIX + packageName),
(PLAY_STORE_WEB_URL_PREFIX + packageName).toUri(),
),
Bundle(),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ public open class VolumeViewModel(
}

public fun increaseVolume() {
this.userActionEvents.tryEmit(Unit)
val unused = userActionEvents.tryEmit(Unit)
volumeRepository.increaseVolume()
}

public fun decreaseVolume() {
this.userActionEvents.tryEmit(Unit)
val unused = userActionEvents.tryEmit(Unit)
volumeRepository.decreaseVolume()
}

Expand Down Expand Up @@ -127,7 +127,7 @@ public open class VolumeViewModel(
}

public fun setVolume(volume: Int) {
this.userActionEvents.tryEmit(Unit)
val unused = userActionEvents.tryEmit(Unit)
if (volume != volumeRepository.volumeState.value.current) {
volumeRepository.setVolume(volume)
}
Expand Down
1 change: 0 additions & 1 deletion media/ui-model/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ android {
com.google.android.horologist.annotations.ExperimentalHorologistApi
kotlin.RequiresOptIn
kotlinx.coroutines.ExperimentalCoroutinesApi
androidx.wear.compose.material.ExperimentalWearMaterialApi
""".trim().split("\\s+".toRegex()).map {
"-opt-in=$it"
}
Expand Down
1 change: 0 additions & 1 deletion media/ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ android {
com.google.android.horologist.annotations.ExperimentalHorologistApi
kotlin.RequiresOptIn
kotlinx.coroutines.ExperimentalCoroutinesApi
androidx.wear.compose.material.ExperimentalWearMaterialApi
""".trim().split("\\s+".toRegex()).map {
"-opt-in=$it"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

@file:OptIn(ExperimentalWearMaterialApi::class)

package com.google.android.horologist.media.ui.screens.browse

import androidx.compose.material.icons.Icons
Expand All @@ -25,6 +27,7 @@ import androidx.compose.material.icons.filled.Podcasts
import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
import androidx.wear.compose.material.ChipDefaults
import androidx.wear.compose.material.ExperimentalWearMaterialApi
import androidx.wear.compose.ui.tooling.preview.WearPreviewDevices
import com.google.android.horologist.composables.PlaceholderChip
import com.google.android.horologist.composables.Section
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

@file:OptIn(ExperimentalWearMaterialApi::class)

package com.google.android.horologist.media.ui.screens.entity

import androidx.compose.foundation.background
Expand Down Expand Up @@ -41,6 +43,7 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.wear.compose.material.ChipDefaults
import androidx.wear.compose.material.ExperimentalWearMaterialApi
import androidx.wear.compose.material.Icon
import androidx.wear.compose.material.Text
import androidx.wear.compose.ui.tooling.preview.WearPreviewDevices
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@
* limitations under the License.
*/

@file:OptIn(ExperimentalWearMaterialApi::class)

package com.google.android.horologist.media.ui.components

import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.wear.compose.material.ExperimentalWearMaterialApi
import com.google.android.horologist.annotations.ExperimentalHorologistApi
import com.google.android.horologist.media.ui.components.display.LoadingMediaDisplay
import com.google.android.horologist.media.ui.components.display.NothingPlayingDisplay
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@
* limitations under the License.
*/

@file:OptIn(ExperimentalWearMaterialApi::class)

package com.google.android.horologist.media.ui.components.animated

import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.wear.compose.material.ExperimentalWearMaterialApi
import com.google.android.horologist.annotations.ExperimentalHorologistApi
import com.google.android.horologist.media.ui.components.display.LoadingMediaDisplay
import com.google.android.horologist.media.ui.components.display.NothingPlayingDisplay
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

@file:OptIn(ExperimentalWearMaterialApi::class)

package com.google.android.horologist.media.ui.screens.browse

import androidx.compose.material.icons.Icons
Expand All @@ -27,6 +29,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.onClick
import androidx.compose.ui.semantics.semantics
import androidx.wear.compose.material.ChipDefaults
import androidx.wear.compose.material.ExperimentalWearMaterialApi
import com.google.android.horologist.annotations.ExperimentalHorologistApi
import com.google.android.horologist.composables.PlaceholderChip
import com.google.android.horologist.composables.Section
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

@file:OptIn(ExperimentalWearMaterialApi::class)

package com.google.android.horologist.media.ui.screens.entity

import android.text.format.Formatter
Expand Down Expand Up @@ -49,6 +51,7 @@ import androidx.compose.ui.unit.dp
import androidx.wear.compose.material.ButtonDefaults
import androidx.wear.compose.material.ChipDefaults
import androidx.wear.compose.material.CircularProgressIndicator
import androidx.wear.compose.material.ExperimentalWearMaterialApi
import androidx.wear.compose.material.Icon
import androidx.wear.compose.material.MaterialTheme
import androidx.wear.compose.material.ProgressIndicatorDefaults
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

@file:OptIn(ExperimentalWearMaterialApi::class)

package com.google.android.horologist.media.ui.screens.entity

import androidx.compose.foundation.layout.Row
Expand All @@ -28,6 +30,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.wear.compose.material.ChipDefaults
import androidx.wear.compose.material.ExperimentalWearMaterialApi
import com.google.android.horologist.annotations.ExperimentalHorologistApi
import com.google.android.horologist.composables.PlaceholderChip
import com.google.android.horologist.compose.layout.rememberActivePlaceholderState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

@file:OptIn(ExperimentalWearMaterialApi::class)

package com.google.android.horologist.media.ui.screens.playlists

import androidx.compose.foundation.layout.Column
Expand All @@ -23,6 +25,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.unit.dp
import androidx.wear.compose.material.ChipDefaults
import androidx.wear.compose.material.ExperimentalWearMaterialApi
import com.google.android.horologist.annotations.ExperimentalHorologistApi
import com.google.android.horologist.composables.PlaceholderChip
import com.google.android.horologist.composables.Section
Expand Down
Loading