-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Glance app widget * Glance app widget * Glance app widget
- Loading branch information
1 parent
c3c214c
commit fb74d17
Showing
60 changed files
with
1,270 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...common/src/main/kotlin/org/michaelbel/movies/common/exceptions/MoviesUpcomingException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package org.michaelbel.movies.common.exceptions | ||
|
||
data object MoviesUpcomingException: Exception() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...nce/src/main/kotlin/org/michaelbel/movies/persistence/database/entity/mini/MovieDbMini.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package org.michaelbel.movies.persistence.database.entity.mini | ||
|
||
data class MovieDbMini( | ||
val movieList: String, | ||
val id: Int, | ||
val title: String, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
@Suppress("dsl_scope_violation") | ||
plugins { | ||
alias(libs.plugins.library) | ||
alias(libs.plugins.kotlin) | ||
alias(libs.plugins.detekt) | ||
id("movies-android-hilt") | ||
id("org.jetbrains.kotlin.plugin.serialization") | ||
} | ||
|
||
android { | ||
namespace = "org.michaelbel.movies.widget" | ||
|
||
defaultConfig { | ||
minSdk = libs.versions.min.sdk.get().toInt() | ||
compileSdk = libs.versions.compile.sdk.get().toInt() | ||
} | ||
|
||
/*buildTypes { | ||
create("benchmark") { | ||
signingConfig = signingConfigs.getByName("debug") | ||
matchingFallbacks += listOf("release") | ||
initWith(getByName("release")) | ||
} | ||
}*/ | ||
|
||
buildFeatures { | ||
compose = true | ||
} | ||
|
||
composeOptions { | ||
kotlinCompilerExtensionVersion = libs.versions.androidx.compose.compiler.get() | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
|
||
kotlinOptions { | ||
freeCompilerArgs = freeCompilerArgs + listOf( | ||
"-opt-in=androidx.compose.material3.ExperimentalMaterial3Api" | ||
) | ||
} | ||
|
||
lint { | ||
quiet = true | ||
abortOnError = false | ||
ignoreWarnings = true | ||
checkDependencies = true | ||
lintConfig = file("${project.rootDir}/config/codestyle/lint.xml") | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(project(":core:interactor")) | ||
implementation(project(":core:common")) | ||
implementation(project(":core:ui")) | ||
implementation(project(":core:work")) | ||
implementation(libs.bundles.glance) | ||
implementation(libs.bundles.datastore) | ||
implementation(libs.androidx.hilt.navigation.compose) | ||
implementation(libs.kotlin.serialization.json) | ||
ksp(libs.androidx.hilt.compiler) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest/> |
26 changes: 26 additions & 0 deletions
26
core/widget/src/main/kotlin/org/michaelbel/movies/widget/MoviesGlanceWidget.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.michaelbel.movies.widget | ||
|
||
import android.content.Context | ||
import androidx.glance.GlanceId | ||
import androidx.glance.appwidget.GlanceAppWidget | ||
import androidx.glance.appwidget.provideContent | ||
import androidx.glance.currentState | ||
import org.michaelbel.movies.widget.theme.MoviesGlanceTheme | ||
import org.michaelbel.movies.widget.work.MoviesGlanceStateDefinition | ||
import org.michaelbel.movies.widget.work.MoviesWidgetState | ||
|
||
internal class MoviesGlanceWidget: GlanceAppWidget() { | ||
|
||
override suspend fun provideGlance(context: Context, id: GlanceId) { | ||
provideContent { | ||
val glanceWidgetState = currentState<MoviesWidgetState>() | ||
MoviesGlanceTheme { | ||
MoviesGlanceWidgetContent( | ||
glanceWidgetState = glanceWidgetState | ||
) | ||
} | ||
} | ||
} | ||
|
||
override val stateDefinition = MoviesGlanceStateDefinition | ||
} |
Oops, something went wrong.