Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.2.1 #5

Merged
merged 19 commits into from Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
9572a50
gradle: updated libraries and using new version of ViewBinding
Javinator9889 Dec 7, 2020
b70a94b
Merge pull request #4 from Javinator9889/master
Javinator9889 Dec 7, 2020
071766f
Kotlin: updated Kt version up-to 1.4.21
Javinator9889 Dec 7, 2020
dbedb5e
Settings: load icons when screen orientation changes
Javinator9889 Dec 10, 2020
878dddd
News: double click scrolls directly to position
Javinator9889 Dec 10, 2020
3b2b5cd
News: error screen now shows a "Click to reload" button
Javinator9889 Dec 10, 2020
fb983a2
News: try to load the icon directly from the web
Javinator9889 Dec 10, 2020
c196458
News: removed unused code
Javinator9889 Dec 10, 2020
1797d3e
Alarms: created new notification system for activity alarms
Javinator9889 Dec 10, 2020
9ce0c11
ActivityRecognition: showing actions as well as in scheduled notifica…
Javinator9889 Dec 10, 2020
32d7932
v1.2.1: updated version code
Javinator9889 Dec 10, 2020
fd87bb1
code: removed deprecated methods
Javinator9889 Dec 10, 2020
80a3438
v1.2.1-rc1
Javinator9889 Dec 10, 2020
f894c34
v1.2.1-rc1: remove old channels and updated boot receiver permissions
Javinator9889 Dec 10, 2020
bec9750
v1.2.1-rc1: updated minimum version
Javinator9889 Dec 10, 2020
d4b2266
Notifications: cancel notification by ID
Javinator9889 Dec 10, 2020
fe248f3
gradle: aggressive optimizations for release builds
Javinator9889 Dec 10, 2020
a1ca37b
News: hide loading bar when error screen is displayed
Javinator9889 Dec 10, 2020
048e0e9
UpdateReceiver: delete notification channels if new version is 141 or…
Javinator9889 Dec 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 }
}