Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ”€ :: (#7) - publishing splash #8

Merged
merged 5 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ android {

dependencies {
implementation(project(":core:design-system"))

implementation(libs.junit)
androidTestImplementation(libs.androidx.test.ext)
implementation(libs.androidx.core.splashscreen)
}
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.GOMSAndroidV2">
android:theme="@style/Theme.App.Starting">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/com/goms/goms_android_v2/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import com.goms.design_system.theme.GomsTheme
import dagger.hilt.android.AndroidEntryPoint

Expand All @@ -19,6 +20,7 @@ class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
installSplashScreen()
GomsTheme { colors, typography ->
// A surface container using the 'background' color from the theme
Box(
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,11 @@
<resources>

<style name="Theme.GOMSAndroidV2" parent="android:Theme.Material.Light.NoActionBar" />

<style name="Theme.App.Starting" parent="Theme.SplashScreen">
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_splash</item>
<item name="postSplashScreenTheme">@style/Theme.GOMSAndroidV2</item>
</style>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ fun ApplySystemUi(isDarkTheme: Boolean) {
val view = LocalView.current
val context = view.context as? Activity ?: return

val statusBarColor = Color.Transparent
val statusBarColor = if (isDarkTheme) Color.Black else Color.White
val navigationBarColor = if (isDarkTheme) Color.Black else Color.White

WindowCompat.setDecorFitsSystemWindows(context.window, false)
val insetsController = WindowCompat.getInsetsController(context.window, view)
insetsController.isAppearanceLightStatusBars = isDarkTheme
insetsController.isAppearanceLightStatusBars = !isDarkTheme
context.window.statusBarColor = statusBarColor.toArgb()
context.window.navigationBarColor = navigationBarColor.toArgb()
}
15 changes: 15 additions & 0 deletions core/design-system/src/main/res/drawable/ic_goms.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="80dp"
android:height="80dp"
android:viewportWidth="80"
android:viewportHeight="80">
<path
android:pathData="M30.733,21.57L39.224,23.322L46.286,21.774L51.43,21.774L53.063,22.018L56.206,22.955L57.88,23.444L58.859,23.851L60.492,24.707L63.146,27.274L65.228,29.759L66.003,31.185L66.82,33.018L67.595,34.648L67.881,35.911L68.575,40.311L68.902,44.752L69.106,47.93L71.555,52.412L71.637,52.819L71.678,53.838L70.902,55.915L70.208,56.771L69.228,57.912L68.738,58.482L67.976,59.053L66.262,60.03L65.963,60.03L65.432,59.949L64.901,59.827L64.534,59.582L64.289,59.215L64.207,57.79L64.37,56.363L64.901,55.141L63.309,53.43L62.084,52.086L61.595,51.393L60.451,50.782L53.063,47.604L52.083,47.563L51.266,47.726L48.327,48.46L45.47,48.704L42.449,48.256L42.082,48.419L42.612,57.178L42.449,58.278L41.714,59.664L40.816,60.641L40.081,61.09L39.306,61.375L37.224,61.538L35.346,61.497L34.652,61.253L34.04,60.845L33.835,60.356L33.754,59.867L33.917,59.256L34.121,58.727L35.183,57.83L36.121,57.097L32.774,49.967L31.468,48.908L22.324,45.16L20.976,44.182L20.16,42.959L16.935,43L15.67,43L14.567,42.837L13.506,42.307L13.098,42.267L8.281,42.633L7.097,42.316L5.587,41.126L5.138,40.719L4.525,39.944L3.79,38.804L3.75,38.559L3.79,38.193L3.913,37.907L4.525,37.378L6.648,35.87L7.097,32.407L7.791,31.552L10.322,29.311L10.444,26.255L10.567,25.685L10.812,25.196L11.383,24.748L11.914,24.625L12.526,24.748L13.465,25.685L13.71,25.685L13.996,25.563L14.404,24.055L14.486,23.77L14.812,23.525L15.431,23.389L16.16,23.607L18.813,25.318L20.038,25.277L26.61,21.936L29.345,21.488L30.733,21.57Z"
android:fillColor="#FFA600"/>
<path
android:pathData="M21.303,45.607L30.774,49.559L24.692,57.83L21.712,60.112L19.793,60.478L15.548,60.804L14.2,60.723L13.262,60.478L12.853,60.112L12.608,59.256L12.853,58.36L14.2,57.341L17.181,56.119L19.671,52.289L21.303,45.607Z"
android:fillColor="#FFA600"/>
<path
android:pathData="M52.491,48.256L60.696,51.759L59.268,53.185L56.124,58.278L55.675,58.889L55.145,59.338L53.716,60.315L52.9,60.6L48.613,60.764L47.552,60.478L47.144,60.234L46.613,59.867L46.531,59.541V59.012L46.817,58.075L47.878,57.056L50.981,55.671L52.614,52.085L52.491,48.256Z"
android:fillColor="#FFA600"/>
</vector>
7 changes: 7 additions & 0 deletions core/design-system/src/main/res/drawable/ic_splash.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/ic_goms"
android:insetLeft="60dp"
android:insetRight="60dp"
android:insetTop="60dp"
android:insetBottom="60dp"/>
Loading