Skip to content

Commit

Permalink
Extra files for optimizing Bitmaps in app
Browse files Browse the repository at this point in the history
New options for managing scrollbars and reduced both RAM and CPU usage
  • Loading branch information
Javinator9889 committed Apr 7, 2020
1 parent 420a497 commit b6f181b
Show file tree
Hide file tree
Showing 18 changed files with 3,435 additions and 199 deletions.
3 changes: 0 additions & 3 deletions ads/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,15 @@ android {
targetSdkVersion 29
versionCode 1
versionName "1.0"
multiDexEnabled = true
}

buildTypes {
beta {
initWith(debug)
proguardFiles 'proguard-rules.pro'
multiDexEnabled = true
}
release {
proguardFiles 'proguard-rules.pro'
multiDexEnabled = true
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package com.javinator9889.handwashingreminder.ads

import android.content.Context
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
Expand Down Expand Up @@ -65,10 +64,6 @@ class AdLoaderImpl private constructor(context: Context?) : AdLoader {
private var instance: AdLoaderImpl? = null

override fun instance(context: Context?): AdLoader {
Log.i(
"AdLoaderImpl", "Instance called - context null? ${context
== null}"
)
this.instance = instance ?: AdLoaderImpl(context)
return instance!!
}
Expand Down
5 changes: 3 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ android {
applicationId "com.javinator9889.handwashingreminder"
minSdkVersion 17
targetSdkVersion 29
versionCode 44
versionCode 45
versionName "1.0"
multiDexEnabled true

Expand Down Expand Up @@ -124,5 +124,6 @@ dependencies {
// 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-core:17.3.0'
implementation 'com.google.firebase:firebase-core:17.1.0'
implementation 'com.google.firebase:firebase-common-ktx:18.0.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import android.content.SharedPreferences
import androidx.multidex.MultiDex
import com.google.android.play.core.splitcompat.SplitCompat
import com.javinator9889.handwashingreminder.gms.ads.AdLoader
import com.javinator9889.handwashingreminder.graphics.ImageCache
import com.javinator9889.handwashingreminder.utils.IMAGE_CACHE_DIR
import com.javinator9889.handwashingreminder.utils.Preferences.Companion.NAME
import com.mikepenz.iconics.Iconics
import javinator9889.localemanager.application.BaseApplication
Expand All @@ -32,6 +34,7 @@ import javinator9889.localemanager.utils.languagesupport.LanguagesSupport.Langua
class HandwashingApplication : BaseApplication() {
lateinit var sharedPreferences: SharedPreferences
var adLoader: AdLoader? = null
lateinit var imageCacheParams: ImageCache.ImageCacheParams

companion object {
private lateinit var instance: HandwashingApplication
Expand All @@ -55,6 +58,8 @@ class HandwashingApplication : BaseApplication() {
instance = this
sharedPreferences = getCustomSharedPreferences(this)!!
Iconics.init(this)
imageCacheParams = ImageCache.ImageCacheParams(this, IMAGE_CACHE_DIR)
imageCacheParams.setMemCacheSizePercent(0.25f)
}

/**
Expand Down
Loading

0 comments on commit b6f181b

Please sign in to comment.