diff --git a/app/build.gradle b/app/build.gradle index f8424da7e..7b3c48802 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -77,11 +77,11 @@ android { } 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 'it.sephiroth.android.exif:library:1.0.1' 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.vr:sdk-panowidget:1.180.0' implementation 'com.google.vr:sdk-videowidget:1.180.0' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt index b53113727..ce98d4286 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt @@ -14,7 +14,10 @@ import com.simplemobiletools.commons.models.RadioItem import com.simplemobiletools.gallery.pro.R import com.simplemobiletools.gallery.pro.dialogs.ManageBottomActionsDialog 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.models.AlbumCover import kotlinx.android.synthetic.main.activity_settings.* @@ -68,7 +71,7 @@ class SettingsActivity : SimpleActivity() { setupBottomActions() setupThumbnailVideoDuration() setupThumbnailFileTypes() - setupShowMediaCount() + setupFolderThumbnailStyle() setupKeepLastModified() setupEnablePullToRefresh() setupAllowZoomingImages() @@ -107,8 +110,8 @@ class SettingsActivity : SimpleActivity() { private fun setupSectionColors() { val adjustedPrimaryColor = getAdjustedPrimaryColor() 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, - migrating_label).forEach { + file_operations_label, deep_zoomable_images_label, extended_details_label, bottom_actions_label, recycle_bin_label, + migrating_label).forEach { it.setTextColor(adjustedPrimaryColor) } } @@ -139,9 +142,9 @@ class SettingsActivity : SimpleActivity() { settings_file_loading_priority.text = getFileLoadingPriorityText() settings_file_loading_priority_holder.setOnClickListener { val items = arrayListOf( - RadioItem(PRIORITY_SPEED, getString(R.string.speed)), - RadioItem(PRIORITY_COMPROMISE, getString(R.string.compromise)), - RadioItem(PRIORITY_VALIDITY, getString(R.string.avoid_showing_invalid_files))) + RadioItem(PRIORITY_SPEED, getString(R.string.speed)), + RadioItem(PRIORITY_COMPROMISE, getString(R.string.compromise)), + RadioItem(PRIORITY_VALIDITY, getString(R.string.avoid_showing_invalid_files))) RadioGroupDialog(this@SettingsActivity, items, config.fileLoadingPriority) { config.fileLoadingPriority = it as Int @@ -411,14 +414,18 @@ class SettingsActivity : SimpleActivity() { } } - private fun setupShowMediaCount() { - settings_show_media_count.isChecked = config.showMediaCount - settings_show_media_count_holder.setOnClickListener { - settings_show_media_count.toggle() - config.showMediaCount = settings_show_media_count.isChecked + private fun setupFolderThumbnailStyle() { + settings_folder_thumbnail_style.text = getFolderStyleText() + settings_folder_thumbnail_style_holder.setOnClickListener { + } } + private fun getFolderStyleText() = getString(when (config.folderStyle) { + FOLDER_STYLE_SQUARE -> R.string.square + else -> R.string.rounded_corners + }) + private fun setupKeepLastModified() { settings_keep_last_modified.isChecked = config.keepLastModified settings_keep_last_modified_holder.setOnClickListener { @@ -517,9 +524,9 @@ class SettingsActivity : SimpleActivity() { settings_screen_rotation.text = getScreenRotationText() settings_screen_rotation_holder.setOnClickListener { val items = arrayListOf( - 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_ASPECT_RATIO, getString(R.string.screen_rotation_aspect_ratio))) + 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_ASPECT_RATIO, getString(R.string.screen_rotation_aspect_ratio))) RadioGroupDialog(this@SettingsActivity, items, config.screenRotation) { config.screenRotation = it as Int diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Config.kt index 2ef341feb..1f4f5e20c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Config.kt @@ -495,4 +495,16 @@ class Config(context: Context) : BaseConfig(context) { var wereFavoritesMigrated: Boolean get() = prefs.getBoolean(WERE_FAVORITES_MIGRATED, false) 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() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt index 956df3884..c3a5e7ffd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt @@ -83,6 +83,9 @@ const val EDITOR_BRUSH_COLOR = "editor_brush_color" const val EDITOR_BRUSH_HARDNESS = "editor_brush_hardness" const val EDITOR_BRUSH_SIZE = "editor_brush_size" 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 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_SMALL = 2 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 diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 71b45e925..399715167 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -436,25 +436,34 @@ + android:paddingBottom="@dimen/bigger_margin"> - + android:paddingEnd="@dimen/medium_margin" + android:text="@string/folder_thumbnail_style" /> + +