Remove material non-3 components

Bug: 228974929

Change-Id: Ie74189bd6ce1a4a2ece36962e0ad1627ac9c71dd
pull/2/head
Alex Vanyo 3 years ago committed by Don Turner
parent 14807caa42
commit bcf05f5502

@ -20,7 +20,7 @@ import android.os.Bundle
import androidx.activity.ComponentActivity import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent import androidx.activity.compose.setContent
import androidx.compose.material.window.ExperimentalMaterialWindowApi import androidx.compose.material.window.ExperimentalMaterialWindowApi
import androidx.compose.material.window.rememberSizeClass import androidx.compose.material.window.calculateSizeClass
import androidx.core.view.WindowCompat import androidx.core.view.WindowCompat
import com.google.samples.apps.nowinandroid.ui.NiaApp import com.google.samples.apps.nowinandroid.ui.NiaApp
import dagger.hilt.android.AndroidEntryPoint import dagger.hilt.android.AndroidEntryPoint
@ -35,7 +35,7 @@ class MainActivity : ComponentActivity() {
// including IME animations // including IME animations
WindowCompat.setDecorFitsSystemWindows(window, false) WindowCompat.setDecorFitsSystemWindows(window, false)
setContent { NiaApp(rememberSizeClass()) } setContent { NiaApp(calculateSizeClass()) }
reportFullyDrawn() reportFullyDrawn()
} }
} }

