Bläddra i källkod

Switched to Composable

Thomas Chef 2 år sedan
förälder
incheckning
819c32eedc

+ 21 - 4
app/build.gradle

@@ -4,12 +4,12 @@ plugins {
 }
 
 android {
-    compileSdk 32
+    compileSdk 33
 
     defaultConfig {
         applicationId "chef.sundby.com.homecontroldisplay"
         minSdk 25
-        targetSdk 32
+        targetSdk 33
         versionCode 1
         versionName "1.0"
 
@@ -31,14 +31,18 @@ android {
     }
     buildFeatures {
         viewBinding true
+        compose true
+    }
+    composeOptions {
+        kotlinCompilerExtensionVersion = "1.3.2"
     }
 }
 
 dependencies {
 
     implementation 'androidx.core:core-ktx:1.7.0'
-    implementation 'androidx.appcompat:appcompat:1.3.0'
-    implementation 'com.google.android.material:material:1.4.0'
+    implementation 'androidx.appcompat:appcompat:1.4.1'
+    implementation 'com.google.android.material:material:1.5.0'
     testImplementation 'junit:junit:4.13.2'
     androidTestImplementation 'androidx.test.ext:junit:1.1.3'
     androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
@@ -50,4 +54,17 @@ dependencies {
 
     //implementation 'com.squareup.retrofit2:retrofit:2.9.0'
     //implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
+
+    // Compose add-ons Copied from:
+    implementation 'androidx.activity:activity-compose:1.6.1'
+
+    //implementation 'androidx.compose.material3:material3:1.0.1'
+    //implementation 'androidx.compose.foundation:foundation:1.3.1'
+    implementation "androidx.compose.material:material:1.3.1"
+    //implementation "androidx.compose.ui:ui:1.3.3"
+
+
+    implementation "androidx.compose.ui:ui-tooling-preview:1.3.3"
+    debugImplementation "androidx.compose.ui:ui-tooling:1.3.3"
+
 }

+ 21 - 0
app/src/main/java/chef/sundby/com/homecontroldisplay/ui/HomeControlApp.kt

@@ -0,0 +1,21 @@
+package chef.sundby.com.homecontroldisplay.ui
+
+import androidx.compose.material.Surface
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.material.Text
+
+@Composable
+fun HomeControlApp() {
+    Text(text="Hej")
+}
+
+@Preview
+@Composable
+fun HomeControlAppPreview() {
+
+    Surface {
+
+        HomeControlApp()
+    }
+}

+ 3 - 3
build.gradle

@@ -1,8 +1,8 @@
 // Top-level build file where you can add configuration options common to all sub-projects/modules.
 plugins {
-    id 'com.android.application' version '7.2.1' apply false
-    id 'com.android.library' version '7.2.1' apply false
-    id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
+    id 'com.android.application' version '7.4.0' apply false
+    id 'com.android.library' version '7.4.0' apply false
+    id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
 }
 
 task clean(type: Delete) {

+ 1 - 1
gradle/wrapper/gradle-wrapper.properties

@@ -1,6 +1,6 @@
 #Sat Jan 07 11:20:19 CET 2023
 distributionBase=GRADLE_USER_HOME
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
 distributionPath=wrapper/dists
 zipStorePath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME