Skip to content

Commit a29a8d8

Browse files
authored
Merge pull request #9 from SimpleAppProjects/develop
merge develop br
2 parents b493c2b + 6165258 commit a29a8d8

File tree

63 files changed

+3529
-1756
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+3529
-1756
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ android {
1414
minSdkVersion rootProject.minSdkVersion
1515
targetSdkVersion rootProject.targetSdkVersion
1616
// NOTE: Version Code Format (TargetSDK, Version Name, Build Number, Variant Code (Android: 00, WearOS: 01)
17-
versionCode 335810200
18-
versionName "5.8.1"
17+
versionCode 335820100
18+
versionName "5.8.2"
1919

2020
vectorDrawables.useSupportLibrary true
2121
}

app/src/main/java/com/thewizrd/simpleweather/controls/viewmodels/AirQualityForecastViewModel.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ import android.app.Application
44
import androidx.annotation.MainThread
55
import androidx.arch.core.util.Function
66
import androidx.core.util.ObjectsCompat
7-
import androidx.lifecycle.*
7+
import androidx.lifecycle.AndroidViewModel
8+
import androidx.lifecycle.LiveData
9+
import androidx.lifecycle.MutableLiveData
10+
import androidx.lifecycle.Observer
11+
import androidx.lifecycle.viewModelScope
812
import com.thewizrd.common.controls.AirQualityViewModel
913
import com.thewizrd.shared_resources.database.WeatherDatabase
1014
import com.thewizrd.shared_resources.locationdata.LocationData
@@ -49,7 +53,7 @@ class AirQualityForecastViewModel(app: Application) : AndroidViewModel(app) {
4953
}
5054
}
5155

52-
private val forecastObserver = Observer<Forecasts> { forecastData ->
56+
private val forecastObserver = Observer<Forecasts?> { forecastData ->
5357
this.aqiForecastData.postValue(forecastData?.aqiForecast)
5458
}
5559

app/src/main/java/com/thewizrd/simpleweather/controls/viewmodels/ChartsViewModel.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ import android.app.Application
44
import androidx.annotation.MainThread
55
import androidx.arch.core.util.Function
66
import androidx.core.util.ObjectsCompat
7-
import androidx.lifecycle.*
7+
import androidx.lifecycle.AndroidViewModel
8+
import androidx.lifecycle.LiveData
9+
import androidx.lifecycle.MutableLiveData
10+
import androidx.lifecycle.Observer
11+
import androidx.lifecycle.viewModelScope
812
import com.thewizrd.shared_resources.database.WeatherDatabase
913
import com.thewizrd.shared_resources.locationdata.LocationData
1014
import com.thewizrd.shared_resources.locationdata.LocationQuery
@@ -85,7 +89,7 @@ class ChartsViewModel(app: Application) : AndroidViewModel(app) {
8589
}
8690
}
8791

