-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop' into ui/#11-search-view-ui
- Loading branch information
Showing
17 changed files
with
229 additions
and
9 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
28 changes: 28 additions & 0 deletions
28
.../main/java/com/terning/core/designsystem/component/bottomsheet/TerningBasicBottomSheet.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,28 @@ | ||
package com.terning.core.designsystem.component.bottomsheet | ||
|
||
import androidx.compose.foundation.layout.navigationBarsPadding | ||
import androidx.compose.material3.ExperimentalMaterial3Api | ||
import androidx.compose.material3.ModalBottomSheet | ||
import androidx.compose.material3.rememberModalBottomSheetState | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
|
||
@OptIn(ExperimentalMaterial3Api::class) | ||
@Composable | ||
fun TerningBasicBottomSheet( | ||
modifier: Modifier = Modifier, | ||
content: @Composable () -> Unit, | ||
onDismissRequest: () -> Unit | ||
) { | ||
val sheetState = rememberModalBottomSheetState() | ||
|
||
ModalBottomSheet( | ||
onDismissRequest = { | ||
onDismissRequest() | ||
}, | ||
sheetState = sheetState, | ||
modifier = modifier.navigationBarsPadding() | ||
) { | ||
content() | ||
} | ||
} |
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
10 changes: 10 additions & 0 deletions
10
feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.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,10 @@ | ||
package com.terning.feature.onboarding.signup | ||
|
||
import androidx.lifecycle.ViewModel | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import javax.inject.Inject | ||
|
||
@HiltViewModel | ||
class SignUpViewModel @Inject constructor() : ViewModel(){ | ||
|
||
} |
100 changes: 100 additions & 0 deletions
100
feature/src/main/java/com/terning/feature/onboarding/signup/component/SignUpBottomSheet.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,100 @@ | ||
package com.terning.feature.onboarding.signup.component | ||
|
||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.aspectRatio | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.lazy.grid.GridCells | ||
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid | ||
import androidx.compose.foundation.lazy.grid.items | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableIntStateOf | ||
import androidx.compose.runtime.saveable.rememberSaveable | ||
import androidx.compose.runtime.setValue | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.unit.dp | ||
import com.terning.core.designsystem.component.bottomsheet.TerningBasicBottomSheet | ||
import com.terning.core.designsystem.component.button.RoundButton | ||
import com.terning.core.designsystem.theme.TerningTheme | ||
import com.terning.core.extension.noRippleClickable | ||
import com.terning.feature.R | ||
|
||
@Composable | ||
fun SignUpBottomSheet( | ||
modifier: Modifier = Modifier, | ||
onDismiss: () -> Unit, | ||
onStartDialog: () -> Unit | ||
) { | ||
TerningBasicBottomSheet( | ||
content = { | ||
Column { | ||
Text( | ||
text = stringResource(id = R.string.sign_up_bottom_sheet_title), | ||
style = TerningTheme.typography.title2, | ||
modifier = modifier | ||
.padding( | ||
start = 28.dp, | ||
bottom = 25.dp | ||
), | ||
) | ||
RadioButtonGroup() | ||
Spacer(modifier = modifier.padding(bottom = 24.dp)) | ||
RoundButton( | ||
style = TerningTheme.typography.button0, | ||
paddingVertical = 19.dp, | ||
cornerRadius = 10.dp, | ||
text = R.string.sign_up_dialog_start, | ||
onButtonClick = { onStartDialog() }, | ||
modifier = modifier.padding(horizontal = 24.dp) | ||
) | ||
Spacer(modifier = modifier.padding(bottom = 15.dp)) | ||
} | ||
}, | ||
onDismissRequest = { onDismiss() } | ||
) | ||
} | ||
|
||
@Composable | ||
fun RadioButtonGroup( | ||
modifier: Modifier = Modifier | ||
) { | ||
val options = listOf( | ||
R.drawable.ic_character1, | ||
R.drawable.ic_character2, | ||
R.drawable.ic_character3, | ||
R.drawable.ic_character4, | ||
R.drawable.ic_character5, | ||
R.drawable.ic_character6 | ||
) | ||
|
||
var selectedOption by rememberSaveable { mutableIntStateOf(options[0]) } | ||
|
||
LazyVerticalGrid( | ||
columns = GridCells.Fixed(3), | ||
verticalArrangement = Arrangement.spacedBy(20.dp), | ||
horizontalArrangement = Arrangement.spacedBy(24.dp), | ||
modifier = modifier | ||
.padding(horizontal = 42.dp) | ||
) { | ||
items(options) { option -> | ||
Image( | ||
painter = painterResource( | ||
id = if (option == selectedOption) R.drawable.ic_selected_character | ||
else option | ||
), | ||
contentDescription = stringResource(id = R.string.sign_up_bottom_sheet_description), | ||
modifier = modifier | ||
.aspectRatio(1f) | ||
.noRippleClickable { | ||
selectedOption = option | ||
} | ||
) | ||
} | ||
} | ||
} |
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,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="76dp" | ||
android:height="76dp" | ||
android:viewportWidth="76" | ||
android:viewportHeight="76"> | ||
<path | ||
android:pathData="M38,38m-38,0a38,38 0,1 1,76 0a38,38 0,1 1,-76 0" | ||
android:fillColor="#DDDDDD"/> | ||
</vector> |
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,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="76dp" | ||
android:height="76dp" | ||
android:viewportWidth="76" | ||
android:viewportHeight="76"> | ||
<path | ||
android:pathData="M38,38m-38,0a38,38 0,1 1,76 0a38,38 0,1 1,-76 0" | ||
android:fillColor="#DDDDDD"/> | ||
</vector> |
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,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="76dp" | ||
android:height="76dp" | ||
android:viewportWidth="76" | ||
android:viewportHeight="76"> | ||
<path | ||
android:pathData="M38,38m-38,0a38,38 0,1 1,76 0a38,38 0,1 1,-76 0" | ||
android:fillColor="#DDDDDD"/> | ||
</vector> |
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,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="76dp" | ||
android:height="76dp" | ||
android:viewportWidth="76" | ||
android:viewportHeight="76"> | ||
<path | ||
android:pathData="M38,38m-38,0a38,38 0,1 1,76 0a38,38 0,1 1,-76 0" | ||
android:fillColor="#DDDDDD"/> | ||
</vector> |
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,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="76dp" | ||
android:height="76dp" | ||
android:viewportWidth="76" | ||
android:viewportHeight="76"> | ||
<path | ||
android:pathData="M38,38m-38,0a38,38 0,1 1,76 0a38,38 0,1 1,-76 0" | ||
android:fillColor="#DDDDDD"/> | ||
</vector> |
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,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="76dp" | ||
android:height="76dp" | ||
android:viewportWidth="76" | ||
android:viewportHeight="76"> | ||
<path | ||
android:pathData="M38,38m-38,0a38,38 0,1 1,76 0a38,38 0,1 1,-76 0" | ||
android:fillColor="#DDDDDD"/> | ||
</vector> |
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,14 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="86dp" | ||
android:height="86dp" | ||
android:viewportWidth="86" | ||
android:viewportHeight="86"> | ||
<path | ||
android:pathData="M43,43m-38,0a38,38 0,1 1,76 0a38,38 0,1 1,-76 0" | ||
android:fillColor="#DDDDDD"/> | ||
<path | ||
android:pathData="M42.998,43m-41.533,0a41.533,41.533 0,1 1,83.067 0a41.533,41.533 0,1 1,-83.067 0" | ||
android:strokeWidth="2" | ||
android:fillColor="#00000000" | ||
android:strokeColor="#1EAC61"/> | ||
</vector> |
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