mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-23 13:08:00 +01:00
commit
3ac7b158b8
14 changed files with 88 additions and 71 deletions
|
@ -1,6 +1,11 @@
|
|||
Changelog
|
||||
==========
|
||||
|
||||
Version 5.1.1 *(2018-10-23)*
|
||||
----------------------------
|
||||
|
||||
* Fixing the inability to delete SD card files
|
||||
|
||||
Version 5.1.0 *(2018-10-23)*
|
||||
----------------------------
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@ android {
|
|||
applicationId "com.simplemobiletools.gallery"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 28
|
||||
versionCode 204
|
||||
versionName "5.1.0"
|
||||
versionCode 205
|
||||
versionName "5.1.1"
|
||||
multiDexEnabled true
|
||||
setProperty("archivesBaseName", "gallery")
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ android {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.simplemobiletools:commons:5.2.0'
|
||||
implementation 'com.simplemobiletools:commons:5.2.8'
|
||||
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
|
||||
implementation 'androidx.multidex:multidex:2.0.0'
|
||||
implementation 'it.sephiroth.android.exif:library:1.0.1'
|
||||
|
|
|
@ -982,10 +982,12 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
}
|
||||
|
||||
private fun refreshViewPager() {
|
||||
if (config.getFileSorting(mDirectory) and SORT_BY_RANDOM == 0) {
|
||||
GetMediaAsynctask(applicationContext, mDirectory, false, false, mShowAll) {
|
||||
gotMedia(it)
|
||||
}.execute()
|
||||
}
|
||||
}
|
||||
|
||||
private fun gotMedia(thumbnailItems: ArrayList<ThumbnailItem>) {
|
||||
val media = thumbnailItems.filter { it is Medium }.map { it as Medium } as ArrayList<Medium>
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package com.simplemobiletools.gallery.databases
|
||||
|
||||
import android.content.Context
|
||||
import androidx.room.Database
|
||||
import androidx.room.Room
|
||||
import androidx.room.RoomDatabase
|
||||
import android.content.Context
|
||||
import com.simplemobiletools.gallery.objects.MyExecutor
|
||||
import com.simplemobiletools.gallery.interfaces.DirectoryDao
|
||||
import com.simplemobiletools.gallery.interfaces.MediumDao
|
||||
import com.simplemobiletools.gallery.models.Directory
|
||||
|
@ -25,6 +26,7 @@ abstract class GalleryDatabase : RoomDatabase() {
|
|||
if (db == null) {
|
||||
db = Room.databaseBuilder(context.applicationContext, GalleryDatabase::class.java, "gallery.db")
|
||||
.fallbackToDestructiveMigration()
|
||||
.setQueryExecutor(MyExecutor.myExecutor)
|
||||
.build()
|
||||
db!!.openHelper.setWriteAheadLoggingEnabled(true)
|
||||
}
|
||||
|
|
|
@ -47,6 +47,7 @@ class ChangeSortingDialog(val activity: BaseSimpleActivity, val isDirectorySorti
|
|||
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
|
||||
currSorting and SORT_BY_RANDOM != 0 -> sortingRadio.sorting_dialog_radio_random
|
||||
else -> sortingRadio.sorting_dialog_radio_name
|
||||
}
|
||||
sortBtn.isChecked = true
|
||||
|
@ -69,6 +70,7 @@ class ChangeSortingDialog(val activity: BaseSimpleActivity, val isDirectorySorti
|
|||
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
|
||||
R.id.sorting_dialog_radio_random -> SORT_BY_RANDOM
|
||||
else -> SORT_BY_DATE_TAKEN
|
||||
}
|
||||
|
||||
|
|
|
@ -1,15 +1,10 @@
|
|||
package com.simplemobiletools.gallery.dialogs
|
||||
|
||||
import android.graphics.Point
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.widget.EditText
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
||||
import com.simplemobiletools.commons.extensions.showKeyboard
|
||||
import com.simplemobiletools.commons.extensions.toast
|
||||
import com.simplemobiletools.commons.extensions.value
|
||||
import com.simplemobiletools.commons.extensions.*
|
||||
import com.simplemobiletools.gallery.R
|
||||
import kotlinx.android.synthetic.main.resize_image.view.*
|
||||
|
||||
|
@ -24,8 +19,7 @@ class ResizeDialog(val activity: BaseSimpleActivity, val size: Point, val callba
|
|||
|
||||
val ratio = size.x / size.y.toFloat()
|
||||
|
||||
widthView.addTextChangedListener(object : TextWatcher {
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
widthView.onTextChangeListener {
|
||||
if (widthView.hasFocus()) {
|
||||
var width = getViewValue(widthView)
|
||||
if (width > size.x) {
|
||||
|
@ -39,15 +33,7 @@ class ResizeDialog(val activity: BaseSimpleActivity, val size: Point, val callba
|
|||
}
|
||||
}
|
||||
|
||||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
|
||||
}
|
||||
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
|
||||
}
|
||||
})
|
||||
|
||||
heightView.addTextChangedListener(object : TextWatcher {
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
heightView.onTextChangeListener {
|
||||
if (heightView.hasFocus()) {
|
||||
var height = getViewValue(heightView)
|
||||
if (height > size.y) {
|
||||
|
@ -61,13 +47,6 @@ class ResizeDialog(val activity: BaseSimpleActivity, val size: Point, val callba
|
|||
}
|
||||
}
|
||||
|
||||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
|
||||
}
|
||||
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
|
||||
}
|
||||
})
|
||||
|
||||
AlertDialog.Builder(activity)
|
||||
.setPositiveButton(R.string.ok, null)
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
|
|
|
@ -139,6 +139,11 @@ fun Context.getSortedDirectories(source: ArrayList<Directory>): ArrayList<Direct
|
|||
val sorting = config.directorySorting
|
||||
val dirs = source.clone() as ArrayList<Directory>
|
||||
|
||||
if (sorting and SORT_BY_RANDOM != 0) {
|
||||
dirs.shuffle()
|
||||
return movePinnedDirectoriesToFront(dirs)
|
||||
}
|
||||
|
||||
dirs.sortWith(Comparator { o1, o2 ->
|
||||
o1 as Directory
|
||||
o2 as Directory
|
||||
|
|
|
@ -344,6 +344,11 @@ class MediaFetcher(val context: Context) {
|
|||
}
|
||||
|
||||
fun sortMedia(media: ArrayList<Medium>, sorting: Int) {
|
||||
if (sorting and SORT_BY_RANDOM != 0) {
|
||||
media.shuffle()
|
||||
return
|
||||
}
|
||||
|
||||
media.sortWith(Comparator { o1, o2 ->
|
||||
o1 as Medium
|
||||
o2 as Medium
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
package com.simplemobiletools.gallery.objects
|
||||
|
||||
import java.util.concurrent.Executors
|
||||
|
||||
object MyExecutor {
|
||||
val myExecutor = Executors.newSingleThreadExecutor()
|
||||
}
|
|
@ -11,8 +11,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="@dimen/activity_margin"
|
||||
android:paddingRight="@dimen/activity_margin"
|
||||
android:paddingTop="@dimen/activity_margin">
|
||||
android:paddingTop="@dimen/activity_margin"
|
||||
android:paddingRight="@dimen/activity_margin">
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/sorting_dialog_radio_sorting"
|
||||
|
@ -24,42 +24,50 @@
|
|||
android:id="@+id/sorting_dialog_radio_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/medium_margin"
|
||||
android:paddingTop="@dimen/medium_margin"
|
||||
android:paddingBottom="@dimen/medium_margin"
|
||||
android:text="@string/name"/>
|
||||
|
||||
<com.simplemobiletools.commons.views.MyCompatRadioButton
|
||||
android:id="@+id/sorting_dialog_radio_path"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/medium_margin"
|
||||
android:paddingTop="@dimen/medium_margin"
|
||||
android:paddingBottom="@dimen/medium_margin"
|
||||
android:text="@string/path"/>
|
||||
|
||||
<com.simplemobiletools.commons.views.MyCompatRadioButton
|
||||
android:id="@+id/sorting_dialog_radio_size"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/medium_margin"
|
||||
android:paddingTop="@dimen/medium_margin"
|
||||
android:paddingBottom="@dimen/medium_margin"
|
||||
android:text="@string/size"/>
|
||||
|
||||
<com.simplemobiletools.commons.views.MyCompatRadioButton
|
||||
android:id="@+id/sorting_dialog_radio_last_modified"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/medium_margin"
|
||||
android:paddingTop="@dimen/medium_margin"
|
||||
android:paddingBottom="@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:paddingBottom="@dimen/medium_margin"
|
||||
android:text="@string/date_taken"/>
|
||||
|
||||
<com.simplemobiletools.commons.views.MyCompatRadioButton
|
||||
android:id="@+id/sorting_dialog_radio_random"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/medium_margin"
|
||||
android:paddingBottom="@dimen/medium_margin"
|
||||
android:text="@string/random"/>
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
<include
|
||||
|
@ -76,16 +84,16 @@
|
|||
android:id="@+id/sorting_dialog_radio_ascending"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/medium_margin"
|
||||
android:paddingTop="@dimen/medium_margin"
|
||||
android:paddingBottom="@dimen/medium_margin"
|
||||
android:text="@string/ascending"/>
|
||||
|
||||
<com.simplemobiletools.commons.views.MyCompatRadioButton
|
||||
android:id="@+id/sorting_dialog_radio_descending"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/medium_margin"
|
||||
android:paddingTop="@dimen/medium_margin"
|
||||
android:paddingBottom="@dimen/medium_margin"
|
||||
android:text="@string/descending"/>
|
||||
</RadioGroup>
|
||||
|
||||
|
@ -97,8 +105,8 @@
|
|||
android:id="@+id/sorting_dialog_use_for_this_folder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/activity_margin"
|
||||
android:paddingTop="@dimen/activity_margin"
|
||||
android:paddingBottom="@dimen/activity_margin"
|
||||
android:text="@string/use_for_this_folder"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/activity_margin">
|
||||
android:paddingLeft="@dimen/activity_margin"
|
||||
android:paddingTop="@dimen/activity_margin"
|
||||
android:paddingRight="@dimen/activity_margin">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/image_width_label"
|
||||
|
@ -29,8 +31,8 @@
|
|||
android:id="@+id/image_height_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="50dp"
|
||||
android:layout_marginStart="50dp"
|
||||
android:layout_marginLeft="50dp"
|
||||
android:layout_toRightOf="@+id/image_width_label"
|
||||
android:text="@string/height"/>
|
||||
|
||||
|
@ -38,9 +40,9 @@
|
|||
android:id="@+id/image_height"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/image_height_label"
|
||||
android:layout_alignStart="@+id/image_height_label"
|
||||
android:layout_below="@+id/image_width_label"
|
||||
android:layout_alignStart="@+id/image_height_label"
|
||||
android:layout_alignLeft="@+id/image_height_label"
|
||||
android:inputType="number"
|
||||
android:maxLength="6"
|
||||
android:maxLines="1"
|
||||
|
@ -54,8 +56,8 @@
|
|||
android:layout_below="@+id/image_height"
|
||||
android:layout_marginTop="@dimen/activity_margin"
|
||||
android:checked="true"
|
||||
android:paddingBottom="@dimen/activity_margin"
|
||||
android:paddingTop="@dimen/activity_margin"
|
||||
android:paddingBottom="@dimen/activity_margin"
|
||||
android:text="@string/keep_aspect_ratio"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -162,7 +162,7 @@
|
|||
<string name="deep_zoomable_images">Immagini ingrandibili a fondo</string>
|
||||
<string name="show_highest_quality">Mostra le immagini alla massima qualità possibile</string>
|
||||
<string name="show_recycle_bin_last">Mostra il cestino come ultimo elemento nella schermata principale</string>
|
||||
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
|
||||
<string name="allow_down_gesture">Chiudi la visuale a schermo intero con un gesto verso il basso</string>
|
||||
|
||||
<!-- Setting sections -->
|
||||
<string name="thumbnails">Miniature</string>
|
||||
|
|
|
@ -146,8 +146,8 @@
|
|||
<string name="scroll_thumbnails_horizontally">Horizontaal scrollen</string>
|
||||
<string name="hide_system_ui_at_fullscreen">Statusbalk automatisch verbergen in volledig scherm</string>
|
||||
<string name="delete_empty_folders">Lege mappen verwijderen na leegmaken</string>
|
||||
<string name="allow_photo_gestures">Helderheid voor afbeeldingen aanpassen met verticale gebaren</string>
|
||||
<string name="allow_video_gestures">Volume en helderheid voor video\'s aanpassen met verticale gebaren</string>
|
||||
<string name="allow_photo_gestures">Helderheid voor afbeeldingen aanpassen met verticale veeggebaren</string>
|
||||
<string name="allow_video_gestures">Volume en helderheid voor video\'s aanpassen met verticale veeggebaren</string>
|
||||
<string name="show_media_count">Aantallen in mappen tonen</string>
|
||||
<string name="replace_share_with_rotate">Menu-item Draaien vastzetten in volledig scherm (in plaats van Delen)</string>
|
||||
<string name="show_extended_details">Uitgebreide informatie tonen in volledig scherm</string>
|
||||
|
@ -162,7 +162,7 @@
|
|||
<string name="deep_zoomable_images">Afbeeldingen ver inzoomen</string>
|
||||
<string name="show_highest_quality">Afbeeldingen in de hoogst mogelijke kwaliteit weergeven</string>
|
||||
<string name="show_recycle_bin_last">Prullenbak als laatste item tonen</string>
|
||||
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
|
||||
<string name="allow_down_gesture">Naar beneden vegen om volledig scherm af te sluiten</string>
|
||||
|
||||
<!-- Setting sections -->
|
||||
<string name="thumbnails">Miniatuurvoorbeelden</string>
|
||||
|
|
|
@ -142,7 +142,7 @@
|
|||
<string name="screen_rotation_system_setting">系统设置</string>
|
||||
<string name="screen_rotation_device_rotation">设备方向</string>
|
||||
<string name="screen_rotation_aspect_ratio">根据长宽比</string>
|
||||
<string name="black_background_at_fullscreen">全屏时使用黑色背景和状态栏</string>
|
||||
<string name="black_background_at_fullscreen">全屏时使用黑色背景和状态栏</string>
|
||||
<string name="scroll_thumbnails_horizontally">水平滚动缩略图</string>
|
||||
<string name="hide_system_ui_at_fullscreen">全屏时自动隐藏状态栏</string>
|
||||
<string name="delete_empty_folders">删除没有内容的空文件夹</string>
|
||||
|
@ -162,7 +162,7 @@
|
|||
<string name="deep_zoomable_images">深度放大图像</string>
|
||||
<string name="show_highest_quality">以最高质量显示图像</string>
|
||||
<string name="show_recycle_bin_last">在主屏幕界面的最后一项显示回收站</string>
|
||||
<string name="allow_down_gesture">Allow closing the fullscreen view with a down gesture</string>
|
||||
<string name="allow_down_gesture">使用下滑手势关闭全屏视图</string>
|
||||
|
||||
<!-- Setting sections -->
|
||||
<string name="thumbnails">缩略图</string>
|
||||
|
|
Loading…
Reference in a new issue