Skip to content

Commit 4ec274e

Browse files
committed
updated to beta
1 parent 4786d34 commit 4ec274e

File tree

8 files changed

+20
-25
lines changed

8 files changed

+20
-25
lines changed

.idea/codeStyles/Project.xml

Lines changed: 0 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/jarRepositories.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ android {
4242
}
4343
composeOptions {
4444
kotlinCompilerExtensionVersion compose_version
45-
kotlinCompilerVersion kotlin_version
4645
}
4746
}
4847

@@ -61,10 +60,12 @@ dependencies {
6160
implementation "androidx.compose.ui:ui:$compose_version"
6261
implementation "androidx.compose.material:material:$compose_version"
6362
implementation "androidx.compose.material:material-icons-extended:$compose_version"
64-
implementation "androidx.compose.ui:ui-tooling:$compose_version"
6563
implementation "androidx.compose.runtime:runtime:$compose_version"
6664
implementation "androidx.ui:ui-tooling:1.0.0-alpha07"
6765

66+
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
67+
debugImplementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
68+
6869
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
6970
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
7071
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"

app/src/main/java/com/hoc081098/datastoresample/ui/MainActivity.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,25 @@ package com.hoc081098.datastoresample.ui
22

33
import android.os.Bundle
44
import androidx.activity.compose.setContent
5+
import androidx.activity.viewModels
56
import androidx.appcompat.app.AppCompatActivity
67
import androidx.compose.material.MaterialTheme
78
import androidx.compose.material.Surface
89
import androidx.compose.runtime.collectAsState
910
import androidx.compose.runtime.getValue
10-
import androidx.lifecycle.viewmodel.compose.viewModel
1111
import com.hoc081098.datastoresample.Locator
1212
import com.hoc081098.datastoresample.ui.theme.DataStoreSampleTheme
1313

1414
class MainActivity : AppCompatActivity() {
15+
private val viewModel by viewModels<MainViewModel>(factoryProducer = { Locator.mainViewModelFactory })
16+
1517
override fun onCreate(savedInstanceState: Bundle?) {
1618
super.onCreate(savedInstanceState)
1719

1820
setContent {
1921
DataStoreSampleTheme(true) {
2022
// A surface container using the 'background' color from the theme
2123
Surface(color = MaterialTheme.colors.background) {
22-
val viewModel = viewModel<MainViewModel>(factory = Locator.mainViewModelFactory)
2324
val state by viewModel.state.collectAsState()
2425

2526
MainScreen(

app/src/main/java/com/hoc081098/datastoresample/ui/MainScreen.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import androidx.compose.foundation.layout.Row
99
import androidx.compose.foundation.layout.Spacer
1010
import androidx.compose.foundation.layout.fillMaxHeight
1111
import androidx.compose.foundation.layout.fillMaxWidth
12+
import androidx.compose.foundation.layout.height
1213
import androidx.compose.foundation.layout.padding
13-
import androidx.compose.foundation.layout.preferredHeight
1414
import androidx.compose.foundation.layout.width
1515
import androidx.compose.foundation.layout.wrapContentWidth
1616
import androidx.compose.foundation.lazy.LazyColumn
@@ -173,7 +173,7 @@ fun SortChip(
173173
shape: Shape = MaterialTheme.shapes.small,
174174
) {
175175
Surface(
176-
modifier = modifier.preferredHeight(28.dp),
176+
modifier = modifier.height(28.dp),
177177
color = MaterialTheme.colors.secondary,
178178
shape = shape,
179179
elevation = 2.dp

build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
buildscript {
33
ext {
4-
compose_version = '1.0.0-alpha12'
4+
compose_version = '1.0.0-beta01'
55
kotlin_version = '1.4.30'
66
coroutines_version = '1.4.2'
77
}
88
repositories {
99
google()
10+
mavenCentral()
1011
jcenter()
1112
}
1213
dependencies {
13-
classpath 'com.android.tools.build:gradle:7.0.0-alpha07'
14+
classpath 'com.android.tools.build:gradle:7.0.0-alpha08'
1415
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1516

1617
// NOTE: Do not place your application dependencies here; they belong
@@ -21,6 +22,7 @@ buildscript {
2122
allprojects {
2223
repositories {
2324
google()
25+
mavenCentral()
2426
jcenter()
2527
}
2628
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Fri Feb 19 15:45:31 ICT 2021
22
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https://services.gradle.org/distributions/gradle-6.8.1-bin.zip
3+
distributionUrl=https://services.gradle.org/distributions/gradle-6.8.2-bin.zip
44
distributionPath=wrapper/dists
55
zipStorePath=wrapper/dists
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)