Skip to content
This repository has been archived by the owner on Sep 8, 2019. It is now read-only.

Commit

Permalink
- v1.7.2 Beta update
Browse files Browse the repository at this point in the history
  • Loading branch information
kollerlukas committed Sep 23, 2017
1 parent 440b964 commit 5b478d6
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 25 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "us.koller.cameraroll"
minSdkVersion 19
targetSdkVersion 26
versionCode 28
versionName "v1.7.1 Beta"
versionCode 29
versionName "v1.7.2 Beta"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
3 changes: 3 additions & 0 deletions app/src/main/java/us/koller/cameraroll/ui/ItemActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,9 @@ public void onReceive(Context context, Intent intent) {
final Activity activity = ItemActivity.this;

String newFilePath = intent.getStringExtra(Rename.NEW_FILE_PATH);
if (newFilePath == null) {
return;
}
int index = newFilePath.lastIndexOf("/");
final String albumPath = newFilePath.substring(0, index);
getIntent().putExtra(ALBUM_PATH, albumPath);
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/java/us/koller/cameraroll/ui/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import android.os.Handler;
import android.provider.MediaStore;
import android.support.annotation.RequiresApi;
import android.support.design.widget.BaseTransientBottomBar;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v4.app.ActivityOptionsCompat;
Expand All @@ -32,10 +31,8 @@
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.WindowInsets;
import android.view.accessibility.AccessibilityManager;
import android.widget.Toast;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -625,12 +622,15 @@ private void resortAlbums() {
AsyncTask.execute(new Runnable() {
@Override
public void run() {
SortUtil.sortAlbums(MainActivity.this, MediaProvider.getAlbums());
//SortUtil.sortAlbums(MainActivity.this, MediaProvider.getAlbums());
final ArrayList<Album> albums = MediaProvider.getAlbumsWithVirtualDirectories(MainActivity.this);
MainActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
snackbar.dismiss();
MainActivity.this.albums = albums;
((RecyclerViewAdapter) recyclerView.getAdapter()).setAlbums(albums);
recyclerView.getAdapter().notifyDataSetChanged();
snackbar.dismiss();
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,12 @@ public boolean onDependentViewChanged(CoordinatorLayout parent, FloatingActionBu
}
return true;
}

@Override
public void onDependentViewRemoved(CoordinatorLayout parent, FloatingActionButton fab, View dependency) {
super.onDependentViewRemoved(parent, fab, dependency);
if (Util.SNACKBAR.equals(dependency.getTag()) && fabTranslationY != -1) {
fab.animate().translationY(fabTranslationY).start();
}
}
}
18 changes: 0 additions & 18 deletions app/src/main/java/us/koller/cameraroll/util/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,21 @@
import android.os.Build;
import android.os.PowerManager;
import android.support.annotation.RequiresApi;
import android.support.design.widget.BaseTransientBottomBar;
import android.support.design.widget.Snackbar;
import android.support.media.ExifInterface;
import android.support.v4.content.res.ResourcesCompat;
import android.support.v4.graphics.drawable.DrawableCompat;
import android.support.v7.content.res.AppCompatResources;
import android.support.v7.widget.Toolbar;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.View;
import android.view.accessibility.AccessibilityManager;
import android.widget.TextView;
import android.widget.Toast;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.util.Locale;

import us.koller.cameraroll.R;
Expand Down Expand Up @@ -155,20 +151,6 @@ public static boolean areStatusBarIconsDark(final View v) {

public static void showSnackbar(Snackbar snackbar) {
snackbar.getView().setTag(SNACKBAR);
// fixing SnackBar animation, when AccessibilityManager is enabled
// Solution from: https://stackoverflow.com/a/43811447/8378871
try {
Field mAccessibilityManagerField = BaseTransientBottomBar.class.getDeclaredField("mAccessibilityManager");
mAccessibilityManagerField.setAccessible(true);
AccessibilityManager accessibilityManager = (AccessibilityManager) mAccessibilityManagerField.get(snackbar);
Field mIsEnabledField = AccessibilityManager.class.getDeclaredField("mIsEnabled");
mIsEnabledField.setAccessible(true);
mIsEnabledField.setBoolean(accessibilityManager, false);
mAccessibilityManagerField.set(snackbar, accessibilityManager);
} catch (Exception e) {
Log.d("Snackbar", "Reflection error: " + e.toString());
}

TextView textView = snackbar.getView()
.findViewById(android.support.design.R.id.snackbar_text);
textView.setTypeface(Typeface.create("sans-serif-monospace", Typeface.NORMAL));
Expand Down

0 comments on commit 5b478d6

Please sign in to comment.