From 12e41b6e6f3b5d95d19e1caa6c9fbe5eb6c9749c Mon Sep 17 00:00:00 2001 From: Andreas Date: Thu, 26 Jan 2023 23:53:24 +0100 Subject: [PATCH] Move Glance Widget to seperate module (#8989) Move Widget to seperate module - Create a core module for presentation. Widget and App will share some resources and hopefully composables --- app/build.gradle.kts | 3 +- app/src/main/AndroidManifest.xml | 2 +- app/src/main/java/eu/kanade/tachiyomi/App.kt | 20 +++-------- .../util/system/ContextExtensions.kt | 6 ---- .../util/system/DensityExtensions.kt | 9 +++++ presentation-core/.gitignore | 1 + presentation-core/build.gradle.kts | 17 ++++++++++ presentation-core/consumer-rules.pro | 0 presentation-core/proguard-rules.pro | 21 ++++++++++++ .../src/main/AndroidManifest.xml | 2 ++ .../src/main/res/values/colors.xml | 0 .../src/main/res/values/colors_greenapple.xml | 0 .../main/res/values/colors_midnightdusk.xml | 0 .../src/main/res/values/colors_strawberry.xml | 0 .../src/main/res/values/colors_tachiyomi.xml | 0 .../src/main/res/values/colors_tako.xml | 0 .../main/res/values/colors_tealturqoise.xml | 0 .../src/main/res/values/colors_tidalwave.xml | 0 .../src/main/res/values/colors_yinyang.xml | 0 .../src/main/res/values/colors_yotsuba.xml | 0 presentation-widget/.gitignore | 1 + presentation-widget/build.gradle.kts | 33 +++++++++++++++++++ presentation-widget/consumer-rules.pro | 0 presentation-widget/proguard-rules.pro | 21 ++++++++++++ .../src/main/AndroidManifest.xml | 2 ++ .../presentation/widget}/GlanceUtils.kt | 3 +- .../widget/TachiyomiWidgetManager.kt | 26 +++++++++++++++ .../widget}/UpdatesGridGlanceReceiver.kt | 2 +- .../widget}/UpdatesGridGlanceWidget.kt | 14 ++++---- .../res/drawable/appwidget_background.xml | 0 .../res/drawable/appwidget_cover_error.xml | 0 .../src/main/res/layout/appwidget_loading.xml | 0 .../res/values-night-v31/colors_appwidget.xml | 0 .../main/res/values-v31/colors_appwidget.xml | 0 .../src/main/res/values-v31/dimens.xml | 0 .../src/main/res/values/colors_appwidget.xml | 0 .../src/main/res/values/dimens.xml | 4 +++ settings.gradle.kts | 2 ++ 38 files changed, 154 insertions(+), 35 deletions(-) create mode 100644 core/src/main/java/eu/kanade/tachiyomi/util/system/DensityExtensions.kt create mode 100644 presentation-core/.gitignore create mode 100644 presentation-core/build.gradle.kts create mode 100644 presentation-core/consumer-rules.pro create mode 100644 presentation-core/proguard-rules.pro create mode 100644 presentation-core/src/main/AndroidManifest.xml rename {app => presentation-core}/src/main/res/values/colors.xml (100%) rename {app => presentation-core}/src/main/res/values/colors_greenapple.xml (100%) rename {app => presentation-core}/src/main/res/values/colors_midnightdusk.xml (100%) rename {app => presentation-core}/src/main/res/values/colors_strawberry.xml (100%) rename {app => presentation-core}/src/main/res/values/colors_tachiyomi.xml (100%) rename {app => presentation-core}/src/main/res/values/colors_tako.xml (100%) rename {app => presentation-core}/src/main/res/values/colors_tealturqoise.xml (100%) rename {app => presentation-core}/src/main/res/values/colors_tidalwave.xml (100%) rename {app => presentation-core}/src/main/res/values/colors_yinyang.xml (100%) rename {app => presentation-core}/src/main/res/values/colors_yotsuba.xml (100%) create mode 100644 presentation-widget/.gitignore create mode 100644 presentation-widget/build.gradle.kts create mode 100644 presentation-widget/consumer-rules.pro create mode 100644 presentation-widget/proguard-rules.pro create mode 100644 presentation-widget/src/main/AndroidManifest.xml rename {app/src/main/java/eu/kanade/tachiyomi/glance => presentation-widget/src/main/java/tachiyomi/presentation/widget}/GlanceUtils.kt (89%) create mode 100644 presentation-widget/src/main/java/tachiyomi/presentation/widget/TachiyomiWidgetManager.kt rename {app/src/main/java/eu/kanade/tachiyomi/glance => presentation-widget/src/main/java/tachiyomi/presentation/widget}/UpdatesGridGlanceReceiver.kt (87%) rename {app/src/main/java/eu/kanade/tachiyomi/glance => presentation-widget/src/main/java/tachiyomi/presentation/widget}/UpdatesGridGlanceWidget.kt (95%) rename {app => presentation-widget}/src/main/res/drawable/appwidget_background.xml (100%) rename {app => presentation-widget}/src/main/res/drawable/appwidget_cover_error.xml (100%) rename {app => presentation-widget}/src/main/res/layout/appwidget_loading.xml (100%) rename {app => presentation-widget}/src/main/res/values-night-v31/colors_appwidget.xml (100%) rename {app => presentation-widget}/src/main/res/values-v31/colors_appwidget.xml (100%) rename {app => presentation-widget}/src/main/res/values-v31/dimens.xml (100%) rename {app => presentation-widget}/src/main/res/values/colors_appwidget.xml (100%) create mode 100644 presentation-widget/src/main/res/values/dimens.xml diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 0a4179758..6b485736d 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -143,6 +143,8 @@ dependencies { implementation(project(":source-api")) implementation(project(":data")) implementation(project(":domain")) + implementation(project(":presentation-core")) + implementation(project(":presentation-widget")) // Compose implementation(platform(compose.bom)) @@ -181,7 +183,6 @@ dependencies { implementation(androidx.splashscreen) implementation(androidx.recyclerview) implementation(androidx.viewpager) - implementation(androidx.glance) implementation(androidx.profileinstaller) implementation(androidx.bundles.lifecycle) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0bbc2c7a..9c211bffa 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -188,7 +188,7 @@ android:exported="false" /> diff --git a/app/src/main/java/eu/kanade/tachiyomi/App.kt b/app/src/main/java/eu/kanade/tachiyomi/App.kt index 48175dba9..7919e8244 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/App.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/App.kt @@ -13,7 +13,6 @@ import android.os.Looper import android.webkit.WebView import androidx.core.app.NotificationManagerCompat import androidx.core.content.getSystemService -import androidx.glance.appwidget.GlanceAppWidgetManager import androidx.lifecycle.DefaultLifecycleObserver import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.ProcessLifecycleOwner @@ -36,7 +35,6 @@ import eu.kanade.tachiyomi.data.coil.MangaCoverKeyer import eu.kanade.tachiyomi.data.coil.MangaKeyer import eu.kanade.tachiyomi.data.coil.TachiyomiImageDecoder import eu.kanade.tachiyomi.data.notification.Notifications -import eu.kanade.tachiyomi.glance.UpdatesGridGlanceWidget import eu.kanade.tachiyomi.network.NetworkHelper import eu.kanade.tachiyomi.network.NetworkPreferences import eu.kanade.tachiyomi.ui.base.delegate.SecureActivityDelegate @@ -47,8 +45,6 @@ import eu.kanade.tachiyomi.util.system.isReleaseBuildType import eu.kanade.tachiyomi.util.system.logcat import eu.kanade.tachiyomi.util.system.notification import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.flow.distinctUntilChanged -import kotlinx.coroutines.flow.drop import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import logcat.AndroidLogcatLogger @@ -58,7 +54,7 @@ import org.acra.config.httpSender import org.acra.ktx.initAcra import org.acra.sender.HttpSender import org.conscrypt.Conscrypt -import tachiyomi.data.DatabaseHandler +import tachiyomi.presentation.widget.TachiyomiWidgetManager import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import uy.kohesive.injekt.injectLazy @@ -128,17 +124,9 @@ class App : Application(), DefaultLifecycleObserver, ImageLoaderFactory { setAppCompatDelegateThemeMode(Injekt.get().themeMode().get()) // Updates widget update - Injekt.get() - .subscribeToList { updatesViewQueries.updates(after = UpdatesGridGlanceWidget.DateLimit.timeInMillis) } - .drop(1) - .distinctUntilChanged() - .onEach { - val manager = GlanceAppWidgetManager(this) - if (manager.getGlanceIds(UpdatesGridGlanceWidget::class.java).isNotEmpty()) { - UpdatesGridGlanceWidget().loadData(it) - } - } - .launchIn(ProcessLifecycleOwner.get().lifecycleScope) + with(TachiyomiWidgetManager) { + init(ProcessLifecycleOwner.get().lifecycleScope, Injekt.get()) + } if (!LogcatLogger.isInstalled && networkPreferences.verboseLogging().get()) { LogcatLogger.install(AndroidLogcatLogger(LogPriority.VERBOSE)) diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/ContextExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/ContextExtensions.kt index 75f9c36b2..570dd440f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/system/ContextExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/ContextExtensions.kt @@ -115,12 +115,6 @@ fun Context.hasPermission(permission: String) = ContextCompat.checkSelfPermissio val getDisplayMaxHeightInPx: Int get() = Resources.getSystem().displayMetrics.let { max(it.heightPixels, it.widthPixels) } -/** - * Converts to px. - */ -val Int.dpToPx: Int - get() = (this * Resources.getSystem().displayMetrics.density).toInt() - /** * Converts to px and takes into account LTR/RTL layout. */ diff --git a/core/src/main/java/eu/kanade/tachiyomi/util/system/DensityExtensions.kt b/core/src/main/java/eu/kanade/tachiyomi/util/system/DensityExtensions.kt new file mode 100644 index 000000000..c88076dc1 --- /dev/null +++ b/core/src/main/java/eu/kanade/tachiyomi/util/system/DensityExtensions.kt @@ -0,0 +1,9 @@ +package eu.kanade.tachiyomi.util.system + +import android.content.res.Resources + +/** + * Converts to px. + */ +val Int.dpToPx: Int + get() = (this * Resources.getSystem().displayMetrics.density).toInt() diff --git a/presentation-core/.gitignore b/presentation-core/.gitignore new file mode 100644 index 000000000..42afabfd2 --- /dev/null +++ b/presentation-core/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/presentation-core/build.gradle.kts b/presentation-core/build.gradle.kts new file mode 100644 index 000000000..9dfd4731f --- /dev/null +++ b/presentation-core/build.gradle.kts @@ -0,0 +1,17 @@ +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") +} + +android { + namespace = "tachiyomi.presentation.core" + + defaultConfig { + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") + } +} + +dependencies { + +} diff --git a/presentation-core/consumer-rules.pro b/presentation-core/consumer-rules.pro new file mode 100644 index 000000000..e69de29bb diff --git a/presentation-core/proguard-rules.pro b/presentation-core/proguard-rules.pro new file mode 100644 index 000000000..481bb4348 --- /dev/null +++ b/presentation-core/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/presentation-core/src/main/AndroidManifest.xml b/presentation-core/src/main/AndroidManifest.xml new file mode 100644 index 000000000..568741e54 --- /dev/null +++ b/presentation-core/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/presentation-core/src/main/res/values/colors.xml similarity index 100% rename from app/src/main/res/values/colors.xml rename to presentation-core/src/main/res/values/colors.xml diff --git a/app/src/main/res/values/colors_greenapple.xml b/presentation-core/src/main/res/values/colors_greenapple.xml similarity index 100% rename from app/src/main/res/values/colors_greenapple.xml rename to presentation-core/src/main/res/values/colors_greenapple.xml diff --git a/app/src/main/res/values/colors_midnightdusk.xml b/presentation-core/src/main/res/values/colors_midnightdusk.xml similarity index 100% rename from app/src/main/res/values/colors_midnightdusk.xml rename to presentation-core/src/main/res/values/colors_midnightdusk.xml diff --git a/app/src/main/res/values/colors_strawberry.xml b/presentation-core/src/main/res/values/colors_strawberry.xml similarity index 100% rename from app/src/main/res/values/colors_strawberry.xml rename to presentation-core/src/main/res/values/colors_strawberry.xml diff --git a/app/src/main/res/values/colors_tachiyomi.xml b/presentation-core/src/main/res/values/colors_tachiyomi.xml similarity index 100% rename from app/src/main/res/values/colors_tachiyomi.xml rename to presentation-core/src/main/res/values/colors_tachiyomi.xml diff --git a/app/src/main/res/values/colors_tako.xml b/presentation-core/src/main/res/values/colors_tako.xml similarity index 100% rename from app/src/main/res/values/colors_tako.xml rename to presentation-core/src/main/res/values/colors_tako.xml diff --git a/app/src/main/res/values/colors_tealturqoise.xml b/presentation-core/src/main/res/values/colors_tealturqoise.xml similarity index 100% rename from app/src/main/res/values/colors_tealturqoise.xml rename to presentation-core/src/main/res/values/colors_tealturqoise.xml diff --git a/app/src/main/res/values/colors_tidalwave.xml b/presentation-core/src/main/res/values/colors_tidalwave.xml similarity index 100% rename from app/src/main/res/values/colors_tidalwave.xml rename to presentation-core/src/main/res/values/colors_tidalwave.xml diff --git a/app/src/main/res/values/colors_yinyang.xml b/presentation-core/src/main/res/values/colors_yinyang.xml similarity index 100% rename from app/src/main/res/values/colors_yinyang.xml rename to presentation-core/src/main/res/values/colors_yinyang.xml diff --git a/app/src/main/res/values/colors_yotsuba.xml b/presentation-core/src/main/res/values/colors_yotsuba.xml similarity index 100% rename from app/src/main/res/values/colors_yotsuba.xml rename to presentation-core/src/main/res/values/colors_yotsuba.xml diff --git a/presentation-widget/.gitignore b/presentation-widget/.gitignore new file mode 100644 index 000000000..42afabfd2 --- /dev/null +++ b/presentation-widget/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/presentation-widget/build.gradle.kts b/presentation-widget/build.gradle.kts new file mode 100644 index 000000000..5553e2dcf --- /dev/null +++ b/presentation-widget/build.gradle.kts @@ -0,0 +1,33 @@ +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") +} + +android { + namespace = "tachiyomi.presentation.widget" + + defaultConfig { + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") + } + + buildFeatures { + compose = true + } + + composeOptions { + kotlinCompilerExtensionVersion = compose.versions.compiler.get() + } +} + +dependencies { + implementation(project(":core")) + implementation(project(":data")) + implementation(project(":domain")) + implementation(project(":presentation-core")) + + implementation(androidx.glance) + + implementation(libs.coil.core) + +} diff --git a/presentation-widget/consumer-rules.pro b/presentation-widget/consumer-rules.pro new file mode 100644 index 000000000..e69de29bb diff --git a/presentation-widget/proguard-rules.pro b/presentation-widget/proguard-rules.pro new file mode 100644 index 000000000..481bb4348 --- /dev/null +++ b/presentation-widget/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/presentation-widget/src/main/AndroidManifest.xml b/presentation-widget/src/main/AndroidManifest.xml new file mode 100644 index 000000000..568741e54 --- /dev/null +++ b/presentation-widget/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/app/src/main/java/eu/kanade/tachiyomi/glance/GlanceUtils.kt b/presentation-widget/src/main/java/tachiyomi/presentation/widget/GlanceUtils.kt similarity index 89% rename from app/src/main/java/eu/kanade/tachiyomi/glance/GlanceUtils.kt rename to presentation-widget/src/main/java/tachiyomi/presentation/widget/GlanceUtils.kt index 5153183d6..1d49e6c81 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/glance/GlanceUtils.kt +++ b/presentation-widget/src/main/java/tachiyomi/presentation/widget/GlanceUtils.kt @@ -1,11 +1,10 @@ -package eu.kanade.tachiyomi.glance +package tachiyomi.presentation.widget import androidx.annotation.StringRes import androidx.compose.runtime.Composable import androidx.glance.GlanceModifier import androidx.glance.LocalContext import androidx.glance.appwidget.cornerRadius -import eu.kanade.tachiyomi.R fun GlanceModifier.appWidgetBackgroundRadius(): GlanceModifier { return this.cornerRadius(R.dimen.appwidget_background_radius) diff --git a/presentation-widget/src/main/java/tachiyomi/presentation/widget/TachiyomiWidgetManager.kt b/presentation-widget/src/main/java/tachiyomi/presentation/widget/TachiyomiWidgetManager.kt new file mode 100644 index 000000000..27d197e6d --- /dev/null +++ b/presentation-widget/src/main/java/tachiyomi/presentation/widget/TachiyomiWidgetManager.kt @@ -0,0 +1,26 @@ +package tachiyomi.presentation.widget + +import android.content.Context +import androidx.glance.appwidget.GlanceAppWidgetManager +import androidx.lifecycle.LifecycleCoroutineScope +import kotlinx.coroutines.flow.distinctUntilChanged +import kotlinx.coroutines.flow.drop +import kotlinx.coroutines.flow.launchIn +import kotlinx.coroutines.flow.onEach +import tachiyomi.data.DatabaseHandler + +object TachiyomiWidgetManager { + + fun Context.init(scope: LifecycleCoroutineScope, database: DatabaseHandler) { + database.subscribeToList { updatesViewQueries.updates(after = UpdatesGridGlanceWidget.DateLimit.timeInMillis) } + .drop(1) + .distinctUntilChanged() + .onEach { + val manager = GlanceAppWidgetManager(this) + if (manager.getGlanceIds(UpdatesGridGlanceWidget::class.java).isNotEmpty()) { + UpdatesGridGlanceWidget().loadData(it) + } + } + .launchIn(scope) + } +} diff --git a/app/src/main/java/eu/kanade/tachiyomi/glance/UpdatesGridGlanceReceiver.kt b/presentation-widget/src/main/java/tachiyomi/presentation/widget/UpdatesGridGlanceReceiver.kt similarity index 87% rename from app/src/main/java/eu/kanade/tachiyomi/glance/UpdatesGridGlanceReceiver.kt rename to presentation-widget/src/main/java/tachiyomi/presentation/widget/UpdatesGridGlanceReceiver.kt index 0fb153500..2318b31fc 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/glance/UpdatesGridGlanceReceiver.kt +++ b/presentation-widget/src/main/java/tachiyomi/presentation/widget/UpdatesGridGlanceReceiver.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.glance +package tachiyomi.presentation.widget import androidx.glance.appwidget.GlanceAppWidget import androidx.glance.appwidget.GlanceAppWidgetReceiver diff --git a/app/src/main/java/eu/kanade/tachiyomi/glance/UpdatesGridGlanceWidget.kt b/presentation-widget/src/main/java/tachiyomi/presentation/widget/UpdatesGridGlanceWidget.kt similarity index 95% rename from app/src/main/java/eu/kanade/tachiyomi/glance/UpdatesGridGlanceWidget.kt rename to presentation-widget/src/main/java/tachiyomi/presentation/widget/UpdatesGridGlanceWidget.kt index 44962d062..e6de78f2c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/glance/UpdatesGridGlanceWidget.kt +++ b/presentation-widget/src/main/java/tachiyomi/presentation/widget/UpdatesGridGlanceWidget.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.glance +package tachiyomi.presentation.widget import android.app.Application import android.content.Intent @@ -43,10 +43,7 @@ import coil.request.ImageRequest import coil.size.Precision import coil.size.Scale import coil.transform.RoundedCornersTransformation -import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.core.security.SecurityPreferences -import eu.kanade.tachiyomi.ui.main.MainActivity -import eu.kanade.tachiyomi.util.Constants import eu.kanade.tachiyomi.util.lang.launchIO import eu.kanade.tachiyomi.util.system.dpToPx import kotlinx.coroutines.MainScope @@ -81,7 +78,8 @@ class UpdatesGridGlanceWidget : GlanceAppWidget() { @Composable private fun WidgetNotAvailable() { - val intent = Intent(LocalContext.current, MainActivity::class.java).apply { + val clazz = Class.forName("eu.kanade.tachiyomi.ui.main.MainActivity") + val intent = Intent(LocalContext.current, clazz).apply { addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) } Box( @@ -134,9 +132,9 @@ class UpdatesGridGlanceWidget : GlanceAppWidget() { .padding(horizontal = 3.dp), contentAlignment = Alignment.Center, ) { - val intent = Intent(LocalContext.current, MainActivity::class.java).apply { - action = MainActivity.SHORTCUT_MANGA - putExtra(Constants.MANGA_EXTRA, mangaId) + val intent = Intent(LocalContext.current, Class.forName("eu.kanade.tachiyomi.ui.main.MainActivity")).apply { + action = "eu.kanade.tachiyomi.SHOW_MANGA" + putExtra("manga", mangaId) addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) diff --git a/app/src/main/res/drawable/appwidget_background.xml b/presentation-widget/src/main/res/drawable/appwidget_background.xml similarity index 100% rename from app/src/main/res/drawable/appwidget_background.xml rename to presentation-widget/src/main/res/drawable/appwidget_background.xml diff --git a/app/src/main/res/drawable/appwidget_cover_error.xml b/presentation-widget/src/main/res/drawable/appwidget_cover_error.xml similarity index 100% rename from app/src/main/res/drawable/appwidget_cover_error.xml rename to presentation-widget/src/main/res/drawable/appwidget_cover_error.xml diff --git a/app/src/main/res/layout/appwidget_loading.xml b/presentation-widget/src/main/res/layout/appwidget_loading.xml similarity index 100% rename from app/src/main/res/layout/appwidget_loading.xml rename to presentation-widget/src/main/res/layout/appwidget_loading.xml diff --git a/app/src/main/res/values-night-v31/colors_appwidget.xml b/presentation-widget/src/main/res/values-night-v31/colors_appwidget.xml similarity index 100% rename from app/src/main/res/values-night-v31/colors_appwidget.xml rename to presentation-widget/src/main/res/values-night-v31/colors_appwidget.xml diff --git a/app/src/main/res/values-v31/colors_appwidget.xml b/presentation-widget/src/main/res/values-v31/colors_appwidget.xml similarity index 100% rename from app/src/main/res/values-v31/colors_appwidget.xml rename to presentation-widget/src/main/res/values-v31/colors_appwidget.xml diff --git a/app/src/main/res/values-v31/dimens.xml b/presentation-widget/src/main/res/values-v31/dimens.xml similarity index 100% rename from app/src/main/res/values-v31/dimens.xml rename to presentation-widget/src/main/res/values-v31/dimens.xml diff --git a/app/src/main/res/values/colors_appwidget.xml b/presentation-widget/src/main/res/values/colors_appwidget.xml similarity index 100% rename from app/src/main/res/values/colors_appwidget.xml rename to presentation-widget/src/main/res/values/colors_appwidget.xml diff --git a/presentation-widget/src/main/res/values/dimens.xml b/presentation-widget/src/main/res/values/dimens.xml new file mode 100644 index 000000000..af52b6c3d --- /dev/null +++ b/presentation-widget/src/main/res/values/dimens.xml @@ -0,0 +1,4 @@ + + 16dp + 12dp + diff --git a/settings.gradle.kts b/settings.gradle.kts index c2aba5f71..c711be250 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -43,3 +43,5 @@ include(":core") include(":macrobenchmark") include(":data") include(":domain") +include(":presentation-widget") +include(":presentation-core")