mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2025-01-18 06:17:59 +01:00
preparing some folder customization things
This commit is contained in:
parent
2c4912950d
commit
b35b22d0eb
5 changed files with 64 additions and 26 deletions
|
@ -77,11 +77,11 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.simplemobiletools:commons:5.31.19'
|
implementation 'com.simplemobiletools:commons:5.31.28'
|
||||||
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
|
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
|
||||||
implementation 'it.sephiroth.android.exif:library:1.0.1'
|
implementation 'it.sephiroth.android.exif:library:1.0.1'
|
||||||
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19'
|
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||||
implementation 'com.google.android.exoplayer:exoplayer-core:2.9.6'
|
implementation 'com.google.android.exoplayer:exoplayer-core:2.9.6'
|
||||||
implementation 'com.google.vr:sdk-panowidget:1.180.0'
|
implementation 'com.google.vr:sdk-panowidget:1.180.0'
|
||||||
implementation 'com.google.vr:sdk-videowidget:1.180.0'
|
implementation 'com.google.vr:sdk-videowidget:1.180.0'
|
||||||
|
|
|
@ -14,7 +14,10 @@ import com.simplemobiletools.commons.models.RadioItem
|
||||||
import com.simplemobiletools.gallery.pro.R
|
import com.simplemobiletools.gallery.pro.R
|
||||||
import com.simplemobiletools.gallery.pro.dialogs.ManageBottomActionsDialog
|
import com.simplemobiletools.gallery.pro.dialogs.ManageBottomActionsDialog
|
||||||
import com.simplemobiletools.gallery.pro.dialogs.ManageExtendedDetailsDialog
|
import com.simplemobiletools.gallery.pro.dialogs.ManageExtendedDetailsDialog
|
||||||
import com.simplemobiletools.gallery.pro.extensions.*
|
import com.simplemobiletools.gallery.pro.extensions.config
|
||||||
|
import com.simplemobiletools.gallery.pro.extensions.emptyTheRecycleBin
|
||||||
|
import com.simplemobiletools.gallery.pro.extensions.mediaDB
|
||||||
|
import com.simplemobiletools.gallery.pro.extensions.showRecycleBinEmptyingDialog
|
||||||
import com.simplemobiletools.gallery.pro.helpers.*
|
import com.simplemobiletools.gallery.pro.helpers.*
|
||||||
import com.simplemobiletools.gallery.pro.models.AlbumCover
|
import com.simplemobiletools.gallery.pro.models.AlbumCover
|
||||||
import kotlinx.android.synthetic.main.activity_settings.*
|
import kotlinx.android.synthetic.main.activity_settings.*
|
||||||
|
@ -68,7 +71,7 @@ class SettingsActivity : SimpleActivity() {
|
||||||
setupBottomActions()
|
setupBottomActions()
|
||||||
setupThumbnailVideoDuration()
|
setupThumbnailVideoDuration()
|
||||||
setupThumbnailFileTypes()
|
setupThumbnailFileTypes()
|
||||||
setupShowMediaCount()
|
setupFolderThumbnailStyle()
|
||||||
setupKeepLastModified()
|
setupKeepLastModified()
|
||||||
setupEnablePullToRefresh()
|
setupEnablePullToRefresh()
|
||||||
setupAllowZoomingImages()
|
setupAllowZoomingImages()
|
||||||
|
@ -107,8 +110,8 @@ class SettingsActivity : SimpleActivity() {
|
||||||
private fun setupSectionColors() {
|
private fun setupSectionColors() {
|
||||||
val adjustedPrimaryColor = getAdjustedPrimaryColor()
|
val adjustedPrimaryColor = getAdjustedPrimaryColor()
|
||||||
arrayListOf(visibility_label, videos_label, thumbnails_label, scrolling_label, fullscreen_media_label, security_label,
|
arrayListOf(visibility_label, videos_label, thumbnails_label, scrolling_label, fullscreen_media_label, security_label,
|
||||||
file_operations_label, deep_zoomable_images_label, extended_details_label, bottom_actions_label, recycle_bin_label,
|
file_operations_label, deep_zoomable_images_label, extended_details_label, bottom_actions_label, recycle_bin_label,
|
||||||
migrating_label).forEach {
|
migrating_label).forEach {
|
||||||
it.setTextColor(adjustedPrimaryColor)
|
it.setTextColor(adjustedPrimaryColor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -139,9 +142,9 @@ class SettingsActivity : SimpleActivity() {
|
||||||
settings_file_loading_priority.text = getFileLoadingPriorityText()
|
settings_file_loading_priority.text = getFileLoadingPriorityText()
|
||||||
settings_file_loading_priority_holder.setOnClickListener {
|
settings_file_loading_priority_holder.setOnClickListener {
|
||||||
val items = arrayListOf(
|
val items = arrayListOf(
|
||||||
RadioItem(PRIORITY_SPEED, getString(R.string.speed)),
|
RadioItem(PRIORITY_SPEED, getString(R.string.speed)),
|
||||||
RadioItem(PRIORITY_COMPROMISE, getString(R.string.compromise)),
|
RadioItem(PRIORITY_COMPROMISE, getString(R.string.compromise)),
|
||||||
RadioItem(PRIORITY_VALIDITY, getString(R.string.avoid_showing_invalid_files)))
|
RadioItem(PRIORITY_VALIDITY, getString(R.string.avoid_showing_invalid_files)))
|
||||||
|
|
||||||
RadioGroupDialog(this@SettingsActivity, items, config.fileLoadingPriority) {
|
RadioGroupDialog(this@SettingsActivity, items, config.fileLoadingPriority) {
|
||||||
config.fileLoadingPriority = it as Int
|
config.fileLoadingPriority = it as Int
|
||||||
|
@ -411,14 +414,18 @@ class SettingsActivity : SimpleActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupShowMediaCount() {
|
private fun setupFolderThumbnailStyle() {
|
||||||
settings_show_media_count.isChecked = config.showMediaCount
|
settings_folder_thumbnail_style.text = getFolderStyleText()
|
||||||
settings_show_media_count_holder.setOnClickListener {
|
settings_folder_thumbnail_style_holder.setOnClickListener {
|
||||||
settings_show_media_count.toggle()
|
|
||||||
config.showMediaCount = settings_show_media_count.isChecked
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun getFolderStyleText() = getString(when (config.folderStyle) {
|
||||||
|
FOLDER_STYLE_SQUARE -> R.string.square
|
||||||
|
else -> R.string.rounded_corners
|
||||||
|
})
|
||||||
|
|
||||||
private fun setupKeepLastModified() {
|
private fun setupKeepLastModified() {
|
||||||
settings_keep_last_modified.isChecked = config.keepLastModified
|
settings_keep_last_modified.isChecked = config.keepLastModified
|
||||||
settings_keep_last_modified_holder.setOnClickListener {
|
settings_keep_last_modified_holder.setOnClickListener {
|
||||||
|
@ -517,9 +524,9 @@ class SettingsActivity : SimpleActivity() {
|
||||||
settings_screen_rotation.text = getScreenRotationText()
|
settings_screen_rotation.text = getScreenRotationText()
|
||||||
settings_screen_rotation_holder.setOnClickListener {
|
settings_screen_rotation_holder.setOnClickListener {
|
||||||
val items = arrayListOf(
|
val items = arrayListOf(
|
||||||
RadioItem(ROTATE_BY_SYSTEM_SETTING, getString(R.string.screen_rotation_system_setting)),
|
RadioItem(ROTATE_BY_SYSTEM_SETTING, getString(R.string.screen_rotation_system_setting)),
|
||||||
RadioItem(ROTATE_BY_DEVICE_ROTATION, getString(R.string.screen_rotation_device_rotation)),
|
RadioItem(ROTATE_BY_DEVICE_ROTATION, getString(R.string.screen_rotation_device_rotation)),
|
||||||
RadioItem(ROTATE_BY_ASPECT_RATIO, getString(R.string.screen_rotation_aspect_ratio)))
|
RadioItem(ROTATE_BY_ASPECT_RATIO, getString(R.string.screen_rotation_aspect_ratio)))
|
||||||
|
|
||||||
RadioGroupDialog(this@SettingsActivity, items, config.screenRotation) {
|
RadioGroupDialog(this@SettingsActivity, items, config.screenRotation) {
|
||||||
config.screenRotation = it as Int
|
config.screenRotation = it as Int
|
||||||
|
|
|
@ -495,4 +495,16 @@ class Config(context: Context) : BaseConfig(context) {
|
||||||
var wereFavoritesMigrated: Boolean
|
var wereFavoritesMigrated: Boolean
|
||||||
get() = prefs.getBoolean(WERE_FAVORITES_MIGRATED, false)
|
get() = prefs.getBoolean(WERE_FAVORITES_MIGRATED, false)
|
||||||
set(wereFavoritesMigrated) = prefs.edit().putBoolean(WERE_FAVORITES_MIGRATED, wereFavoritesMigrated).apply()
|
set(wereFavoritesMigrated) = prefs.edit().putBoolean(WERE_FAVORITES_MIGRATED, wereFavoritesMigrated).apply()
|
||||||
|
|
||||||
|
var showFolderMediaCount: Int
|
||||||
|
get() = prefs.getInt(FOLDER_MEDIA_COUNT, FOLDER_MEDIA_CNT_LINE)
|
||||||
|
set(showFolderMediaCount) = prefs.edit().putInt(FOLDER_MEDIA_COUNT, showFolderMediaCount).apply()
|
||||||
|
|
||||||
|
var folderStyle: Int
|
||||||
|
get() = prefs.getInt(FOLDER_THUMBNAIL_STYLE, FOLDER_STYLE_SQUARE)
|
||||||
|
set(folderStyle) = prefs.edit().putInt(FOLDER_THUMBNAIL_STYLE, folderStyle).apply()
|
||||||
|
|
||||||
|
var limitFolderTitle: Boolean
|
||||||
|
get() = prefs.getBoolean(LIMIT_FOLDER_TITLE, false)
|
||||||
|
set(limitFolderTitle) = prefs.edit().putBoolean(LIMIT_FOLDER_TITLE, limitFolderTitle).apply()
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,6 +83,9 @@ const val EDITOR_BRUSH_COLOR = "editor_brush_color"
|
||||||
const val EDITOR_BRUSH_HARDNESS = "editor_brush_hardness"
|
const val EDITOR_BRUSH_HARDNESS = "editor_brush_hardness"
|
||||||
const val EDITOR_BRUSH_SIZE = "editor_brush_size"
|
const val EDITOR_BRUSH_SIZE = "editor_brush_size"
|
||||||
const val WERE_FAVORITES_MIGRATED = "were_favorites_migrated"
|
const val WERE_FAVORITES_MIGRATED = "were_favorites_migrated"
|
||||||
|
const val FOLDER_THUMBNAIL_STYLE = "folder_thumbnail_style"
|
||||||
|
const val FOLDER_MEDIA_COUNT = "folder_media_count"
|
||||||
|
const val LIMIT_FOLDER_TITLE = "folder_limit_title"
|
||||||
|
|
||||||
// slideshow
|
// slideshow
|
||||||
const val SLIDESHOW_INTERVAL = "slideshow_interval"
|
const val SLIDESHOW_INTERVAL = "slideshow_interval"
|
||||||
|
@ -224,3 +227,10 @@ const val HIGH_TILE_DPI = 280
|
||||||
const val ROUNDED_CORNERS_NONE = 1
|
const val ROUNDED_CORNERS_NONE = 1
|
||||||
const val ROUNDED_CORNERS_SMALL = 2
|
const val ROUNDED_CORNERS_SMALL = 2
|
||||||
const val ROUNDED_CORNERS_BIG = 3
|
const val ROUNDED_CORNERS_BIG = 3
|
||||||
|
|
||||||
|
const val FOLDER_MEDIA_CNT_LINE = 1
|
||||||
|
const val FOLDER_MEDIA_CNT_BRACKETS = 2
|
||||||
|
const val FOLDER_MEDIA_CNT_NONE = 3
|
||||||
|
|
||||||
|
const val FOLDER_STYLE_SQUARE = 1
|
||||||
|
const val FOLDER_STYLE_ROUNDED_CORNERS = 2
|
||||||
|
|
|
@ -436,25 +436,34 @@
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/settings_show_media_count_holder"
|
android:id="@+id/settings_folder_thumbnail_style_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/medium_margin"
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
android:background="?attr/selectableItemBackground"
|
android:background="?attr/selectableItemBackground"
|
||||||
android:paddingStart="@dimen/normal_margin"
|
android:paddingStart="@dimen/normal_margin"
|
||||||
android:paddingTop="@dimen/activity_margin"
|
android:paddingTop="@dimen/bigger_margin"
|
||||||
android:paddingEnd="@dimen/normal_margin"
|
android:paddingEnd="@dimen/normal_margin"
|
||||||
android:paddingBottom="@dimen/activity_margin">
|
android:paddingBottom="@dimen/bigger_margin">
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MySwitchCompat
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
android:id="@+id/settings_show_media_count"
|
android:id="@+id/settings_folder_thumbnail_style_label"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@null"
|
android:layout_centerVertical="true"
|
||||||
android:clickable="false"
|
android:layout_toStartOf="@+id/settings_folder_thumbnail_style"
|
||||||
android:paddingStart="@dimen/medium_margin"
|
android:paddingStart="@dimen/medium_margin"
|
||||||
android:text="@string/show_media_count"
|
android:paddingEnd="@dimen/medium_margin"
|
||||||
app:switchPadding="@dimen/medium_margin" />
|
android:text="@string/folder_thumbnail_style" />
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/settings_folder_thumbnail_style"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_marginEnd="@dimen/medium_margin"
|
||||||
|
android:background="@null"
|
||||||
|
android:clickable="false" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue