-
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.
Added a popup for collecting personal information including gender selection. Also added a general-purpose bottom sheet component. The PersonalInfoPopup component is called on the main screen.
- Loading branch information
Showing
3 changed files
with
179 additions
and
10 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
160 changes: 160 additions & 0 deletions
160
composeApp/src/commonMain/kotlin/org/alwinsden/remnant/ui/PopsUps/InfoSectionPopUps.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 |
---|---|---|
@@ -0,0 +1,160 @@ | ||
package org.alwinsden.remnant.ui.PopsUps | ||
|
||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.interaction.MutableInteractionSource | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.fillMaxHeight | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.width | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material.Button | ||
import androidx.compose.material.ButtonDefaults | ||
import androidx.compose.material.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.unit.dp | ||
import com.composables.icons.lucide.Lucide | ||
import com.composables.icons.lucide.MoveUpLeft | ||
import org.alwinsden.remnant.InterFontFamily | ||
|
||
@Composable | ||
fun PersonalInfoPopup() { | ||
BottomControllerComponent( | ||
onOuterClick = { | ||
println("TRIGGER logs") | ||
}, | ||
) { | ||
Column( | ||
modifier = Modifier | ||
.background( | ||
color = Color(0xffffffff), | ||
shape = RoundedCornerShape( | ||
topStart = 25.dp, | ||
topEnd = 25.dp | ||
) | ||
) | ||
.fillMaxWidth() | ||
.padding(vertical = 15.dp), | ||
horizontalAlignment = Alignment.CenterHorizontally, | ||
verticalArrangement = Arrangement.spacedBy(10.dp), | ||
) { | ||
Text( | ||
text = "Select gender: ", | ||
fontFamily = InterFontFamily, | ||
modifier = Modifier.fillMaxWidth(.9f) | ||
) | ||
|
||
//this is the selection component | ||
Button( | ||
onClick = { | ||
// | ||
}, | ||
colors = ButtonDefaults.buttonColors( | ||
backgroundColor = Color(0xffD9D9D9) | ||
), | ||
shape = RoundedCornerShape(50), | ||
modifier = Modifier.fillMaxWidth(.9f) | ||
) { | ||
Row( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(vertical = 5.dp, horizontal = 5.dp), | ||
horizontalArrangement = Arrangement.SpaceBetween, | ||
verticalAlignment = Alignment.CenterVertically | ||
) { | ||
Text("Male", fontFamily = InterFontFamily) | ||
Image( | ||
Lucide.MoveUpLeft, | ||
contentDescription = null, | ||
modifier = Modifier | ||
.width(20.dp), | ||
) | ||
} | ||
} | ||
|
||
//this is the selection component | ||
Button( | ||
onClick = { | ||
// | ||
}, | ||
colors = ButtonDefaults.buttonColors( | ||
backgroundColor = Color(0xffD9D9D9) | ||
), | ||
shape = RoundedCornerShape(50), | ||
modifier = Modifier.fillMaxWidth(.9f) | ||
) { | ||
Row( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(vertical = 5.dp, horizontal = 5.dp), | ||
horizontalArrangement = Arrangement.SpaceBetween, | ||
verticalAlignment = Alignment.CenterVertically | ||
) { | ||
Text("Female", fontFamily = InterFontFamily) | ||
Image( | ||
Lucide.MoveUpLeft, | ||
contentDescription = null, | ||
modifier = Modifier | ||
.width(20.dp), | ||
) | ||
} | ||
} | ||
|
||
//this is the selection component | ||
Button( | ||
onClick = { | ||
// | ||
}, | ||
colors = ButtonDefaults.buttonColors( | ||
backgroundColor = Color(0xffD9D9D9) | ||
), | ||
shape = RoundedCornerShape(50), | ||
modifier = Modifier.fillMaxWidth(.9f) | ||
) { | ||
Row( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(vertical = 5.dp, horizontal = 5.dp), | ||
horizontalArrangement = Arrangement.SpaceBetween, | ||
verticalAlignment = Alignment.CenterVertically | ||
) { | ||
Text("rather not say. ", fontFamily = InterFontFamily) | ||
Image( | ||
Lucide.MoveUpLeft, | ||
contentDescription = null, | ||
modifier = Modifier | ||
.width(20.dp), | ||
) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Composable | ||
fun BottomControllerComponent(onOuterClick: () -> Unit, content: @Composable () -> Unit) { | ||
Column( | ||
modifier = Modifier | ||
.fillMaxHeight() | ||
.background( | ||
color = Color(0xff2B2B2B).copy(alpha = .57f) | ||
) | ||
.clickable( | ||
indication = null, | ||
interactionSource = remember { MutableInteractionSource() } | ||
) { | ||
onOuterClick() | ||
}, | ||
verticalArrangement = Arrangement.Bottom | ||
) { | ||
content() | ||
} | ||
} |