Skip to content
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
1 change: 0 additions & 1 deletion Jetsurvey/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ dependencies {
debugImplementation(libs.androidx.compose.ui.tooling)

implementation(libs.accompanist.permissions)
implementation(libs.accompanist.systemuicontroller)

implementation(libs.coil.kt.compose)

Expand Down
3 changes: 2 additions & 1 deletion Jetsurvey/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@

<activity
android:name=".MainActivity"
android:exported="true">
android:exported="true"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ package com.example.compose.jetsurvey

import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import com.example.compose.jetsurvey.theme.JetsurveyTheme

class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
enableEdgeToEdge()
super.onCreate(savedInstanceState)

setContent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.material3.Button
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Snackbar
Expand All @@ -53,7 +52,6 @@ import com.example.compose.jetsurvey.theme.JetsurveyTheme
import com.example.compose.jetsurvey.util.supportWideScreen
import kotlinx.coroutines.launch

@OptIn(ExperimentalMaterial3Api::class) // Scaffold is experimental in m3
@Composable
fun SignInScreen(
email: String?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ fun SignInSignUpTopAppBar(
)
}

@OptIn(ExperimentalMaterial3Api::class) // OutlinedTextField is experimental in m3
@Composable
fun Email(
emailState: TextFieldState = remember { EmailState() },
Expand Down Expand Up @@ -166,7 +165,6 @@ fun Email(
emailState.getError()?.let { error -> TextFieldError(textError = error) }
}

@OptIn(ExperimentalMaterial3Api::class) // OutlinedTextField is experimental in m3
@Composable
fun Password(
label: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.material3.Button
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
Expand All @@ -39,7 +38,6 @@ import com.example.compose.jetsurvey.theme.JetsurveyTheme
import com.example.compose.jetsurvey.theme.stronglyDeemphasizedAlpha
import com.example.compose.jetsurvey.util.supportWideScreen

@OptIn(ExperimentalMaterial3Api::class) // Scaffold is experimental in m3
@Composable
fun SignUpScreen(
email: String?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Button
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
Expand Down Expand Up @@ -60,9 +60,10 @@ fun WelcomeScreen(
) {
var showBranding by remember { mutableStateOf(true) }

Surface(modifier = Modifier.supportWideScreen()) {
Scaffold(modifier = Modifier.supportWideScreen()) { innerPadding ->
Column(
modifier = Modifier
.padding(innerPadding)
.fillMaxWidth()
.verticalScroll(rememberScrollState())
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.WindowInsetsSides.Companion.Bottom
import androidx.compose.foundation.layout.WindowInsetsSides.Companion.Horizontal
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.systemBars
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Close
Expand All @@ -50,8 +56,6 @@ import com.example.compose.jetsurvey.R
import com.example.compose.jetsurvey.theme.stronglyDeemphasizedAlpha
import com.example.compose.jetsurvey.util.supportWideScreen

@OptIn(ExperimentalMaterial3Api::class)
// Scaffold is experimental in m3
@Composable
fun SurveyQuestionsScreen(
surveyScreenData: SurveyScreenData,
Expand Down Expand Up @@ -87,7 +91,6 @@ fun SurveyQuestionsScreen(
}
}

@OptIn(ExperimentalMaterial3Api::class) // Scaffold is experimental in m3
@Composable
fun SurveyResultScreen(
onDonePressed: () -> Unit,
Expand Down Expand Up @@ -220,14 +223,14 @@ fun SurveyBottomBar(
onNextPressed: () -> Unit,
onDonePressed: () -> Unit
) {
Surface(
modifier = Modifier.fillMaxWidth(),
shadowElevation = 7.dp,
) {

Surface(shadowElevation = 7.dp) {
Row(
modifier = Modifier
.fillMaxWidth()
// Since we're not using a Material component but we implement our own bottom bar,
// we will also need to implement our own edge-to-edge support. Similar to the
// NavigationBar, we add the horizontal and bottom padding if it hasn't been consumed yet.
.windowInsetsPadding(WindowInsets.systemBars.only(Horizontal + Bottom))
.padding(horizontal = 16.dp, vertical = 20.dp)
) {
if (shouldShowPreviousButton) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import com.google.accompanist.systemuicontroller.rememberSystemUiController

const val stronglyDeemphasizedAlpha = 0.6f
const val slightlyDeemphasizedAlpha = 0.87f
Expand Down Expand Up @@ -98,16 +96,6 @@ fun JetsurveyTheme(
DarkColors
}

val systemUiController = rememberSystemUiController()
DisposableEffect(systemUiController, useDarkTheme) {
systemUiController.setSystemBarsColor(
color = colors.surface,
darkIcons = !useDarkTheme
)

onDispose { }
}

MaterialTheme(
colorScheme = colors,
shapes = Shapes,
Expand Down
7 changes: 1 addition & 6 deletions Jetsurvey/app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,5 @@
~
-->
<resources>
<!-- Base application theme. -->
<style name="Theme.Jetsurvey" parent="Theme.Material3.DayNight.NoActionBar">
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowBackground">?attr/colorSurface</item>
</style>
<style name="Theme.Jetsurvey" parent="Theme.Material3.DayNight.NoActionBar"/>
</resources>