~repos /only-bible-app
git clone https://pyrossh.dev/repos/only-bible-app.git
The only bible app you will ever need. No ads. No in-app purchases. No distractions.
32c2a303
—
Peter John 1 year ago
add animation for BottomBar
app/src/main/java/dev/pyrossh/onlyBible/AppHost.kt
CHANGED
|
@@ -42,13 +42,14 @@ fun AppHost(model: AppViewModel = viewModel()) {
|
|
|
42
42
|
tween(400),
|
|
43
43
|
)
|
|
44
44
|
},
|
|
45
|
-
//
|
|
45
|
+
// exitTransition = {
|
|
46
|
+
// fadeOut()
|
|
46
|
-
//
|
|
47
|
+
// val props = this.targetState.toRoute<ChapterScreenProps>()
|
|
47
|
-
//
|
|
48
|
+
// slideOutOfContainer(
|
|
48
|
-
//
|
|
49
|
+
// Dir.valueOf(props.dir).slideDirection(),
|
|
49
|
-
//
|
|
50
|
+
// tween(400),
|
|
51
|
+
// )
|
|
50
|
-
//
|
|
52
|
+
// },
|
|
51
|
-
// },
|
|
52
53
|
popEnterTransition = {
|
|
53
54
|
slideIntoContainer(
|
|
54
55
|
AnimatedContentTransitionScope.SlideDirection.Right,
|
app/src/main/java/dev/pyrossh/onlyBible/ChapterScreen.kt
CHANGED
|
@@ -7,6 +7,9 @@ import android.text.style.BulletSpan
|
|
|
7
7
|
import android.text.style.ForegroundColorSpan
|
|
8
8
|
import android.text.style.StyleSpan
|
|
9
9
|
import androidx.compose.animation.AnimatedContentTransitionScope
|
|
10
|
+
import androidx.compose.animation.AnimatedVisibility
|
|
11
|
+
import androidx.compose.animation.slideInVertically
|
|
12
|
+
import androidx.compose.animation.slideOutVertically
|
|
10
13
|
import androidx.compose.foundation.clickable
|
|
11
14
|
import androidx.compose.foundation.gestures.detectHorizontalDragGestures
|
|
12
15
|
import androidx.compose.foundation.interaction.MutableInteractionSource
|
|
@@ -199,7 +202,11 @@ fun ChapterScreen(
|
|
|
199
202
|
)
|
|
200
203
|
},
|
|
201
204
|
bottomBar = {
|
|
205
|
+
AnimatedVisibility(
|
|
202
|
-
|
|
206
|
+
visible = selectedVerses.isNotEmpty(),
|
|
207
|
+
enter = slideInVertically(initialOffsetY = { it }),
|
|
208
|
+
exit = slideOutVertically(targetOffsetY = { it }),
|
|
209
|
+
) {
|
|
203
210
|
BottomAppBar(
|
|
204
211
|
containerColor = Color.Transparent,
|
|
205
212
|
contentPadding = PaddingValues(0.dp),
|