Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Commit

Permalink
v0.8.6
Browse files Browse the repository at this point in the history
==================
* Revert compileSdkVersion to 28, using 29 causes issues.

There are more issues related to the move from API 28 to API 29 which need to be addressed before this API level can be used for compilation. Work has begun.

* Re-enable the core metadata extractor library as it's been updated to 2.13.0 now.
* Use updated Liz libary.
  • Loading branch information
apcro committed Mar 22, 2020
1 parent 873026d commit d771427
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 28 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
v0.8.6
==================
* Revert compileSdkVersion to 28, using 29 causes issues.

There are more issues related to the move from API 28 to API 29 which need to be addressed before this API level can be used for compilation. Work has begun.

* Re-enable the core metadata extractor library as it's been updated to 2.13.0 now.
* Use updated Liz libary.

v0.8.5
==================
* Update library versions to latest
Expand Down
14 changes: 7 additions & 7 deletions leafpicrevived/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

android {
compileSdkVersion 29
compileSdkVersion 28
defaultConfig {
applicationId "com.alienpants.leafpicrevived"
minSdkVersion 21
targetSdkVersion 29
versionName "v0.8.5"
versionCode 23
targetSdkVersion 28
versionName "v0.8.6"
versionCode 24
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
Expand Down Expand Up @@ -96,8 +96,8 @@ dependencies {
implementation "io.noties.markwon:core:4.2.0"
implementation 'com.jakewharton:butterknife:10.2.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.0'
// implementation 'com.drewnoakes:metadata-extractor:2.12.0'
implementation 'com.github.apcro:metadata-extractor:master'
implementation 'com.drewnoakes:metadata-extractor:2.13.0'
// implementation 'com.github.apcro:metadata-extractor:master'
implementation "com.orhanobut:hawk:2.0.1"
implementation 'com.commonsware.cwac:provider:0.5.3'

Expand Down Expand Up @@ -129,7 +129,7 @@ dependencies {
implementation 'com.android.support:multidex:1.0.3'

dependencies {
implementation 'com.github.apcro:Liz:0.6.0'
implementation 'com.github.apcro:Liz:0.6.1'
}
}

Expand Down
2 changes: 2 additions & 0 deletions leafpicrevived/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
android:label="@string/app_name"
android:largeHeap="true"
android:theme="@style/Theme.AppCompat">
<!-- this is needed for SDK 29+ -->
<!-- android:requestLegacyExternalStorage="true" -->
<activity
android:name="com.alienpants.leafpicrevived.activities.PlayerActivity"
android:configChanges="orientation|screenSize"
Expand Down
9 changes: 9 additions & 0 deletions leafpicrevived/src/main/assets/latest_changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
v0.8.6
==================
* Revert compileSdkVersion to 28, using 29 causes issues.

There are more issues related to the move from API 28 to API 29 which need to be addressed before this API level can be used for compilation. Work has begun.

* Re-enable the core metadata extractor library as it's been updated to 2.13.0 now.
* Use updated Liz libary.

v0.8.5
==================
* Update library versions to latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,7 @@ protected void onPostResume() {
.setAction(StringUtils.html(buttonHtml), view -> AlertDialogsHelper.showChangelogDialog(MainActivity.this));
View snackbarView = snackbar.getView();
snackbarView.setBackgroundColor(getBackgroundColor());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
snackbarView.setElevation(getResources().getDimension(R.dimen.snackbar_elevation));
snackbarView.setElevation(getResources().getDimension(R.dimen.snackbar_elevation));
snackbar.show();
Prefs.setLastVersionCode(BuildConfig.VERSION_CODE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,15 @@ public Album(Cursor cur) {
}

public static String[] getProjection() {
return new String[]{
String projectionString[] = new String[]{
MediaStore.Files.FileColumns.PARENT,
MediaStore.Images.Media.BUCKET_DISPLAY_NAME,
"count(*)",
// "count(*)",
"count(bucket_id)",
MediaStore.Images.Media.DATA,
"max(" + MediaStore.Images.Media.DATE_MODIFIED + ")"
};
return projectionString;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,12 @@ public ArrayList<String> getFolders(int status) {
public int getFoldersCount(int status) {
int c = 0;
SQLiteDatabase db = getReadableDatabase();
Cursor cur = db.query(TABLE_ALBUMS, new String[]{"count(*)"}, ALBUM_STATUS + "=?", new String[]{String.valueOf(status)}, null, null, null);
if (cur.moveToFirst())
c = cur.getInt(0);
// Cursor cur = db.query(TABLE_ALBUMS, new String[]{"*"}, ALBUM_STATUS + "=?", new String[]{String.valueOf(status)}, null, null, null);
// if (cur.moveToFirst())
// c = cur.getInt(0);
String countQuery = "SELECT * FROM " + TABLE_ALBUMS;
Cursor cur = db.rawQuery(countQuery, null);
c = cur.getCount();
cur.close();
db.close();
return c;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static Observable<Album> getAlbums(Context context, boolean hidden, Array
return hidden ? getHiddenAlbums(context, excluded) : getAlbums(context, excluded, sortingMode, sortingOrder);
}

private static String getHavingCluause(int excludedCount){
private static String getHavingClause(int excludedCount){

if (excludedCount == 0)
return "(";
Expand All @@ -48,7 +48,7 @@ private static String getHavingCluause(int excludedCount){
.append(" NOT LIKE ?");

// NOTE: dont close ths parenthesis it will be closed by ContentResolver
//res.append(")");
// res.append(")");

return res.toString();

Expand All @@ -64,31 +64,31 @@ private static Observable<Album> getAlbums(Context context, ArrayList<String> ex

ArrayList<Object> args = new ArrayList<>();

// @TODO 0.8.6 rewrite this, can't use group by in SQL in Android Q at this point
// https://android.googlesource.com/platform/packages/apps/Gallery2/+/master/src/com/android/gallery3d/data/BucketHelper.java
if (Prefs.showVideos()) {
query.selection(String.format("%s=? or %s=?) group by (%s) %s ",
query.selection(String.format("%s=? or %s=?) GROUP BY (%s) %s ",
MediaStore.Files.FileColumns.MEDIA_TYPE,
MediaStore.Files.FileColumns.MEDIA_TYPE,
MediaStore.Files.FileColumns.PARENT,
getHavingCluause(excludedAlbums.size())));
getHavingClause(excludedAlbums.size())));
args.add(MediaStore.Files.FileColumns.MEDIA_TYPE_IMAGE);
args.add(MediaStore.Files.FileColumns.MEDIA_TYPE_VIDEO);
} else {
query.selection(String.format("%s=?) group by (%s) %s ",
query.selection(String.format("%s=?) GROUP BY (%s) %s ",
MediaStore.Files.FileColumns.MEDIA_TYPE,
MediaStore.Files.FileColumns.PARENT,
getHavingCluause(excludedAlbums.size())));
getHavingClause(excludedAlbums.size())));
args.add(MediaStore.Files.FileColumns.MEDIA_TYPE_IMAGE);
}


//NOTE: LIKE params for query
for (String s : excludedAlbums)
args.add(s+"%");


query.args(args.toArray());


return QueryUtils.query(query.build(), context.getContentResolver(), Album::new);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,7 @@ public Query build() {
}

public String[] getStringArgs() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
return Arrays.stream(args).map(Object::toString).toArray(String[]::new);

String[] list = new String[args.length];
for (int i = 0; i < args.length; i++) list[i] = String.valueOf(args[i]);
return list;
return Arrays.stream(args).map(Object::toString).toArray(String[]::new);
}
}

Expand Down

0 comments on commit d771427

Please sign in to comment.