@ -33,9 +33,8 @@ dependencies {
debugImplementation "androidx.savedstate:savedstate-ktx:1.1.0" debugImplementation "androidx.savedstate:savedstate-ktx:1.1.0"
debugImplementation libs.androidx.lifecycle.viewModelCompose debugImplementation libs.androidx.lifecycle.viewModelCompose
api libs.androidx.compose.foundation
api libs.androidx.compose.foundation.layout api libs.androidx.compose.foundation.layout
// TODO (M3): Remove this dependency when all components are available
api libs.androidx.compose.material
api libs.androidx.compose.material.iconsExtended api libs.androidx.compose.material.iconsExtended
api libs.androidx.compose.material3 api libs.androidx.compose.material3
debugApi libs.androidx.compose.ui.tooling debugApi libs.androidx.compose.ui.tooling

@ -22,11 +22,11 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.size
import androidx.compose.foundation.selection.toggleable import androidx.compose.foundation.selection.toggleable
import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.Icon
import androidx.compose.material.icons.Icons.Filled import androidx.compose.material.icons.Icons.Filled
import androidx.compose.material.icons.filled.Add import androidx.compose.material.icons.filled.Add
import androidx.compose.material.icons.filled.Done import androidx.compose.material.icons.filled.Done
import androidx.compose.material.ripple.rememberRipple import androidx.compose.material.ripple.rememberRipple
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember import androidx.compose.runtime.remember

@ -23,15 +23,15 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.wrapContentSize import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.material.CircularProgressIndicator
import androidx.compose.material.Icon
import androidx.compose.material.MaterialTheme
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.MoreVert import androidx.compose.material.icons.filled.MoreVert
import androidx.compose.material.icons.filled.Search import androidx.compose.material.icons.filled.Search
import androidx.compose.material.ripple.RippleAlpha import androidx.compose.material.ripple.RippleAlpha
import androidx.compose.material.ripple.RippleTheme import androidx.compose.material.ripple.RippleTheme
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
@ -62,8 +62,8 @@ fun NiaToolbar(
} }
Text( Text(
text = stringResource(id = titleRes), text = stringResource(id = titleRes),
style = MaterialTheme.typography.h6, style = MaterialTheme.typography.titleLarge,
fontWeight = FontWeight.SemiBold fontWeight = FontWeight.Bold
) )
IconButton(onClick = { onMenuClick() }) { IconButton(onClick = { onMenuClick() }) {
Icon( Icon(
@ -86,7 +86,6 @@ fun NiaLoadingIndicator(
) { ) {
CircularProgressIndicator( CircularProgressIndicator(
modifier = Modifier.semantics { contentDescription = contentDesc }, modifier = Modifier.semantics { contentDescription = contentDesc },
color = androidx.compose.material3.MaterialTheme.colorScheme.primary
) )
} }
} }

@ -23,11 +23,11 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.width
import androidx.compose.material.Icon
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.icons.Icons.Filled import androidx.compose.material.icons.Icons.Filled
import androidx.compose.material.icons.filled.Android import androidx.compose.material.icons.filled.Android
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
@ -87,7 +87,7 @@ private fun InterestContent(name: String, description: String, modifier: Modifie
Column(modifier) { Column(modifier) {
Text( Text(
text = name, text = name,
style = MaterialTheme.typography.h5, style = MaterialTheme.typography.headlineSmall,
modifier = Modifier.padding( modifier = Modifier.padding(
vertical = if (description.isEmpty()) 0.dp else 4.dp vertical = if (description.isEmpty()) 0.dp else 4.dp
) )
@ -95,7 +95,7 @@ private fun InterestContent(name: String, description: String, modifier: Modifie
if (description.isNotEmpty()) { if (description.isNotEmpty()) {
Text( Text(
text = description, text = description,
style = MaterialTheme.typography.body2 style = MaterialTheme.typography.bodyMedium
) )
} }
} }

@ -26,12 +26,9 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material.Chip
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.Icon
import androidx.compose.material.icons.Icons.Filled import androidx.compose.material.icons.Icons.Filled
import androidx.compose.material.icons.filled.ArrowBack import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.filled.Check import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text import androidx.compose.material3.Text
@ -48,6 +45,7 @@ import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
import com.google.samples.apps.nowinandroid.core.model.data.FollowableTopic import com.google.samples.apps.nowinandroid.core.model.data.FollowableTopic
import com.google.samples.apps.nowinandroid.core.ui.NiaLoadingIndicator import com.google.samples.apps.nowinandroid.core.ui.NiaLoadingIndicator
import com.google.samples.apps.nowinandroid.core.ui.component.NiaFilterChip
import com.google.samples.apps.nowinandroid.feature.topic.R.string import com.google.samples.apps.nowinandroid.feature.topic.R.string
import com.google.samples.apps.nowinandroid.feature.topic.TopicUiState.Loading import com.google.samples.apps.nowinandroid.feature.topic.TopicUiState.Loading
@ -158,7 +156,6 @@ private fun TopicBodyPreview() {
} }
} }
@OptIn(ExperimentalMaterialApi::class)
@Composable @Composable
private fun TopicToolbar( private fun TopicToolbar(
uiState: FollowableTopic, uiState: FollowableTopic,
@ -180,12 +177,11 @@ private fun TopicToolbar(
) )
} }
val selected = uiState.isFollowed val selected = uiState.isFollowed
Chip(onClick = { onFollowClick(!selected) }) { NiaFilterChip(
checked = selected,
onCheckedChange = onFollowClick,
) {
if (selected) { if (selected) {
Icon(
imageVector = Filled.Check,
contentDescription = null
)
Text("FOLLOWING") Text("FOLLOWING")
} else { } else {
Text("NOT FOLLOWING") Text("NOT FOLLOWING")

@ -4,7 +4,7 @@ androidDesugarJdkLibs = "1.1.5"
androidGradlePlugin = "7.1.2" androidGradlePlugin = "7.1.2"
androidxActivity = "1.4.0" androidxActivity = "1.4.0"
androidxAppCompat = "1.3.0" androidxAppCompat = "1.3.0"
androidxCompose = "1.2.0-alpha06" androidxCompose = "1.2.0-alpha07"
androidxMaterialWindow = "1.2.0-SNAPSHOT" androidxMaterialWindow = "1.2.0-SNAPSHOT"
androidxComposeMaterial3 = "1.0.0-alpha07" androidxComposeMaterial3 = "1.0.0-alpha07"
androidxCore = "1.7.0" androidxCore = "1.7.0"
@ -51,8 +51,8 @@ android-gradlePlugin = { group = "com.android.tools.build", name = "gradle", ver
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "androidxActivity" } androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "androidxActivity" }
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "androidxAppCompat" } androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "androidxAppCompat" }
androidx-benchmark-macro = { group = "androidx.benchmark", name = "benchmark-macro-junit4", version.ref = "androidxMacroBenchmark" } androidx-benchmark-macro = { group = "androidx.benchmark", name = "benchmark-macro-junit4", version.ref = "androidxMacroBenchmark" }
androidx-compose-foundation = { group = "androidx.compose.foundation", name = "foundation", version.ref = "androidxCompose" }
androidx-compose-foundation-layout = { group = "androidx.compose.foundation", name = "foundation-layout", version.ref = "androidxCompose" } androidx-compose-foundation-layout = { group = "androidx.compose.foundation", name = "foundation-layout", version.ref = "androidxCompose" }
androidx-compose-material = { group = "androidx.compose.material", name = "material", version.ref = "androidxCompose" }
androidx-compose-material-window = {group = "androidx.compose.material", name = "material-window", version.ref="androidxMaterialWindow"} androidx-compose-material-window = {group = "androidx.compose.material", name = "material-window", version.ref="androidxMaterialWindow"}
androidx-compose-material-iconsExtended = { group = "androidx.compose.material", name = "material-icons-extended", version.ref = "androidxCompose" } androidx-compose-material-iconsExtended = { group = "androidx.compose.material", name = "material-icons-extended", version.ref = "androidxCompose" }
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "androidxComposeMaterial3" } androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "androidxComposeMaterial3" }

@ -29,7 +29,7 @@ dependencyResolutionManagement {
// Register the AndroidX snapshot repository first so snapshots don't attempt (and fail) // Register the AndroidX snapshot repository first so snapshots don't attempt (and fail)
// to download from the non-snapshot repositories // to download from the non-snapshot repositories
maven { maven {
url 'https://androidx.dev/snapshots/builds/8350530/artifacts/repository' url 'https://androidx.dev/snapshots/builds/8414861/artifacts/repository'
content { content {
// The AndroidX snapshot repository will only have androidx artifacts, don't // The AndroidX snapshot repository will only have androidx artifacts, don't
// bother trying to find other ones // bother trying to find other ones

Loading…
Cancel
Save