add a toggle for scrolling thumbnails horizontally

This commit is contained in:
tibbi 2017-06-18 21:16:40 +02:00
parent 5be34f27ee
commit 2734fe9615
2 changed files with 29 additions and 0 deletions

View file

@ -33,6 +33,7 @@ class SettingsActivity : SimpleActivity() {
setupMaxBrightness()
setupCropThumbnails()
setupDarkBackground()
setupScrollHorizontally()
setupScreenRotation()
setupShowMedia()
updateTextColors(settings_holder)
@ -112,6 +113,14 @@ class SettingsActivity : SimpleActivity() {
}
}
private fun setupScrollHorizontally() {
settings_scroll_horizontally.isChecked = config.scrollHorizontally
settings_scroll_horizontally_holder.setOnClickListener {
settings_scroll_horizontally.toggle()
config.scrollHorizontally = settings_scroll_horizontally.isChecked
}
}
private fun setupScreenRotation() {
settings_screen_rotation.text = getScreenRotationText()
settings_screen_rotation_holder.setOnClickListener {

View file

@ -208,6 +208,26 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_scroll_horizontally_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:padding="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_scroll_horizontally"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:text="@string/scroll_thumbnails_horizontally"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_screen_rotation_holder"
android:layout_width="match_parent"