Skip to content

Commit e9b8455

Browse files
committed
Latest feedback: experimental flag, licenses, surface
1 parent 59aed9f commit e9b8455

6 files changed

Lines changed: 28 additions & 18 deletions

File tree

app/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ android {
4848
}
4949
kotlinOptions {
5050
jvmTarget = '1.8'
51+
allWarningsAsErrors = false
52+
freeCompilerArgs += [
53+
'-opt-in=androidx.compose.material3.ExperimentalMaterial3Api',
54+
'-opt-in=androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi',
55+
]
5156
}
5257
buildFeatures {
5358
compose true

app/src/main/AndroidManifest.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (C) 2023 The Android Open Source Project
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ https://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
217
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
318
xmlns:tools="http://schemas.android.com/tools">
419

app/src/main/java/com/example/reply/MainActivity.kt

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,29 @@ package com.example.reply
1717

1818
import android.os.Bundle
1919
import androidx.activity.ComponentActivity
20-
import androidx.activity.OnBackPressedCallback
2120
import androidx.activity.compose.setContent
22-
import androidx.activity.viewModels
23-
import androidx.compose.material3.ExperimentalMaterial3Api
24-
import androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi
21+
import androidx.compose.material3.Surface
2522
import androidx.compose.material3.windowsizeclass.WindowWidthSizeClass
2623
import androidx.compose.material3.windowsizeclass.calculateWindowSizeClass
2724
import androidx.compose.runtime.Composable
28-
import androidx.compose.runtime.collectAsState
2925
import androidx.compose.ui.tooling.preview.Preview
30-
import com.example.reply.data.MailboxType
31-
import com.example.reply.data.local.LocalEmailsDataProvider
3226
import com.example.reply.ui.ReplyApp
3327
import com.example.reply.ui.theme.ReplyTheme
3428

3529
class MainActivity : ComponentActivity() {
36-
@OptIn(ExperimentalMaterial3WindowSizeClassApi::class)
30+
3731
override fun onCreate(savedInstanceState: Bundle?) {
3832
super.onCreate(savedInstanceState)
3933

4034
setContent {
4135
ReplyTheme {
42-
val windowSize = calculateWindowSizeClass(this)
36+
Surface {
37+
val windowSize = calculateWindowSizeClass(this)
4338

44-
ReplyApp(
45-
windowSize = windowSize.widthSizeClass,
46-
)
39+
ReplyApp(
40+
windowSize = windowSize.widthSizeClass,
41+
)
42+
}
4743
}
4844
}
4945
}

app/src/main/java/com/example/reply/ui/ReplyApp.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package com.example.reply.ui
1717

18-
import androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi
1918
import androidx.compose.material3.windowsizeclass.WindowWidthSizeClass
2019
import androidx.compose.runtime.Composable
2120
import androidx.compose.runtime.collectAsState
@@ -26,7 +25,6 @@ import com.example.reply.data.MailboxType
2625
import com.example.reply.ui.utils.ReplyContentType
2726
import com.example.reply.ui.utils.ReplyNavigationType
2827

29-
@OptIn(ExperimentalMaterial3WindowSizeClassApi::class)
3028
@Composable
3129
fun ReplyApp(
3230
windowSize: WindowWidthSizeClass,

app/src/main/java/com/example/reply/ui/ReplyDetailsScreen.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import androidx.compose.material3.Button
3636
import androidx.compose.material3.ButtonDefaults
3737
import androidx.compose.material3.Card
3838
import androidx.compose.material3.CardDefaults
39-
import androidx.compose.material3.ExperimentalMaterial3Api
4039
import androidx.compose.material3.Icon
4140
import androidx.compose.material3.IconButton
4241
import androidx.compose.material3.MaterialTheme
@@ -130,7 +129,6 @@ private fun ReplyDetailsScreenTopBar(
130129
}
131130
}
132131

133-
@OptIn(ExperimentalMaterial3Api::class)
134132
@Composable
135133
private fun ReplyEmailDetailsCard(
136134
email: Email,

app/src/main/java/com/example/reply/ui/ReplyHomeContent.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import androidx.compose.foundation.lazy.items
3030
import androidx.compose.foundation.shape.CircleShape
3131
import androidx.compose.material3.Card
3232
import androidx.compose.material3.CardDefaults
33-
import androidx.compose.material3.ExperimentalMaterial3Api
3433
import androidx.compose.material3.MaterialTheme
3534
import androidx.compose.material3.Text
3635
import androidx.compose.runtime.Composable
@@ -119,7 +118,6 @@ fun ReplyListAndDetailContent(
119118
}
120119
}
121120

122-
@OptIn(ExperimentalMaterial3Api::class)
123121
@Composable
124122
fun ReplyEmailListItem(
125123
email: Email,

0 commit comments

Comments
 (0)