hide the keyboard at togglig a slideshow setup checkbox

This commit is contained in:
tibbi 2017-08-05 14:05:51 +02:00
parent c47ddc536d
commit 3757616a47
3 changed files with 12 additions and 3 deletions

View file

@ -37,7 +37,7 @@ android {
}
dependencies {
compile 'com.simplemobiletools:commons:2.24.0'
compile 'com.simplemobiletools:commons:2.24.1'
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0'
compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0'
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'

View file

@ -4,6 +4,7 @@ import android.support.v7.app.AlertDialog
import android.view.LayoutInflater
import android.view.View
import android.view.WindowManager
import com.simplemobiletools.commons.extensions.hideKeyboard
import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.activities.SimpleActivity
@ -11,6 +12,7 @@ import com.simplemobiletools.gallery.extensions.config
import com.simplemobiletools.gallery.helpers.SLIDESHOW_DEFAULT_INTERVAL
import kotlinx.android.synthetic.main.dialog_slideshow.view.*
class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) {
val dialog: AlertDialog
val view: View
@ -25,19 +27,28 @@ class SlideshowDialog(val activity: SimpleActivity, val callback: () -> Unit) {
}
}
interval_value.setOnFocusChangeListener { v, hasFocus ->
if (!hasFocus)
activity.hideKeyboard(v)
}
include_videos_holder.setOnClickListener {
interval_value.clearFocus()
include_videos.toggle()
}
random_order_holder.setOnClickListener {
interval_value.clearFocus()
random_order.toggle()
}
use_fade_holder.setOnClickListener {
interval_value.clearFocus()
use_fade.toggle()
}
move_backwards_holder.setOnClickListener {
interval_value.clearFocus()
move_backwards.toggle()
}
}

View file

@ -5,8 +5,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<requestFocus/>
<RelativeLayout
android:id="@+id/slideshow_holder"
android:layout_width="match_parent"