From 2ce5c902047b14e114cd2f7b2008ba70b88d1648 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 23 Aug 2016 21:48:23 +0200 Subject: [PATCH] if Same sorting is enabled, use the directory sorting --- .../main/java/com/simplemobiletools/gallery/Config.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/simplemobiletools/gallery/Config.java b/app/src/main/java/com/simplemobiletools/gallery/Config.java index cebe037bb..da9c2e794 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/Config.java +++ b/app/src/main/java/com/simplemobiletools/gallery/Config.java @@ -39,11 +39,17 @@ public class Config { } public int getSorting() { + if (getIsSameSorting()) + return getDirectorySorting(); + return mPrefs.getInt(Constants.SORT_ORDER, Constants.SORT_BY_DATE | Constants.SORT_DESCENDING); } public void setSorting(int order) { - mPrefs.edit().putInt(Constants.SORT_ORDER, order).apply(); + if (getIsSameSorting()) + setDirectorySorting(order); + else + mPrefs.edit().putInt(Constants.SORT_ORDER, order).apply(); } public int getDirectorySorting() {