File tree 4 files changed +23
-3
lines changed
4 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ android {
37
37
kotlinOptions {
38
38
jvmTarget = " 11"
39
39
}
40
+ buildFeatures {
41
+ compose = true
42
+ }
40
43
}
41
44
42
45
dependencies {
Original file line number Diff line number Diff line change 15
15
16
16
<activity
17
17
android : name =" .MainActivity"
18
- android : exported =" false " >
18
+ android : exported =" true " >
19
19
20
20
<intent-filter >
21
21
<action android : name =" android.intent.action.MAIN" />
Original file line number Diff line number Diff line change 1
1
package com.peterfarlow
2
2
3
3
import android.os.Bundle
4
+ import androidx.activity.compose.setContent
4
5
import androidx.appcompat.app.AppCompatActivity
6
+ import androidx.compose.material.Text
7
+ import androidx.compose.runtime.Composable
8
+ import androidx.compose.ui.tooling.preview.Preview
5
9
import dagger.hilt.android.AndroidEntryPoint
6
10
7
11
@AndroidEntryPoint
8
12
class MainActivity : AppCompatActivity () {
9
13
10
14
override fun onCreate (savedInstanceState : Bundle ? ) {
11
15
super .onCreate(savedInstanceState)
12
- setContentView(R .layout.activity_main)
16
+ setContent {
17
+ HomeScreen ()
18
+ }
13
19
}
14
20
}
21
+
22
+ @Composable
23
+ fun HomeScreen () {
24
+ Text (" Hello, world!" )
25
+ }
26
+
27
+ @Composable
28
+ @Preview
29
+ fun DefaultPreview () {
30
+ HomeScreen ()
31
+ }
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ buildscript {
5
5
}
6
6
dependencies {
7
7
classpath(" com.android.tools.build:gradle:7.0.0" )
8
- classpath(" org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21 " )
8
+ classpath(" org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.32 " )
9
9
classpath(" com.google.dagger:hilt-android-gradle-plugin:2.38.1" )
10
10
}
11
11
}
You can’t perform that action at this time.
0 commit comments