Skip to content

Commit

Permalink
Bump Glance to version 1.0.0 and Lifecycle to version 2.6.2 + adds Ma…
Browse files Browse the repository at this point in the history
…terialComponents dependency
  • Loading branch information
Andr3Carvalh0 committed Dec 19, 2023
1 parent 32255a8 commit 50149b5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ dependencies {
implementation(Libraries.Compose.Lifecycle)
implementation(Libraries.Hilt.Core)
implementation(Libraries.Hilt.Navigation)
implementation(Libraries.MaterialComponents)

kapt(Libraries.Hilt.Compiler)

Expand Down
10 changes: 7 additions & 3 deletions app/src/main/java/pt/andre/widgetcandy/widget/CandyWidget.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
package pt.andre.widgetcandy.widget

import android.content.Context
import androidx.compose.runtime.Composable
import androidx.glance.GlanceId
import androidx.glance.appwidget.GlanceAppWidget
import androidx.glance.appwidget.provideContent
import androidx.glance.state.PreferencesGlanceStateDefinition
import androidx.glance.text.Text

internal class CandyWidget : GlanceAppWidget() {

@Composable
override fun Content() {
Text(text = "Hello World!")
override suspend fun provideGlance(context: Context, id: GlanceId) {
provideContent {
Text(text = "Hello World!")
}
}

override val stateDefinition = PreferencesGlanceStateDefinition
Expand Down
2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/Libraries.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ object Libraries {

const val JUnit = "junit:junit:${Versions.JUnit.MAIN}"

const val MaterialComponents = "com.google.android.material:material:${Versions.MATERIAL_COMPONENTS}"

object Kotlin {
const val Coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.Kotlin.COROUTINES}"

Expand Down
5 changes: 3 additions & 2 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ object Versions {
const val ACTIVITY = "1.8.2"
const val CORE = "1.12.0"
const val DATASTORE = "1.0.0"
const val LIFECYCLE = "2.6.1"
const val GLANCE = "1.0.0-alpha05"
const val LIFECYCLE = "2.6.2"
const val GLANCE = "1.0.0"
}

object Accompanist {
Expand All @@ -24,6 +24,7 @@ object Versions {
}

const val COIL = "2.2.2"
const val MATERIAL_COMPONENTS = "1.11.0"

object Compose {
const val HILT = "1.1.0"
Expand Down

0 comments on commit 50149b5

Please sign in to comment.