Skip to content

Commit

Permalink
Fix splashscreen and warnings (#1047)
Browse files Browse the repository at this point in the history
  • Loading branch information
yschimke authored Mar 20, 2024
1 parent 6be60e2 commit fa74141
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ class MainActivity : ComponentActivity() {

jankPrinter = JankPrinter()

setTheme(android.R.style.Theme_DeviceDefault)

setContent {
navController = rememberSwipeDismissableNavController()

Expand Down
2 changes: 1 addition & 1 deletion ComposeStarter/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<activity
android:name=".presentation.MainActivity"
android:exported="true"
android:label="@string/app_name"
android:taskAffinity=".main"
android:theme="@style/Theme.App.Starting">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ package com.example.android.wearable.composestarter.presentation
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.ScrollState
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Build
Expand Down Expand Up @@ -77,14 +77,12 @@ import com.google.android.horologist.compose.rotaryinput.rotaryWithScroll
*/
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
installSplashScreen()

super.onCreate(savedInstanceState)

setContent {
installSplashScreen()

WearApp()

setTheme(android.R.style.Theme_DeviceDefault)
}
}
}
Expand Down Expand Up @@ -112,7 +110,7 @@ fun WearApp() {

@Composable
fun GreetingScreen(greetingName: String, onShowList: () -> Unit) {
val scrollState = ScrollState(0)
val scrollState = rememberScrollState()

/* If you have enough items in your list, use [ScalingLazyColumn] which is an optimized
* version of LazyColumn for wear devices with some added features. For more information,
Expand Down

0 comments on commit fa74141

Please sign in to comment.