From cb3857f02e942e8e46a8db9978ca3fc62f709f1d Mon Sep 17 00:00:00 2001 From: kollerlukas Date: Sun, 5 Feb 2017 23:33:16 -0800 Subject: [PATCH] - Bug fixes --- app/build.gradle | 2 +- .../us/koller/cameraroll/data/MediaLoader/MediaLoader.java | 6 +----- .../main/java/us/koller/cameraroll/ui/AboutActivity.java | 7 +++++++ .../main/java/us/koller/cameraroll/ui/MainActivity.java | 1 - 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 61b69743..12249cd2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,7 +7,7 @@ android { applicationId "us.koller.cameraroll" minSdkVersion 21 targetSdkVersion 25 - versionCode 8 + versionCode 9 versionName "v1.0 Beta" renderscriptTargetApi 25 renderscriptSupportModeEnabled true diff --git a/app/src/main/java/us/koller/cameraroll/data/MediaLoader/MediaLoader.java b/app/src/main/java/us/koller/cameraroll/data/MediaLoader/MediaLoader.java index 137ef0f0..8f98f823 100644 --- a/app/src/main/java/us/koller/cameraroll/data/MediaLoader/MediaLoader.java +++ b/app/src/main/java/us/koller/cameraroll/data/MediaLoader/MediaLoader.java @@ -41,8 +41,6 @@ public interface Callback { public static final String FILE_TYPE_NO_MEDIA = ".nomedia"; public static final int PERMISSION_REQUEST_CODE = 16; - private static int mode = -1; - private Loader loader; public MediaLoader() { @@ -94,9 +92,7 @@ public void onDestroy() { } public static void toggleMode(Context context) { - if (mode == -1) { - mode = getMode(context); - } + int mode = getMode(context); int newMode = mode == MODE_STORAGE ? MODE_MEDIASTORE : MODE_STORAGE; diff --git a/app/src/main/java/us/koller/cameraroll/ui/AboutActivity.java b/app/src/main/java/us/koller/cameraroll/ui/AboutActivity.java index 4031e9b9..46e381e7 100644 --- a/app/src/main/java/us/koller/cameraroll/ui/AboutActivity.java +++ b/app/src/main/java/us/koller/cameraroll/ui/AboutActivity.java @@ -181,6 +181,13 @@ public void run() { @Override public void onSwipeFinish(int dir) { + if (handler != null && runnable != null) { + handler.removeCallbacks(runnable); + consumed = false; + } + handler = null; + runnable = null; + getWindow().setReturnTransition(new TransitionSet() .addTransition(new Slide(dir > 0 ? Gravity.TOP : Gravity.BOTTOM)) .setInterpolator(new AccelerateDecelerateInterpolator())); diff --git a/app/src/main/java/us/koller/cameraroll/ui/MainActivity.java b/app/src/main/java/us/koller/cameraroll/ui/MainActivity.java index 82fa13a6..041faf61 100644 --- a/app/src/main/java/us/koller/cameraroll/ui/MainActivity.java +++ b/app/src/main/java/us/koller/cameraroll/ui/MainActivity.java @@ -15,7 +15,6 @@ import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; -import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View;