diff --git a/CHANGELOG b/CHANGELOG
index c4da86b..84f6a14 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,5 @@
## v1.1.1
-+ New notifications handler - now they must notify when expected
++ New notifications handler - now you must get notified when expected
## v1.1.0
+ NEW: OkHttp for handling file downloading.
diff --git a/app/build.gradle b/app/build.gradle
index e8a4951..8f14950 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -42,7 +42,7 @@ android {
applicationId "com.javinator9889.handwashingreminder"
minSdkVersion 17
targetSdkVersion 29
- versionCode 105
+ versionCode 106
versionName "1.1.1-${gitCommitHash}"
multiDexEnabled true
resConfigs "en", "es"
diff --git a/app/src/main/java/com/javinator9889/handwashingreminder/activities/DynamicFeatureProgress.kt b/app/src/main/java/com/javinator9889/handwashingreminder/activities/DynamicFeatureProgress.kt
index d31fdd6..203aa7f 100644
--- a/app/src/main/java/com/javinator9889/handwashingreminder/activities/DynamicFeatureProgress.kt
+++ b/app/src/main/java/com/javinator9889/handwashingreminder/activities/DynamicFeatureProgress.kt
@@ -116,9 +116,8 @@ class DynamicFeatureProgress : SplitCompatBaseActivity(),
SplitInstallSessionStatus.FAILED -> {
Toast.makeText(
this, getString(
- R.string
- .dynamic_module_loading_error
- ), Toast.LENGTH_LONG
+ R.string.dynamic_module_loading_error, state.errorCode),
+ Toast.LENGTH_LONG
).show()
Timber.e(
"Installation failed - error code: ${state.errorCode}"
diff --git a/app/src/main/java/com/javinator9889/handwashingreminder/activities/LauncherActivity.kt b/app/src/main/java/com/javinator9889/handwashingreminder/activities/LauncherActivity.kt
index c9026cb..f229aa9 100644
--- a/app/src/main/java/com/javinator9889/handwashingreminder/activities/LauncherActivity.kt
+++ b/app/src/main/java/com/javinator9889/handwashingreminder/activities/LauncherActivity.kt
@@ -189,10 +189,10 @@ class LauncherActivity : AppCompatActivity() {
modules += AppIntro.MODULE_NAME
launchOnInstall = true
}
- modules += if (isAtLeast(AndroidVersion.LOLLIPOP))
+ /*modules += if (isAtLeast(AndroidVersion.LOLLIPOP))
OkHttp.MODULE_NAME
else
- OkHttpLegacy.MODULE_NAME
+ OkHttpLegacy.MODULE_NAME*/
if (googleApi.isGooglePlayServicesAvailable(
this,
GOOGLE_PLAY_SERVICES_MIN_VERSION
diff --git a/app/src/main/java/com/javinator9889/handwashingreminder/jobs/BootCompletedJob.kt b/app/src/main/java/com/javinator9889/handwashingreminder/jobs/BootCompletedJob.kt
index a35e998..69d0cdd 100644
--- a/app/src/main/java/com/javinator9889/handwashingreminder/jobs/BootCompletedJob.kt
+++ b/app/src/main/java/com/javinator9889/handwashingreminder/jobs/BootCompletedJob.kt
@@ -40,6 +40,7 @@ class BootCompletedJob : BroadcastReceiver() {
else
app.activityHandler.disableActivityTracker()
try {
+ Timber.d("Enqueuing notifications as the device has rebooted")
with(WorkHandler(requireNotNull(context))) {
enqueuePeriodicNotificationsWorker()
}
diff --git a/app/src/main/java/com/javinator9889/handwashingreminder/network/HttpDownloader.kt b/app/src/main/java/com/javinator9889/handwashingreminder/network/HttpDownloader.kt
index a230b66..fb2eb75 100644
--- a/app/src/main/java/com/javinator9889/handwashingreminder/network/HttpDownloader.kt
+++ b/app/src/main/java/com/javinator9889/handwashingreminder/network/HttpDownloader.kt
@@ -18,20 +18,18 @@
*/
package com.javinator9889.handwashingreminder.network
-import com.javinator9889.handwashingreminder.utils.AndroidVersion
-import com.javinator9889.handwashingreminder.utils.OkHttp
-import com.javinator9889.handwashingreminder.utils.OkHttpLegacy
-import com.javinator9889.handwashingreminder.utils.isAtLeast
+import com.javinator9889.handwashingreminder.network.okhttp.OkHttpDownloader as Downloader
object HttpDownloader {
fun newInstance(): OkHttpDownloader {
- val className = if (isAtLeast(AndroidVersion.LOLLIPOP))
+ /*val className = if (isAtLeast(AndroidVersion.LOLLIPOP))
"${OkHttp.PACKAGE_NAME}.${OkHttp.CLASS_NAME}\$${OkHttp.PROVIDER_NAME}"
else
"${OkHttpLegacy.PACKAGE_NAME}.${OkHttpLegacy
.CLASS_NAME}\$${OkHttpLegacy.PROVIDER_NAME}"
val okHttpProvider = Class.forName(className).kotlin.objectInstance
as OkHttpDownloader.Provider
- return okHttpProvider.newInstance()
+ return okHttpProvider.newInstance()*/
+ return Downloader.newInstance()
}
}
\ No newline at end of file
diff --git a/app/src/main/java/com/javinator9889/handwashingreminder/network/okhttp/OkHttpDownloader.kt b/app/src/main/java/com/javinator9889/handwashingreminder/network/okhttp/OkHttpDownloader.kt
new file mode 100644
index 0000000..763497d
--- /dev/null
+++ b/app/src/main/java/com/javinator9889/handwashingreminder/network/okhttp/OkHttpDownloader.kt
@@ -0,0 +1,49 @@
+/*
+ * Copyright © 2020 - present | Handwashing reminder by Javinator9889
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see https://www.gnu.org/licenses/.
+ *
+ * Created by Javinator9889 on 21/04/20 - Handwashing reminder.
+ */
+package com.javinator9889.handwashingreminder.network.okhttp
+
+import com.javinator9889.handwashingreminder.network.OkHttpDownloader
+import okhttp3.CacheControl
+import okhttp3.OkHttpClient
+import okhttp3.Request
+import okio.BufferedSource
+import java.io.IOException
+
+class OkHttpDownloader : OkHttpDownloader {
+ private val client = OkHttpClient()
+
+ companion object Provider : OkHttpDownloader.Provider {
+ override fun newInstance(): OkHttpDownloader = OkHttpDownloader()
+ }
+
+ override fun downloadFile(url: String): BufferedSource {
+ val request = with(Request.Builder()) {
+ url(url)
+ cacheControl(CacheControl.FORCE_NETWORK)
+ build()
+ }
+ with(client.newCall(request).execute()) {
+ if (!isSuccessful) {
+ close()
+ throw IOException("Unexpected code $this")
+ }
+ return body()!!.source()
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index e11aa59..a17df80 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -53,7 +53,7 @@
contenido a la aplicación para que funcione correctamente. Por favor,
espera un minuto - este proceso no debería durar mucho.
¡Vaya! Algo ha ido
- mal 😥 - intenta el proceso de nuevo
+ mal 😥 - intenta el proceso de nuevo | código de error: %1$d
Hecho
Preparando…
Instalando…
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index fdfe0ae..8741206 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -52,7 +52,7 @@
content to the app so it works correctly. Please, wait a minute
- this process should not last long.
Oops! Something went
- wrong 😥 - please retry the process
+ wrong 😥 - please retry the process | error code: %1$d
Done
Preparing…
Installing…
diff --git a/appintro/src/main/java/com/javinator9889/handwashingreminder/appintro/IntroActivity.kt b/appintro/src/main/java/com/javinator9889/handwashingreminder/appintro/IntroActivity.kt
index eb4fe5a..9b4275f 100644
--- a/appintro/src/main/java/com/javinator9889/handwashingreminder/appintro/IntroActivity.kt
+++ b/appintro/src/main/java/com/javinator9889/handwashingreminder/appintro/IntroActivity.kt
@@ -73,7 +73,7 @@ class IntroActivity : AppIntro2(),
override fun attachBaseContext(base: Context?) {
super.attachBaseContext(base)
- SplitCompat.installActivity(base)
+ SplitCompat.installActivity(this)
}
override fun onCreate(savedInstanceState: Bundle?) {