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

@ -33,9 +33,8 @@ dependencies {
debugImplementation "androidx.savedstate:savedstate-ktx:1.1.0"
debugImplementation libs.androidx.lifecycle.viewModelCompose
api libs.androidx.compose.foundation
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.material3
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.selection.toggleable
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.Icon
import androidx.compose.material.icons.Icons.Filled
import androidx.compose.material.icons.filled.Add
import androidx.compose.material.icons.filled.Done
import androidx.compose.material.ripple.rememberRipple
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
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.fillMaxWidth
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.filled.MoreVert
import androidx.compose.material.icons.filled.Search
import androidx.compose.material.ripple.RippleAlpha
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.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
@ -62,8 +62,8 @@ fun NiaToolbar(
}
Text(
text = stringResource(id = titleRes),
style = MaterialTheme.typography.h6,
fontWeight = FontWeight.SemiBold
style = MaterialTheme.typography.titleLarge,
fontWeight = FontWeight.Bold
)
IconButton(onClick = { onMenuClick() }) {
Icon(
@ -86,7 +86,6 @@ fun NiaLoadingIndicator(
) {
CircularProgressIndicator(
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.size
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.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.runtime.Composable
import androidx.compose.ui.Alignment
@ -87,7 +87,7 @@ private fun InterestContent(name: String, description: String, modifier: Modifie
Column(modifier) {
Text(
text = name,
style = MaterialTheme.typography.h5,
style = MaterialTheme.typography.headlineSmall,
modifier = Modifier.padding(
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()) {
Text(
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.size
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.filled.ArrowBack
import androidx.compose.material.icons.filled.Check
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
@ -48,6 +45,7 @@ import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
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.component.NiaFilterChip
import com.google.samples.apps.nowinandroid.feature.topic.R.string
import com.google.samples.apps.nowinandroid.feature.topic.TopicUiState.Loading
@ -158,7 +156,6 @@ private fun TopicBodyPreview() {
}
}
@OptIn(ExperimentalMaterialApi::class)
@Composable
private fun TopicToolbar(
uiState: FollowableTopic,
@ -180,12 +177,11 @@ private fun TopicToolbar(
)
}
val selected = uiState.isFollowed
Chip(onClick = { onFollowClick(!selected) }) {
NiaFilterChip(
checked = selected,
onCheckedChange = onFollowClick,
) {
if (selected) {
Icon(
imageVector = Filled.Check,
contentDescription = null
)
Text("FOLLOWING")
} else {
Text("NOT FOLLOWING")

@ -4,7 +4,7 @@ androidDesugarJdkLibs = "1.1.5"
androidGradlePlugin = "7.1.2"
androidxActivity = "1.4.0"
androidxAppCompat = "1.3.0"
androidxCompose = "1.2.0-alpha06"
androidxCompose = "1.2.0-alpha07"
androidxMaterialWindow = "1.2.0-SNAPSHOT"
androidxComposeMaterial3 = "1.0.0-alpha07"
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-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "androidxAppCompat" }
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-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-iconsExtended = { group = "androidx.compose.material", name = "material-icons-extended", version.ref = "androidxCompose" }
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)
// to download from the non-snapshot repositories
maven {
url 'https://androidx.dev/snapshots/builds/8350530/artifacts/repository'
url 'https://androidx.dev/snapshots/builds/8414861/artifacts/repository'
content {
// The AndroidX snapshot repository will only have androidx artifacts, don't
// bother trying to find other ones

Loading…
Cancel
Save