Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
0170e29
docs: add alarm widget + global font size design doc
wassupluke Mar 31, 2026
9db366f
docs: add alarm widget implementation plan
wassupluke Mar 31, 2026
637ea71
feat: add FONT_SIZE, ALARM_TEXT, ALARM_WIDGET_TAP_PACKAGE DataStore keys
wassupluke Mar 31, 2026
0ed2a6a
feat: add string resources for alarm widget and font size
wassupluke Mar 31, 2026
26bcb86
feat: add fontSize and alarmWidgetTapPackage to SettingsViewModel (st…
wassupluke Mar 31, 2026
a4d02a8
feat: WeatherWidget reads FONT_SIZE from DataStore instead of hardcod…
wassupluke Mar 31, 2026
5d848ba
feat: implement AlarmWidget Glance widget
wassupluke Mar 31, 2026
3fcb495
feat: add AlarmWidgetReceiver with alarm change broadcast handling
wassupluke Mar 31, 2026
ca67d44
feat: register AlarmWidgetReceiver and alarm_widget_info in manifest
wassupluke Mar 31, 2026
4695608
feat: add font size slider and alarm widget tap-action picker to Sett…
wassupluke Mar 31, 2026
b5d96bf
fix: remove redundant double section title in alarm widget settings
wassupluke Mar 31, 2026
4e89281
refactor: rename package and app to Wasses Widgets
wassupluke Apr 1, 2026
06e6bfe
feat: rename tap-action labels, make Fahrenheit default
wassupluke Apr 1, 2026
d3680de
fix: read current alarm on widget placement (APPWIDGET_UPDATE)
wassupluke Apr 1, 2026
b9deae0
refactor: rename string keys to <where>_<what> convention; add widget…
wassupluke Apr 1, 2026
b8fecb9
fix: avoid double goAsync() crash on APPWIDGET_UPDATE
wassupluke Apr 2, 2026
daa14a3
fix upcoming alarm not showing when widget is first placed, add alarm…
wassupluke Apr 2, 2026
ee0aaef
shrink widget touch target to the text area, abstract widget basics t…
wassupluke Apr 2, 2026
fe0c35c
shrink widget touch target to the text area, abstract widget basics t…
wassupluke Apr 2, 2026
0018f55
initial commit
wassupluke Apr 2, 2026
0cdb99e
remove unused imports
wassupluke Apr 2, 2026
5e19c25
fix: use ColorProvider(Int) to avoid RestrictTo library group violation
wassupluke Apr 2, 2026
4442207
fix: suppress RestrictedApi for ColorProvider(Color) in both widgets
wassupluke Apr 2, 2026
95e67b0
fix: use string resource for alarm none text; clamp icon size
wassupluke Apr 2, 2026
bdcbaf0
revert: restore icon size to fontSize.dp (no clamping)
wassupluke Apr 2, 2026
6492667
refactor: rename package from wasseswidgets to widgets
wassupluke Apr 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ val gitVersionName = providers.exec {
}.standardOutput.asText.map { it.trim().removePrefix("v").ifEmpty { "0.0.0" } }

android {
namespace = "com.wassupluke.simpleweather"
namespace = "com.wassupluke.widgets"
compileSdk = 36

defaultConfig {
applicationId = "com.wassupluke.simpleweather"
applicationId = "com.wassupluke.widgets"
minSdk = 26
targetSdk = 36
versionCode = gitVersionCode.get()
Expand Down
20 changes: 19 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

<queries>
<intent>
Expand All @@ -30,7 +31,8 @@

<receiver
android:name=".widget.WeatherWidgetReceiver"
android:exported="true">
android:exported="true"
android:label="@string/widget_temperature_label">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
Expand All @@ -39,5 +41,21 @@
android:resource="@xml/weather_widget_info" />
</receiver>

<receiver
android:name=".widget.AlarmWidgetReceiver"
android:exported="true"
android:label="@string/widget_alarm_label">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="android.app.action.NEXT_ALARM_CLOCK_CHANGED" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.TIME_SET" />
<action android:name="android.intent.action.TIMEZONE_CHANGED" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/alarm_widget_info" />
</receiver>

</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.wassupluke.simpleweather.data
package com.wassupluke.widgets.data

import android.content.Context
import android.graphics.Color as AndroidColor
Expand Down Expand Up @@ -38,7 +38,7 @@ fun parseColorSafe(colorString: String): Int? {
val Context.dataStore: DataStore<Preferences> by preferencesDataStore(name = "weather_settings")

object WeatherDataStore {
const val DEFAULT_TEMP_UNIT = "C"
const val DEFAULT_TEMP_UNIT = "F"
const val DEFAULT_INTERVAL_MINUTES = 60

val USE_DEVICE_LOCATION = booleanPreferencesKey("use_device_location")
Expand All @@ -53,4 +53,9 @@ object WeatherDataStore {
val WIDGET_TEXT_COLOR = stringPreferencesKey("widget_text_color")
val WIDGET_TAP_PACKAGE = stringPreferencesKey("widget_tap_package")
val WIDGET_DYNAMIC_COLOR = booleanPreferencesKey("widget_dynamic_color")
val FONT_SIZE = intPreferencesKey("font_size")
val ALARM_WIDGET_TAP_PACKAGE = stringPreferencesKey("alarm_widget_tap_package")
val ALARM_TEXT = stringPreferencesKey("alarm_text")

const val DEFAULT_FONT_SIZE = 48
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.wassupluke.simpleweather.data
package com.wassupluke.widgets.data

import android.content.Context
import android.location.Geocoder
import androidx.datastore.preferences.core.edit
import com.wassupluke.simpleweather.data.api.NetworkModule
import com.wassupluke.simpleweather.data.api.OpenMeteoService
import com.wassupluke.widgets.data.api.NetworkModule
import com.wassupluke.widgets.data.api.OpenMeteoService
import java.util.Locale

class WeatherRepository(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.wassupluke.simpleweather.data.api
package com.wassupluke.widgets.data.api

import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory
import kotlinx.serialization.json.Json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.wassupluke.simpleweather.data.api
package com.wassupluke.widgets.data.api

import retrofit2.http.GET
import retrofit2.http.Query
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.wassupluke.simpleweather.data.api
package com.wassupluke.widgets.data.api

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
package com.wassupluke.simpleweather.ui
package com.wassupluke.widgets.ui

import android.Manifest
import android.annotation.SuppressLint
import android.content.pm.PackageManager
import android.os.Bundle
import androidx.core.content.ContextCompat
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.activity.viewModels
import androidx.core.content.ContextCompat
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.wassupluke.simpleweather.data.WeatherDataStore
import com.wassupluke.simpleweather.data.WeatherRepository
import com.wassupluke.simpleweather.data.dataStore
import com.wassupluke.simpleweather.ui.settings.SettingsScreen
import com.wassupluke.simpleweather.ui.settings.SettingsViewModel
import com.wassupluke.simpleweather.ui.theme.SimpleWeatherTheme
import com.wassupluke.simpleweather.worker.WorkScheduler
import com.google.android.gms.location.LocationServices
import androidx.lifecycle.lifecycleScope
import com.google.android.gms.location.LocationServices
import com.wassupluke.widgets.data.WeatherDataStore
import com.wassupluke.widgets.data.WeatherRepository
import com.wassupluke.widgets.data.dataStore
import com.wassupluke.widgets.ui.settings.SettingsScreen
import com.wassupluke.widgets.ui.settings.SettingsViewModel
import com.wassupluke.widgets.ui.theme.SimpleWeatherTheme
import com.wassupluke.widgets.worker.WorkScheduler
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.launch
Expand All @@ -37,6 +38,7 @@ class MainActivity : ComponentActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()

setContent {
SimpleWeatherTheme {
Expand Down
Loading
Loading