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 7757f501c..45279a23d 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 @@ -631,6 +631,7 @@ class SettingsActivity : SimpleActivity() { put(ANIMATE_GIFS, config.animateGifs) put(CROP_THUMBNAILS, config.cropThumbnails) put(SHOW_THUMBNAIL_VIDEO_DURATION, config.showThumbnailVideoDuration) + put(SHOW_THUMBNAIL_FILE_TYPES, config.showThumbnailFileTypes) put(SCROLL_HORIZONTALLY, config.scrollHorizontally) put(ENABLE_PULL_TO_REFRESH, config.enablePullToRefresh) put(MAX_BRIGHTNESS, config.maxBrightness) @@ -687,6 +688,8 @@ class SettingsActivity : SimpleActivity() { put(FOLDER_THUMBNAIL_STYLE, config.folderStyle) put(FOLDER_MEDIA_COUNT, config.showFolderMediaCount) put(LIMIT_FOLDER_TITLE, config.limitFolderTitle) + put(THUMBNAIL_SPACING, config.thumbnailSpacing) + put(FILE_ROUNDED_CORNERS, config.fileRoundedCorners) } exportSettings(configItems) @@ -768,6 +771,7 @@ class SettingsActivity : SimpleActivity() { ANIMATE_GIFS -> config.animateGifs = value.toBoolean() CROP_THUMBNAILS -> config.cropThumbnails = value.toBoolean() SHOW_THUMBNAIL_VIDEO_DURATION -> config.showThumbnailVideoDuration = value.toBoolean() + SHOW_THUMBNAIL_FILE_TYPES -> config.showThumbnailFileTypes = value.toBoolean() SCROLL_HORIZONTALLY -> config.scrollHorizontally = value.toBoolean() ENABLE_PULL_TO_REFRESH -> config.enablePullToRefresh = value.toBoolean() MAX_BRIGHTNESS -> config.maxBrightness = value.toBoolean() @@ -823,6 +827,8 @@ class SettingsActivity : SimpleActivity() { FOLDER_THUMBNAIL_STYLE -> config.folderStyle = value.toInt() FOLDER_MEDIA_COUNT -> config.showFolderMediaCount = value.toInt() LIMIT_FOLDER_TITLE -> config.limitFolderTitle = value.toBoolean() + THUMBNAIL_SPACING -> config.thumbnailSpacing = value.toInt() + FILE_ROUNDED_CORNERS -> config.fileRoundedCorners = value.toBoolean() ALBUM_COVERS -> { val existingCovers = config.parseAlbumCovers() val existingCoverPaths = existingCovers.map { it.path }.toMutableList() as ArrayList diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt index 1e0306d42..621d55c28 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt @@ -539,7 +539,11 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: ArrayList ROUNDED_CORNERS_SMALL + config.fileRoundedCorners -> ROUNDED_CORNERS_BIG + else -> ROUNDED_CORNERS_NONE + } if (loadImageInstantly) { activity.loadImage(medium.type, path, medium_thumbnail, scrollHorizontally, animateGifs, cropThumbnails, roundedCorners, medium.getKey(), diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeFileThumbnailStyleDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeFileThumbnailStyleDialog.kt index 8fcf1a6e7..6c4b33092 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeFileThumbnailStyleDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeFileThumbnailStyleDialog.kt @@ -19,10 +19,12 @@ class ChangeFileThumbnailStyleDialog(val activity: BaseSimpleActivity) : DialogI init { view = activity.layoutInflater.inflate(R.layout.dialog_change_file_thumbnail_style, null).apply { + dialog_file_style_rounded_corners.isChecked = config.fileRoundedCorners dialog_file_style_animate_gifs.isChecked = config.animateGifs dialog_file_style_show_thumbnail_video_duration.isChecked = config.showThumbnailVideoDuration dialog_file_style_show_thumbnail_file_types.isChecked = config.showThumbnailFileTypes + dialog_file_style_rounded_corners_holder.setOnClickListener { dialog_file_style_rounded_corners.toggle() } dialog_file_style_animate_gifs_holder.setOnClickListener { dialog_file_style_animate_gifs.toggle() } dialog_file_style_show_thumbnail_video_duration_holder.setOnClickListener { dialog_file_style_show_thumbnail_video_duration.toggle() } dialog_file_style_show_thumbnail_file_types_holder.setOnClickListener { dialog_file_style_show_thumbnail_file_types.toggle() } @@ -35,7 +37,8 @@ class ChangeFileThumbnailStyleDialog(val activity: BaseSimpleActivity) : DialogI RadioItem(4, "2x"), RadioItem(8, "4x"), RadioItem(16, "8x"), - RadioItem(32, "16x")) + RadioItem(32, "16x"), + RadioItem(64, "32x")) RadioGroupDialog(activity, items, thumbnailSpacing) { thumbnailSpacing = it as Int @@ -43,6 +46,7 @@ class ChangeFileThumbnailStyleDialog(val activity: BaseSimpleActivity) : DialogI } } } + updateThumbnailSpacingText() AlertDialog.Builder(activity) @@ -54,6 +58,7 @@ class ChangeFileThumbnailStyleDialog(val activity: BaseSimpleActivity) : DialogI } override fun onClick(dialog: DialogInterface, which: Int) { + config.fileRoundedCorners = view.dialog_file_style_rounded_corners.isChecked config.animateGifs = view.dialog_file_style_animate_gifs.isChecked config.showThumbnailVideoDuration = view.dialog_file_style_show_thumbnail_video_duration.isChecked config.showThumbnailFileTypes = view.dialog_file_style_show_thumbnail_file_types.isChecked 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 1cf352cdc..960559e33 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 @@ -511,4 +511,8 @@ class Config(context: Context) : BaseConfig(context) { var thumbnailSpacing: Int get() = prefs.getInt(THUMBNAIL_SPACING, 2) set(thumbnailSpacing) = prefs.edit().putInt(THUMBNAIL_SPACING, thumbnailSpacing).apply() + + var fileRoundedCorners: Boolean + get() = prefs.getBoolean(FILE_ROUNDED_CORNERS, false) + set(fileRoundedCorners) = prefs.edit().putBoolean(FILE_ROUNDED_CORNERS, fileRoundedCorners).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 91b060de3..7f622edd2 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 @@ -87,6 +87,7 @@ const val FOLDER_THUMBNAIL_STYLE = "folder_thumbnail_style" const val FOLDER_MEDIA_COUNT = "folder_media_count" const val LIMIT_FOLDER_TITLE = "folder_limit_title" const val THUMBNAIL_SPACING = "thumbnail_spacing" +const val FILE_ROUNDED_CORNERS = "file_rounded_corners" // slideshow const val SLIDESHOW_INTERVAL = "slideshow_interval" diff --git a/app/src/main/res/layout/dialog_change_file_thumbnail_style.xml b/app/src/main/res/layout/dialog_change_file_thumbnail_style.xml index 06c8deff2..5c0b8716d 100644 --- a/app/src/main/res/layout/dialog_change_file_thumbnail_style.xml +++ b/app/src/main/res/layout/dialog_change_file_thumbnail_style.xml @@ -46,6 +46,26 @@ + + + + + +