From 434815eb65aaab5fa63682edcb834d91736bda3e Mon Sep 17 00:00:00 2001 From: cutmail Date: Tue, 4 Apr 2017 17:03:52 +0900 Subject: [PATCH 01/37] Ignore keystore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 45d0e9e..f03a958 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ out/ local.properties .envrc +releasekey.keystore # Eclipse project files .classpath From 7a87839c9b33c875decee0c8744836d68fe1b730 Mon Sep 17 00:00:00 2001 From: cutmail Date: Thu, 20 Apr 2017 17:40:04 +0900 Subject: [PATCH 02/37] Update gradle tools version --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 413c307..820d805 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.0' + classpath 'com.android.tools.build:gradle:2.3.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files classpath 'com.google.gms:google-services:3.0.0' From ee391ba2e9ea381fa0018fbe3e19d6b85c14e0e5 Mon Sep 17 00:00:00 2001 From: cutmail Date: Thu, 20 Apr 2017 17:44:32 +0900 Subject: [PATCH 03/37] Ignore release key --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 45d0e9e..f03a958 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ out/ local.properties .envrc +releasekey.keystore # Eclipse project files .classpath From fa449d887cec31a7beb8551c25c7b5ac6d6a25d5 Mon Sep 17 00:00:00 2001 From: cutmail Date: Sun, 18 Jun 2017 15:59:15 +0900 Subject: [PATCH 04/37] Update gradle version --- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 820d805..0cad3ad 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.1' + classpath 'com.android.tools.build:gradle:3.0.0-alpha4' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files classpath 'com.google.gms:google-services:3.0.0' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 41b57f8..2fd57f9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Thu Mar 16 16:34:07 JST 2017 +#Sun Jun 18 15:57:21 JST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-rc-1-all.zip From 013bc9ed34dd058fe184179154b6bfc4ebed0f5b Mon Sep 17 00:00:00 2001 From: cutmail Date: Sun, 18 Jun 2017 16:09:21 +0900 Subject: [PATCH 05/37] Update fabric gradle tools --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index a320604..e1008a7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'io.fabric.tools:gradle:1.21.6' + classpath 'io.fabric.tools:gradle:1.22.2' } } apply plugin: 'com.android.application' From 7bfe986b6b4be43f7334b3e6ae7779bfd08920a3 Mon Sep 17 00:00:00 2001 From: cutmail Date: Sun, 18 Jun 2017 16:13:39 +0900 Subject: [PATCH 06/37] Add google maven repository --- app/build.gradle | 1 + build.gradle | 3 +++ 2 files changed, 4 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index e1008a7..4f2d035 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -13,6 +13,7 @@ apply plugin: 'io.fabric' repositories { maven { url 'https://maven.fabric.io/public' } + maven { url 'https://maven.google.com' } } android { diff --git a/build.gradle b/build.gradle index 0cad3ad..fd8ac74 100644 --- a/build.gradle +++ b/build.gradle @@ -3,6 +3,9 @@ buildscript { repositories { jcenter() + maven { + url 'https://maven.google.com' + } } dependencies { classpath 'com.android.tools.build:gradle:3.0.0-alpha4' From 92fdbeb9f16df03008ef78faabdf3255154d72d9 Mon Sep 17 00:00:00 2001 From: cutmail Date: Sun, 18 Jun 2017 16:34:49 +0900 Subject: [PATCH 07/37] Revert "Update fabric gradle tools" This reverts commit 013bc9ed34dd058fe184179154b6bfc4ebed0f5b. --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 4f2d035..911d012 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'io.fabric.tools:gradle:1.22.2' + classpath 'io.fabric.tools:gradle:1.21.6' } } apply plugin: 'com.android.application' From 40674dd9ebf2b36b53d90bc9c876efb2e8bb23fb Mon Sep 17 00:00:00 2001 From: cutmail Date: Thu, 22 Jun 2017 10:18:51 +0900 Subject: [PATCH 08/37] Update Firebase SDK to v11.0.1 --- app/build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 911d012..d4622d1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -42,9 +42,9 @@ dependencies { compile 'com.jakewharton.timber:timber:4.5.1' compile 'com.github.hotchemi:android-rate:1.0.1' compile 'com.firebaseui:firebase-ui-database:0.6.1' - compile 'com.google.firebase:firebase-database:10.0.1' - compile 'com.google.firebase:firebase-core:10.0.1' - compile 'com.google.firebase:firebase-crash:10.0.1' + compile 'com.google.firebase:firebase-database:11.0.1' + compile 'com.google.firebase:firebase-core:11.0.1' + compile 'com.google.firebase:firebase-crash:11.0.1' compile 'com.jakewharton:butterknife:8.5.1' annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0' } From d83e16e773e42c4458b91770abbccedab218c900 Mon Sep 17 00:00:00 2001 From: cutmail Date: Thu, 22 Jun 2017 10:24:19 +0900 Subject: [PATCH 09/37] Update firebase-ui-database --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 911d012..090cd89 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -41,7 +41,7 @@ dependencies { compile 'com.android.support:appcompat-v7:25.0.1' compile 'com.jakewharton.timber:timber:4.5.1' compile 'com.github.hotchemi:android-rate:1.0.1' - compile 'com.firebaseui:firebase-ui-database:0.6.1' + compile 'com.firebaseui:firebase-ui-database:1.2.0' compile 'com.google.firebase:firebase-database:10.0.1' compile 'com.google.firebase:firebase-core:10.0.1' compile 'com.google.firebase:firebase-crash:10.0.1' From 151d9a340833900164c7967024a6e0743aa50d33 Mon Sep 17 00:00:00 2001 From: cutmail Date: Thu, 22 Jun 2017 10:54:05 +0900 Subject: [PATCH 10/37] Update ButterKnife 8.6.0 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 911d012..83a4e36 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -45,8 +45,8 @@ dependencies { compile 'com.google.firebase:firebase-database:10.0.1' compile 'com.google.firebase:firebase-core:10.0.1' compile 'com.google.firebase:firebase-crash:10.0.1' - compile 'com.jakewharton:butterknife:8.5.1' - annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0' + compile 'com.jakewharton:butterknife:8.6.0' + annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0' } apply plugin: 'com.google.gms.google-services' \ No newline at end of file From 0fdfb3404a3751548a7954bde324d7f3cf31530a Mon Sep 17 00:00:00 2001 From: cutmail Date: Thu, 22 Jun 2017 11:07:27 +0900 Subject: [PATCH 11/37] Update Crashlytics to v2.6.8 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 911d012..011fe60 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -35,8 +35,8 @@ android { } dependencies { - compile('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') { - transitive = true; + compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') { + transitive = true } compile 'com.android.support:appcompat-v7:25.0.1' compile 'com.jakewharton.timber:timber:4.5.1' From 283a5063b2cb5f1242d6960bfea05b94b6454549 Mon Sep 17 00:00:00 2001 From: cutmail Date: Sat, 1 Jul 2017 15:37:15 +0900 Subject: [PATCH 12/37] Update Gradle --- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index fd8ac74..72b5d3c 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:3.0.0-alpha4' + classpath 'com.android.tools.build:gradle:3.0.0-alpha5' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files classpath 'com.google.gms:google-services:3.0.0' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2fd57f9..a4f9ed9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sun Jun 18 15:57:21 JST 2017 +#Sat Jul 01 15:35:56 JST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-rc-1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-milestone-1-all.zip From 66e35157111622f874e160be456376840d7ab7b7 Mon Sep 17 00:00:00 2001 From: cutmail Date: Sat, 1 Jul 2017 15:48:59 +0900 Subject: [PATCH 13/37] Update Fabric gradle tools --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 911d012..4f2d035 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'io.fabric.tools:gradle:1.21.6' + classpath 'io.fabric.tools:gradle:1.22.2' } } apply plugin: 'com.android.application' From bd532d0f1b897b0f4999c04919c6b55c23d077b8 Mon Sep 17 00:00:00 2001 From: cutmail Date: Wed, 4 Apr 2018 14:38:15 +0900 Subject: [PATCH 14/37] Update gradle --- app/build.gradle | 20 ++++++++++---------- build.gradle | 3 ++- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 04923f2..e34eee0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -18,7 +18,7 @@ repositories { android { compileSdkVersion 25 - buildToolsVersion "25.0.2" + buildToolsVersion '27.0.3' defaultConfig { applicationId "me.cutmail.disasterapp" @@ -35,17 +35,17 @@ android { } dependencies { - compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') { + implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') { transitive = true } - compile 'com.android.support:appcompat-v7:25.0.1' - compile 'com.jakewharton.timber:timber:4.5.1' - compile 'com.github.hotchemi:android-rate:1.0.1' - compile 'com.firebaseui:firebase-ui-database:1.2.0' - compile 'com.google.firebase:firebase-database:11.0.1' - compile 'com.google.firebase:firebase-core:11.0.1' - compile 'com.google.firebase:firebase-crash:11.0.1' - compile 'com.jakewharton:butterknife:8.6.0' + implementation 'com.android.support:appcompat-v7:25.0.1' + implementation 'com.jakewharton.timber:timber:4.5.1' + implementation 'com.github.hotchemi:android-rate:1.0.1' + implementation 'com.firebaseui:firebase-ui-database:1.2.0' + implementation 'com.google.firebase:firebase-database:11.0.1' + implementation 'com.google.firebase:firebase-core:11.0.1' + implementation 'com.google.firebase:firebase-crash:11.0.1' + implementation 'com.jakewharton:butterknife:8.6.0' annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0' } diff --git a/build.gradle b/build.gradle index 72b5d3c..15d61ff 100644 --- a/build.gradle +++ b/build.gradle @@ -6,9 +6,10 @@ buildscript { maven { url 'https://maven.google.com' } + google() } dependencies { - classpath 'com.android.tools.build:gradle:3.0.0-alpha5' + classpath 'com.android.tools.build:gradle:3.1.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files classpath 'com.google.gms:google-services:3.0.0' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a4f9ed9..eeaefd3 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sat Jul 01 15:35:56 JST 2017 +#Wed Apr 04 14:34:02 JST 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-milestone-1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip From 888b15b2a27310c8c53a6f8ef0ca53b2cdf10261 Mon Sep 17 00:00:00 2001 From: cutmail Date: Wed, 4 Apr 2018 14:52:52 +0900 Subject: [PATCH 15/37] Update fabric --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e34eee0..a1442a8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'io.fabric.tools:gradle:1.22.2' + classpath 'io.fabric.tools:gradle:1.25.2' } } apply plugin: 'com.android.application' @@ -35,7 +35,7 @@ android { } dependencies { - implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') { + implementation('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') { transitive = true } implementation 'com.android.support:appcompat-v7:25.0.1' From 79f779ddb6ff6dbbef561756a09ad2ed47f74e8a Mon Sep 17 00:00:00 2001 From: cutmail Date: Thu, 5 Apr 2018 14:39:23 +0900 Subject: [PATCH 16/37] Update libs --- app/build.gradle | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index a1442a8..09c50d4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -39,12 +39,12 @@ dependencies { transitive = true } implementation 'com.android.support:appcompat-v7:25.0.1' - implementation 'com.jakewharton.timber:timber:4.5.1' + implementation 'com.jakewharton.timber:timber:4.7.0' implementation 'com.github.hotchemi:android-rate:1.0.1' implementation 'com.firebaseui:firebase-ui-database:1.2.0' - implementation 'com.google.firebase:firebase-database:11.0.1' - implementation 'com.google.firebase:firebase-core:11.0.1' - implementation 'com.google.firebase:firebase-crash:11.0.1' + implementation 'com.google.firebase:firebase-database:12.0.1' + implementation 'com.google.firebase:firebase-core:12.0.1' + implementation 'com.google.firebase:firebase-crash:12.0.1' implementation 'com.jakewharton:butterknife:8.6.0' annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0' } From c0e390c818309f6b4d07fc47976c5ecc1bce5e1e Mon Sep 17 00:00:00 2001 From: cutmail Date: Thu, 5 Apr 2018 15:24:35 +0900 Subject: [PATCH 17/37] Update google-services --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 15d61ff..fcee343 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ buildscript { classpath 'com.android.tools.build:gradle:3.1.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files - classpath 'com.google.gms:google-services:3.0.0' + classpath 'com.google.gms:google-services:3.1.2' } } From 46f0ec1793abb29c590c79e9147cc17708cd795e Mon Sep 17 00:00:00 2001 From: cutmail Date: Thu, 5 Apr 2018 15:37:43 +0900 Subject: [PATCH 18/37] Update targetsdkversion --- app/build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 09c50d4..c68692e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,13 +17,13 @@ repositories { } android { - compileSdkVersion 25 + compileSdkVersion 27 buildToolsVersion '27.0.3' defaultConfig { applicationId "me.cutmail.disasterapp" minSdkVersion 14 - targetSdkVersion 25 + targetSdkVersion 27 versionCode 17 versionName "1.7.0" } @@ -38,7 +38,7 @@ dependencies { implementation('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') { transitive = true } - implementation 'com.android.support:appcompat-v7:25.0.1' + implementation 'com.android.support:appcompat-v7:27.1.0' implementation 'com.jakewharton.timber:timber:4.7.0' implementation 'com.github.hotchemi:android-rate:1.0.1' implementation 'com.firebaseui:firebase-ui-database:1.2.0' From 768291febbcaa54aa0b0b43c46eca0bacdccb09d Mon Sep 17 00:00:00 2001 From: cutmail Date: Thu, 5 Apr 2018 15:57:56 +0900 Subject: [PATCH 19/37] Update firebase-ui-database --- app/build.gradle | 2 +- .../disasterapp/activity/MainActivity.java | 30 ++++++++++++------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index c68692e..f56d1ce 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -41,7 +41,7 @@ dependencies { implementation 'com.android.support:appcompat-v7:27.1.0' implementation 'com.jakewharton.timber:timber:4.7.0' implementation 'com.github.hotchemi:android-rate:1.0.1' - implementation 'com.firebaseui:firebase-ui-database:1.2.0' + implementation 'com.firebaseui:firebase-ui-database:3.3.0' implementation 'com.google.firebase:firebase-database:12.0.1' implementation 'com.google.firebase:firebase-core:12.0.1' implementation 'com.google.firebase:firebase-crash:12.0.1' diff --git a/app/src/main/java/me/cutmail/disasterapp/activity/MainActivity.java b/app/src/main/java/me/cutmail/disasterapp/activity/MainActivity.java index ebc87f5..da0c424 100644 --- a/app/src/main/java/me/cutmail/disasterapp/activity/MainActivity.java +++ b/app/src/main/java/me/cutmail/disasterapp/activity/MainActivity.java @@ -16,8 +16,9 @@ import com.crashlytics.android.answers.Answers; import com.crashlytics.android.answers.CustomEvent; import com.firebase.ui.database.FirebaseListAdapter; -import com.google.firebase.database.DatabaseReference; +import com.firebase.ui.database.FirebaseListOptions; import com.google.firebase.database.FirebaseDatabase; +import com.google.firebase.database.Query; import butterknife.BindView; import butterknife.ButterKnife; @@ -49,12 +50,15 @@ protected void onCreate(Bundle savedInstanceState) { } @Override - protected void onDestroy() { - super.onDestroy(); + protected void onStart() { + super.onStart(); + adapter.startListening(); + } - if (adapter != null) { - adapter.cleanup(); - } + @Override + protected void onStop() { + super.onStop(); + adapter.stopListening(); } private void setupRateDialog() { @@ -85,10 +89,16 @@ public boolean onOptionsItemSelected(MenuItem item) { } private void setupLayout() { - DatabaseReference ref = FirebaseDatabase.getInstance().getReference("entries"); - adapter = new FirebaseListAdapter(this, Entry.class, android.R.layout.simple_list_item_1, ref) { - @Override - protected void populateView(View v, Entry entry, int position) { + Query query = FirebaseDatabase.getInstance() + .getReference("entries"); + + FirebaseListOptions options = new FirebaseListOptions.Builder() + .setQuery(query, Entry.class) + .setLayout(android.R.layout.simple_list_item_1) + .build(); + + adapter = new FirebaseListAdapter(options) { + @Override protected void populateView(View v, Entry entry, int position) { ((TextView) v.findViewById(android.R.id.text1)).setText(entry.getTitle()); } }; From 96cc8fa420909bcb05edae2e0df8cc35a0db12c7 Mon Sep 17 00:00:00 2001 From: cutmail Date: Thu, 5 Apr 2018 16:23:02 +0900 Subject: [PATCH 20/37] Fix Timber warning --- .../main/java/me/cutmail/disasterapp/DisasterApplication.java | 3 ++- .../java/me/cutmail/disasterapp/activity/MainActivity.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/me/cutmail/disasterapp/DisasterApplication.java b/app/src/main/java/me/cutmail/disasterapp/DisasterApplication.java index 3228e19..af177e6 100644 --- a/app/src/main/java/me/cutmail/disasterapp/DisasterApplication.java +++ b/app/src/main/java/me/cutmail/disasterapp/DisasterApplication.java @@ -1,6 +1,7 @@ package me.cutmail.disasterapp; import android.app.Application; +import android.support.annotation.NonNull; import android.util.Log; import com.crashlytics.android.Crashlytics; @@ -30,7 +31,7 @@ private void setupTimber() { private static class CrashReportingTree extends Timber.Tree { @Override - protected void log(int priority, String tag, String message, Throwable t) { + protected void log(int priority, String tag, @NonNull String message, Throwable t) { if (priority == Log.VERBOSE || priority == Log.DEBUG) { return; } diff --git a/app/src/main/java/me/cutmail/disasterapp/activity/MainActivity.java b/app/src/main/java/me/cutmail/disasterapp/activity/MainActivity.java index da0c424..fc5749e 100644 --- a/app/src/main/java/me/cutmail/disasterapp/activity/MainActivity.java +++ b/app/src/main/java/me/cutmail/disasterapp/activity/MainActivity.java @@ -121,7 +121,7 @@ private void openInquiry() { intent.putExtra(Intent.EXTRA_TEXT, "こちらにお問い合わせ内容をご記入ください。"); startActivity(intent); } catch (ActivityNotFoundException e) { - Timber.e(e, e.getMessage()); + Timber.e(e); } } @@ -133,7 +133,7 @@ private void openPlayStore() { Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); } catch (ActivityNotFoundException e) { - Timber.e(e, e.getMessage()); + Timber.e(e); } } From 5f685039dfd6f0efb5ae3bf5d767a4e4166af715 Mon Sep 17 00:00:00 2001 From: cutmail Date: Wed, 8 Aug 2018 15:00:15 +0900 Subject: [PATCH 21/37] Update Gradle plugins --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index fcee343..98391ac 100644 --- a/build.gradle +++ b/build.gradle @@ -9,10 +9,10 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.0' + classpath 'com.android.tools.build:gradle:3.1.4' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files - classpath 'com.google.gms:google-services:3.1.2' + classpath 'com.google.gms:google-services:4.0.1' } } From 47b06b09e65ed7aa6f1727ce4913c894081121fe Mon Sep 17 00:00:00 2001 From: cutmail Date: Wed, 8 Aug 2018 15:08:23 +0900 Subject: [PATCH 22/37] Update ButterKnife --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index f56d1ce..5e07e5d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -45,8 +45,8 @@ dependencies { implementation 'com.google.firebase:firebase-database:12.0.1' implementation 'com.google.firebase:firebase-core:12.0.1' implementation 'com.google.firebase:firebase-crash:12.0.1' - implementation 'com.jakewharton:butterknife:8.6.0' - annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0' + implementation 'com.jakewharton:butterknife:8.8.1' + annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1' } apply plugin: 'com.google.gms.google-services' \ No newline at end of file From cf494a4f04a6d45adac2b37f9c8dfb2625c94789 Mon Sep 17 00:00:00 2001 From: cutmail Date: Wed, 8 Aug 2018 15:55:29 +0900 Subject: [PATCH 23/37] Update fabric tools --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 5e07e5d..0eaaf51 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'io.fabric.tools:gradle:1.25.2' + classpath 'io.fabric.tools:gradle:1.25.4' } } apply plugin: 'com.android.application' From 2a9f27e9663d8c40d961509d9041d26781f49d97 Mon Sep 17 00:00:00 2001 From: cutmail Date: Wed, 8 Aug 2018 16:03:57 +0900 Subject: [PATCH 24/37] Update AppCompat and firebase --- app/build.gradle | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 5e07e5d..f7d01c2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -38,13 +38,13 @@ dependencies { implementation('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') { transitive = true } - implementation 'com.android.support:appcompat-v7:27.1.0' + implementation 'com.android.support:appcompat-v7:27.1.1' implementation 'com.jakewharton.timber:timber:4.7.0' implementation 'com.github.hotchemi:android-rate:1.0.1' implementation 'com.firebaseui:firebase-ui-database:3.3.0' - implementation 'com.google.firebase:firebase-database:12.0.1' - implementation 'com.google.firebase:firebase-core:12.0.1' - implementation 'com.google.firebase:firebase-crash:12.0.1' + implementation 'com.google.firebase:firebase-database:16.0.1' + implementation 'com.google.firebase:firebase-core:16.0.1' + implementation 'com.google.firebase:firebase-crash:16.0.1' implementation 'com.jakewharton:butterknife:8.8.1' annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1' } From cd01b6dde85abdd498693ecfda15147d4424da85 Mon Sep 17 00:00:00 2001 From: cutmail Date: Wed, 8 Aug 2018 16:07:29 +0900 Subject: [PATCH 25/37] Change minSdkVersion to 16 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index f7d01c2..5782249 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -22,7 +22,7 @@ android { defaultConfig { applicationId "me.cutmail.disasterapp" - minSdkVersion 14 + minSdkVersion 16 targetSdkVersion 27 versionCode 17 versionName "1.7.0" From 3c437cf199bc24aea2b7343c84ee74173e33fa7a Mon Sep 17 00:00:00 2001 From: cutmail Date: Wed, 8 Aug 2018 16:18:25 +0900 Subject: [PATCH 26/37] Update Timber --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 9d1b882..b9cebe8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -39,7 +39,7 @@ dependencies { transitive = true } implementation 'com.android.support:appcompat-v7:27.1.1' - implementation 'com.jakewharton.timber:timber:4.7.0' + implementation 'com.jakewharton.timber:timber:4.7.1' implementation 'com.github.hotchemi:android-rate:1.0.1' implementation 'com.firebaseui:firebase-ui-database:3.3.0' implementation 'com.google.firebase:firebase-database:16.0.1' From 21e30f9783a71d7ffa97972f088fcfd586d4eb3c Mon Sep 17 00:00:00 2001 From: cutmail Date: Thu, 7 Feb 2019 00:01:11 +0900 Subject: [PATCH 27/37] =?UTF-8?q?=E4=B8=80=E6=97=A6=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=82=8B=E3=81=A8=E3=81=93=E3=82=8D=E3=81=BE?= =?UTF-8?q?=E3=81=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 27 ++-- .../disasterapp/DisasterApplication.java | 2 +- .../disasterapp/activity/AboutActivity.java | 4 +- .../activity/EntryDetailActivity.java | 4 +- .../disasterapp/activity/MainActivity.java | 119 ++++++++++++------ app/src/main/res/layout/activity_main.xml | 32 ++++- build.gradle | 5 +- gradle.properties | 4 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 9 files changed, 134 insertions(+), 65 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 9d1b882..0733117 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'io.fabric.tools:gradle:1.25.4' + classpath 'io.fabric.tools:gradle:1.27.1' } } apply plugin: 'com.android.application' @@ -17,13 +17,13 @@ repositories { } android { - compileSdkVersion 27 - buildToolsVersion '27.0.3' + compileSdkVersion 28 + buildToolsVersion '28.0.3' defaultConfig { applicationId "me.cutmail.disasterapp" - minSdkVersion 16 - targetSdkVersion 27 + minSdkVersion 26 + targetSdkVersion 28 versionCode 17 versionName "1.7.0" } @@ -38,15 +38,16 @@ dependencies { implementation('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') { transitive = true } - implementation 'com.android.support:appcompat-v7:27.1.1' - implementation 'com.jakewharton.timber:timber:4.7.0' + implementation 'androidx.appcompat:appcompat:1.0.2' + implementation 'androidx.paging:paging-runtime:2.1.0' + implementation 'com.jakewharton.timber:timber:4.7.1' implementation 'com.github.hotchemi:android-rate:1.0.1' - implementation 'com.firebaseui:firebase-ui-database:3.3.0' - implementation 'com.google.firebase:firebase-database:16.0.1' - implementation 'com.google.firebase:firebase-core:16.0.1' - implementation 'com.google.firebase:firebase-crash:16.0.1' - implementation 'com.jakewharton:butterknife:8.8.1' - annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1' + implementation 'com.firebaseui:firebase-ui-firestore:4.3.1' + implementation 'com.google.firebase:firebase-database:16.0.6' + implementation 'com.google.firebase:firebase-core:16.0.6' + implementation 'com.google.firebase:firebase-crash:16.2.1' + implementation 'com.jakewharton:butterknife:10.0.0' + annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0' } apply plugin: 'com.google.gms.google-services' \ No newline at end of file diff --git a/app/src/main/java/me/cutmail/disasterapp/DisasterApplication.java b/app/src/main/java/me/cutmail/disasterapp/DisasterApplication.java index af177e6..ac085ee 100644 --- a/app/src/main/java/me/cutmail/disasterapp/DisasterApplication.java +++ b/app/src/main/java/me/cutmail/disasterapp/DisasterApplication.java @@ -1,13 +1,13 @@ package me.cutmail.disasterapp; import android.app.Application; -import android.support.annotation.NonNull; import android.util.Log; import com.crashlytics.android.Crashlytics; import com.google.firebase.crash.FirebaseCrash; import com.google.firebase.database.FirebaseDatabase; +import androidx.annotation.NonNull; import timber.log.Timber; public class DisasterApplication extends Application { diff --git a/app/src/main/java/me/cutmail/disasterapp/activity/AboutActivity.java b/app/src/main/java/me/cutmail/disasterapp/activity/AboutActivity.java index d258442..63581f4 100644 --- a/app/src/main/java/me/cutmail/disasterapp/activity/AboutActivity.java +++ b/app/src/main/java/me/cutmail/disasterapp/activity/AboutActivity.java @@ -2,8 +2,8 @@ import android.content.pm.PackageManager; import android.os.Bundle; -import android.support.v7.app.ActionBar; -import android.support.v7.app.AppCompatActivity; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; import android.view.MenuItem; import android.widget.TextView; diff --git a/app/src/main/java/me/cutmail/disasterapp/activity/EntryDetailActivity.java b/app/src/main/java/me/cutmail/disasterapp/activity/EntryDetailActivity.java index 344510f..20ba3db 100644 --- a/app/src/main/java/me/cutmail/disasterapp/activity/EntryDetailActivity.java +++ b/app/src/main/java/me/cutmail/disasterapp/activity/EntryDetailActivity.java @@ -5,8 +5,8 @@ import android.content.Intent; import android.net.Uri; import android.os.Bundle; -import android.support.v7.app.ActionBar; -import android.support.v7.app.AppCompatActivity; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; import android.text.TextUtils; import android.view.Menu; import android.view.MenuItem; diff --git a/app/src/main/java/me/cutmail/disasterapp/activity/MainActivity.java b/app/src/main/java/me/cutmail/disasterapp/activity/MainActivity.java index fc5749e..29b1a86 100644 --- a/app/src/main/java/me/cutmail/disasterapp/activity/MainActivity.java +++ b/app/src/main/java/me/cutmail/disasterapp/activity/MainActivity.java @@ -4,22 +4,27 @@ import android.content.Intent; import android.net.Uri; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; +import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; -import android.widget.AdapterView; -import android.widget.ListView; +import android.view.ViewGroup; import android.widget.TextView; import com.crashlytics.android.Crashlytics; import com.crashlytics.android.answers.Answers; import com.crashlytics.android.answers.CustomEvent; -import com.firebase.ui.database.FirebaseListAdapter; -import com.firebase.ui.database.FirebaseListOptions; -import com.google.firebase.database.FirebaseDatabase; -import com.google.firebase.database.Query; - +import com.firebase.ui.firestore.paging.FirestorePagingAdapter; +import com.firebase.ui.firestore.paging.FirestorePagingOptions; +import com.google.firebase.firestore.CollectionReference; +import com.google.firebase.firestore.FirebaseFirestore; +import com.google.firebase.firestore.Query; + +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; +import androidx.paging.PagedList; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; import butterknife.BindView; import butterknife.ButterKnife; import hotchemi.android.rate.AppRate; @@ -29,18 +34,23 @@ import timber.log.Timber; -public class MainActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { +public class MainActivity extends AppCompatActivity { - @BindView(R.id.listView) - ListView listView; + @BindView(R.id.paging_recycler) + RecyclerView recyclerView; - private FirebaseListAdapter adapter; + private FirebaseFirestore firestore; + private CollectionReference collectionReference; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ButterKnife.bind(this); + + firestore = FirebaseFirestore.getInstance(); + collectionReference = firestore.collection("entries"); + setupLayout(); Fabric.with(this, new Crashlytics()); @@ -49,18 +59,6 @@ protected void onCreate(Bundle savedInstanceState) { AppRate.showRateDialogIfMeetsConditions(this); } - @Override - protected void onStart() { - super.onStart(); - adapter.startListening(); - } - - @Override - protected void onStop() { - super.onStop(); - adapter.stopListening(); - } - private void setupRateDialog() { AppRate.with(this).monitor(); } @@ -89,21 +87,47 @@ public boolean onOptionsItemSelected(MenuItem item) { } private void setupLayout() { - Query query = FirebaseDatabase.getInstance() - .getReference("entries"); + Query query = collectionReference.orderBy("title"); + + PagedList.Config config = new PagedList.Config.Builder() + .setEnablePlaceholders(false) + .setPrefetchDistance(10) + .setPageSize(20) + .build(); - FirebaseListOptions options = new FirebaseListOptions.Builder() - .setQuery(query, Entry.class) - .setLayout(android.R.layout.simple_list_item_1) + FirestorePagingOptions options = new FirestorePagingOptions.Builder() + .setLifecycleOwner(this) + .setQuery(query, config, Entry.class) .build(); - adapter = new FirebaseListAdapter(options) { - @Override protected void populateView(View v, Entry entry, int position) { - ((TextView) v.findViewById(android.R.id.text1)).setText(entry.getTitle()); + FirestorePagingAdapter adapter = new FirestorePagingAdapter(options) { + @Override protected void onBindViewHolder(@NonNull ItemViewHolder holder, int position, @NonNull Entry entry) { + holder.bind(entry); + } + + @NonNull @Override public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()) + .inflate(android.R.layout.simple_list_item_1, parent, false); + return new ItemViewHolder(view); } }; - listView.setAdapter(adapter); - listView.setOnItemClickListener(this); + + recyclerView.setLayoutManager(new LinearLayoutManager(this)); + recyclerView.setAdapter(adapter); + +// +// FirebaseListOptions options = new FirebaseListOptions.Builder() +// .setQuery(query, Entry.class) +// .setLayout(android.R.layout.simple_list_item_1) +// .build(); +// +// adapter = new FirebaseListAdapter(options) { +// @Override protected void populateView(View v, Entry entry, int position) { +// ((TextView) v.findViewById(android.R.id.text1)).setText(entry.getTitle()); +// } +// }; +// listView.setAdapter(adapter); +// listView.setOnItemClickListener(this); } private void openAbout() { @@ -137,12 +161,27 @@ private void openPlayStore() { } } - @Override - public void onItemClick(AdapterView parent, View view, int position, long id) { - if (adapter != null) { - Entry entry = adapter.getItem(position); - Intent intent = EntryDetailActivity.createIntent(this, entry.getTitle(), entry.getUrl()); - startActivity(intent); +// @Override +// public void onItemClick(AdapterView parent, View view, int position, long id) { +// if (adapter != null) { +// Entry entry = adapter.getItem(position); +// Intent intent = EntryDetailActivity.createIntent(this, entry.getTitle(), entry.getUrl()); +// startActivity(intent); +// } +// } + + public static class ItemViewHolder extends RecyclerView.ViewHolder { + + @BindView(android.R.id.text1) + TextView mTextView; + + ItemViewHolder(View itemView) { + super(itemView); + ButterKnife.bind(this, itemView); + } + + void bind(Entry entry) { + mTextView.setText(entry.getTitle()); } } } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 825ab43..dc892a3 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,4 +1,30 @@ - + + android:layout_height="match_parent" + tools:context="me.cutmail.disasterapp.activity.MainActivity"> + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle index 98391ac..68ebd39 100644 --- a/build.gradle +++ b/build.gradle @@ -9,15 +9,16 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.4' + classpath 'com.android.tools.build:gradle:3.2.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files - classpath 'com.google.gms:google-services:4.0.1' + classpath 'com.google.gms:google-services:4.2.0' } } allprojects { repositories { jcenter() + google() } } diff --git a/gradle.properties b/gradle.properties index 1d3591c..915f0e6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,4 +15,6 @@ # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true \ No newline at end of file +# org.gradle.parallel=true +android.enableJetifier=true +android.useAndroidX=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index eeaefd3..f9ef170 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip From 00dbc409eb40d982d7d8fb8058469cd1ab2e54d5 Mon Sep 17 00:00:00 2001 From: cutmail Date: Thu, 7 Feb 2019 00:42:13 +0900 Subject: [PATCH 28/37] Add click listener --- .../disasterapp/activity/MainActivity.java | 58 ++++++++++--------- app/src/main/res/layout/activity_main.xml | 7 +-- app/src/main/res/layout/entry_list_item.xml | 20 +++++++ 3 files changed, 53 insertions(+), 32 deletions(-) create mode 100644 app/src/main/res/layout/entry_list_item.xml diff --git a/app/src/main/java/me/cutmail/disasterapp/activity/MainActivity.java b/app/src/main/java/me/cutmail/disasterapp/activity/MainActivity.java index 29b1a86..c5bb54a 100644 --- a/app/src/main/java/me/cutmail/disasterapp/activity/MainActivity.java +++ b/app/src/main/java/me/cutmail/disasterapp/activity/MainActivity.java @@ -23,6 +23,7 @@ import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.paging.PagedList; +import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import butterknife.BindView; @@ -107,27 +108,24 @@ private void setupLayout() { @NonNull @Override public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) - .inflate(android.R.layout.simple_list_item_1, parent, false); - return new ItemViewHolder(view); + .inflate(R.layout.entry_list_item, parent, false); + return new ItemViewHolder(view, new ItemViewHolder.OnEntryClickListener() { + @Override public void onItemClick(Entry entry) { + openEntry(entry); + } + }); } }; recyclerView.setLayoutManager(new LinearLayoutManager(this)); recyclerView.setAdapter(adapter); + DividerItemDecoration itemDecoration = new DividerItemDecoration(recyclerView.getContext(), new LinearLayoutManager(this).getOrientation()); + recyclerView.addItemDecoration(itemDecoration); + } -// -// FirebaseListOptions options = new FirebaseListOptions.Builder() -// .setQuery(query, Entry.class) -// .setLayout(android.R.layout.simple_list_item_1) -// .build(); -// -// adapter = new FirebaseListAdapter(options) { -// @Override protected void populateView(View v, Entry entry, int position) { -// ((TextView) v.findViewById(android.R.id.text1)).setText(entry.getTitle()); -// } -// }; -// listView.setAdapter(adapter); -// listView.setOnItemClickListener(this); + public void openEntry(Entry entry) { + Intent intent = EntryDetailActivity.createIntent(this, entry.getTitle(), entry.getUrl()); + startActivity(intent); } private void openAbout() { @@ -161,27 +159,33 @@ private void openPlayStore() { } } -// @Override -// public void onItemClick(AdapterView parent, View view, int position, long id) { -// if (adapter != null) { -// Entry entry = adapter.getItem(position); -// Intent intent = EntryDetailActivity.createIntent(this, entry.getTitle(), entry.getUrl()); -// startActivity(intent); -// } -// } + static class ItemViewHolder extends RecyclerView.ViewHolder { + + public interface OnEntryClickListener { + void onItemClick(Entry entry); + } - public static class ItemViewHolder extends RecyclerView.ViewHolder { + @BindView(R.id.container) + View mView; - @BindView(android.R.id.text1) + @BindView(R.id.title) TextView mTextView; - ItemViewHolder(View itemView) { + private final OnEntryClickListener listener; + + ItemViewHolder(View itemView, OnEntryClickListener listener) { super(itemView); + this.listener = listener; ButterKnife.bind(this, itemView); } - void bind(Entry entry) { + void bind(final Entry entry) { mTextView.setText(entry.getTitle()); + mView.setOnClickListener(new View.OnClickListener() { + @Override public void onClick(View v) { + listener.onItemClick(entry); + } + }); } } } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index dc892a3..67d5e1f 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -11,7 +11,7 @@ style="?android:attr/progressBarStyleHorizontal" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginTop="-6dp" + android:layout_marginTop="-8dp" android:background="@android:color/transparent" android:indeterminate="true" tools:ignore="NegativeMargin" /> @@ -21,10 +21,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/paging_loading" - android:paddingLeft="16dp" - android:paddingRight="16dp" - android:paddingTop="8dp" android:clipToPadding="false" - tools:listitem="@android:layout/simple_list_item_1" /> + tools:listitem="@layout/entry_list_item" /> \ No newline at end of file diff --git a/app/src/main/res/layout/entry_list_item.xml b/app/src/main/res/layout/entry_list_item.xml new file mode 100644 index 0000000..0b7e15f --- /dev/null +++ b/app/src/main/res/layout/entry_list_item.xml @@ -0,0 +1,20 @@ + + + + + + \ No newline at end of file From c82ddc67581382f0c12f2615e8cb74752d256535 Mon Sep 17 00:00:00 2001 From: cutmail Date: Thu, 7 Feb 2019 00:47:28 +0900 Subject: [PATCH 29/37] =?UTF-8?q?https=E3=81=AE=E3=82=B5=E3=82=A4=E3=83=88?= =?UTF-8?q?=E3=81=8C=E8=A6=8B=E3=82=8C=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index f905fba..6073689 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -16,7 +16,8 @@ android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" - android:theme="@style/AppTheme"> + android:theme="@style/AppTheme" + android:usesCleartextTraffic="true"> From fd7c3ac08122bc0b2f7147d23e6a988275c6a941 Mon Sep 17 00:00:00 2001 From: cutmail Date: Tue, 19 Feb 2019 14:48:18 +0900 Subject: [PATCH 30/37] Update gradle --- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 68ebd39..8e9bfc6 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.2.1' + classpath 'com.android.tools.build:gradle:3.4.0-beta04' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files classpath 'com.google.gms:google-services:4.2.0' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f9ef170..edec7c2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Apr 04 14:34:02 JST 2018 +#Tue Feb 19 14:47:56 JST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip From a03fe11f8263b4856ccbcdc32a54459d1f9c529a Mon Sep 17 00:00:00 2001 From: cutmail Date: Tue, 19 Feb 2019 14:56:23 +0900 Subject: [PATCH 31/37] Update libraries --- app/build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 0733117..379b3ab 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -35,16 +35,16 @@ android { } dependencies { - implementation('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') { + implementation('com.crashlytics.sdk.android:crashlytics:2.9.9@aar') { transitive = true } - implementation 'androidx.appcompat:appcompat:1.0.2' + implementation 'androidx.appcompat:appcompat:1.1.0-alpha02' implementation 'androidx.paging:paging-runtime:2.1.0' implementation 'com.jakewharton.timber:timber:4.7.1' implementation 'com.github.hotchemi:android-rate:1.0.1' implementation 'com.firebaseui:firebase-ui-firestore:4.3.1' implementation 'com.google.firebase:firebase-database:16.0.6' - implementation 'com.google.firebase:firebase-core:16.0.6' + implementation 'com.google.firebase:firebase-core:16.0.7' implementation 'com.google.firebase:firebase-crash:16.2.1' implementation 'com.jakewharton:butterknife:10.0.0' annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0' From 6ee4e1f58f606c4befd3bdc4ccf009b43b00ec78 Mon Sep 17 00:00:00 2001 From: cutmail Date: Tue, 19 Feb 2019 15:01:38 +0900 Subject: [PATCH 32/37] =?UTF-8?q?Entry=E3=82=92=E5=BC=95=E6=95=B0=E3=81=A7?= =?UTF-8?q?=E6=B8=A1=E3=81=95=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cutmail/disasterapp/activity/MainActivity.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/me/cutmail/disasterapp/activity/MainActivity.java b/app/src/main/java/me/cutmail/disasterapp/activity/MainActivity.java index c5bb54a..ded608a 100644 --- a/app/src/main/java/me/cutmail/disasterapp/activity/MainActivity.java +++ b/app/src/main/java/me/cutmail/disasterapp/activity/MainActivity.java @@ -110,8 +110,8 @@ private void setupLayout() { View view = LayoutInflater.from(parent.getContext()) .inflate(R.layout.entry_list_item, parent, false); return new ItemViewHolder(view, new ItemViewHolder.OnEntryClickListener() { - @Override public void onItemClick(Entry entry) { - openEntry(entry); + @Override public void onItemClick(String title, String url) { + openEntry(title, url); } }); } @@ -123,8 +123,8 @@ private void setupLayout() { recyclerView.addItemDecoration(itemDecoration); } - public void openEntry(Entry entry) { - Intent intent = EntryDetailActivity.createIntent(this, entry.getTitle(), entry.getUrl()); + public void openEntry(String title, String url) { + Intent intent = EntryDetailActivity.createIntent(this, title, url); startActivity(intent); } @@ -162,7 +162,7 @@ private void openPlayStore() { static class ItemViewHolder extends RecyclerView.ViewHolder { public interface OnEntryClickListener { - void onItemClick(Entry entry); + void onItemClick(String title, String url); } @BindView(R.id.container) @@ -183,7 +183,7 @@ void bind(final Entry entry) { mTextView.setText(entry.getTitle()); mView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - listener.onItemClick(entry); + listener.onItemClick(entry.getTitle(), entry.getUrl()); } }); } From d9b871998999cc58754e38b85bc2037d18d8a072 Mon Sep 17 00:00:00 2001 From: cutmail Date: Tue, 19 Feb 2019 15:15:45 +0900 Subject: [PATCH 33/37] Bind ProgressBar --- .../disasterapp/activity/MainActivity.java | 22 +++++++++++++++++++ app/src/main/res/layout/activity_main.xml | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/me/cutmail/disasterapp/activity/MainActivity.java b/app/src/main/java/me/cutmail/disasterapp/activity/MainActivity.java index ded608a..aafb830 100644 --- a/app/src/main/java/me/cutmail/disasterapp/activity/MainActivity.java +++ b/app/src/main/java/me/cutmail/disasterapp/activity/MainActivity.java @@ -9,6 +9,7 @@ import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; +import android.widget.ProgressBar; import android.widget.TextView; import com.crashlytics.android.Crashlytics; @@ -16,6 +17,7 @@ import com.crashlytics.android.answers.CustomEvent; import com.firebase.ui.firestore.paging.FirestorePagingAdapter; import com.firebase.ui.firestore.paging.FirestorePagingOptions; +import com.firebase.ui.firestore.paging.LoadingState; import com.google.firebase.firestore.CollectionReference; import com.google.firebase.firestore.FirebaseFirestore; import com.google.firebase.firestore.Query; @@ -40,6 +42,9 @@ public class MainActivity extends AppCompatActivity { @BindView(R.id.paging_recycler) RecyclerView recyclerView; + @BindView(R.id.paging_loading) + ProgressBar progressBar; + private FirebaseFirestore firestore; private CollectionReference collectionReference; @@ -115,6 +120,23 @@ private void setupLayout() { } }); } + + @Override protected void onLoadingStateChanged(@NonNull LoadingState state) { + switch (state) { + case LOADING_INITIAL: + case LOADING_MORE: + progressBar.setVisibility(View.VISIBLE); + break; + case LOADED: + progressBar.setVisibility(View.GONE); + break; + case FINISHED: + progressBar.setVisibility(View.GONE); + break; + case ERROR: + break; + } + } }; recyclerView.setLayoutManager(new LinearLayoutManager(this)); diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 67d5e1f..4c4c2e5 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -11,7 +11,7 @@ style="?android:attr/progressBarStyleHorizontal" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginTop="-8dp" + android:layout_marginTop="-6dp" android:background="@android:color/transparent" android:indeterminate="true" tools:ignore="NegativeMargin" /> From 8a00a7f0e1f7d8970cbef365ebcfdd3506d1662c Mon Sep 17 00:00:00 2001 From: cutmail Date: Wed, 20 Feb 2019 11:53:44 +0900 Subject: [PATCH 34/37] =?UTF-8?q?Firebase=E3=81=AEADID=E5=8F=8E=E9=9B=86?= =?UTF-8?q?=E3=82=92=E7=84=A1=E5=8A=B9=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 6073689..428a1d3 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -35,6 +35,7 @@ + From 9f051222854b046d1d14e80a081a6fe63ab07109 Mon Sep 17 00:00:00 2001 From: cutmail Date: Wed, 20 Feb 2019 12:04:42 +0900 Subject: [PATCH 35/37] Move to Crashlytics from Firebase CrashReporting --- .../main/java/me/cutmail/disasterapp/DisasterApplication.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/me/cutmail/disasterapp/DisasterApplication.java b/app/src/main/java/me/cutmail/disasterapp/DisasterApplication.java index ac085ee..d9e73f3 100644 --- a/app/src/main/java/me/cutmail/disasterapp/DisasterApplication.java +++ b/app/src/main/java/me/cutmail/disasterapp/DisasterApplication.java @@ -4,7 +4,6 @@ import android.util.Log; import com.crashlytics.android.Crashlytics; -import com.google.firebase.crash.FirebaseCrash; import com.google.firebase.database.FirebaseDatabase; import androidx.annotation.NonNull; @@ -40,7 +39,7 @@ protected void log(int priority, String tag, @NonNull String message, Throwable if (t != null) { Crashlytics.getInstance().core.logException(t); - FirebaseCrash.report(t); + Crashlytics.logException(t); } } } From 707d309eeab577c9cf2f6bbdbae109a2a3647e09 Mon Sep 17 00:00:00 2001 From: cutmail Date: Wed, 20 Feb 2019 12:06:09 +0900 Subject: [PATCH 36/37] Remove Firebase Crash --- app/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 379b3ab..ef8e3a1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -45,7 +45,6 @@ dependencies { implementation 'com.firebaseui:firebase-ui-firestore:4.3.1' implementation 'com.google.firebase:firebase-database:16.0.6' implementation 'com.google.firebase:firebase-core:16.0.7' - implementation 'com.google.firebase:firebase-crash:16.2.1' implementation 'com.jakewharton:butterknife:10.0.0' annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0' } From 734c62e846516c9b78e130287d5ce37331e505f0 Mon Sep 17 00:00:00 2001 From: cutmail Date: Wed, 20 Feb 2019 12:29:10 +0900 Subject: [PATCH 37/37] Bump up 1.8.0 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index ef8e3a1..5d61c3a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -24,8 +24,8 @@ android { applicationId "me.cutmail.disasterapp" minSdkVersion 26 targetSdkVersion 28 - versionCode 17 - versionName "1.7.0" + versionCode 18 + versionName "1.8.0" } buildTypes { release {