Skip to content

Commit

Permalink
v1.2.1
Browse files Browse the repository at this point in the history
v1.2.1
  • Loading branch information
Javinator9889 committed Dec 10, 2020
2 parents 2b9a235 + 048e0e9 commit 38d6659
Show file tree
Hide file tree
Showing 63 changed files with 1,088 additions and 516 deletions.
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 10 additions & 6 deletions ads/build.gradle
@@ -1,14 +1,18 @@
apply plugin: 'com.android.dynamic-feature'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 29

buildFeatures {
viewBinding true
dataBinding true
}

compileSdkVersion 30

defaultConfig {
minSdkVersion 17
targetSdkVersion 29
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"
}
Expand Down Expand Up @@ -37,7 +41,7 @@ dependencies {
implementation project(':app')

// https://firebase.google.com/docs/admob/android/quick-start#import_the_mobile_ads_sdk
implementation 'com.google.firebase:firebase-ads:19.2.0'
implementation 'com.google.firebase:firebase-ads:19.6.0'
}
repositories {
mavenCentral()
Expand Down
78 changes: 42 additions & 36 deletions app/build.gradle
@@ -1,7 +1,6 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.mikepenz.aboutlibraries.plugin'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'com.google.firebase.crashlytics'
Expand Down Expand Up @@ -32,16 +31,19 @@ def gitCommitHash = { ->
}

android {
buildFeatures.viewBinding = true
compileSdkVersion 29
buildFeatures {
viewBinding true
dataBinding true
}
compileSdkVersion 30
buildToolsVersion "29.0.3"

defaultConfig {
applicationId "com.javinator9889.handwashingreminder"
minSdkVersion 17
targetSdkVersion 29
versionCode 137
versionName "1.2.0-${gitCommitHash}"
minSdkVersion 16
targetSdkVersion 30
versionCode 142
versionName "1.2.1-${gitCommitHash}"
multiDexEnabled true
resConfigs "en", "es"
vectorDrawables.useSupportLibrary = true
Expand Down Expand Up @@ -111,20 +113,22 @@ dependencies {
def room_version = "2.2.5"
implementation fileTree(dir: 'libs', include: ['*.jar'])
api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
api 'androidx.appcompat:appcompat:1.1.0'
api 'androidx.core:core-ktx:1.3.0'
api 'androidx.appcompat:appcompat:1.2.0'
api 'androidx.core:core-ktx:1.3.2'
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'
api 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

// https://stackoverflow.com/questions/64247956/why-does-im-getting-service-not-registered-exception-even-though-i-not-used
api 'com.google.android.gms:play-services-basement:17.5.0'
// https://github.com/Javinator9889/LocaleManager
api 'com.github.javinator9889:localemanager:1.1X'
// https://material.io/develop/android/docs/getting-started/
api 'com.google.android.material:material:1.1.0'
api 'com.google.android.material:material:1.2.1'
// https://developers.google.com/android/guides/setup
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.1.0'
// https://developer.android.com/jetpack/androidx/releases/annotation
api 'androidx.annotation:annotation:1.1.0'
// https://developer.android.com/jetpack/androidx/releases/cardview
Expand All @@ -134,32 +138,32 @@ dependencies {
// https://developer.android.com/studio/build/multidex
api 'androidx.multidex:multidex:2.0.1'
// https://github.com/mikepenz/Android-Iconics
api 'com.mikepenz:iconics-core:5.0.3'
api 'com.mikepenz:iconics-views:5.0.3'
api 'com.mikepenz:iconics-core:5.2.1'
api 'com.mikepenz:iconics-views:5.2.1'
//noinspection GradleDependency
api 'com.mikepenz:google-material-typeface:3.0.1.4.original-kotlin@aar'
api 'com.mikepenz:ionicons-typeface:2.0.1.5-kotlin@aar'
api 'com.mikepenz:google-material-typeface:3.0.1.6.original-kotlin@aar'
api 'com.mikepenz:ionicons-typeface:2.0.1.7-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
api 'com.google.android.play:core:1.7.3'
api 'com.google.android.play:core-ktx:1.7.0'
api 'com.google.android.play:core:1.9.0'
api 'com.google.android.play:core-ktx:1.8.1'
// 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
api 'com.google.firebase:firebase-common-ktx:19.3.0'
api 'com.google.firebase:firebase-analytics:17.4.3'
api 'com.google.firebase:firebase-crashlytics:17.1.0'
api 'com.google.firebase:firebase-perf:19.0.7'
implementation 'com.google.firebase:firebase-auth:19.3.1'
api 'com.google.firebase:firebase-common-ktx:19.4.0'
api 'com.google.firebase:firebase-analytics:18.0.0'
api 'com.google.firebase:firebase-crashlytics:17.3.0'
api 'com.google.firebase:firebase-perf:19.0.10'
implementation 'com.google.firebase:firebase-auth:20.0.1'
// http://airbnb.io/lottie/#/android?id=getting-started
api 'com.airbnb.android:lottie:3.4.1'
api 'com.airbnb.android:lottie:3.5.0'
// https://firebase.google.com/docs/remote-config/use-config-android
implementation 'com.google.firebase:firebase-config:19.1.4'
implementation 'com.google.firebase:firebase-config-ktx:19.1.4'
implementation 'com.google.firebase:firebase-config:20.0.2'
implementation 'com.google.firebase:firebase-config-ktx:20.0.2'
// https://mvnrepository.com/artifact/androidx.emoji/emoji/
api 'androidx.emoji:emoji:1.1.0'
api 'androidx.emoji:emoji-appcompat:1.1.0'
Expand All @@ -184,16 +188,16 @@ dependencies {
// https://github.com/afollestad/material-dialogs/
implementation 'com.afollestad.material-dialogs:core:3.3.0'
// https://developer.android.com/google/play/billing/billing_library_overview
implementation 'com.android.billingclient:billing:3.0.0'
implementation 'com.android.billingclient:billing-ktx:3.0.0'
implementation 'com.android.billingclient:billing:3.0.2'
implementation 'com.android.billingclient:billing-ktx:3.0.2'
// https://github.com/cbeust/klaxon
implementation 'com.beust:klaxon:5.2'
implementation 'com.beust:klaxon:5.4'
// https://github.com/SufficientlySecure/html-textview
implementation 'org.sufficientlysecure:html-textview:3.9'
implementation 'org.sufficientlysecure:html-textview:4.0'
// https://github.com/square/okhttp/tree/okhttp_3.12.x
implementation 'com.squareup.okhttp3:okhttp:3.12.11'
implementation 'com.squareup.okhttp3:okhttp:3.12.12'
// https://square.github.io/okio/#releases
implementation 'com.squareup.okio:okio:2.6.0'
implementation 'com.squareup.okio:okio:2.9.0'
// https://github.com/deano2390/MaterialShowcaseView
implementation 'com.github.deano2390:MaterialShowcaseView:1.3.4'
// https://github.com/PhilJay/MPAndroidChart
Expand All @@ -202,6 +206,8 @@ dependencies {
implementation "androidx.room:room-ktx:$room_version"
kapt "androidx.room:room-compiler:$room_version"
// https://coil-kt.github.io/coil/
api "io.coil-kt:coil:0.11.0"
api "io.coil-kt:coil:1.1.0"
// https://developer.android.com/jetpack/androidx/releases/work#declaring_dependencies
implementation "androidx.work:work-runtime-ktx:2.4.0"
}
apply plugin: 'com.google.gms.google-services'
5 changes: 4 additions & 1 deletion app/src/main/AndroidManifest.xml
Expand Up @@ -73,9 +73,12 @@

<receiver
android:name=".jobs.BootCompletedJob"
android:enabled="true">
android:enabled="true"
android:exported="true">
<intent-filter>
<category android:name="android.intent.category.DEFAULT"/>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
</intent-filter>
</receiver>

Expand Down
Expand Up @@ -36,14 +36,12 @@ import com.google.firebase.analytics.FirebaseAnalytics
import com.javinator9889.handwashingreminder.BuildConfig
import com.javinator9889.handwashingreminder.R
import com.javinator9889.handwashingreminder.activities.base.SplitCompatBaseActivity
import com.javinator9889.handwashingreminder.utils.AndroidVersion
import com.javinator9889.handwashingreminder.utils.CONFIRMATION_REQUEST_CODE
import com.javinator9889.handwashingreminder.utils.filterNotEmpty
import com.javinator9889.handwashingreminder.utils.isAtLeast
import kotlinx.android.synthetic.main.dynamic_content_pb.*
import com.javinator9889.handwashingreminder.databinding.DynamicContentPbBinding
import com.javinator9889.handwashingreminder.utils.*
import timber.log.Timber

class DynamicFeatureProgress : SplitCompatBaseActivity(),
class DynamicFeatureProgress :
SplitCompatBaseActivity<DynamicContentPbBinding>(),
SplitInstallStateUpdatedListener {
companion object {
const val MODULES = "modules"
Expand All @@ -60,10 +58,12 @@ class DynamicFeatureProgress : SplitCompatBaseActivity(),

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val layout = inflateLayout()
splitInstallManager.registerListener(this)
with(FirebaseAnalytics.getInstance(this)) {
setCurrentScreen(
this@DynamicFeatureProgress, "Dynamic module", null
"Dynamic module",
this@DynamicFeatureProgress::class
)
}
modules =
Expand All @@ -85,7 +85,7 @@ class DynamicFeatureProgress : SplitCompatBaseActivity(),
}
}
if (moduleCount > 0 && modules.isNotEmpty()) {
setContentView(R.layout.dynamic_content_pb)
setContentView(layout.root)
overridePendingTransition(android.R.anim.fade_in, 0)
val installRequest = installRequestBuilder.build()
splitInstallManager.startInstall(installRequest)
Expand Down Expand Up @@ -114,8 +114,8 @@ class DynamicFeatureProgress : SplitCompatBaseActivity(),
}

@SuppressLint("SetTextI18n")
override fun onStateUpdate(state: SplitInstallSessionState?) {
when (state?.status()) {
override fun onStateUpdate(state: SplitInstallSessionState) {
when (state.status()) {
SplitInstallSessionStatus.FAILED -> {
Toast.makeText(
this, getString(
Expand All @@ -140,36 +140,36 @@ class DynamicFeatureProgress : SplitCompatBaseActivity(),
finish()
}
SplitInstallSessionStatus.PENDING -> {
install_progress.isIndeterminate = true
percentage.text = getString(R.string.preparing)
binding.installProgress.isIndeterminate = true
binding.percentage.text = getString(R.string.preparing)
}
SplitInstallSessionStatus.DOWNLOADING -> {
val downloadedBytes =
Formatter.formatFileSize(this, state.bytesDownloaded)
val bytesToDownload =
Formatter.formatFileSize(this, state.totalBytesToDownload)
bytesInfo.text = "$downloadedBytes / $bytesToDownload"
install_progress.isIndeterminate = false
install_progress.max = state.totalBytesToDownload.toInt()
binding.bytesInfo.text = "$downloadedBytes / $bytesToDownload"
binding.installProgress.isIndeterminate = false
binding.installProgress.max = state.totalBytesToDownload.toInt()
val progress = state.bytesDownloaded.toInt()
if (isAtLeast(AndroidVersion.N))
install_progress.setProgress(progress, true)
binding.installProgress.setProgress(progress, true)
else
install_progress.progress = progress
binding.installProgress.progress = progress
val currentPercentage =
(state.bytesDownloaded * 100 / state.totalBytesToDownload)
.toInt()
percentage.text = "$currentPercentage %"
binding.percentage.text = "$currentPercentage %"
}
SplitInstallSessionStatus.INSTALLING -> {
install_progress.isIndeterminate = true
bytesInfo.text = ""
percentage.text = getString(R.string.installing)
binding.installProgress.isIndeterminate = true
binding.bytesInfo.text = ""
binding.percentage.text = getString(R.string.installing)
}
SplitInstallSessionStatus.INSTALLED -> {
SplitInstallHelper.updateAppInfo(this)
if (++currentModule >= moduleCount) {
dynamic_content_title.text = getString(R.string.done)
binding.dynamicContentTitle.text = getString(R.string.done)
setResultWithIntent(Activity.RESULT_OK)
finish()
}
Expand All @@ -189,4 +189,7 @@ class DynamicFeatureProgress : SplitCompatBaseActivity(),
finish()
}
}

override fun inflateLayout(): DynamicContentPbBinding =
DynamicContentPbBinding.inflate(layoutInflater).also { binding = it }
}

0 comments on commit 38d6659

Please sign in to comment.