Skip to content

Commit 2feda1a

Browse files

File tree

6 files changed

+6
-46
lines changed

6 files changed

+6
-46
lines changed

JetLagged/app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ dependencies {
105105
implementation(libs.androidx.lifecycle.viewModelCompose)
106106
implementation(libs.androidx.navigation.compose)
107107
implementation(libs.androidx.constraintlayout.compose)
108+
implementation(libs.google.android.material)
108109

109110
implementation(libs.androidx.compose.runtime)
110111
implementation(libs.androidx.compose.foundation)
@@ -117,7 +118,6 @@ dependencies {
117118
implementation(libs.androidx.compose.ui.tooling.preview)
118119
debugImplementation(libs.androidx.compose.ui.tooling)
119120

120-
implementation(libs.accompanist.systemuicontroller)
121121
implementation(libs.accompanist.flowlayout)
122122

123123
implementation(libs.coil.kt.compose)

JetLagged/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929

3030
<activity
3131
android:name=".MainActivity"
32-
android:label="@string/app_name"
3332
android:theme="@style/Theme.JetLagged"
34-
android:exported="true">
33+
android:exported="true"
34+
android:windowSoftInputMode="adjustResize">
3535
<intent-filter>
3636
<action android:name="android.intent.action.MAIN" />
3737
<category android:name="android.intent.category.LAUNCHER" />

JetLagged/app/src/main/java/com/example/jetlagged/MainActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ package com.example.jetlagged
1919
import android.os.Bundle
2020
import androidx.activity.ComponentActivity
2121
import androidx.activity.compose.setContent
22-
import androidx.core.view.WindowCompat
22+
import androidx.activity.enableEdgeToEdge
2323
import com.example.jetlagged.ui.theme.JetLaggedTheme
2424

2525
class MainActivity : ComponentActivity() {
2626

2727
override fun onCreate(savedInstanceState: Bundle?) {
28+
enableEdgeToEdge()
2829
super.onCreate(savedInstanceState)
29-
WindowCompat.setDecorFitsSystemWindows(window, false)
3030
setContent {
3131
JetLaggedTheme {
3232
HomeScreenDrawer()

JetLagged/app/src/main/java/com/example/jetlagged/ui/theme/Theme.kt

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,11 @@
1616

1717
package com.example.jetlagged.ui.theme
1818

19-
import android.app.Activity
20-
import android.content.Context
21-
import android.content.ContextWrapper
2219
import androidx.compose.foundation.shape.CircleShape
2320
import androidx.compose.material3.MaterialTheme
2421
import androidx.compose.material3.Shapes
2522
import androidx.compose.material3.lightColorScheme
2623
import androidx.compose.runtime.Composable
27-
import androidx.compose.runtime.SideEffect
28-
import androidx.compose.ui.platform.LocalContext
29-
import androidx.compose.ui.platform.LocalView
30-
import androidx.core.view.WindowCompat
3124

3225
private val LightColorScheme = lightColorScheme(
3326
primary = Yellow,
@@ -45,26 +38,10 @@ private val shapes: Shapes
4538
fun JetLaggedTheme(
4639
content: @Composable () -> Unit,
4740
) {
48-
49-
val view = LocalView.current
50-
val context = LocalContext.current
51-
if (!view.isInEditMode) {
52-
SideEffect {
53-
WindowCompat.getInsetsController(context.findActivity().window, view)
54-
.isAppearanceLightStatusBars = true
55-
}
56-
}
57-
5841
MaterialTheme(
5942
colorScheme = LightColorScheme,
6043
typography = Typography,
6144
shapes = shapes,
6245
content = content
6346
)
6447
}
65-
private tailrec fun Context.findActivity(): Activity =
66-
when (this) {
67-
is Activity -> this
68-
is ContextWrapper -> this.baseContext.findActivity()
69-
else -> throw IllegalArgumentException("Could not find activity!")
70-
}

JetLagged/app/src/main/res/values-v23/themes.xml

Lines changed: 0 additions & 10 deletions
This file was deleted.

JetLagged/app/src/main/res/values/themes.xml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,5 @@
1313
the License.
1414
-->
1515
<resources>
16-
17-
<style name="Theme.JetLagged" parent="android:Theme.Material.Light.NoActionBar">
18-
<item name="android:statusBarColor">@android:color/transparent</item>
19-
<item name="android:navigationBarColor">@android:color/transparent</item>
20-
<item name="android:windowTranslucentStatus">true</item>
21-
</style>
22-
23-
16+
<style name="Theme.JetLagged" parent="Theme.MaterialComponents.DayNight"/>
2417
</resources>

0 commit comments

Comments
 (0)