Skip to content

Commit

Permalink
Merge branch 'development' into 'master'
Browse files Browse the repository at this point in the history
v1.1.2

Closes #9

See merge request Javinator9889/handwashing-reminder!6
  • Loading branch information
Javinator9889 committed Apr 29, 2020
2 parents 8e6dd92 + 0b8ae76 commit 61c068e
Show file tree
Hide file tree
Showing 81 changed files with 2,055 additions and 1,367 deletions.
16 changes: 0 additions & 16 deletions ads/build.gradle
Expand Up @@ -27,25 +27,9 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':app')
implementation "androidx.core:core-ktx:1.2.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"

// https://developer.android.com/kotlin/ktx#play-core
implementation 'com.google.android.play:core-ktx:1.7.0'
// https://firebase.google.com/docs/admob/android/quick-start#import_the_mobile_ads_sdk
implementation 'com.google.firebase:firebase-ads:19.1.0'
// https://developer.android.com/studio/build/multidex
implementation 'androidx.multidex:multidex:2.0.1'
// https://github.com/JakeWharton/timber
implementation 'com.jakewharton.timber:timber:4.7.1'
// https://firebase.google.com/docs/android/setup#add-sdks
implementation 'com.google.firebase:firebase-core:17.3.0'
implementation 'com.google.firebase:firebase-common-ktx:19.3.0'
implementation 'com.google.firebase:firebase-analytics:17.3.0'
implementation 'com.google.firebase:firebase-crashlytics:17.0.0-beta04'
implementation 'com.google.firebase:firebase-perf:19.0.6'
// https://developer.android.com/jetpack/androidx/releases/cardview
implementation 'androidx.cardview:cardview:1.0.0'
}
repositories {
mavenCentral()
Expand Down
65 changes: 36 additions & 29 deletions app/build.gradle
Expand Up @@ -42,8 +42,8 @@ android {
applicationId "com.javinator9889.handwashingreminder"
minSdkVersion 17
targetSdkVersion 29
versionCode 107
versionName "1.1.1-${gitCommitHash}"
versionCode 117
versionName "1.1.2-${gitCommitHash}"
multiDexEnabled true
resConfigs "en", "es"

Expand Down Expand Up @@ -83,13 +83,17 @@ android {
jniDebuggable false
renderscriptDebuggable false
zipAlignEnabled true
/*firebaseCrashlytics {
// When manually initializing Firebase, Crashlytics mapping upload does not work
mappingFileUploadEnabled false
}*/
}
}
dexOptions {
preDexLibraries true
javaMaxHeapSize "1G"
}
dynamicFeatures = [":appintro", ":ads", ":bundledemoji", ":okhttp", ":okhttplegacy"]
dynamicFeatures = [":appintro", ":ads", ":bundledemoji"]

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -104,58 +108,58 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
api 'androidx.appcompat:appcompat:1.1.0'
api 'androidx.core:core-ktx:1.2.0'
api 'androidx.legacy:legacy-support-v4:1.0.0'
api 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

// https://github.com/Javinator9889/LocaleManager
implementation 'com.github.javinator9889:localemanager:1.1X'
api 'com.github.javinator9889:localemanager:1.1X'
// https://material.io/develop/android/docs/getting-started/
implementation 'com.google.android.material:material:1.1.0'
api 'com.google.android.material:material:1.1.0'
// https://developers.google.com/android/guides/setup
implementation 'com.google.android.gms:play-services-location:17.0.0'
// https://developer.android.com/jetpack/androidx/releases/annotation
implementation 'androidx.annotation:annotation:1.1.0'
api 'androidx.annotation:annotation:1.1.0'
// https://developer.android.com/jetpack/androidx/releases/cardview
implementation 'androidx.cardview:cardview:1.0.0'
api 'androidx.cardview:cardview:1.0.0'
// https://developer.android.com/jetpack/androidx/releases/recyclerview
implementation 'androidx.recyclerview:recyclerview:1.1.0'
api 'androidx.recyclerview:recyclerview:1.1.0'
// https://developer.android.com/studio/build/multidex
implementation 'androidx.multidex:multidex:2.0.1'
api 'androidx.multidex:multidex:2.0.1'
// https://github.com/mikepenz/Android-Iconics
implementation 'com.mikepenz:iconics-core:5.0.2'
implementation 'com.mikepenz:iconics-views:5.0.2'
api 'com.mikepenz:iconics-core:5.0.2'
api 'com.mikepenz:iconics-views:5.0.2'
//noinspection GradleDependency
implementation 'com.mikepenz:google-material-typeface:3.0.1.4.original-kotlin@aar'
implementation 'com.mikepenz:ionicons-typeface:2.0.1.5-kotlin@aar'
api 'com.mikepenz:google-material-typeface:3.0.1.4.original-kotlin@aar'
api 'com.mikepenz:ionicons-typeface:2.0.1.5-kotlin@aar'
// https://github.com/mikepenz/AboutLibraries
implementation "com.mikepenz:aboutlibraries-core:${latestAboutLibsRelease}"
implementation "com.mikepenz:aboutlibraries:${latestAboutLibsRelease}"
// https://developer.android.com/kotlin/ktx#play-core
implementation 'com.google.android.play:core-ktx:1.7.0'
api 'com.google.android.play:core:1.7.2'
api 'com.google.android.play:core-ktx:1.7.0'
// https://developer.android.com/kotlin/ktx#collection
implementation 'androidx.collection:collection-ktx:1.1.0'
// https://kotlinlang.org/docs/reference/reflection.html
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
// https://firebase.google.com/docs/android/setup#add-sdks
implementation 'com.google.firebase:firebase-common-ktx:19.3.0'
implementation 'com.google.firebase:firebase-analytics:17.3.0'
implementation 'com.google.firebase:firebase-crashlytics:17.0.0-beta04'
implementation 'com.google.firebase:firebase-perf:19.0.6'
api 'com.google.firebase:firebase-common-ktx:19.3.0'
api 'com.google.firebase:firebase-analytics:17.3.0'
api 'com.google.firebase:firebase-crashlytics:17.0.0'
api 'com.google.firebase:firebase-perf:19.0.6'
// http://airbnb.io/lottie/#/android?id=getting-started
implementation "com.airbnb.android:lottie:3.4.0"
api "com.airbnb.android:lottie:3.4.0"
// https://firebase.google.com/docs/remote-config/use-config-android
implementation 'com.google.firebase:firebase-config:19.1.3'
implementation 'com.google.firebase:firebase-config-ktx:19.1.3'
// https://developer.android.com/jetpack/androidx/releases/work#declaring_dependencies
implementation 'androidx.work:work-runtime-ktx:2.3.4'
// https://mvnrepository.com/artifact/androidx.emoji/emoji/1.0.0
implementation 'androidx.emoji:emoji:1.0.0'
implementation 'androidx.emoji:emoji-appcompat:1.0.0'
api 'androidx.emoji:emoji:1.0.0'
api 'androidx.emoji:emoji-appcompat:1.0.0'
// https://github.com/mikepenz/FastAdapter
implementation "com.mikepenz:fastadapter:${latestFastAdapterRelease}"
// https://developer.android.com/kotlin/ktx#lifecycle
Expand All @@ -167,13 +171,13 @@ dependencies {
// https://developer.android.com/kotlin/ktx#livedata
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0'
// https://github.com/JakeWharton/timber
implementation 'com.jakewharton.timber:timber:4.7.1'
api 'com.jakewharton.timber:timber:4.7.1'
// https://developer.android.com/jetpack/androidx/releases/lifecycle#declaring_dependencies
implementation 'androidx.lifecycle:lifecycle-viewmodel-savedstate:2.2.0'
// https://developer.android.com/reference/kotlin/androidx/preference/package-summary
implementation 'androidx.preference:preference:1.1.1'
// https://github.com/bumptech/glide
implementation 'com.github.bumptech.glide:glide:4.11.0'
api 'com.github.bumptech.glide:glide:4.11.0'
kapt 'com.github.bumptech.glide:compiler:4.11.0'
// https://github.com/afollestad/material-dialogs/
implementation 'com.afollestad.material-dialogs:core:3.3.0'
Expand All @@ -188,4 +192,7 @@ dependencies {
implementation 'com.squareup.okio:okio:2.5.0'
// https://github.com/google/conscrypt/
implementation 'org.conscrypt:conscrypt-android:2.4.0'
// https://github.com/deano2390/MaterialShowcaseView
implementation 'com.github.deano2390:MaterialShowcaseView:1.3.4'
}
apply plugin: 'com.google.gms.google-services'
7 changes: 4 additions & 3 deletions app/proguard-rules.pro
Expand Up @@ -80,6 +80,7 @@
#data models
-keep class com.javinator9889.handwashingreminder.collections.** { *;}

# prevent Crashlytics obfuscation
-keep class com.google.firebase.crashlytics.** { *; }
-dontwarn com.google.firebase.crashlytics.**
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
52 changes: 29 additions & 23 deletions app/src/main/AndroidManifest.xml
Expand Up @@ -22,32 +22,27 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:hardwareAccelerated="true"
tools:ignore="LockedOrientationActivity">

<activity android:name="com.javinator9889.handwashingreminder.activities.LauncherActivity"
android:screenOrientation="portrait"
android:configChanges="orientation">
<activity
android:name="com.javinator9889.handwashingreminder.activities.LauncherActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activities.MainActivity"
android:screenOrientation="portrait"
android:configChanges="orientation" />
<activity android:name=".activities.PrivacyTermsActivity"
android:screenOrientation="portrait"
android:configChanges="orientation" />
<activity android:name=".activities.DynamicFeatureProgress"
android:screenOrientation="portrait"
android:configChanges="orientation" />
<activity android:name=".activities.views.fragments.washinghands.WashingHandsFragment"
android:screenOrientation="portrait"
android:configChanges="orientation" />
<activity android:name=".activities.views.fragments.diseases.DiseaseExpandedView"
android:screenOrientation="portrait"
android:configChanges="orientation" />
<activity
android:name=".activities.MainActivity" />
<activity
android:name=".activities.PrivacyTermsActivity" />
<activity
android:name=".activities.DynamicFeatureProgress" />
<activity
android:name=".activities.views.fragments.washinghands.WashingHandsFragment" />
<activity
android:name=".activities.views.fragments.diseases.DiseaseExpandedView" />

<meta-data
android:name="preloaded_fonts"
Expand All @@ -56,15 +51,13 @@
<receiver
android:name=".gms.activity.ActivityReceiver"
android:enabled="true"
android:exported="true">
</receiver>
android:exported="true" />

<receiver
android:name=".jobs.UpdateReceiver"
android:enabled="true">
<intent-filter>
<action
android:name="android.intent.action.MY_PACKAGE_REPLACED" />
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>
</receiver>

Expand All @@ -75,7 +68,20 @@
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<meta-data android:name="firebase_analytics_collection_enabled" android:value="false" />

<receiver
android:name=".jobs.alarms.AlarmReceiver"
android:enabled="true"
android:exported="true" />

<receiver
android:name=".jobs.ShareReceiver"
android:enabled="true"
android:exported="true" />

<meta-data
android:name="firebase_analytics_collection_enabled"
android:value="false" />
<provider
android:name="com.google.firebase.provider.FirebaseInitProvider"
android:authorities="${applicationId}.firebaseinitprovider"
Expand Down
Expand Up @@ -27,6 +27,7 @@ import android.widget.Toast
import com.google.android.play.core.ktx.bytesDownloaded
import com.google.android.play.core.ktx.errorCode
import com.google.android.play.core.ktx.totalBytesToDownload
import com.google.android.play.core.splitinstall.SplitInstallHelper
import com.google.android.play.core.splitinstall.SplitInstallRequest
import com.google.android.play.core.splitinstall.SplitInstallSessionState
import com.google.android.play.core.splitinstall.SplitInstallStateUpdatedListener
Expand Down Expand Up @@ -163,6 +164,7 @@ class DynamicFeatureProgress : SplitCompatBaseActivity(),
percentage.text = getString(R.string.installing)
}
SplitInstallSessionStatus.INSTALLED -> {
SplitInstallHelper.updateAppInfo(this)
if (++currentModule >= moduleCount) {
dynamic_content_title.text = getString(R.string.done)
setResultWithIntent(Activity.RESULT_OK)
Expand Down
Expand Up @@ -42,7 +42,7 @@ import com.javinator9889.handwashingreminder.emoji.EmojiLoader
import com.javinator9889.handwashingreminder.gms.ads.AdLoader
import com.javinator9889.handwashingreminder.gms.ads.AdsEnabler
import com.javinator9889.handwashingreminder.gms.vendor.BillingService
import com.javinator9889.handwashingreminder.jobs.workers.WorkHandler
import com.javinator9889.handwashingreminder.jobs.alarms.AlarmHandler
import com.javinator9889.handwashingreminder.utils.*
import com.javinator9889.handwashingreminder.utils.Preferences.Companion.ADS_ENABLED
import com.javinator9889.handwashingreminder.utils.Preferences.Companion.APP_INIT_KEY
Expand Down Expand Up @@ -189,10 +189,6 @@ class LauncherActivity : AppCompatActivity() {
modules += AppIntro.MODULE_NAME
launchOnInstall = true
}
/*modules += if (isAtLeast(AndroidVersion.LOLLIPOP))
OkHttp.MODULE_NAME
else
OkHttpLegacy.MODULE_NAME*/
if (googleApi.isGooglePlayServicesAvailable(
this,
GOOGLE_PLAY_SERVICES_MIN_VERSION
Expand Down Expand Up @@ -240,7 +236,11 @@ class LauncherActivity : AppCompatActivity() {
}

private suspend fun initVariables() {
app.firebaseInitDeferred.await()
// Wait at most 3 seconds for Firebase to initialize. Then continue
// with the app initialization
withTimeoutOrNull(3_000L) {
app.firebaseInitDeferred.await()
}
Timber.d("Firebase initialized correctly")
Timber.d("Initializing Iconics")
Iconics.init(this)
Expand All @@ -260,8 +260,8 @@ class LauncherActivity : AppCompatActivity() {
}
Timber.d("Initializing Billing Service")
app.billingService = BillingService(this)
with(WorkHandler(this)) {
enqueuePeriodicNotificationsWorker()
with(AlarmHandler(this)) {
scheduleAllAlarms()
}
Timber.d("Adding periodic notifications if not enqueued yet")
Timber.d("Setting-up Firebase custom properties")
Expand Down

0 comments on commit 61c068e

Please sign in to comment.