From cfd901845df4b1b05c3b378e1401289166a9feb0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 14 Dec 2025 21:58:28 +0000 Subject: [PATCH 1/2] Initial plan From d16cbe705ee5574965a3921e2b8dceba92eb7bd8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 14 Dec 2025 22:15:20 +0000 Subject: [PATCH 2/2] Fix Android build: upgrade to AGP 8.7.3, SDK 35, and fix widget API usage - Upgraded AGP from 8.5.2 to 8.7.3 to support compileSdk 35 - Updated compileSdk, targetSdk to 35 (minSdk remains 24) - Built web app and ran npx cap sync to regenerate Capacitor files - Removed composeOptions.kotlinCompilerExtensionVersion (Kotlin 2.0+ auto-manages) - Fixed duplicate splash resource (removed splash.png, kept splash.xml) - Added missing color resource (splashBackground) and string (title_activity_main) - Fixed theme reference from @android:style to @style - Installed and configured Java 21 for Capacitor compatibility - Updated Glance widget API calls to use GlanceAppWidgetManager - Fixed actionStartActivity to pass Intent parameter - Build now completes successfully with assembleDebug Co-authored-by: LuminLynx <212206643+LuminLynx@users.noreply.github.com> --- android/app/build.gradle | 4 ---- android/app/src/main/AndroidManifest.xml | 2 +- android/app/src/main/assets/public/index.html | 18 +++++++++--------- .../luminlynx/misty/widget/WeatherWidget.kt | 2 +- .../misty/widget/WeatherWidgetReceiver.kt | 8 ++++++-- .../config/WeatherWidgetConfigActivity.kt | 6 ++++-- android/app/src/main/res/drawable/splash.png | Bin 4040 -> 0 bytes android/app/src/main/res/values/colors.xml | 4 ++++ android/app/src/main/res/values/strings.xml | 1 + android/build.gradle | 6 +++--- 10 files changed, 29 insertions(+), 22 deletions(-) delete mode 100644 android/app/src/main/res/drawable/splash.png create mode 100644 android/app/src/main/res/values/colors.xml diff --git a/android/app/build.gradle b/android/app/build.gradle index 8f54835..ad31b25 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -52,10 +52,6 @@ android { buildFeatures { compose = true } - - composeOptions { - kotlinCompilerExtensionVersion = "1.5.15" - } } dependencies { diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 6f5dded..eab4f67 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -38,7 +38,7 @@ + android:theme="@style/Theme.Material3.DayNight"> diff --git a/android/app/src/main/assets/public/index.html b/android/app/src/main/assets/public/index.html index d5575f5..bfed15a 100644 --- a/android/app/src/main/assets/public/index.html +++ b/android/app/src/main/assets/public/index.html @@ -14,19 +14,19 @@ - - - - - - - + + + + + + + - - + + diff --git a/android/app/src/main/java/com/luminlynx/misty/widget/WeatherWidget.kt b/android/app/src/main/java/com/luminlynx/misty/widget/WeatherWidget.kt index c9ce40a..bdc66d5 100644 --- a/android/app/src/main/java/com/luminlynx/misty/widget/WeatherWidget.kt +++ b/android/app/src/main/java/com/luminlynx/misty/widget/WeatherWidget.kt @@ -106,7 +106,7 @@ private fun WeatherWidgetContent( .fillMaxSize() .background(backgroundColor) .padding(16.dp) - .clickable(actionStartActivity()), + .clickable(actionStartActivity(Intent(context, MainActivity::class.java))), contentAlignment = Alignment.Center ) { if (weatherData != null) { diff --git a/android/app/src/main/java/com/luminlynx/misty/widget/WeatherWidgetReceiver.kt b/android/app/src/main/java/com/luminlynx/misty/widget/WeatherWidgetReceiver.kt index 3fe5bd0..4b92b93 100644 --- a/android/app/src/main/java/com/luminlynx/misty/widget/WeatherWidgetReceiver.kt +++ b/android/app/src/main/java/com/luminlynx/misty/widget/WeatherWidgetReceiver.kt @@ -4,6 +4,7 @@ import android.appwidget.AppWidgetManager import android.content.Context import android.util.Log import androidx.glance.appwidget.GlanceAppWidget +import androidx.glance.appwidget.GlanceAppWidgetManager import androidx.glance.appwidget.GlanceAppWidgetReceiver import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -33,10 +34,13 @@ class WeatherWidgetReceiver : GlanceAppWidgetReceiver() { // This method is called from WorkManager to trigger updates val scope = CoroutineScope(SupervisorJob() + Dispatchers.Main) scope.launch { + val glanceManager = GlanceAppWidgetManager(context) + val weatherWidget = WeatherWidget() appWidgetIds.forEach { widgetId -> try { - // Glance will handle the update through the WeatherWidget instance - WeatherWidget().update(context, AppWidgetManager.getInstance(context)) + // Get GlanceId for this widget and update + val glanceId = glanceManager.getGlanceIdBy(widgetId) + weatherWidget.update(context, glanceId) } catch (e: Exception) { Log.e(TAG, "Error updating widget $widgetId", e) } diff --git a/android/app/src/main/java/com/luminlynx/misty/widget/config/WeatherWidgetConfigActivity.kt b/android/app/src/main/java/com/luminlynx/misty/widget/config/WeatherWidgetConfigActivity.kt index 2e0d968..db64f75 100644 --- a/android/app/src/main/java/com/luminlynx/misty/widget/config/WeatherWidgetConfigActivity.kt +++ b/android/app/src/main/java/com/luminlynx/misty/widget/config/WeatherWidgetConfigActivity.kt @@ -14,6 +14,7 @@ import androidx.compose.runtime.* import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp +import androidx.glance.appwidget.GlanceAppWidgetManager import androidx.lifecycle.lifecycleScope import com.luminlynx.misty.widget.WeatherWidget import com.luminlynx.misty.widget.WeatherWidgetWorker @@ -68,8 +69,9 @@ class WeatherWidgetConfigActivity : ComponentActivity() { private fun saveConfiguration() { lifecycleScope.launch { // Update widget - val appWidgetManager = AppWidgetManager.getInstance(this@WeatherWidgetConfigActivity) - WeatherWidget().update(this@WeatherWidgetConfigActivity, appWidgetManager) + val glanceManager = GlanceAppWidgetManager(this@WeatherWidgetConfigActivity) + val glanceId = glanceManager.getGlanceIdBy(appWidgetId) + WeatherWidget().update(this@WeatherWidgetConfigActivity, glanceId) // Get update frequency and schedule worker val config = preferences.widgetConfig.first() diff --git a/android/app/src/main/res/drawable/splash.png b/android/app/src/main/res/drawable/splash.png deleted file mode 100644 index f7a64923ea1a0565d25fa139c176d6bf42184e48..0000000000000000000000000000000000000000 GIT binary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ak2T}3ez?AuooV@CUD0)vm!eIrlqVYM0y2lY z1zer{@-toIhXWlqYWR~8yQoB`({<;Rv21+Zm$VLT+d}hV!V_Klm0xmVy2DIr2MOH^ zp4OthWo_zd%>6Fu`v*M7PE54w>=>*bnqTXez|}21$7?KfU7`UHkQbceUz@%Z5SPh( zf|1c?s;d{FU2)&wGjtkEWYEo4?Vd;u_CU>;tL^5+QK(f~;dr=m{U{Aj3jwwE3!GRq z$F!^t>%w%vBNRx8O))O@a~7`k--n$qj^O)$*-$by@_t2Wz_&HW{*@Uy#TY@Qn6z<6 zl4svmjF*uxvQ*COHRGd&VR7vwK$7|T{20gdieL1R%Z|)8$MRd0-L=KE8fE2Elq|C8 zo%yOJtr2+_EPaEqd8HcW?zYwESN~L7r5D~hLZxo$uo@H0Wq3ETe;(%m-GEFGx^HTR zHp|&GLrSk-%Cu!43@kQf+9m&4(>o(RqyWb~WetoKY~aneh!p0yATpfC6w`@ydruv@ zIjhr+Z2#6_F?VKjj3w{RRYob&FfF=7U&vtVx80!jDr|adJ7Of!mkHYmqu}X|yKZel z_M$tF@824GU3I%1GEUQtH1m2PWH2Dds+kVlwV5GQJGd!t|8O!gV5c1^OVz`cZa9Me zD{3^lL1;fjtU?%eb36r6d9Uz81=4cr^3G@JpjEuc%j>ZNryed0SQ4PgnNBP&e=hn+ z?SbFgG`|$Ahr&u9R>YFQ;%c;PG0nr~Bt74$ZViOq8}pjQJct(ouyK1+1JlPjW_U)a zy6-~`zPs8Vg!6BS>;D>d{v&bym$>#R?0gQ_e#giEjkx|xT>Fm|{8JLY+??3hvR93~ XyOn+%7f`N3b2T^T3uj5+eShz7v)7qy diff --git a/android/app/src/main/res/values/colors.xml b/android/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..9b116cc --- /dev/null +++ b/android/app/src/main/res/values/colors.xml @@ -0,0 +1,4 @@ + + + #FFFFFF + diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index f66136e..9f726ff 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -1,6 +1,7 @@ Misty Weather Widget + Misty Display current weather conditions on your home screen Loading weather data... Unable to load weather diff --git a/android/build.gradle b/android/build.gradle index 2b8e5f7..1469488 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -3,9 +3,9 @@ buildscript { ext.kotlin_version = '2.0.0' ext { - compileSdkVersion = 34 + compileSdkVersion = 35 minSdkVersion = 24 - targetSdkVersion = 34 + targetSdkVersion = 35 androidxAppCompatVersion = '1.6.1' androidxCoordinatorLayoutVersion = '1.2.0' coreSplashScreenVersion = '1.0.1' @@ -18,7 +18,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.5.2' + classpath 'com.android.tools.build:gradle:8.7.3' classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.0' classpath 'org.jetbrains.kotlin:compose-compiler-gradle-plugin:2.0.0' // NOTE: Do not place your application dependencies here; they belong