mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2024-12-24 23:44:20 +01:00
remove sorting by date_taken while it doesnt work anyway
This commit is contained in:
parent
2f1b545456
commit
26aa79294b
@ -29,8 +29,8 @@ class ChangeSortingDialog(val activity: BaseSimpleActivity, val isDirectorySorti
|
||||
.setPositiveButton(R.string.ok, this)
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.create().apply {
|
||||
activity.setupDialogStuff(view, this, R.string.sort_by)
|
||||
}
|
||||
activity.setupDialogStuff(view, this, R.string.sort_by)
|
||||
}
|
||||
|
||||
currSorting = if (isDirectorySorting) config.directorySorting else config.getFileSorting(path)
|
||||
setupSortRadio()
|
||||
@ -44,7 +44,6 @@ class ChangeSortingDialog(val activity: BaseSimpleActivity, val isDirectorySorti
|
||||
currSorting and SORT_BY_PATH != 0 -> sortingRadio.sorting_dialog_radio_path
|
||||
currSorting and SORT_BY_SIZE != 0 -> sortingRadio.sorting_dialog_radio_size
|
||||
currSorting and SORT_BY_DATE_MODIFIED != 0 -> sortingRadio.sorting_dialog_radio_last_modified
|
||||
currSorting and SORT_BY_DATE_TAKEN != 0 -> sortingRadio.sorting_dialog_radio_date_taken
|
||||
else -> sortingRadio.sorting_dialog_radio_name
|
||||
}
|
||||
sortBtn.isChecked = true
|
||||
@ -66,8 +65,7 @@ class ChangeSortingDialog(val activity: BaseSimpleActivity, val isDirectorySorti
|
||||
R.id.sorting_dialog_radio_name -> SORT_BY_NAME
|
||||
R.id.sorting_dialog_radio_path -> SORT_BY_PATH
|
||||
R.id.sorting_dialog_radio_size -> SORT_BY_SIZE
|
||||
R.id.sorting_dialog_radio_last_modified -> SORT_BY_DATE_MODIFIED
|
||||
else -> SORT_BY_DATE_TAKEN
|
||||
else -> SORT_BY_DATE_MODIFIED
|
||||
}
|
||||
|
||||
if (view.sorting_dialog_radio_order.checkedRadioButtonId == R.id.sorting_dialog_radio_descending) {
|
||||
|
@ -6,6 +6,7 @@ import com.google.gson.Gson
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import com.simplemobiletools.commons.helpers.BaseConfig
|
||||
import com.simplemobiletools.commons.helpers.SORT_BY_DATE_MODIFIED
|
||||
import com.simplemobiletools.commons.helpers.SORT_BY_DATE_TAKEN
|
||||
import com.simplemobiletools.commons.helpers.SORT_DESCENDING
|
||||
import com.simplemobiletools.gallery.R
|
||||
import com.simplemobiletools.gallery.models.AlbumCover
|
||||
@ -17,7 +18,13 @@ class Config(context: Context) : BaseConfig(context) {
|
||||
}
|
||||
|
||||
var directorySorting: Int
|
||||
get() = prefs.getInt(DIRECTORY_SORT_ORDER, SORT_BY_DATE_MODIFIED or SORT_DESCENDING)
|
||||
get(): Int {
|
||||
var sort = prefs.getInt(DIRECTORY_SORT_ORDER, SORT_BY_DATE_MODIFIED or SORT_DESCENDING)
|
||||
if (sort and SORT_BY_DATE_TAKEN != 0) {
|
||||
sort = sort - SORT_BY_DATE_TAKEN + SORT_BY_DATE_MODIFIED
|
||||
}
|
||||
return sort
|
||||
}
|
||||
set(order) = prefs.edit().putInt(DIRECTORY_SORT_ORDER, order).apply()
|
||||
|
||||
fun saveFileSorting(path: String, value: Int) {
|
||||
@ -28,7 +35,13 @@ class Config(context: Context) : BaseConfig(context) {
|
||||
}
|
||||
}
|
||||
|
||||
fun getFileSorting(path: String) = prefs.getInt(SORT_FOLDER_PREFIX + path.toLowerCase(), sorting)
|
||||
fun getFileSorting(path: String): Int {
|
||||
var sort = prefs.getInt(SORT_FOLDER_PREFIX + path.toLowerCase(), sorting)
|
||||
if (sort and SORT_BY_DATE_TAKEN != 0) {
|
||||
sort = sort - SORT_BY_DATE_TAKEN + SORT_BY_DATE_MODIFIED
|
||||
}
|
||||
return sort
|
||||
}
|
||||
|
||||
fun removeFileSorting(path: String) {
|
||||
prefs.edit().remove(SORT_FOLDER_PREFIX + path.toLowerCase()).apply()
|
||||
|
@ -52,14 +52,6 @@
|
||||
android:paddingTop="@dimen/medium_margin"
|
||||
android:text="@string/last_modified"/>
|
||||
|
||||
<com.simplemobiletools.commons.views.MyCompatRadioButton
|
||||
android:id="@+id/sorting_dialog_radio_date_taken"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/medium_margin"
|
||||
android:paddingTop="@dimen/medium_margin"
|
||||
android:text="@string/date_taken"/>
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
<include
|
||||
|
Loading…
Reference in New Issue
Block a user