Skip to content

Commit

Permalink
Merge pull request #190 from chikoski/main
Browse files Browse the repository at this point in the history
[JetStream] Update tv-material to 1.0.0 stable
  • Loading branch information
chikoski authored Sep 26, 2024
2 parents a6ca5ff + 84055dd commit 732dcc0
Show file tree
Hide file tree
Showing 27 changed files with 28 additions and 110 deletions.
10 changes: 2 additions & 8 deletions JetStreamCompose/benchmark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,13 @@ kotlin {
jvmToolchain(17)
}

composeCompiler {
enableStrongSkippingMode = true
}

android {
namespace = "com.google.jetstream.benchmark"
compileSdk = 34
compileSdk = 35

defaultConfig {
minSdk = 28
targetSdk = 34
targetSdk = 35

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments["androidx.benchmark.suppressErrors"] = "EMULATOR"
Expand Down Expand Up @@ -67,8 +63,6 @@ baselineProfile {


dependencies {
implementation(libs.androidx.compose.runtime.base)

implementation(libs.androidx.junit)
implementation(libs.androidx.uiautomator)

Expand Down
44 changes: 19 additions & 25 deletions JetStreamCompose/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,40 +1,34 @@
[versions]
activity-compose = "1.9.0"
android-gradle-plugin = "8.4.1"
android-test-plugin = "8.4.1"
androidx-baselineprofile = "1.2.4"
benchmark-macro-junit4 = "1.2.4"
activity-compose = "1.9.2"
android-gradle-plugin = "8.6.1"
android-test-plugin = "8.6.1"
androidx-baselineprofile = "1.3.1"
benchmark-macro-junit4 = "1.3.1"
coil-compose = "2.6.0"
compose-bom = "2024.05.00"
compose-foundation = "1.7.0-beta02"
compose-ui = "1.7.0-beta02"
compose-runtime = "1.7.0-beta02"
tv-material = "1.0.0-beta01"
compose-bom = "2024.09.02"
tv-material = "1.0.0"
core-ktx = "1.13.1"
core-splashscreen = "1.0.1"
hilt-navigation-compose = "1.2.0"
hilt-android = "2.51.1"
junit = "1.1.5"
kotlin-android = "2.0.0"
kotlinx-serialization = "1.6.0"
ksp = "2.0.0-1.0.21"
lifecycle-runtime-ktx = "2.8.1"
media3-ui = "1.3.1"
media3-exoplayer = "1.3.1"
navigation-compose = "2.7.7"
profileinstaller = "1.3.1"
junit = "1.2.1"
kotlin-android = "2.0.20"
kotlinx-serialization = "1.6.3"
ksp = "2.0.20-1.0.24"
lifecycle-runtime-ktx = "2.8.6"
media3-ui = "1.4.1"
media3-exoplayer = "1.4.1"
navigation-compose = "2.8.1"
profileinstaller = "1.4.0"
uiautomator = "2.3.0"
rules = "1.5.0"
rules = "1.6.1"

[libraries]
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activity-compose" }
androidx-benchmark-macro-junit4 = { module = "androidx.benchmark:benchmark-macro-junit4", version.ref = "benchmark-macro-junit4" }
androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "compose-bom" }
androidx-compose-foundation-base = { module = "androidx.compose.foundation:foundation", version.ref = "compose-foundation" }
androidx-compose-runtime-base = { module = "androidx.compose.runtime:runtime", version.ref = "compose-runtime" }
androidx-compose-ui-base = { module = "androidx.compose.ui:ui", version.ref = "compose-ui" }
androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose-ui" }
androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose-ui" }
androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" }
androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" }
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "core-ktx" }
androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "core-splashscreen" }
androidx-hilt-navigation-compose = { module = "androidx.hilt:hilt-navigation-compose", version.ref = "hilt-navigation-compose" }
Expand Down
2 changes: 1 addition & 1 deletion JetStreamCompose/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
16 changes: 2 additions & 14 deletions JetStreamCompose/jetstream/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
Expand All @@ -29,19 +27,15 @@ kotlin {
jvmToolchain(17)
}

composeCompiler {
enableStrongSkippingMode = true
}

android {
namespace = "com.google.jetstream"
// Needed for latest androidx snapshot build
compileSdk = 34
compileSdk = 35

defaultConfig {
applicationId = "com.google.jetstream"
minSdk = 28
targetSdk = 34
targetSdk = 35
versionCode = 1
versionName = "1.0"

Expand Down Expand Up @@ -79,14 +73,8 @@ dependencies {
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.androidx.activity.compose)
implementation(platform(libs.androidx.compose.bom))

// Compose UI libs (Using snapshot build for focus restoring APIs)
implementation(libs.androidx.compose.ui.base)
implementation(libs.androidx.compose.ui.tooling.preview)

// Compose foundation library to replace tv-foundation
implementation(libs.androidx.compose.foundation.base)

// extra material icons
implementation(libs.androidx.material.icons.extended)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.Modifier
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.tv.material3.ExperimentalTvMaterial3Api
import androidx.tv.material3.LocalContentColor
import androidx.tv.material3.MaterialTheme
import com.google.jetstream.presentation.App
Expand All @@ -34,7 +33,6 @@ import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class MainActivity : ComponentActivity() {
@OptIn(ExperimentalTvMaterial3Api::class)
override fun onCreate(savedInstanceState: Bundle?) {
installSplashScreen()
super.onCreate(savedInstanceState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ import androidx.compose.ui.unit.DpRect
import androidx.compose.ui.unit.height
import androidx.compose.ui.unit.width
import androidx.compose.ui.zIndex
import androidx.tv.material3.ExperimentalTvMaterial3Api
import androidx.tv.material3.MaterialTheme

@OptIn(ExperimentalTvMaterial3Api::class)
@Composable
fun DashboardTopBarItemIndicator(
currentTabPosition: DpRect,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,8 @@ fun MovieFilterChip(

private val ChipColor @Composable get() = Color.White.copy(alpha = 0.1f)

@OptIn(ExperimentalTvMaterial3Api::class)
private val ChipContentColor @Composable get() = MaterialTheme.colorScheme.inverseSurface

@OptIn(ExperimentalTvMaterial3Api::class)
private val ChipFocusedBorder
@Composable get() = Border(
border = BorderStroke(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ val CarouselSaver = Saver<CarouselState, Int>(
restore = { CarouselState(it) }
)

@OptIn(
ExperimentalTvMaterial3Api::class
)
@OptIn(ExperimentalTvMaterial3Api::class)
@Composable
fun FeaturedMoviesCarousel(
movies: List<Movie>,
Expand Down Expand Up @@ -171,7 +169,6 @@ private fun BoxScope.CarouselIndicator(
}
}

@OptIn(ExperimentalTvMaterial3Api::class)
@Composable
private fun CarouselItemForeground(
movie: Movie,
Expand Down Expand Up @@ -248,7 +245,6 @@ private fun CarouselItemBackground(movie: Movie, modifier: Modifier = Modifier)
)
}

@OptIn(ExperimentalTvMaterial3Api::class)
@Composable
private fun WatchNowButton() {
Button(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import androidx.compose.ui.unit.sp
import androidx.tv.material3.Border
import androidx.tv.material3.CardDefaults
import androidx.tv.material3.ClassicCard
import androidx.tv.material3.ExperimentalTvMaterial3Api
import androidx.tv.material3.MaterialTheme
import androidx.tv.material3.Text
import com.google.jetstream.R
Expand All @@ -50,7 +49,7 @@ import com.google.jetstream.presentation.theme.JetStreamBorderWidth
import com.google.jetstream.presentation.theme.JetStreamCardShape
import com.google.jetstream.presentation.utils.ourColors

@OptIn(ExperimentalComposeUiApi::class, ExperimentalTvMaterial3Api::class)
@OptIn(ExperimentalComposeUiApi::class)
@Composable
fun CastAndCrewList(castAndCrew: List<MovieCast>) {
val childPadding = rememberChildPadding()
Expand Down Expand Up @@ -79,9 +78,7 @@ fun CastAndCrewList(castAndCrew: List<MovieCast>) {
}
}

@OptIn(ExperimentalTvMaterial3Api::class)
@Composable

private fun CastAndCrewItem(
castMember: MovieCast,
modifier: Modifier = Modifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.tv.material3.ExperimentalTvMaterial3Api
import androidx.tv.material3.MaterialTheme
import androidx.tv.material3.Text

@OptIn(ExperimentalTvMaterial3Api::class)
@Composable
fun DotSeparatedRow(
modifier: Modifier = Modifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.tv.material3.Border
import androidx.tv.material3.ClickableSurfaceDefaults
import androidx.tv.material3.ExperimentalTvMaterial3Api
import androidx.tv.material3.Icon
import androidx.tv.material3.MaterialTheme
import androidx.tv.material3.Surface
Expand All @@ -49,7 +48,6 @@ import com.google.jetstream.data.util.StringConstants
import com.google.jetstream.presentation.screens.dashboard.rememberChildPadding
import com.google.jetstream.presentation.theme.JetStreamCardShape

@OptIn(ExperimentalTvMaterial3Api::class)
@Composable
fun MovieReviews(
modifier: Modifier = Modifier,
Expand Down Expand Up @@ -80,7 +78,6 @@ fun MovieReviews(
}
}

@OptIn(ExperimentalTvMaterial3Api::class)
@Composable
private fun Review(
reviewAndRating: MovieReviewsAndRatings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ import androidx.compose.ui.unit.dp
import androidx.tv.material3.Border
import androidx.tv.material3.CardDefaults
import androidx.tv.material3.CompactCard
import androidx.tv.material3.ExperimentalTvMaterial3Api
import androidx.tv.material3.MaterialTheme
import androidx.tv.material3.Text
import coil.compose.AsyncImage
Expand Down Expand Up @@ -86,7 +85,6 @@ fun MoviesScreenMovieList(
}
}

@OptIn(ExperimentalTvMaterial3Api::class)
@Composable
private fun MovieListItem(
itemWidth: Dp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.text.font.FontWeight
import androidx.tv.material3.ExperimentalTvMaterial3Api
import androidx.tv.material3.MaterialTheme
import androidx.tv.material3.Text

@OptIn(ExperimentalTvMaterial3Api::class)
@Composable
fun TitleValueText(
modifier: Modifier = Modifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.dp
import androidx.tv.material3.ExperimentalTvMaterial3Api
import androidx.tv.material3.MaterialTheme
import androidx.tv.material3.Text
import com.google.jetstream.data.util.StringConstants

@OptIn(ExperimentalTvMaterial3Api::class)
@Composable
fun AboutSection() {
val context = LocalContext.current
Expand Down Expand Up @@ -83,5 +81,5 @@ fun AboutSection() {
private fun Context.getVersionNumber(): String {
val packageName = packageName
val metaData = packageManager.getPackageInfo(packageName, PackageManager.GET_META_DATA)
return metaData.versionName
return metaData.versionName!!
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@ import androidx.compose.ui.unit.dp
import androidx.tv.material3.Border
import androidx.tv.material3.Button
import androidx.tv.material3.ButtonDefaults
import androidx.tv.material3.ExperimentalTvMaterial3Api
import androidx.tv.material3.MaterialTheme
import androidx.tv.material3.Text
import com.google.jetstream.presentation.theme.JetStreamButtonShape

@OptIn(ExperimentalTvMaterial3Api::class)
@Composable
fun AccountsSectionDialogButton(
modifier: Modifier = Modifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowForwardIos
import androidx.compose.material.icons.filled.ArrowForwardIos
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -54,7 +53,6 @@ fun HelpAndSupportSection() {
}
}

@OptIn(ExperimentalTvMaterial3Api::class)
@Composable
private fun HelpAndSupportSectionItem(
title: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.tv.material3.ExperimentalTvMaterial3Api
import androidx.tv.material3.ListItem
import androidx.tv.material3.ListItemDefaults
import androidx.tv.material3.MaterialTheme
Expand All @@ -32,7 +31,6 @@ import androidx.tv.material3.surfaceColorAtElevation
import com.google.jetstream.data.util.StringConstants
import com.google.jetstream.presentation.theme.JetStreamCardShape

@OptIn(ExperimentalTvMaterial3Api::class)
@Composable
fun SubtitlesSection(
isSubtitlesChecked: Boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.tv.material3.Border
import androidx.tv.material3.ClickableSurfaceDefaults
import androidx.tv.material3.ExperimentalTvMaterial3Api
import androidx.tv.material3.LocalContentColor
import androidx.tv.material3.MaterialTheme
import androidx.tv.material3.Surface
Expand All @@ -66,7 +65,6 @@ import com.google.jetstream.presentation.common.MoviesRow
import com.google.jetstream.presentation.screens.dashboard.rememberChildPadding
import com.google.jetstream.presentation.theme.JetStreamCardShape

@OptIn(ExperimentalTvMaterial3Api::class)
@Composable
fun SearchScreen(
onMovieClick: (movie: Movie) -> Unit,
Expand Down Expand Up @@ -103,7 +101,7 @@ fun SearchScreen(
}
}

@OptIn(ExperimentalComposeUiApi::class, ExperimentalTvMaterial3Api::class)
@OptIn(ExperimentalComposeUiApi::class)
@Composable
fun SearchResult(
movieList: MovieList,
Expand Down
Loading

0 comments on commit 732dcc0

Please sign in to comment.