move option animate gifs to main settings

This commit is contained in:
gmasil 2023-09-22 17:11:47 +02:00
parent 669bfcd904
commit d203c1fced
No known key found for this signature in database
GPG key ID: 135FC0B941F3ECC7
4 changed files with 24 additions and 19 deletions

View file

@ -66,6 +66,7 @@ class SettingsActivity : SimpleActivity() {
setupOpenVideosOnSeparateScreen()
setupMaxBrightness()
setupCropThumbnails()
setupAnimateGifs()
setupDarkBackground()
setupScrollHorizontally()
setupScreenRotation()
@ -310,6 +311,14 @@ class SettingsActivity : SimpleActivity() {
}
}
private fun setupAnimateGifs() {
binding.settingsAnimateGifs.isChecked = config.animateGifs
binding.settingsAnimateGifsHolder.setOnClickListener {
binding.settingsAnimateGifs.toggle()
config.animateGifs = binding.settingsAnimateGifs.isChecked
}
}
private fun setupDarkBackground() {
binding.settingsBlackBackground.isChecked = config.blackBackground
binding.settingsBlackBackgroundHolder.setOnClickListener {

View file

@ -17,13 +17,11 @@ class ChangeFileThumbnailStyleDialog(val activity: BaseSimpleActivity) : DialogI
init {
binding = DialogChangeFileThumbnailStyleBinding.inflate(activity.layoutInflater).apply {
dialogFileStyleRoundedCorners.isChecked = config.fileRoundedCorners
dialogFileStyleAnimateGifs.isChecked = config.animateGifs
dialogFileStyleShowThumbnailVideoDuration.isChecked = config.showThumbnailVideoDuration
dialogFileStyleShowThumbnailFileTypes.isChecked = config.showThumbnailFileTypes
dialogFileStyleMarkFavoriteItems.isChecked = config.markFavoriteItems
dialogFileStyleRoundedCornersHolder.setOnClickListener { dialogFileStyleRoundedCorners.toggle() }
dialogFileStyleAnimateGifsHolder.setOnClickListener { dialogFileStyleAnimateGifs.toggle() }
dialogFileStyleShowThumbnailVideoDurationHolder.setOnClickListener { dialogFileStyleShowThumbnailVideoDuration.toggle() }
dialogFileStyleShowThumbnailFileTypesHolder.setOnClickListener { dialogFileStyleShowThumbnailFileTypes.toggle() }
dialogFileStyleMarkFavoriteItemsHolder.setOnClickListener { dialogFileStyleMarkFavoriteItems.toggle() }
@ -59,7 +57,6 @@ class ChangeFileThumbnailStyleDialog(val activity: BaseSimpleActivity) : DialogI
override fun onClick(dialog: DialogInterface, which: Int) {
config.fileRoundedCorners = binding.dialogFileStyleRoundedCorners.isChecked
config.animateGifs = binding.dialogFileStyleAnimateGifs.isChecked
config.showThumbnailVideoDuration = binding.dialogFileStyleShowThumbnailVideoDuration.isChecked
config.showThumbnailFileTypes = binding.dialogFileStyleShowThumbnailFileTypes.isChecked
config.markFavoriteItems = binding.dialogFileStyleMarkFavoriteItems.isChecked

View file

@ -326,6 +326,21 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_animate_gifs_holder"
style="@style/SettingsHolderCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/settings_animate_gifs"
style="@style/SettingsCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/animate_gifs" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_file_thumbnail_style_holder"
style="@style/SettingsHolderTextViewOneLinerStyle"

View file

@ -61,22 +61,6 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/dialog_file_style_animate_gifs_holder"
style="@style/SettingsHolderCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/dialog_file_style_animate_gifs"
style="@style/SettingsCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/animate_gifs" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/dialog_file_style_show_thumbnail_video_duration_holder"
style="@style/SettingsHolderCheckboxStyle"