88-
private val forecastObserver = Observer<Forecasts> { forecastData ->
92+
private val forecastObserver = Observer<Forecasts?> { forecastData ->
8993
this.forecastData.postValue(
9094
graphDataMapper.apply(
9195
Pair(
@@ -96,7 +100,7 @@ class ChartsViewModel(app: Application) : AndroidViewModel(app) {
96100
)
97101
}
98102

99-
private val hrforecastObserver = Observer<List<HourlyForecast>> { forecastData ->
103+
private val hrforecastObserver = Observer<List<HourlyForecast>?> { forecastData ->
100104
this.forecastData.postValue(
101105
graphDataMapper.apply(
102106
Pair(

app/src/main/java/com/thewizrd/simpleweather/main/WeatherNowFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ class WeatherNowFragment : AbstractWeatherListDetailFragment(), BannerManagerInt
11451145
.transition(BitmapTransitionOptions.withCrossFade(300))
11461146
.addListener(object : RequestListener<Bitmap?> {
11471147
override fun onLoadFailed(
1148-
e: GlideException?, model: Any,
1148+
e: GlideException?, model: Any?,
11491149
target: Target<Bitmap?>,
11501150
isFirstResource: Boolean
11511151
): Boolean {
@@ -1155,7 +1155,7 @@ class WeatherNowFragment : AbstractWeatherListDetailFragment(), BannerManagerInt
11551155
}
11561156

11571157
override fun onResourceReady(
1158-
resource: Bitmap?, model: Any,
1158+
resource: Bitmap, model: Any,
11591159
target: Target<Bitmap?>,
11601160
dataSource: DataSource,
11611161
isFirstResource: Boolean

app/src/main/java/com/thewizrd/simpleweather/notifications/WeatherAlertNotificationService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public void onCreate() {
7272

7373
@Override
7474
public void onDestroy() {
75-
String json = JSONParser.serializer(mNotifications, HashMap.class);
75+
String json = JSONParser.serializer(mNotifications, Map.class);
7676
notifPrefs.edit().putString(KEY_NOTIFS, json).apply();
7777

7878
super.onDestroy();

app/src/main/java/com/thewizrd/simpleweather/preferences/SettingsFragment.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,16 @@ class SettingsFragment : BaseSettingsFragment(),
576576
}
577577

578578
registerPref = findPreference(KEY_APIREGISTER)!!
579+
registerPref.setOnPreferenceClickListener { preference ->
580+
preference.intent?.let {
581+
runCatching {
582+
if (it.resolveActivity(preference.context.packageManager) != null) {
583+
startActivity(it)
584+
}
585+
}
586+
}
587+
true
588+
}
579589

580590
// Set key as verified if API Key is req for API and its set
581591
if (weatherModule.weatherManager.isKeyRequired()) {

app/src/main/java/com/thewizrd/simpleweather/setup/SetupProviderFragment.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,16 @@ class SetupProviderFragment : CustomPreferenceFragmentCompat(), StepperFragment
175175
}
176176

177177
registerPref = findPreference(KEY_APIREGISTER)!!
178+
registerPref.setOnPreferenceClickListener { preference ->
179+
preference.intent?.let {
180+
runCatching {
181+
if (it.resolveActivity(preference.context.packageManager) != null) {
182+
startActivity(it)
183+
}
184+
}
185+
}
186+
true
187+
}
178188

179189
providerPref.value = settingsManager.getAPI()
180190

app/src/main/java/com/thewizrd/simpleweather/viewmodels/WeatherNowViewModel.kt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ import com.thewizrd.simpleweather.R
3434
import com.thewizrd.simpleweather.controls.ImageDataViewModel
3535
import com.thewizrd.weather_api.weatherModule
3636
import kotlinx.coroutines.Dispatchers
37-
import kotlinx.coroutines.flow.*
37+
import kotlinx.coroutines.flow.MutableStateFlow
38+
import kotlinx.coroutines.flow.SharingStarted
39+
import kotlinx.coroutines.flow.map
40+
import kotlinx.coroutines.flow.stateIn
41+
import kotlinx.coroutines.flow.update
3842
import kotlinx.coroutines.launch
3943
import kotlinx.coroutines.withContext
4044

@@ -230,8 +234,9 @@ class WeatherNowViewModel(app: Application) : AndroidViewModel(app) {
230234
if (state.locationData?.countryCode?.let { !wm.isRegionSupported(it) } == true) {
231235
Logger.writeLine(
232236
Log.WARN,
233-
"Location: %s",
234-
JSONParser.serializer(state.locationData)
237+
"Location: %s; countryCode: %s",
238+
JSONParser.serializer(state.locationData),
239+
state.locationData.countryCode
235240
)
236241
Logger.writeLine(
237242
Log.WARN,
@@ -288,8 +293,9 @@ class WeatherNowViewModel(app: Application) : AndroidViewModel(app) {
288293
if (state.locationData?.countryCode?.let { !wm.isRegionSupported(it) } == true) {
289294
Logger.writeLine(
290295
Log.WARN,
291-
"Location: %s",
292-
JSONParser.serializer(state.locationData)
296+
"Location: %s; countryCode: %s",
297+
JSONParser.serializer(state.locationData),
298+
state.locationData.countryCode
293299
)
294300
Logger.writeLine(
295301
Log.WARN,

app/src/main/java/com/thewizrd/simpleweather/widgets/remoteviews/CustomBackgroundWidgetRemoteViewCreator.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ abstract class CustomBackgroundWidgetRemoteViewCreator(
240240
override fun onLoadFailed(
241241
e: GlideException?,
242242
model: Any?,
243-
target: Target<Bitmap>?,
243+
target: Target<Bitmap>,
244244
isFirstResource: Boolean
245245
): Boolean {
246246
if (it.isActive) {
@@ -250,10 +250,10 @@ abstract class CustomBackgroundWidgetRemoteViewCreator(
250250
}
251251

252252
override fun onResourceReady(
253-
resource: Bitmap?,
254-
model: Any?,
253+
resource: Bitmap,
254+
model: Any,
255255
target: Target<Bitmap>?,
256-
dataSource: DataSource?,
256+
dataSource: DataSource,
257257
isFirstResource: Boolean
258258
): Boolean {
259259
if (it.isActive) {

build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ buildscript {
44
ext {
55
compileSdkVersion = 34
66
minSdkVersion = 21
7-
targetSdkVersion = 34
7+
targetSdkVersion = 33
88

99
kotlin_version = '1.9.0'
1010
kotlinx_version = '1.7.3'
1111
ksp_version = '1.9.0-1.0.13'
1212

1313
desugar_version = '2.0.3'
1414

15-
firebase_version = '32.2.2'
15+
firebase_version = '32.2.3'
1616
gms_location_version = '21.0.1'
1717

1818
annotation_version = '1.6.0'
@@ -23,7 +23,7 @@ buildscript {
2323
arch_core_runtime_version = '2.2.0'
2424
fragment_version = '1.6.1'
2525
lifecycle_version = '2.6.1'
26-
nav_version = '2.7.0'
26+
nav_version = '2.7.1'
2727
paging_version = '3.2.0'
2828
preference_version = '1.2.1'
2929
recyclerview_version = '1.3.1'
@@ -40,13 +40,13 @@ buildscript {
4040

4141
material_version = '1.9.0'
4242

43-
compose_compiler_version = '1.5.1'
43+
compose_compiler_version = '1.5.2'
4444
compose_version = '1.5.0'
4545
wear_compose_version = '1.2.0'
4646
horologist_version = '0.4.12'
4747
accompanist_version = '0.30.1'
4848

49-
glide_version = '4.15.1'
49+
glide_version = '4.16.0'
5050
icu4j_version = '73.2'
5151
moshi_version = '1.15.0'
5252
okhttp_version = '4.11.0'
@@ -60,10 +60,10 @@ buildscript {
6060
}
6161

6262
dependencies {
63-
classpath 'com.android.tools.build:gradle:8.1.0'
63+
classpath 'com.android.tools.build:gradle:8.1.1'
6464
classpath "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:$ksp_version"
6565
classpath 'com.google.gms:google-services:4.3.15'
66-
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.8'
66+
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9'
6767
classpath 'com.google.firebase:perf-plugin:1.4.2'
6868
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
6969
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

0 commit comments

Comments
 (0)