-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding creating playlists, only names for now
- Loading branch information
1 parent
dc552ca
commit e0d1923
Showing
10 changed files
with
125 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 52 additions & 26 deletions
78
...Main/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/common/composables/FotoDIalog.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,78 @@ | ||
package com.kevinschildhorn.fotopresenter.ui.screens.common.composables | ||
|
||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.ColumnScope | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material.AlertDialog | ||
import androidx.compose.material.Button | ||
import androidx.compose.material.ButtonDefaults | ||
import androidx.compose.material.Card | ||
import androidx.compose.material.TextButton | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.clip | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.window.Dialog | ||
import com.kevinschildhorn.atomik.color.base.composeColor | ||
import com.kevinschildhorn.fotopresenter.ui.atoms.FotoColors | ||
import com.kevinschildhorn.fotopresenter.ui.atoms.Padding | ||
import com.kevinschildhorn.fotopresenter.ui.screens.common.CommonAtoms | ||
|
||
@Composable | ||
fun FotoDialog( | ||
dialogTitle: String, | ||
onDismissRequest: () -> Unit, | ||
onConfirmation: () -> Unit, | ||
content: @Composable (() -> Unit)?, | ||
content: @Composable ColumnScope.() -> Unit, | ||
) { | ||
AlertDialog( | ||
modifier = Modifier.clip(RoundedCornerShape(10.dp)), | ||
backgroundColor = FotoColors.surface.composeColor, | ||
title = { | ||
AtomikText( | ||
text = dialogTitle, | ||
atom = CommonAtoms.dialogTitle | ||
) | ||
}, | ||
text = content, | ||
onDismissRequest = { | ||
onDismissRequest() | ||
}, | ||
confirmButton = { | ||
PrimaryTextButton("Confirm"){ | ||
onConfirmation() | ||
} | ||
}, | ||
dismissButton = { | ||
TextButton( | ||
onClick = { | ||
onDismissRequest() | ||
} | ||
Dialog(onDismissRequest = { onDismissRequest() }) { | ||
// Draw a rectangle shape with rounded corners inside the dialog | ||
Card( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(16.dp), | ||
shape = RoundedCornerShape(16.dp), | ||
) { | ||
Column( | ||
modifier = Modifier | ||
.fillMaxWidth().padding(Padding.STANDARD.dp), | ||
verticalArrangement = Arrangement.Center, | ||
horizontalAlignment = Alignment.Start, | ||
) { | ||
AtomikText("Cancel", atom = CommonAtoms.dialogButton) | ||
AtomikText( | ||
text = dialogTitle, | ||
atom = CommonAtoms.dialogTitle, | ||
) | ||
Spacer(Modifier.size(Padding.MEDIUM.dp)) | ||
content() | ||
Row( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(top = Padding.SMALL.dp), | ||
horizontalArrangement = Arrangement.End, | ||
verticalAlignment = Alignment.CenterVertically | ||
) { | ||
TextButton( | ||
onClick = { | ||
onDismissRequest() | ||
}, | ||
modifier = Modifier.padding(Padding.SMALL.dp) | ||
) { | ||
AtomikText("Cancel", atom = CommonAtoms.dialogButton) | ||
} | ||
PrimaryTextButton("Confirm") { | ||
onConfirmation() | ||
} | ||
} | ||
} | ||
} | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters