Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
82fdab0
JSONParser: add missing converters
thewizrd Feb 4, 2024
eae02a7
radar: remove earthwindmap
thewizrd Feb 4, 2024
782c2ce
SimpleWeather.app: v5.8.4-build1
thewizrd Feb 4, 2024
a3d901b
gradle: update dependencies
thewizrd Apr 28, 2024
e624e41
nullability for room v2.6+
thewizrd Apr 29, 2024
f91a243
UnitTests: update for personal keys
thewizrd Apr 29, 2024
b17f8d3
analytics: capture custom user properties
thewizrd Apr 30, 2024
5aa63db
OpenWeatherMapProvider: prepare for OneCall 3.0 migration
thewizrd May 1, 2024
033d844
weather-api: add user agent extension
thewizrd May 1, 2024
8467ada
NWSWeatherProvider: update query endpoint
thewizrd May 2, 2024
b5d84c5
weather-api: fix external calls for pollen and alerts
thewizrd May 3, 2024
7086245
NWSWeatherProvider: support additional locations
thewizrd May 4, 2024
99a32ac
RemoteConfigService: check if default provider is enabled
thewizrd May 4, 2024
12ce5ab
gradle: update dependencies
thewizrd May 4, 2024
74c900b
weather-api: add GooglePollenProvider
thewizrd May 5, 2024
f489923
radar: support additional touch gestures
thewizrd May 5, 2024
64d9392
radar: add Tomorrow.io radar support
thewizrd May 5, 2024
4e3c086
alerts: add option to filter alerts by severity
thewizrd May 6, 2024
7f1f755
settings: only allow selection of enabled providers
thewizrd May 6, 2024
f2a1633
Units: use ChipPreference for preference items
thewizrd May 9, 2024
eb5b952
gradle: update dependencies
thewizrd May 9, 2024
3b4326f
WeatherKitProvider: fix alerts
thewizrd May 10, 2024
26eb2ef
alerts: support opening WeatherKit details links
thewizrd May 10, 2024
597b332
gradle: don't minify libraries
thewizrd May 12, 2024
d16dc0d
weather-api: fix build for nongms
thewizrd May 12, 2024
5d57ada
FeaturesFragment: allow reordering weather now features
thewizrd May 12, 2024
ced6c30
HEREWeatherProvider: update for destination weather api v3
thewizrd May 13, 2024
b283c4b
weather-api: remove references to HERELocationProvider
thewizrd May 13, 2024
046538a
maps: use legacy renderer
thewizrd May 13, 2024
9662c2b
remove example tests
thewizrd May 14, 2024
97255e3
remove example tests
thewizrd May 14, 2024
de0224c
wear: fix build
thewizrd May 14, 2024
bdb0383
app: android.transition -> androidx.transitions
thewizrd May 14, 2024
7d82457
IconProviderPreference: add premium icon identifier
thewizrd May 14, 2024
fd908ef
units: add knots
thewizrd May 14, 2024
4c48576
wear: some minor ui adjustments
thewizrd May 14, 2024
37c5a72
gradle: update dependencies
thewizrd May 14, 2024
28e169a
Import translations
thewizrd May 14, 2024
1996dd1
SimpleWeather: v5.9.0-build0
thewizrd May 14, 2024
1199bba
radar: set gesture restrictions after position is updated
thewizrd May 15, 2024
3c87a40
maps: use legacy renderer for debug
thewizrd May 15, 2024
c9fa41b
MainActivity: disable predictive back for now
thewizrd May 15, 2024
f6533d7
MapTileRadarViewProvider: always show marker
thewizrd May 15, 2024
2628383
SimpleWeather: v5.9.0-build1
thewizrd May 15, 2024
e1281bd
AccuWeatherProvider: fix external calls
thewizrd May 26, 2024
50d3772
GooglePollenProvider: extend duration
thewizrd May 26, 2024
09dc9fa
NWSWeatherProvider: if forecast is valid break from loop
thewizrd May 26, 2024
1965861
TomorrowIoRadarViewProvider: remove old tile overlays
thewizrd May 26, 2024
da6a25c
HEREWeatherProvider: fix some parsing issues
thewizrd May 26, 2024
a37139e
SimpleWeather: v5.9.0-build2
thewizrd May 26, 2024
fc27466
WeatherNow: navigate on header click
thewizrd May 26, 2024
3c3dfc4
SimpleWeather: v5.9.0-build3
thewizrd May 26, 2024
978a753
WeatherAPI: some alert fixes
thewizrd May 27, 2024
f0f8aba
WeatherDataLoader: location checks
thewizrd May 27, 2024
e90c68f
SimpleWeather: v5.9.0-build4
thewizrd May 27, 2024
4234cdc
NWSWeatherProvider: update forecast endpoint
thewizrd Jul 14, 2024
b3d9b63
LocationsFragment: fix drop target for favorites
thewizrd Jul 15, 2024
0616e9a
SimpleWeather: v5.9.0-build5
thewizrd Jul 15, 2024
9dd32f9
gradle: update dependencies
thewizrd Jul 15, 2024
a614366
gradle: update targetSdk v34
thewizrd Jul 15, 2024
2e2ad8f
SimpleWeather: support 16 KB page sizes
thewizrd Aug 7, 2024
e4dfd57
SimpleWeather: remove UpdaterTimerService
thewizrd Aug 7, 2024
f8248ac
gradle: update compileSdk v35
thewizrd Aug 7, 2024
36ee541
gradle: update dependencies
thewizrd Aug 7, 2024
f43a5ff
ChipPreference: use the proper "use" function
thewizrd Aug 7, 2024
abdd0a3
SimpleWeather: bug roundup
thewizrd Aug 9, 2024
6cf04f4
WindComplicationService: add shorter knots unit
thewizrd Aug 9, 2024
429b571
SimpleWeather: add new complications
thewizrd Aug 9, 2024
caf412c
WeatherNowViewModel: load alerts on refresh
thewizrd Aug 10, 2024
7a939ac
WeatherAlertPanel: fix scroll for dialog
thewizrd Aug 10, 2024
2df7bfe
WeatherNow: fix TimeText and indicator for nested screens
thewizrd Aug 10, 2024
f459e3e
WeatherNow: switch RangeBarGraph impl
thewizrd Aug 11, 2024
acd96fc
WeatherNow: increase hourly forecast count to 24
thewizrd Aug 11, 2024
bd65f62
DetailCard: update layout
thewizrd Aug 11, 2024
0520732
AQIControl: add segmented progress indicator for aqi
thewizrd Aug 11, 2024
fbe8643
WeatherNow: adjust padding for section labels
thewizrd Aug 11, 2024
cc5425e
WeatherNow: adjust moon phase size
thewizrd Aug 11, 2024
90349f8
WeatherNow: add precipitation to rangebar view
thewizrd Aug 11, 2024
deae30d
WeatherNow: additional ui adjustments
thewizrd Aug 11, 2024
3ce77ff
WeatherNow: avoid trying to initialize more than once
thewizrd Aug 12, 2024
f62a732
PollenCountControl: add icons to view
thewizrd Aug 12, 2024
28d8f86
MoonPhaseControl: use recycler view for flow
thewizrd Aug 12, 2024
68d571f
WeatherDetailItem: update list item layout
thewizrd Aug 15, 2024
152ecfc
MoonPhaseControl: adjust opacity for non-active phases
thewizrd Aug 16, 2024
c7ceb15
WeatherAlertPanel: adjust for transitions
thewizrd Aug 16, 2024
b0c3150
WeatherNow: use cards for all panels
thewizrd Aug 17, 2024
8dc4477
WeatherNow: updates for graphs
thewizrd Aug 18, 2024
a6d9685
APIRequestUtils: try exponential backoff for retries
thewizrd Aug 18, 2024
e8230bc
LineView: keep series position static
thewizrd Aug 18, 2024
b8d9855
gradle: update dependencies
thewizrd Aug 18, 2024
534a063
WeatherNowViewModel: add perf trace
thewizrd Aug 18, 2024
734bea0
SimpleWeather: v5.10.0
thewizrd Aug 18, 2024
da1cd15
WeatherNow: adjust center index
thewizrd Aug 19, 2024
cb17d91
SimpleWeather: v5.10.0-build1
thewizrd Aug 19, 2024
b469297
SimpleWeather: remove foreground service permissions
thewizrd Aug 20, 2024
723057f
MetnoWeatherProvider: improve forecast compilation
thewizrd Aug 20, 2024
851bdaa
WeatherDetailItem: hide icon if not expandable
thewizrd Aug 20, 2024
4b1e774
WeatherData: avoid rounding data
thewizrd Aug 20, 2024
14b793d
WeatherNow: add feels like temp
thewizrd Aug 20, 2024
03b5cee
SimpleWeather: add support for pro entitlement
thewizrd Aug 24, 2024
6dc139b
RemoteConfigService: add support for fetching config flag
thewizrd Aug 25, 2024
fbf63d9
BarGraphView: remove unnecessary logging
thewizrd Aug 26, 2024
09cb8ef
RadarProvider: add support for NWS tiles
thewizrd Aug 26, 2024
4065ed4
gradle: update dependencies
thewizrd Aug 26, 2024
88e7110
SimpleWeather: v5.10.0-build2
thewizrd Aug 26, 2024
9321c8d
SimpleWeather: add in-app review prompt
thewizrd Aug 27, 2024
03f401e
weather-api: add support for BrightSky (DWD)
thewizrd Aug 29, 2024
6bd90ab
weather-api: add support for ECCC (Canada)
thewizrd Sep 1, 2024
ebd9422
credits: update for new providers
thewizrd Sep 1, 2024
fbaf6f2
RadarProvider: add support for ECCC radar
thewizrd Sep 1, 2024
1a049fa
NWSRadarViewProvider: fix bbox
thewizrd Sep 1, 2024
a0ff01b
WeatherNowScreen: adjust alignment
thewizrd Sep 2, 2024
33e3335
CurrentLocationWeatherComplicationService: don't use full location name
thewizrd Sep 2, 2024
5a3816d
wear: update forecast tiles
thewizrd Sep 2, 2024
263f72e
WeatherNowScreen: additional re-alignment
thewizrd Sep 2, 2024
70e262b
WeatherKitProvider: first forecast should be for today
thewizrd Sep 2, 2024
057397a
WeatherBitIOProvider: remove minutely param
thewizrd Sep 2, 2024
8a956a4
WeatherProviderFactory: remove OneCall api usage
thewizrd Sep 2, 2024
8408648
SimpleWeather: v5.10.0-build3
thewizrd Sep 2, 2024
cf234f6
wear: update forecast tile preview
thewizrd Sep 2, 2024
018320d
alerts: handle error
thewizrd Sep 15, 2024
de3cff5
weather-api: skip requests with an invalid key
thewizrd Sep 15, 2024
8139fe7
tests: move to correct package
thewizrd Sep 16, 2024
0cbbacc
SimpleWeather: v5.10.0-build4
thewizrd Sep 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
25 changes: 15 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@ android {

defaultConfig {
applicationId "com.thewizrd.simpleweather"
testApplicationId "com.thewizrd.simpleweather.test"
// Specifies the fully-qualified class name of the test instrumentation runner.
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
// NOTE: Version Code Format (TargetSDK, Version Name, Build Number, Variant Code (Android: 00, WearOS: 01)
versionCode 335840000
versionName "5.8.4"
// NOTE: Version Code Format (TargetSDK, Version Name, Build Number, Variant Code (Android: 0, WearOS: 1)
versionCode 345100040
versionName "5.10.0"

vectorDrawables.useSupportLibrary true
vectorDrawables {
useSupportLibrary true
}
}

buildTypes {
Expand All @@ -40,6 +43,7 @@ android {
buildFeatures {
dataBinding true
viewBinding true
buildConfig true
}

compileOptions {
Expand Down Expand Up @@ -124,7 +128,7 @@ dependencies {
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation "androidx.annotation:annotation:$annotation_version"
implementation "androidx.constraintlayout:constraintlayout:$constraintlayout_version"
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
implementation "androidx.vectordrawable:vectordrawable:$vectordrawable_version"
implementation 'androidx.palette:palette-ktx:1.0.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation "androidx.paging:paging-runtime-ktx:$paging_version"
Expand All @@ -145,7 +149,7 @@ dependencies {
ksp "com.github.bumptech.glide:ksp:$glide_version"
implementation "com.jakewharton.timber:timber:$timber_version"
implementation "com.ibm.icu:icu4j:$icu4j_version"
implementation 'com.github.skydoves:colorpickerview:2.2.4'
implementation 'com.github.skydoves:colorpickerview:2.3.0'

implementation "com.squareup.moshi:moshi-kotlin:$moshi_version"
ksp "com.squareup.moshi:moshi-kotlin-codegen:$moshi_version"
Expand All @@ -163,15 +167,16 @@ dependencies {
fullgmsImplementation 'com.google.firebase:firebase-config'
fullgmsImplementation 'com.google.firebase:firebase-perf'

fullgmsImplementation 'com.google.android.gms:play-services-base:18.2.0'
fullgmsImplementation "com.google.android.gms:play-services-base:$gms_base_version"
fullgmsImplementation "com.google.android.gms:play-services-location:$gms_location_version"
fullgmsImplementation 'com.google.android.gms:play-services-maps:18.1.0'
fullgmsImplementation 'com.google.android.gms:play-services-wearable:18.1.0'
fullgmsImplementation 'com.google.android.gms:play-services-maps:19.0.0'
fullgmsImplementation "com.google.android.gms:play-services-wearable:$gms_wearable_version"
fullgmsImplementation 'com.google.android.play:app-update-ktx:2.1.0'
fullgmsImplementation 'com.google.android.play:feature-delivery-ktx:2.1.0'
fullgmsImplementation 'com.google.android.play:review-ktx:2.0.1'
fullgmsImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$kotlinx_version"

nongmsImplementation 'org.osmdroid:osmdroid-android:6.1.16'
nongmsImplementation 'org.osmdroid:osmdroid-android:6.1.20'
}

if (getGradle().getStartParameter().getTaskRequests().toString().contains("Fullgms")) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.thewizrd.simpleweather
package com.thewizrd.simpleweather.test

import android.content.Context
import android.content.SharedPreferences
Expand Down Expand Up @@ -49,7 +49,7 @@ import java.util.*
* @see [Testing documentation](http://d.android.com/tools/testing)
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
class InstrumentedTests {
private lateinit var settingsManager: SettingsManager

@Before
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.thewizrd.simpleweather
package com.thewizrd.simpleweather.test

import android.content.Context
import android.content.SharedPreferences
Expand All @@ -13,6 +13,7 @@ import com.thewizrd.common.CommonModule
import com.thewizrd.common.commonModule
import com.thewizrd.common.controls.WeatherUiModel
import com.thewizrd.shared_resources.*
import com.thewizrd.shared_resources.di.settingsManager
import com.thewizrd.shared_resources.exceptions.WeatherException
import com.thewizrd.shared_resources.locationdata.LocationData
import com.thewizrd.shared_resources.locationdata.WeatherLocationProvider
Expand All @@ -22,9 +23,11 @@ import com.thewizrd.shared_resources.remoteconfig.WeatherProviderConfig
import com.thewizrd.shared_resources.utils.Coordinate
import com.thewizrd.shared_resources.utils.DateTimeUtils
import com.thewizrd.shared_resources.utils.JSONParser
import com.thewizrd.shared_resources.utils.LocaleUtils
import com.thewizrd.shared_resources.utils.ZoneIdCompat
import com.thewizrd.shared_resources.weatherdata.WeatherAPI
import com.thewizrd.shared_resources.weatherdata.WeatherProvider
import com.thewizrd.shared_resources.weatherdata.auth.BasicAuthProviderKey
import com.thewizrd.shared_resources.weatherdata.model.Weather
import com.thewizrd.simpleweather.images.ImageDatabase
import com.thewizrd.simpleweather.images.model.ImageData
Expand Down Expand Up @@ -97,19 +100,19 @@ class UnitTests {
}

runBlocking {
appLib.settingsManager.loadIfNeeded()
settingsManager.loadIfNeeded()
}

if (appLib.settingsManager.usePersonalKey()) {
appLib.settingsManager.setPersonalKey(false)
if (settingsManager.usePersonalKey()) {
settingsManager.setPersonalKey(false)
wasUsingPersonalKey = true
}
}

@After
fun destroy() {
if (wasUsingPersonalKey) {
appLib.settingsManager.setPersonalKey(true)
settingsManager.setPersonalKey(true)
wasUsingPersonalKey = false
}
}
Expand Down Expand Up @@ -470,28 +473,43 @@ class UnitTests {
@Throws(WeatherException::class)
@Test
fun getTomorrowIOWeather() {
settingsManager.setPersonalKey(true)
settingsManager.setAPIKey(WeatherAPI.TOMORROWIO, "TomorrowIo_REPLACE_VALUE")

runBlocking(Dispatchers.Default) {
val provider = weatherModule.weatherManager.getWeatherProvider(WeatherAPI.TOMORROWIO)
val weather =
getWeather(provider, Coordinate(34.0207305, -118.6919157)) // ~ Los Angeles
assertTrue(weather.isValid && WeatherUiModel(weather).isValid)
}

settingsManager.setAPIKey(WeatherAPI.TOMORROWIO, null)
settingsManager.setPersonalKey(false)
}

@Throws(WeatherException::class)
@Test
fun getWeatherbitIOWeather() {
settingsManager.setPersonalKey(true)
settingsManager.setAPIKey(WeatherAPI.WEATHERBITIO, "WeatherBitIo_REPLACE_VALUE")

runBlocking(Dispatchers.Default) {
val provider =
weatherModule.weatherManager.getWeatherProvider(WeatherAPI.WEATHERBITIO)
val weather =
getWeather(provider, Coordinate(39.9, -105.1)) // ~ Denver, CO
assertTrue(weather.isValid && WeatherUiModel(weather).isValid)
}

settingsManager.setAPIKey(WeatherAPI.WEATHERBITIO, null)
settingsManager.setPersonalKey(false)
}

@Test
fun getPollenData() {
settingsManager.setPersonalKey(true)
settingsManager.setAPIKey(WeatherAPI.TOMORROWIO, "TomorrowIo_REPLACE_VALUE")

runBlocking(Dispatchers.Default) {
val provider = TomorrowIOWeatherProvider()
val location =
Expand All @@ -500,18 +518,30 @@ class UnitTests {
val pollenData = provider.getPollenData(location!!)
assertNotNull(pollenData)
}

settingsManager.setAPIKey(WeatherAPI.TOMORROWIO, null)
settingsManager.setPersonalKey(false)
}

@Throws(WeatherException::class)
@Test
fun getMeteomaticsWeather() {
settingsManager.setPersonalKey(true)
settingsManager.setAPIKey(
WeatherAPI.METEOMATICS,
BasicAuthProviderKey("username", "password").toString()
)

runBlocking(Dispatchers.Default) {
val provider =
weatherModule.weatherManager.getWeatherProvider(WeatherAPI.METEOMATICS)
val weather =
getWeather(provider, Coordinate(52.22, 20.97))
assertTrue(weather.isValid && WeatherUiModel(weather).isValid)
}

settingsManager.setAPIKey(WeatherAPI.METEOMATICS, null)
settingsManager.setPersonalKey(false)
}

@Test
Expand Down Expand Up @@ -543,6 +573,47 @@ class UnitTests {
}
}

@Throws(WeatherException::class)
@Test
fun getDWDWeather() {
runBlocking(Dispatchers.Default) {
val provider =
weatherModule.weatherManager.getWeatherProvider(WeatherAPI.DWD)
val weather =
getWeather(provider, Coordinate(52.52, 13.4)) // Berlin
assertTrue(weather.isValid && WeatherUiModel(weather).isValid)
}
}

@Throws(WeatherException::class)
@Test
fun getECCCWeather() {
runBlocking(Dispatchers.Default) {
val provider =
weatherModule.weatherManager.getWeatherProvider(WeatherAPI.ECCC)
val weather =
getWeather(provider, Coordinate(48.737, -91.984)) // Banning, ON
assertTrue(weather.isValid && WeatherUiModel(weather).isValid)
}
}

@Throws(WeatherException::class)
@Test
fun getECCCWeather_FR() {
runBlocking(Dispatchers.Default) {
val locale = LocaleUtils.getLocale()
LocaleUtils.setLocaleCode(Locale.CANADA_FRENCH.toLanguageTag())

val provider =
weatherModule.weatherManager.getWeatherProvider(WeatherAPI.ECCC)
val weather =
getWeather(provider, Coordinate(48.737, -91.984)) // Banning, ON
assertTrue(weather.isValid && WeatherUiModel(weather).isValid)
// Restore
LocaleUtils.setLocaleCode(locale.toLanguageTag())
}
}

@Test
fun moshiSerializeTest() {
JSONParser.deserializer<WeatherProviderConfig>(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.thewizrd.simpleweather
package com.thewizrd.simpleweather.test

import android.content.Context
import android.content.SharedPreferences
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,25 @@ import com.google.firebase.analytics.FirebaseAnalytics
import com.google.firebase.crashlytics.FirebaseCrashlytics
import com.google.firebase.messaging.FirebaseMessaging
import com.google.firebase.remoteconfig.FirebaseRemoteConfig
import com.thewizrd.shared_resources.utils.AnalyticsProps
import com.thewizrd.shared_resources.utils.ContextUtils.isLargeTablet
import com.thewizrd.shared_resources.utils.ContextUtils.isSmallestWidth
import com.thewizrd.shared_resources.utils.ContextUtils.isTv
import com.thewizrd.shared_resources.utils.CrashlyticsLoggingTree
import com.thewizrd.shared_resources.utils.Logger
import timber.log.Timber

object FirebaseConfigurator {
@SuppressLint("MissingPermission")
fun initialize(context: Context) {
FirebaseAnalytics.getInstance(context).setUserProperty("device_type", "mobile")
FirebaseAnalytics.getInstance(context).setUserProperty(
AnalyticsProps.DEVICE_TYPE, if (context.isTv()) {
"tv"
} else if (context.isLargeTablet() || context.isSmallestWidth(600)) {
"tablet"
} else {
"mobile"
}
)

FirebaseCrashlytics.getInstance().apply {
setCrashlyticsCollectionEnabled(true)
Expand Down
26 changes: 17 additions & 9 deletions app/src/fullgms/java/com/thewizrd/simpleweather/extras/Extras.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@ import android.content.Intent
import androidx.navigation.findNavController
import androidx.preference.Preference
import com.google.android.gms.maps.MapsInitializer
import com.google.android.gms.maps.MapsInitializer.Renderer
import com.google.android.play.core.splitcompat.SplitCompat
import com.thewizrd.extras.extrasModule
import com.thewizrd.shared_resources.appLib
import com.thewizrd.shared_resources.store.PlayStoreUtils
import com.thewizrd.simpleweather.*
import com.thewizrd.simpleweather.App
import com.thewizrd.simpleweather.BuildConfig
import com.thewizrd.simpleweather.FirebaseConfigurator
import com.thewizrd.simpleweather.NavGraphDirections
import com.thewizrd.simpleweather.R
import com.thewizrd.simpleweather.locale.UserLocaleActivity
import com.thewizrd.simpleweather.preferences.BaseSettingsFragment
import com.thewizrd.simpleweather.preferences.SettingsFragment
Expand All @@ -25,13 +30,16 @@ import timber.log.Timber
fun initializeExtras() {
extrasModule.initialize()

MapsInitializer.initialize(appLib.context, MapsInitializer.Renderer.LATEST) {
MapsInitializer.initialize(
appLib.context,
if (BuildConfig.DEBUG) Renderer.LEGACY else Renderer.LATEST
) {
when (it) {
MapsInitializer.Renderer.LATEST -> {
Renderer.LATEST -> {
Timber.tag("Application").d("The latest version of the renderer is used.")
}

MapsInitializer.Renderer.LEGACY -> {
Renderer.LEGACY -> {
Timber.tag("Application").d("The legacy version of the renderer is used.")
}
}
Expand Down Expand Up @@ -83,7 +91,7 @@ fun SettingsFragment.IconsFragment.navigateUnsupportedIconPack() {
// Navigate to premium page
if (isPremiumSupported()) {
rootView.findNavController()
.navigate(`SettingsFragment$IconsFragmentDirections`.actionIconsFragmentToPremiumFragment())
.safeNavigate(`SettingsFragment$IconsFragmentDirections`.actionIconsFragmentToPremiumFragment())
} else {
showSnackbar(
Snackbar.make(
Expand All @@ -98,7 +106,7 @@ fun SettingsFragment.IconsFragment.navigateUnsupportedIconPack() {
}

fun enableAdditionalRefreshIntervals(): Boolean {
return extrasModule.isEnabled()
return extrasModule.isPremiumEnabled()
}

fun checkPremiumStatus() {
Expand All @@ -110,17 +118,17 @@ fun isPremiumSupported(): Boolean {
}

fun isRadarInteractionEnabled(): Boolean {
return extrasModule.isEnabled()
return extrasModule.isAtLeastProEnabled()
}

fun areNotificationExtrasEnabled(): Boolean {
return extrasModule.isEnabled()
return extrasModule.isAtLeastProEnabled()
}

fun SettingsFragment.createPremiumPreference(): Preference {
val premiumPref = Preference(requireContext()).apply {
title = context.getString(R.string.pref_title_premium)
summary = context.getString(R.string.message_premium_prompt)
summary = context.getString(R.string.pref_summary_premium)
setIcon(R.drawable.ic_star_24dp)
order = 0
}
Expand Down
Loading