Skip to content

Commit 10a591f

Browse files
committed
Merge branch 'navigation-anims' into main
2 parents 6059a9e + 08f98b6 commit 10a591f

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

app/build.gradle.kts

+2-1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ dependencies {
8383
implementation("com.google.accompanist:accompanist-placeholder-material:0.30.1")
8484
implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.6")
8585
implementation("androidx.compose.ui:ui-tooling-preview-android:1.5.3")
86+
implementation("androidx.navigation:navigation-compose:2.7.4")
8687
lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0")
8788

8889
// Coroutines
@@ -97,7 +98,7 @@ dependencies {
9798
implementation("com.google.dagger:hilt-android:2.48.1")
9899
kapt("com.google.dagger:hilt-android-compiler:2.48.1")
99100
kapt("androidx.hilt:hilt-compiler:1.0.0")
100-
implementation("androidx.hilt:hilt-navigation-compose:1.1.0-beta01")
101+
implementation("androidx.hilt:hilt-navigation-compose:1.1.0-rc01")
101102

102103
// Retrofit
103104
implementation("com.squareup.retrofit2:retrofit:2.9.0")

app/src/main/java/dev/shorthouse/coinwatch/ui/screen/list/CoinListScreen.kt

+2-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import androidx.compose.runtime.derivedStateOf
3535
import androidx.compose.runtime.getValue
3636
import androidx.compose.runtime.remember
3737
import androidx.compose.runtime.rememberCoroutineScope
38-
import androidx.compose.runtime.setValue
3938
import androidx.compose.ui.Alignment
4039
import androidx.compose.ui.Modifier
4140
import androidx.compose.ui.input.nestedscroll.nestedScroll
@@ -94,7 +93,7 @@ fun CoinListScreen(
9493
is CoinListUiState.Success -> {
9594
val lazyListState = rememberLazyListState()
9695
val scope = rememberCoroutineScope()
97-
val showButton by remember {
96+
val showJumpToTopFab by remember {
9897
derivedStateOf {
9998
lazyListState.firstVisibleItemIndex > 0
10099
}
@@ -119,7 +118,7 @@ fun CoinListScreen(
119118
},
120119
floatingActionButton = {
121120
AnimatedVisibility(
122-
visible = showButton,
121+
visible = showJumpToTopFab,
123122
enter = scaleIn(),
124123
exit = scaleOut()
125124
) {

app/src/main/java/dev/shorthouse/coinwatch/ui/screen/search/CoinSearchScreen.kt

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package dev.shorthouse.coinwatch.ui.screen.search
22

33
import androidx.activity.compose.BackHandler
4+
import androidx.compose.foundation.layout.Box
45
import androidx.compose.foundation.layout.PaddingValues
56
import androidx.compose.foundation.layout.fillMaxSize
67
import androidx.compose.foundation.lazy.LazyColumn
@@ -95,7 +96,9 @@ fun CoinSearchScreen(
9596
)
9697
}
9798

98-
CoinSearchUiState.Loading -> {}
99+
is CoinSearchUiState.Loading -> {
100+
Box(modifier = Modifier.fillMaxSize())
101+
}
99102
}
100103
}
101104

@@ -195,7 +198,7 @@ fun CoinSearchContent(
195198
active = true,
196199
onActiveChange = {},
197200
tonalElevation = 0.dp,
198-
modifier = modifier.focusRequester(focusRequester)
201+
modifier = modifier.focusRequester(focusRequester).fillMaxSize()
199202
)
200203

201204
LaunchedEffect(focusRequester) {

0 commit comments

Comments
 (0)