build: update to Compose 1.0.0-beta01

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya 2021-02-24 23:24:45 +05:30
parent c8052be29a
commit 6e77a5e94b
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80
4 changed files with 13 additions and 13 deletions

View file

@ -49,7 +49,7 @@ fun LobstersApp() {
}
val jumpToIndex: (Int) -> Unit = {
coroutineScope.launch {
hottestPostsListState.snapToItemIndex(it)
hottestPostsListState.animateScrollToItem(it)
}
}
@ -100,7 +100,7 @@ fun LobstersBottomNav(
},
label = { Text(stringResource(id = screen.labelRes)) },
selected = currentDestination == screen,
alwaysShowLabels = false,
alwaysShowLabel = false,
onClick = {
if (screen != currentDestination) {
navigateToDestination(screen)

View file

@ -3,7 +3,7 @@ package dev.msfjarvis.lobsters.ui.main
import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.runtime.Providers
import androidx.compose.runtime.CompositionLocalProvider
import dagger.hilt.android.AndroidEntryPoint
import dev.msfjarvis.lobsters.ui.theme.LobstersTheme
import dev.msfjarvis.lobsters.ui.urllauncher.LocalUrlLauncher
@ -17,7 +17,7 @@ class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
Providers(LocalUrlLauncher provides urlLauncher) {
CompositionLocalProvider(LocalUrlLauncher provides urlLauncher) {
LobstersTheme {
LobstersApp()
}

View file

@ -8,7 +8,7 @@ import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.requiredWidth
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.shape.RoundedCornerShape
@ -111,7 +111,7 @@ fun LobstersItem(
transformations(CircleCropTransformation())
},
modifier = Modifier
.width(30.dp)
.requiredWidth(30.dp)
.padding(4.dp)
.constrainAs(avatar) {
top.linkTo(tags.bottom)