Skip to content

Commit 25bc2b6

Browse files
authored
Merge pull request #25 from SimpleAppProjects/feature/merge_5.13.0
v5.13.0
2 parents 043c71f + aa4a970 commit 25bc2b6

File tree

957 files changed

+26028
-8403
lines changed

Some content is hidden

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

957 files changed

+26028
-8403
lines changed

app/build.gradle

Lines changed: 83 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
1-
apply plugin: 'com.android.application'
2-
apply plugin: 'androidx.navigation.safeargs'
3-
apply plugin: 'kotlin-android'
4-
apply plugin: 'kotlin-kapt'
5-
apply plugin: 'com.google.devtools.ksp'
1+
plugins {
2+
id 'com.android.application'
3+
id 'androidx.navigation.safeargs'
4+
id 'kotlin-android'
5+
id 'kotlin-kapt'
6+
id 'com.google.devtools.ksp'
7+
}
68

79
android {
8-
compileSdk rootProject.compileSdkVersion
10+
compileSdk = libs.versions.compileSdkVersion.get().toInteger()
911

1012
defaultConfig {
1113
applicationId "com.thewizrd.simpleweather"
1214
testApplicationId "com.thewizrd.simpleweather.test"
1315
// Specifies the fully-qualified class name of the test instrumentation runner.
1416
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
15-
minSdkVersion rootProject.minSdkVersion
16-
targetSdkVersion rootProject.targetSdkVersion
17+
minSdkVersion libs.versions.minSdkVersion.get().toInteger()
18+
targetSdkVersion libs.versions.targetSdkVersion.get().toInteger()
1719
// NOTE: Version Code Format (TargetSDK, Version Name, Build Number, Variant Code (Android: 0, WearOS: 1)
1820
// ex) 345100131 = (34, 5.10, 013, 0)
19-
versionCode 355120090
20-
versionName "5.12.0"
21+
versionCode 365130140
22+
versionName "5.13.0"
2123

2224
vectorDrawables {
2325
useSupportLibrary true
@@ -29,7 +31,7 @@ android {
2931
applicationIdSuffix ".debug"
3032
debuggable true
3133
minifyEnabled false
32-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
34+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
3335
manifestPlaceholders = [allowBackup: false]
3436
}
3537
release {
@@ -100,88 +102,88 @@ dependencies {
100102
fullgmsImplementation project(":extras")
101103

102104
// Unit Testing
103-
androidTestImplementation "androidx.test:core:$test_core_version"
105+
androidTestImplementation libs.test.core
104106

105107
// AndroidJUnitRunner and JUnit Rules
106-
androidTestImplementation "androidx.test:runner:$test_runner_version"
107-
androidTestImplementation "androidx.test:rules:$test_rules_version"
108+
androidTestImplementation libs.test.runner
109+
androidTestImplementation libs.test.rules
108110

109111
// Assertions
110-
androidTestImplementation "androidx.test.ext:junit:$junit_version"
111-
androidTestImplementation "androidx.test.ext:truth:$androidx_truth_version"
112-
androidTestImplementation "com.google.truth:truth:$google_truth_version"
112+
androidTestImplementation libs.test.ext.junit
113+
androidTestImplementation libs.test.ext.truth
114+
androidTestImplementation libs.google.truth
113115

114-
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:$desugar_version"
116+
coreLibraryDesugaring libs.desugar.jdk.libs
115117

116118
// Kotlin
117-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinx_version"
118-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinx_version"
119-
120-
implementation "androidx.core:core-ktx:$core_version"
121-
implementation "androidx.core:core-splashscreen:$coresplash_version"
122-
implementation "androidx.appcompat:appcompat:$appcompat_version"
123-
implementation "androidx.fragment:fragment-ktx:$fragment_version"
124-
implementation "com.google.android.material:material:$material_version"
125-
implementation "androidx.arch.core:core-runtime:$arch_core_runtime_version"
126-
implementation 'androidx.cardview:cardview:1.0.0'
127-
implementation "androidx.recyclerview:recyclerview:$recyclerview_version"
128-
implementation "androidx.preference:preference-ktx:$preference_version"
129-
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
130-
implementation "androidx.annotation:annotation:$annotation_version"
131-
implementation "androidx.constraintlayout:constraintlayout:$constraintlayout_version"
132-
implementation "androidx.vectordrawable:vectordrawable:$vectordrawable_version"
133-
implementation 'androidx.palette:palette-ktx:1.0.0'
134-
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
135-
implementation "androidx.paging:paging-runtime-ktx:$paging_version"
136-
implementation "androidx.work:work-runtime-ktx:$work_version"
137-
implementation "androidx.work:work-multiprocess:$work_version"
138-
139-
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
140-
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
141-
142-
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
143-
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
144-
145-
implementation "androidx.room:room-runtime:$room_version"
146-
ksp "androidx.room:room-compiler:$room_version"
147-
148-
implementation "com.squareup.okhttp3:okhttp:$okhttp_version"
149-
implementation "com.github.bumptech.glide:glide:$glide_version"
150-
ksp "com.github.bumptech.glide:ksp:$glide_version"
151-
implementation "com.jakewharton.timber:timber:$timber_version"
152-
implementation "com.ibm.icu:icu4j:$icu4j_version"
153-
implementation 'com.github.skydoves:colorpickerview:2.3.0'
154-
155-
implementation "com.squareup.moshi:moshi-kotlin:$moshi_version"
156-
ksp "com.squareup.moshi:moshi-kotlin-codegen:$moshi_version"
157-
implementation "com.squareup.moshi:moshi-adapters:$moshi_version"
119+
implementation libs.kotlinx.coroutines.core
120+
implementation libs.kotlinx.coroutines.android
121+
122+
implementation libs.core.ktx
123+
implementation libs.core.splashscreen
124+
implementation libs.appcompat
125+
implementation libs.fragment.ktx
126+
implementation libs.material
127+
implementation libs.arch.core.runtime
128+
implementation libs.cardview
129+
implementation libs.recyclerview
130+
implementation libs.preference.ktx
131+
implementation libs.legacy.support.v4
132+
implementation libs.annotation
133+
implementation libs.constraintlayout
134+
implementation libs.vectordrawable
135+
implementation libs.palette.ktx
136+
implementation libs.swiperefreshlayout
137+
implementation libs.paging.runtime.ktx
138+
implementation libs.work.runtime.ktx
139+
implementation libs.work.multiprocess
140+
141+
implementation libs.lifecycle.extensions
142+
implementation libs.lifecycle.runtime.ktx
143+
144+
implementation libs.navigation.fragment.ktx
145+
implementation libs.navigation.ui.ktx
146+
147+
implementation libs.room.runtime
148+
ksp libs.room.compiler
149+
150+
implementation libs.okhttp
151+
implementation libs.glide
152+
ksp libs.glide.ksp
153+
implementation libs.timber
154+
implementation libs.icu4j
155+
implementation libs.colorpickerview
156+
157+
implementation libs.moshi.kotlin
158+
ksp libs.moshi.kotlin.codegen
159+
implementation libs.moshi.adapters
158160

159161
// Firebase
160-
fullgmsImplementation platform("com.google.firebase:firebase-bom:$firebase_version")
161-
fullgmsImplementation 'com.google.firebase:firebase-analytics'
162-
fullgmsImplementation 'com.google.firebase:firebase-crashlytics'
163-
fullgmsImplementation 'com.google.firebase:firebase-auth'
164-
fullgmsImplementation 'com.google.firebase:firebase-firestore'
165-
fullgmsImplementation 'com.google.firebase:firebase-messaging'
166-
fullgmsImplementation 'com.google.firebase:firebase-storage'
167-
fullgmsImplementation 'com.google.firebase:firebase-database'
168-
fullgmsImplementation 'com.google.firebase:firebase-config'
169-
fullgmsImplementation 'com.google.firebase:firebase-perf'
170-
171-
fullgmsImplementation "com.google.android.gms:play-services-base:$gms_base_version"
172-
fullgmsImplementation "com.google.android.gms:play-services-location:$gms_location_version"
173-
fullgmsImplementation 'com.google.android.gms:play-services-maps:19.2.0'
174-
fullgmsImplementation "com.google.android.gms:play-services-wearable:$gms_wearable_version"
175-
fullgmsImplementation 'com.google.android.play:app-update-ktx:2.1.0'
176-
fullgmsImplementation 'com.google.android.play:feature-delivery-ktx:2.1.0'
177-
fullgmsImplementation 'com.google.android.play:review-ktx:2.0.2'
178-
fullgmsImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$kotlinx_version"
179-
180-
nongmsImplementation 'org.osmdroid:osmdroid-android:6.1.20'
162+
fullgmsImplementation platform(libs.firebase.bom)
163+
fullgmsImplementation libs.firebase.analytics
164+
fullgmsImplementation libs.firebase.crashlytics
165+
fullgmsImplementation libs.firebase.auth
166+
fullgmsImplementation libs.firebase.firestore
167+
fullgmsImplementation libs.firebase.messaging
168+
fullgmsImplementation libs.firebase.storage
169+
fullgmsImplementation libs.firebase.database
170+
fullgmsImplementation libs.firebase.config
171+
fullgmsImplementation libs.firebase.perf
172+
173+
fullgmsImplementation libs.gms.play.services.base
174+
fullgmsImplementation libs.gms.play.services.location
175+
fullgmsImplementation libs.gms.play.services.maps
176+
fullgmsImplementation libs.gms.play.services.wearable
177+
fullgmsImplementation libs.play.app.update.ktx
178+
fullgmsImplementation libs.play.feature.delivery.ktx
179+
fullgmsImplementation libs.play.review.ktx
180+
fullgmsImplementation libs.kotlinx.coroutines.play.services
181+
182+
nongmsImplementation libs.osmdroid.android
181183
}
182184

183185
if (getGradle().getStartParameter().getTaskRequests().toString().contains("Fullgms")) {
184186
apply plugin: 'com.google.gms.google-services'
185187
apply plugin: 'com.google.firebase.crashlytics'
186188
apply plugin: 'com.google.firebase.firebase-perf'
187-
}
189+
}

app/src/androidTestFullgms/java/com/thewizrd/simpleweather/test/UnitTests.kt

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
1212
import com.thewizrd.common.CommonModule
1313
import com.thewizrd.common.commonModule
1414
import com.thewizrd.common.controls.WeatherUiModel
15-
import com.thewizrd.shared_resources.*
15+
import com.thewizrd.shared_resources.AppState
16+
import com.thewizrd.shared_resources.ApplicationLib
17+
import com.thewizrd.shared_resources.DateTimeConstants
18+
import com.thewizrd.shared_resources.SharedModule
19+
import com.thewizrd.shared_resources.appLib
1620
import com.thewizrd.shared_resources.di.settingsManager
1721
import com.thewizrd.shared_resources.exceptions.WeatherException
1822
import com.thewizrd.shared_resources.locationdata.LocationData
@@ -21,6 +25,7 @@ import com.thewizrd.shared_resources.locationdata.toLocationData
2125
import com.thewizrd.shared_resources.okhttp3.OkHttp3Utils.await
2226
import com.thewizrd.shared_resources.preferences.SettingsManager
2327
import com.thewizrd.shared_resources.remoteconfig.WeatherProviderConfig
28+
import com.thewizrd.shared_resources.sharedDeps
2429
import com.thewizrd.shared_resources.utils.Coordinate
2530
import com.thewizrd.shared_resources.utils.DateTimeUtils
2631
import com.thewizrd.shared_resources.utils.JSONParser
@@ -39,6 +44,7 @@ import com.thewizrd.weather_api.google.location.AndroidLocationProvider
3944
import com.thewizrd.weather_api.google.location.GoogleLocationProvider
4045
import com.thewizrd.weather_api.google.location.getFromLocationNameAsync
4146
import com.thewizrd.weather_api.google.location.isGeocoderAvailable
47+
import com.thewizrd.weather_api.google.pollen.GooglePollenProvider
4248
import com.thewizrd.weather_api.here.auth.hereOAuthService
4349
import com.thewizrd.weather_api.locationiq.LocationIQProvider
4450
import com.thewizrd.weather_api.nws.SolCalcAstroProvider
@@ -53,15 +59,17 @@ import kotlinx.coroutines.runBlocking
5359
import kotlinx.coroutines.withContext
5460
import okhttp3.Request
5561
import org.junit.After
56-
import org.junit.Assert.*
62+
import org.junit.Assert.assertFalse
63+
import org.junit.Assert.assertNotNull
64+
import org.junit.Assert.assertTrue
5765
import org.junit.Before
5866
import org.junit.Test
5967
import org.junit.runner.RunWith
6068
import java.io.IOException
6169
import java.time.Duration
6270
import java.time.ZonedDateTime
6371
import java.time.format.DateTimeFormatter
64-
import java.util.*
72+
import java.util.Locale
6573
import java.util.concurrent.ExecutionException
6674

6775
@RunWith(AndroidJUnit4::class)
@@ -307,8 +315,8 @@ class UnitTests {
307315
@Throws(ExecutionException::class, InterruptedException::class)
308316
fun firebaseDBTest() {
309317
runBlocking(Dispatchers.Default) {
310-
val updateTime = ImageDatabase.getLastUpdateTime()
311-
assertTrue(updateTime > 0)
318+
val remoteDBVersionTimestamp = ImageDatabase.getVersionTimestamp()
319+
assertTrue(remoteDBVersionTimestamp > 0)
312320
}
313321
}
314322

@@ -674,6 +682,29 @@ class UnitTests {
674682
settingsManager.setPersonalKey(WeatherAPI.GOOGLE, false)
675683
}
676684

685+
@Throws(WeatherException::class)
686+
@Test
687+
fun getGooglePollen() {
688+
val originalKey = settingsManager.getAPIKey(WeatherAPI.GOOGLE_POLLEN)
689+
690+
settingsManager.setPersonalKey(WeatherAPI.GOOGLE_POLLEN, true)
691+
settingsManager.setAPIKey(WeatherAPI.GOOGLE_POLLEN, "Google_REPLACE_VALUE")
692+
693+
runBlocking(Dispatchers.Default) {
694+
val locationData = LocationData().apply {
695+
latitude = 47.6721646
696+
longitude = -122.1706614
697+
tzLong = "America/Los_Angeles"
698+
}
699+
700+
val pollen = GooglePollenProvider().getPollenData(locationData) // ~ Mountain View
701+
assertNotNull(pollen)
702+
}
703+
704+
settingsManager.setAPIKey(WeatherAPI.GOOGLE_POLLEN, originalKey)
705+
settingsManager.setPersonalKey(WeatherAPI.GOOGLE_POLLEN, false)
706+
}
707+
677708
@Test
678709
fun moshiSerializeTest() {
679710
JSONParser.deserializer<WeatherProviderConfig>(

app/src/fullgms/AndroidManifest.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@
44

55
<application tools:ignore="AllowBackup,MissingApplicationIcon">
66

7+
<activity
8+
android:name=".wearable.RemoteLaunchActivity"
9+
android:theme="@android:style/Theme.NoDisplay"
10+
android:exported="true">
11+
<intent-filter>
12+
<action android:name="android.intent.action.VIEW" />
13+
14+
<category android:name="android.intent.category.DEFAULT" />
15+
<category android:name="android.intent.category.BROWSABLE" />
16+
17+
<data
18+
android:scheme="simpleweather"
19+
android:host="launch-activity" />
20+
</intent-filter>
21+
</activity>
22+
723
<service
824
android:name=".wearable.WearableDataListenerService"
925
android:enabled="true"

app/src/fullgms/java/com/thewizrd/simpleweather/FirebaseConfigurator.kt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ import android.content.Context
55
import com.google.firebase.analytics.FirebaseAnalytics
66
import com.google.firebase.crashlytics.FirebaseCrashlytics
77
import com.google.firebase.messaging.FirebaseMessaging
8+
import com.google.firebase.remoteconfig.ConfigUpdate
9+
import com.google.firebase.remoteconfig.ConfigUpdateListener
810
import com.google.firebase.remoteconfig.FirebaseRemoteConfig
11+
import com.google.firebase.remoteconfig.FirebaseRemoteConfigException
12+
import com.thewizrd.shared_resources.remoteconfig.remoteConfigService
913
import com.thewizrd.shared_resources.utils.AnalyticsProps
1014
import com.thewizrd.shared_resources.utils.ContextUtils.isLargeTablet
1115
import com.thewizrd.shared_resources.utils.ContextUtils.isSmallestWidth
@@ -47,5 +51,24 @@ object FirebaseConfigurator {
4751
FirebaseMessaging.getInstance().subscribeToTopic("debug_all")
4852
}
4953
}
54+
55+
// Add Firebase RemoteConfig real-time listener
56+
FirebaseRemoteConfig.getInstance().run {
57+
addOnConfigUpdateListener(object : ConfigUpdateListener {
58+
override fun onUpdate(configUpdate: ConfigUpdate) {
59+
Logger.verbose("FirebaseConfigurator", "Remote update received")
60+
61+
remoteConfigService.checkConfig()
62+
}
63+
64+
override fun onError(error: FirebaseRemoteConfigException) {
65+
Logger.error(
66+
"FirebaseConfigurator",
67+
message = "Error on real-time update",
68+
t = error
69+
)
70+
}
71+
})
72+
}
5073
}
5174
}

app/src/fullgms/java/com/thewizrd/simpleweather/extras/Extras.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import androidx.preference.Preference
1212
import com.google.android.gms.maps.MapsInitializer
1313
import com.google.android.gms.maps.MapsInitializer.Renderer
1414
import com.google.android.play.core.splitcompat.SplitCompat
15-
import com.google.firebase.installations.ktx.installations
16-
import com.google.firebase.ktx.Firebase
15+
import com.google.firebase.Firebase
16+
import com.google.firebase.installations.installations
1717
import com.thewizrd.extras.extrasModule
1818
import com.thewizrd.shared_resources.appLib
1919
import com.thewizrd.shared_resources.store.PlayStoreUtils

0 commit comments

Comments
 (0)