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

Commit

Permalink
- fixed album pinning when sorting by name
Browse files Browse the repository at this point in the history
  • Loading branch information
kollerlukas committed Oct 1, 2017
1 parent 6c0c13a commit 19feb10
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 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 30
versionName "v1.0"
versionCode 31
versionName "v1.0.1"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,8 @@ private static void scanPaths(final Context context, final String[] paths, final
@Override
public void onScanCompleted(String path, Uri uri) {
if (uri == null) {
Log.i("FileOperation", "MediaScannerConnection.scanFile() !FAILED! path = [" + path + "]");
if (new File(path).exists()) {
Log.i("FileOperation", "MediaScannerConnection.scanFile() !FAILED! path = [" + path + "]");
AlbumItem albumItem = AlbumItem.getInstance(path);
ContentValues values = new ContentValues();
if (albumItem instanceof Video) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,16 @@ private String getChunk(String s, int slength, int marker) {
}

public int compare(SortUtil.Sortable sortable1, SortUtil.Sortable sortable2) {
String name1 = sortable1.getName(), name2 = sortable2.getName();
if ((name1 == null) || (name2 == null)) {
if ((sortable1 == null) || (sortable2 == null)) {
return 0;
}

if (sortable1.pinned() ^ sortable2.pinned()) {
return sortable2.pinned() ? 1 : -1;
}

String name1 = sortable1.getName(), name2 = sortable2.getName();

int thisMarker = 0;
int thatMarker = 0;
int s1Length = name1.length();
Expand Down

0 comments on commit 19feb10

Please sign in to comment.