|
|
@@ -0,0 +1,39 @@
|
|
|
+package org.sirekanyan.outline.ui
|
|
|
+
|
|
|
+import androidx.compose.animation.AnimatedVisibility
|
|
|
+import androidx.compose.animation.fadeIn
|
|
|
+import androidx.compose.animation.fadeOut
|
|
|
+import androidx.compose.animation.slideInVertically
|
|
|
+import androidx.compose.animation.slideOutVertically
|
|
|
+import androidx.compose.foundation.layout.Box
|
|
|
+import androidx.compose.foundation.layout.Spacer
|
|
|
+import androidx.compose.foundation.layout.fillMaxSize
|
|
|
+import androidx.compose.foundation.layout.navigationBarsPadding
|
|
|
+import androidx.compose.foundation.layout.padding
|
|
|
+import androidx.compose.foundation.layout.size
|
|
|
+import androidx.compose.material.icons.Icons
|
|
|
+import androidx.compose.material.icons.outlined.Add
|
|
|
+import androidx.compose.material3.ExtendedFloatingActionButton
|
|
|
+import androidx.compose.material3.Icon
|
|
|
+import androidx.compose.material3.Text
|
|
|
+import androidx.compose.runtime.Composable
|
|
|
+import androidx.compose.ui.Alignment
|
|
|
+import androidx.compose.ui.Modifier
|
|
|
+import androidx.compose.ui.unit.dp
|
|
|
+
|
|
|
+@Composable
|
|
|
+fun AddKeyButton(visible: Boolean, onClick: () -> Unit) {
|
|
|
+ Box(Modifier.fillMaxSize().navigationBarsPadding(), Alignment.BottomEnd) {
|
|
|
+ AnimatedVisibility(
|
|
|
+ visible = visible,
|
|
|
+ enter = fadeIn() + slideInVertically { it / 2 },
|
|
|
+ exit = fadeOut() + slideOutVertically { it / 2 },
|
|
|
+ ) {
|
|
|
+ ExtendedFloatingActionButton(onClick, Modifier.padding(16.dp)) {
|
|
|
+ Icon(Icons.Outlined.Add, null)
|
|
|
+ Spacer(Modifier.size(16.dp))
|
|
|
+ Text("Add key")
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|