Skip to content

Commit d011fd1

Browse files
Empty Compose M3 template (#23)
1 parent a09bbcb commit d011fd1

36 files changed

+263
-1711
lines changed

app/build.gradle

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,30 @@
1+
/*
2+
* Copyright (C) 2023 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
plugins {
217
id 'com.android.application'
318
id 'org.jetbrains.kotlin.android'
4-
id 'com.google.devtools.ksp' version "1.8.0-1.0.9"
19+
id 'com.google.devtools.ksp' version "1.8.10-1.0.9"
520
}
621

722
android {
823
compileSdk 33
924

1025
defaultConfig {
1126
applicationId "com.example.inventory"
12-
minSdk 21
27+
minSdk 24
1328
targetSdk 33
1429
versionCode 1
1530
versionName "1.0"
@@ -37,7 +52,7 @@ android {
3752
compose true
3853
}
3954
composeOptions {
40-
kotlinCompilerExtensionVersion compose_compiler_version
55+
kotlinCompilerExtensionVersion '1.4.3'
4156
}
4257
packagingOptions {
4358
resources {
@@ -49,16 +64,16 @@ android {
4964

5065
dependencies {
5166
// Import the Compose BOM
52-
implementation platform('androidx.compose:compose-bom:2023.01.00')
67+
implementation platform('androidx.compose:compose-bom:2023.03.00')
5368

54-
implementation 'androidx.activity:activity-compose:1.6.1'
55-
implementation "androidx.compose.material:material"
69+
implementation 'androidx.activity:activity-compose:1.7.0'
70+
implementation 'androidx.compose.material3:material3'
5671
implementation "androidx.compose.ui:ui"
5772
implementation "androidx.compose.ui:ui-tooling"
5873
implementation "androidx.compose.ui:ui-tooling-preview"
5974
implementation 'androidx.core:core-ktx:1.9.0'
60-
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
61-
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.5.1"
75+
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
76+
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1"
6277
implementation "androidx.navigation:navigation-compose:2.5.3"
6378

6479
//Room
@@ -69,4 +84,4 @@ dependencies {
6984
// Testing
7085
androidTestImplementation "androidx.test.espresso:espresso-core:3.5.1"
7186
androidTestImplementation "androidx.test.ext:junit:1.1.5"
72-
}
87+
}

app/src/androidTest/java/com/example/inventory/ItemDaoTest.kt

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

app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!--
3-
~ Copyright (C) 2022 The Android Open Source Project
3+
~ Copyright (C) 2023 The Android Open Source Project
44
~
55
~ Licensed under the Apache License, Version 2.0 (the "License");
66
~ you may not use this file except in compliance with the License.
77
~ You may obtain a copy of the License at
88
~
9-
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~ https://www.apache.org/licenses/LICENSE-2.0
1010
~
1111
~ Unless required by applicable law or agreed to in writing, software
1212
~ distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,7 +18,6 @@
1818
xmlns:tools="http://schemas.android.com/tools">
1919

2020
<application
21-
android:name=".InventoryApplication"
2221
android:allowBackup="true"
2322
android:icon="@mipmap/ic_launcher"
2423
android:label="@string/app_name"
@@ -29,13 +28,13 @@
2928
<activity
3029
android:name=".MainActivity"
3130
android:exported="true"
31+
android:label="@string/app_name"
3232
android:theme="@style/Theme.Inventory">
3333
<intent-filter>
3434
<action android:name="android.intent.action.MAIN" />
35-
3635
<category android:name="android.intent.category.LAUNCHER" />
3736
</intent-filter>
3837
</activity>
3938
</application>
4039

41-
</manifest>
40+
</manifest>

app/src/main/java/com/example/inventory/InventoryApp.kt

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

app/src/main/java/com/example/inventory/InventoryApplication.kt

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

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright (C) 2022 The Android Open Source Project
2+
* Copyright (C) 2023 The Android Open Source Project
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,14 +18,24 @@ package com.example.inventory
1818
import android.os.Bundle
1919
import androidx.activity.ComponentActivity
2020
import androidx.activity.compose.setContent
21+
import androidx.compose.foundation.layout.fillMaxSize
22+
import androidx.compose.material3.MaterialTheme
23+
import androidx.compose.material3.Surface
24+
import androidx.compose.ui.Modifier
2125
import com.example.inventory.ui.theme.InventoryTheme
2226

2327
class MainActivity : ComponentActivity() {
2428
override fun onCreate(savedInstanceState: Bundle?) {
2529
super.onCreate(savedInstanceState)
2630
setContent {
2731
InventoryTheme {
28-
InventoryApp()
32+
// A surface container using the 'background' color from the theme
33+
Surface(
34+
modifier = Modifier.fillMaxSize(),
35+
color = MaterialTheme.colorScheme.background
36+
) {
37+
// TODO: Call main composable
38+
}
2939
}
3040
}
3141
}

0 commit comments

Comments
 (0)