File tree 3 files changed +9
-6
lines changed
src/main/java/dev/shorthouse/coinwatch/ui/screen
3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ dependencies {
83
83
implementation(" com.google.accompanist:accompanist-placeholder-material:0.30.1" )
84
84
implementation(" org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.6" )
85
85
implementation(" androidx.compose.ui:ui-tooling-preview-android:1.5.3" )
86
+ implementation(" androidx.navigation:navigation-compose:2.7.4" )
86
87
lintChecks(" com.slack.lint.compose:compose-lint-checks:1.2.0" )
87
88
88
89
// Coroutines
@@ -97,7 +98,7 @@ dependencies {
97
98
implementation(" com.google.dagger:hilt-android:2.48.1" )
98
99
kapt(" com.google.dagger:hilt-android-compiler:2.48.1" )
99
100
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 " )
101
102
102
103
// Retrofit
103
104
implementation(" com.squareup.retrofit2:retrofit:2.9.0" )
Original file line number Diff line number Diff line change @@ -35,7 +35,6 @@ import androidx.compose.runtime.derivedStateOf
35
35
import androidx.compose.runtime.getValue
36
36
import androidx.compose.runtime.remember
37
37
import androidx.compose.runtime.rememberCoroutineScope
38
- import androidx.compose.runtime.setValue
39
38
import androidx.compose.ui.Alignment
40
39
import androidx.compose.ui.Modifier
41
40
import androidx.compose.ui.input.nestedscroll.nestedScroll
@@ -94,7 +93,7 @@ fun CoinListScreen(
94
93
is CoinListUiState .Success -> {
95
94
val lazyListState = rememberLazyListState()
96
95
val scope = rememberCoroutineScope()
97
- val showButton by remember {
96
+ val showJumpToTopFab by remember {
98
97
derivedStateOf {
99
98
lazyListState.firstVisibleItemIndex > 0
100
99
}
@@ -119,7 +118,7 @@ fun CoinListScreen(
119
118
},
120
119
floatingActionButton = {
121
120
AnimatedVisibility (
122
- visible = showButton ,
121
+ visible = showJumpToTopFab ,
123
122
enter = scaleIn(),
124
123
exit = scaleOut()
125
124
) {
Original file line number Diff line number Diff line change 1
1
package dev.shorthouse.coinwatch.ui.screen.search
2
2
3
3
import androidx.activity.compose.BackHandler
4
+ import androidx.compose.foundation.layout.Box
4
5
import androidx.compose.foundation.layout.PaddingValues
5
6
import androidx.compose.foundation.layout.fillMaxSize
6
7
import androidx.compose.foundation.lazy.LazyColumn
@@ -95,7 +96,9 @@ fun CoinSearchScreen(
95
96
)
96
97
}
97
98
98
- CoinSearchUiState .Loading -> {}
99
+ is CoinSearchUiState .Loading -> {
100
+ Box (modifier = Modifier .fillMaxSize())
101
+ }
99
102
}
100
103
}
101
104
@@ -195,7 +198,7 @@ fun CoinSearchContent(
195
198
active = true ,
196
199
onActiveChange = {},
197
200
tonalElevation = 0 .dp,
198
- modifier = modifier.focusRequester(focusRequester)
201
+ modifier = modifier.focusRequester(focusRequester).fillMaxSize()
199
202
)
200
203
201
204
LaunchedEffect (focusRequester) {
You can’t perform that action at this time.
0 commit comments