From ddf790bfe191d54fe47077b3406675b3de553296 Mon Sep 17 00:00:00 2001 From: Amine Date: Sun, 28 May 2017 18:18:15 +0200 Subject: [PATCH] Removed Firebase Crash deps, updated retrofit (with fixes) and disabled minification. --- app/build.gradle | 9 ++++----- app/proguard-rules.pro | 3 +++ .../bou/readerforselfoss/AddSourceActivity.kt | 4 ++-- .../bou/readerforselfoss/HomeActivity.kt | 18 +++++++----------- .../bou/readerforselfoss/LoginActivity.kt | 2 +- .../bou/readerforselfoss/ReaderActivity.kt | 12 ++++++------ .../bou/readerforselfoss/SourcesActivity.kt | 2 +- .../adapters/SourcesListAdapter.kt | 2 +- .../bou/readerforselfoss/utils/AppUtils.kt | 4 ---- app/src/main/res/drawable-hdpi/ic_refresh.png | Bin 0 -> 422 bytes app/src/main/res/drawable-mdpi/ic_refresh.png | Bin 0 -> 276 bytes .../main/res/drawable-xhdpi/ic_refresh.png | Bin 0 -> 557 bytes .../main/res/drawable-xxhdpi/ic_refresh.png | Bin 0 -> 787 bytes .../main/res/drawable-xxxhdpi/ic_refresh.png | Bin 0 -> 1050 bytes app/src/main/res/menu/home_menu.xml | 2 +- 15 files changed, 26 insertions(+), 32 deletions(-) create mode 100644 app/src/main/res/drawable-hdpi/ic_refresh.png create mode 100644 app/src/main/res/drawable-mdpi/ic_refresh.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_refresh.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_refresh.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_refresh.png diff --git a/app/build.gradle b/app/build.gradle index 822a678..1108f21 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -38,7 +38,7 @@ android { } buildTypes { release { - minifyEnabled true + minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } @@ -73,7 +73,6 @@ dependencies { compile 'com.android.support.constraint:constraint-layout:1.0.2' // Firebase + crashlytics - compile 'com.google.android.gms:play-services:10.2.6' compile 'com.google.firebase:firebase-core:10.2.6' compile 'com.google.firebase:firebase-config:10.2.6' compile 'com.google.firebase:firebase-invites:10.2.6' @@ -93,9 +92,9 @@ dependencies { } // Retrofit + http logging + okhttp - compile 'com.squareup.retrofit2:retrofit:2.1.0' - compile 'com.squareup.okhttp3:logging-interceptor:3.4.1' - compile 'com.squareup.retrofit2:converter-gson:2.1.0' + compile 'com.squareup.retrofit2:retrofit:2.3.0' + compile 'com.squareup.okhttp3:logging-interceptor:3.8.0' + compile 'com.squareup.retrofit2:converter-gson:2.3.0' compile 'com.burgstaller:okhttp-digest:1.12' // Material-ish things diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index d308e3a..11f314f 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -50,6 +50,9 @@ -dontwarn retrofit2.Platform$Java8 -keepattributes Signature -keepattributes Exceptions +-dontwarn okio.** +-dontwarn javax.annotation.Nullable +-dontwarn javax.annotation.ParametersAreNonnullByDefault #Bottom bar lib diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/AddSourceActivity.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/AddSourceActivity.kt index 61cc392..c650b1c 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/AddSourceActivity.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/AddSourceActivity.kt @@ -68,7 +68,7 @@ class AddSourceActivity : AppCompatActivity() { api.spouts().enqueue(object : Callback> { override fun onResponse(call: Call>, response: Response>) { if (response.body() != null) { - items = response.body() + items = response.body()!! val itemsStrings = items.map { it.value.name } for ((key, value) in items) { @@ -106,7 +106,7 @@ class AddSourceActivity : AppCompatActivity() { } else { api.createSource(title, url, mSpoutsValue!!, mTags.text.toString(), "").enqueue(object : Callback { override fun onResponse(call: Call, response: Response) { - if (response.body() != null && response.body().isSuccess) { + if (response.body() != null && response.body()!!.isSuccess) { finish() } else { Toast.makeText(this@AddSourceActivity, R.string.cant_create_source, Toast.LENGTH_SHORT).show() diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/HomeActivity.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/HomeActivity.kt index 9bef128..63faa79 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/HomeActivity.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/HomeActivity.kt @@ -14,7 +14,6 @@ import android.support.v7.widget.GridLayoutManager import android.support.v7.widget.RecyclerView import android.support.v7.widget.StaggeredGridLayoutManager import android.support.v7.widget.helper.ItemTouchHelper -import android.util.Log import android.view.Menu import android.view.MenuItem import android.widget.Toast @@ -36,7 +35,6 @@ import com.github.stkent.amplify.tracking.Amplify import com.google.android.gms.appinvite.AppInviteInvitation import com.google.android.gms.common.ConnectionResult import com.google.android.gms.common.GoogleApiAvailability -import com.google.firebase.crash.FirebaseCrash import com.google.firebase.remoteconfig.FirebaseRemoteConfig import com.mikepenz.aboutlibraries.Libs import com.mikepenz.aboutlibraries.LibsBuilder @@ -188,8 +186,6 @@ class HomeActivity : AppCompatActivity() { tabNew!!.setBadgeCount(items.size - 1) } catch (e: IndexOutOfBoundsException) { - FirebaseCrash.logcat(Log.ERROR, "SWIPE ERROR", "Swipe index out of bound") - FirebaseCrash.report(e) } } @@ -247,7 +243,7 @@ class HomeActivity : AppCompatActivity() { elementsShown = UNREAD_SHOWN api!!.unreadItems.enqueue(object : Callback> { override fun onResponse(call: Call>, response: Response>) { - if (response.body() != null && response.body().isNotEmpty()) { + if (response.body() != null && response.body()!!.isNotEmpty()) { items = response.body() as ArrayList } else { items = ArrayList() @@ -267,7 +263,7 @@ class HomeActivity : AppCompatActivity() { elementsShown = READ_SHOWN api!!.readItems.enqueue(object : Callback> { override fun onResponse(call: Call>, response: Response>) { - if (response.body() != null && response.body().isNotEmpty()) { + if (response.body() != null && response.body()!!.isNotEmpty()) { items = response.body() as ArrayList } else { items = ArrayList() @@ -287,7 +283,7 @@ class HomeActivity : AppCompatActivity() { elementsShown = FAV_SHOWN api!!.starredItems.enqueue(object : Callback> { override fun onResponse(call: Call>, response: Response>) { - if (response.body() != null && response.body().isNotEmpty()) { + if (response.body() != null && response.body()!!.isNotEmpty()) { items = response.body() as ArrayList } else { items = ArrayList() @@ -360,7 +356,7 @@ class HomeActivity : AppCompatActivity() { api!!.readAll(ids).enqueue(object : Callback { override fun onResponse(call: Call, response: Response) { - if (response.body() != null && response.body().isSuccess) { + if (response.body() != null && response.body()!!.isSuccess) { Toast.makeText(this@HomeActivity, R.string.all_posts_read, Toast.LENGTH_SHORT).show() } else { Toast.makeText(this@HomeActivity, R.string.all_posts_not_read, Toast.LENGTH_SHORT).show() @@ -432,10 +428,10 @@ class HomeActivity : AppCompatActivity() { api!!.stats.enqueue(object : Callback { override fun onResponse(call: Call, response: Response) { if (response.body() != null) { - tabNew!!.setBadgeCount(response.body().unread) + tabNew!!.setBadgeCount(response.body()!!.unread) if (displayAllCount) { - tabArchive!!.setBadgeCount(response.body().total) - tabStarred!!.setBadgeCount(response.body().starred) + tabArchive!!.setBadgeCount(response.body()!!.total) + tabStarred!!.setBadgeCount(response.body()!!.starred) } else { tabArchive!!.removeBadge() tabStarred!!.removeBadge() diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/LoginActivity.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/LoginActivity.kt index 41a18f3..e0a4758 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/LoginActivity.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/LoginActivity.kt @@ -203,7 +203,7 @@ class LoginActivity : AppCompatActivity() { } override fun onResponse(call: Call, response: Response) { - if (response.body() != null && response.body().isSuccess) { + if (response.body() != null && response.body()!!.isSuccess) { mFirebaseAnalytics!!.logEvent(FirebaseAnalytics.Event.LOGIN, Bundle()) goToMain() } else { diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/ReaderActivity.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/ReaderActivity.kt index 0243284..a078ee2 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/ReaderActivity.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/ReaderActivity.kt @@ -53,12 +53,12 @@ class ReaderActivity : DragDismissActivity() { parser.parseUrl(url).enqueue(object : Callback { override fun onResponse(call: Call, response: Response) { if (response.body() != null) { - source.text = response.body().domain - title.text = response.body().title - if (response.body().content != null && !response.body().content.isEmpty()) - content.setHtml(response.body().content, HtmlHttpImageGetter(content, null, true)) - if (response.body().lead_image_url != null && !response.body().lead_image_url.isEmpty()) - Glide.with(applicationContext).load(response.body().lead_image_url).asBitmap().fitCenter().into(image) + source.text = response.body()!!.domain + title.text = response.body()!!.title + if (response.body()!!.content != null && !response.body()!!.content.isEmpty()) + content.setHtml(response.body()!!.content, HtmlHttpImageGetter(content, null, true)) + if (response.body()!!.lead_image_url != null && !response.body()!!.lead_image_url.isEmpty()) + Glide.with(applicationContext).load(response.body()!!.lead_image_url).asBitmap().fitCenter().into(image) hideProgressBar() } else { errorAfterMercuryCall() diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/SourcesActivity.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/SourcesActivity.kt index 05c613d..08ab4fd 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/SourcesActivity.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/SourcesActivity.kt @@ -36,7 +36,7 @@ class SourcesActivity : AppCompatActivity() { api.sources.enqueue(object : Callback> { override fun onResponse(call: Call>, response: Response>) { - if (response.body() != null && response.body().isNotEmpty()) { + if (response.body() != null && response.body()!!.isNotEmpty()) { items = response.body() as ArrayList } val mAdapter = SourcesListAdapter(this@SourcesActivity, items, api) diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/adapters/SourcesListAdapter.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/adapters/SourcesListAdapter.kt index 646f507..ec41326 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/adapters/SourcesListAdapter.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/adapters/SourcesListAdapter.kt @@ -84,7 +84,7 @@ class SourcesListAdapter(private val app: Activity, private val items: ArrayList val (id) = items[adapterPosition] api.deleteSource(id).enqueue(object : Callback { override fun onResponse(call: Call, response: Response) { - if (response.body() != null && response.body().isSuccess) { + if (response.body() != null && response.body()!!.isSuccess) { items.removeAt(adapterPosition) notifyItemRemoved(adapterPosition) notifyItemRangeChanged(adapterPosition, itemCount) diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/utils/AppUtils.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/utils/AppUtils.kt index 78c7332..0706115 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/utils/AppUtils.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/utils/AppUtils.kt @@ -6,11 +6,9 @@ import android.content.SharedPreferences import android.net.Uri import android.support.v7.app.AlertDialog import android.text.TextUtils -import android.util.Log import android.util.Patterns import apps.amine.bou.readerforselfoss.BuildConfig import apps.amine.bou.readerforselfoss.R -import com.google.firebase.crash.FirebaseCrash import com.google.firebase.remoteconfig.FirebaseRemoteConfig import okhttp3.HttpUrl @@ -57,8 +55,6 @@ fun checkApkVersion(settings: SharedPreferences, editor: SharedPreferences.Edito if (task.isSuccessful) { mFirebaseRemoteConfig.activateFetched() } else { - FirebaseCrash.logcat(Log.DEBUG, "CONFIG FETCH", "remote config task unsuccessful") - FirebaseCrash.report(Exception(task.exception)) } isThereAnUpdate(settings, editor, context, mFirebaseRemoteConfig) diff --git a/app/src/main/res/drawable-hdpi/ic_refresh.png b/app/src/main/res/drawable-hdpi/ic_refresh.png new file mode 100644 index 0000000000000000000000000000000000000000..6d4481ff70e887fd65a08d83f3551348a049bc61 GIT binary patch literal 422 zcmV;X0a^ZuP)YU6vjK)I#dKF1<^G18H$L$gM*Vsi=%_1B6hOvYdE=xIyjYDTLj-h3WaXfx{06; zhNhp#lS{BoPI60}N>3nv_`dvd?!D)pBodPtt3Vb7)X{~F9$wL)Cv!kA>Of4~z`<}h zxP+k`B_JBJhc8I+fo*b>e{Z8OC+d|xDzGTGB&Lv|yP5~PcP~-dxbcLXPuoEIZ*t*t z;|{8Ubf7+mXFbrh$|f!7Wvz^8!5yBPoS>Hm=UoOBSg#0bad-h`P@Q!vP&@Nif(+`i zZpPmfHiMG?1xm#Sy)Y;nALLHfjA|XLp_p~{*q9G9U9qW& z8PPF|7JJUalQ!_lwufL8VIEn3!$Q>fEmgKntOX3Jr8?!N&e|P$d*BXvtY8``I_JH{ z*2jTv8SGF)mEs*+qg2!~wRwN@@8JTAqnD>a-MfYkzUk9_d?6ISY+C{Jup a{}6Wsc(lK30000Nkl7F(pD)0gG0WXfqhMV%?kfIMl$D3~Q$8}H vQ!nyKeC?IRiq2RU(nH?2D~c$hxE_B1xDIBu!Ob|g00000NkvXXu0mjfCBpsr literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxhdpi/ic_refresh.png b/app/src/main/res/drawable-xxhdpi/ic_refresh.png new file mode 100644 index 0000000000000000000000000000000000000000..455000ed554b636ada38840748feee474ab5b993 GIT binary patch literal 787 zcmV+u1MK{XP)bBua`tJQRYL{5S@ckrG5VqYial zlR$zZ2!-mJn+09^a3kGR)b!V&2WR&Cop)9?od50Jo#+4l=AC(Fo*9qF%F4>h%4*Gu zN}9OKATi?1u|R?`hQu$YsLC1JVHRa0R~aFjMrg&KF}@Sb!E6=ZV48e1MGqC}aSQ?B zqg}kli4wH2PVwkk{=)=LEg#U)Fu`OT13(-Vz17uk4lQ|ful(c|=c34>RK@6}kq~|{ zm?dmrr+B)@=QJ(YR ztk*P-4$zZcw4D^m|+b?U&qUDc7+WmMk8*26`sB4d_{1Q3|vgS2(+rv)ySu zlYmmsDAi_3&jA@TNAWWQrN<+l3RJ+=1+2y!0J?! z0WR@2%f;^^uSJV;&+3Xz9OpJsM#XA8D~?US_{f0xe#hACv9hwVva(vU`UkF)LaEL8 R1>gVx002ovPDHLkV1n<7e?b5M literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_refresh.png b/app/src/main/res/drawable-xxxhdpi/ic_refresh.png new file mode 100644 index 0000000000000000000000000000000000000000..58b116e0dcda402ba3ab4cee90d9aa83a9305b84 GIT binary patch literal 1050 zcmV+#1m*jQP)S`Z3J zK@WjNkpy9Zl6J8N(Y%*k1SS2Nl*H!DS$FsRGkRdYeOV6YeDi&~|IGjYbH?G&(9qD( z(9qD((9qBz0#;!^%Fuuo^k5Vd>@&)~wXiFt*oPHfvK6Wm?!-1!;3MWj2QFZ%r}6}HUJkgF$^o{$6+`H%*Fq1kSTvX znn8gk#F)vKXaEQC3se}vUa@>h2H=NEP~-G;D52#4%QEB#vNhcudQijWMlxdA1P@?l zL)o|O$i`jtxqa>q{CW8j3@}NLOeGAkOc3ujS0tedKTMy0XS_te?$nzM-o<|PAdfi0 zk&myQMi#Y!i^5UHSeX#)70*&!#iVirI3OIO9dSOf?O?M-r2(uJX59M-@tJWsUMe%d zqW^_}|1w;bScA~0%D@o;`xOG-QY8l1$}uPi9+zd_5=9{-7^vO%*!NsMkpYCUYK31o z<5b9}GLU27Ew#*9tT2(WaN)CVup0R!2C&7znx#rUje&E9k}b#*Uy(OeHidyUjha20yrs985qz%kaSluu!xj$_PJDWAdsU+^Z|ZL_wMGZ1Sx z1N_cgq}>eg+gAa0Gw|K+2D4rpU7lzfC#00pn}K3_9{)3~=P**hnfr$*|USk(P~u`0TL0xjVxiAvkGq zl=cq}L$6_odh6TkQ`~-dY~cQkK*hT+`NWoh4+6GHq{ys`%7qrjan`%khEVpzZy{Hn z+``U@o2ExRay_e&5P}@jV;|S$*QWk>V7d=Dh)YNmoxqy0pUCbQc5`0E<#4F5aNF&6 zW*_b$8!1?WCrVkhggjp>R1S1D|;?ly%OJw%mpHTmW|CgkGFFk zBx^$%5*P9&Occ^_lBJ|q=wyA|7%MY|S$EZpI+P$4%N!aS8X6iJ8X6iJ8X83S1OHOk Uu7;mup#T5?07*qoM6N<$g5Ub@YybcN literal 0 HcmV?d00001 diff --git a/app/src/main/res/menu/home_menu.xml b/app/src/main/res/menu/home_menu.xml index d9660a7..1aec784 100644 --- a/app/src/main/res/menu/home_menu.xml +++ b/app/src/main/res/menu/home_menu.xml @@ -10,7 +10,7 @@