-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from futuredapp/feature/v3
Architectural Revamp
- Loading branch information
Showing
162 changed files
with
2,591 additions
and
1,919 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,9 @@ jobs: | |
runs-on: [ ubuntu-latest ] | ||
env: | ||
EXCLUDE_AAB_FILTER: .*intermediate | ||
# TODO Platform-specific slack channel name for notifications, eg. "gmlh-android" | ||
# TODO PROJECT-SETUP Platform-specific slack channel name for notifications, eg. "gmlh-android" | ||
SLACK_CHANNEL: project-slack-channel-name | ||
# TODO verify product flavor configuration | ||
# TODO PROJECT-SETUP verify product flavor configuration | ||
# Specifies API environment for KMP build. | ||
# One of [dev|prod] as per configuration of Buildkonfig plugin in :shared:network:* Gradle module. | ||
KMP_FLAVOR: prod | ||
|
@@ -38,9 +38,9 @@ jobs: | |
- name: Generate app bundle | ||
shell: bash | ||
env: | ||
# TODO Set up `ANDROID_RELEASE_KEYSTORE_PASSWORD` secret for this GitHub repository | ||
# TODO Set up `ANDROID_RELEASE_KEY_PASSWORD` secret for this GitHub repository | ||
# TODO Set up `ANDROID_RELEASE_KEY_ALIAS` secret for this GitHub repository | ||
# TODO PROJECT-SETUP Set up `ANDROID_RELEASE_KEYSTORE_PASSWORD` secret for this GitHub repository | ||
# TODO PROJECT-SETUP Set up `ANDROID_RELEASE_KEY_PASSWORD` secret for this GitHub repository | ||
# TODO PROJECT-SETUP Set up `ANDROID_RELEASE_KEY_ALIAS` secret for this GitHub repository | ||
RELEASE_KEYSTORE_PASS: ${{ secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD }} | ||
RELEASE_KEY_PASS: ${{ secrets.ANDROID_RELEASE_KEY_PASSWORD }} | ||
RELEASE_KEY_ALIAS: ${{ secrets.ANDROID_RELEASE_KEY_ALIAS }} | ||
|
@@ -54,9 +54,9 @@ jobs: | |
- name: Upload Android Release to Play Store | ||
uses: r0adkll/[email protected] | ||
with: | ||
# TODO Set up `GOOGLE_PLAY_PUBLISH_SERVICE_ACCOUNT` as plaintext JSON for this GitHub repository | ||
# TODO PROJECT-SETUP Set up `GOOGLE_PLAY_PUBLISH_SERVICE_ACCOUNT` as plaintext JSON for this GitHub repository | ||
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_PUBLISH_SERVICE_ACCOUNT }} | ||
# TODO This has to be applicationId | ||
# TODO PROJECT-SETUP This has to be applicationId | ||
packageName: app.futured.kmptemplate.android | ||
releaseFiles: ${{ steps.artifacts.outputs.aab_file }} | ||
track: internal | ||
|
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
54 changes: 54 additions & 0 deletions
54
androidApp/src/main/kotlin/app/futured/kmptemplate/android/ui/navigation/HomeNavHostUi.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,54 @@ | ||
package app.futured.kmptemplate.android.ui.navigation | ||
|
||
import androidx.compose.foundation.layout.WindowInsets | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.navigationBars | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material3.Scaffold | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.ui.Modifier | ||
import androidx.lifecycle.compose.collectAsStateWithLifecycle | ||
import app.futured.kmptemplate.android.ui.screen.FirstScreenUi | ||
import app.futured.kmptemplate.android.ui.screen.SecondScreenUi | ||
import app.futured.kmptemplate.android.ui.screen.ThirdScreenUi | ||
import app.futured.kmptemplate.feature.navigation.home.HomeChild | ||
import app.futured.kmptemplate.feature.navigation.home.HomeConfig | ||
import app.futured.kmptemplate.feature.navigation.home.HomeNavHost | ||
import com.arkivanov.decompose.ExperimentalDecomposeApi | ||
import com.arkivanov.decompose.extensions.compose.stack.Children | ||
import com.arkivanov.decompose.extensions.compose.stack.animation.predictiveback.androidPredictiveBackAnimatable | ||
import com.arkivanov.decompose.extensions.compose.stack.animation.predictiveback.predictiveBackAnimation | ||
import com.arkivanov.decompose.router.stack.ChildStack | ||
|
||
@OptIn(ExperimentalDecomposeApi::class) | ||
@Composable | ||
fun HomeNavHostUi( | ||
navHost: HomeNavHost, | ||
modifier: Modifier = Modifier, | ||
) { | ||
val stack: ChildStack<HomeConfig, HomeChild> by navHost.stack.collectAsStateWithLifecycle() | ||
val actions = navHost.actions | ||
|
||
Scaffold( | ||
modifier = modifier, | ||
contentWindowInsets = WindowInsets.navigationBars, | ||
content = { paddings -> | ||
Children( | ||
stack = stack, | ||
modifier = Modifier.padding(paddings), | ||
animation = predictiveBackAnimation( | ||
backHandler = navHost.backHandler, | ||
onBack = actions::pop, | ||
selector = { backEvent, _, _ -> androidPredictiveBackAnimatable(backEvent) }, | ||
), | ||
) { child -> | ||
when (val childInstance = child.instance) { | ||
is HomeChild.First -> FirstScreenUi(screen = childInstance.screen, modifier = Modifier.fillMaxSize()) | ||
is HomeChild.Second -> SecondScreenUi(screen = childInstance.screen, modifier = Modifier.fillMaxSize()) | ||
is HomeChild.Third -> ThirdScreenUi(screen = childInstance.screen, modifier = Modifier.fillMaxSize()) | ||
} | ||
} | ||
}, | ||
) | ||
} |
50 changes: 50 additions & 0 deletions
50
androidApp/src/main/kotlin/app/futured/kmptemplate/android/ui/navigation/ProfileNavHostUi.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,50 @@ | ||
package app.futured.kmptemplate.android.ui.navigation | ||
|
||
import androidx.compose.foundation.layout.WindowInsets | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.navigationBars | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material3.Scaffold | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.ui.Modifier | ||
import androidx.lifecycle.compose.collectAsStateWithLifecycle | ||
import app.futured.kmptemplate.android.ui.screen.ProfileScreenUi | ||
import app.futured.kmptemplate.feature.navigation.profile.ProfileChild | ||
import app.futured.kmptemplate.feature.navigation.profile.ProfileConfig | ||
import app.futured.kmptemplate.feature.navigation.profile.ProfileNavHost | ||
import com.arkivanov.decompose.ExperimentalDecomposeApi | ||
import com.arkivanov.decompose.extensions.compose.stack.Children | ||
import com.arkivanov.decompose.extensions.compose.stack.animation.predictiveback.androidPredictiveBackAnimatable | ||
import com.arkivanov.decompose.extensions.compose.stack.animation.predictiveback.predictiveBackAnimation | ||
import com.arkivanov.decompose.router.stack.ChildStack | ||
|
||
@OptIn(ExperimentalDecomposeApi::class) | ||
@Composable | ||
fun ProfileNavHostUi( | ||
navHost: ProfileNavHost, | ||
modifier: Modifier = Modifier, | ||
) { | ||
val stack: ChildStack<ProfileConfig, ProfileChild> by navHost.stack.collectAsStateWithLifecycle() | ||
val actions = navHost.actions | ||
|
||
Scaffold( | ||
modifier = modifier, | ||
contentWindowInsets = WindowInsets.navigationBars, | ||
content = { paddings -> | ||
Children( | ||
stack = stack, | ||
modifier = Modifier.padding(paddings), | ||
animation = predictiveBackAnimation( | ||
backHandler = navHost.backHandler, | ||
onBack = actions::pop, | ||
selector = { backEvent, _, _ -> androidPredictiveBackAnimatable(backEvent) }, | ||
), | ||
) { child -> | ||
when (val childInstance = child.instance) { | ||
is ProfileChild.Profile -> ProfileScreenUi(screen = childInstance.screen, modifier = Modifier.fillMaxSize()) | ||
} | ||
} | ||
}, | ||
) | ||
} |
46 changes: 46 additions & 0 deletions
46
androidApp/src/main/kotlin/app/futured/kmptemplate/android/ui/navigation/RootNavHostUi.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,46 @@ | ||
package app.futured.kmptemplate.android.ui.navigation | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.material3.CircularProgressIndicator | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
import androidx.lifecycle.compose.collectAsStateWithLifecycle | ||
import app.futured.kmptemplate.android.ui.screen.LoginScreenUi | ||
import app.futured.kmptemplate.feature.navigation.root.RootChild | ||
import app.futured.kmptemplate.feature.navigation.root.RootConfig | ||
import app.futured.kmptemplate.feature.navigation.root.RootNavHost | ||
import com.arkivanov.decompose.router.slot.ChildSlot | ||
|
||
@Composable | ||
fun RootNavHostUi( | ||
navHost: RootNavHost, | ||
modifier: Modifier = Modifier, | ||
) { | ||
val slot: ChildSlot<RootConfig, RootChild> by navHost.slot.collectAsStateWithLifecycle() | ||
|
||
Box(modifier.background(MaterialTheme.colorScheme.background)) { | ||
when (val childInstance = slot.child?.instance) { | ||
is RootChild.Login -> LoginScreenUi(screen = childInstance.screen, modifier = Modifier.fillMaxSize()) | ||
is RootChild.SignedIn -> SignedInNavHostUi(navHost = childInstance.navHost, modifier = Modifier.fillMaxSize()) | ||
null -> ApplicationLoading(Modifier.fillMaxSize()) | ||
} | ||
} | ||
} | ||
|
||
@Composable | ||
private fun ApplicationLoading( | ||
modifier: Modifier = Modifier, | ||
) = Box(modifier.background(MaterialTheme.colorScheme.background)) { | ||
CircularProgressIndicator( | ||
Modifier | ||
.size(48.dp) | ||
.align(Alignment.Center), | ||
) | ||
} |
Oops, something went wrong.