Commit 41b7da4b authored by Mygod's avatar Mygod

Fix #460

parent b0180fb9
...@@ -2,9 +2,10 @@ package com.github.shadowsocks.preferences ...@@ -2,9 +2,10 @@ package com.github.shadowsocks.preferences
import android.content.Context import android.content.Context
import android.content.res.TypedArray import android.content.res.TypedArray
import android.os.Bundle
import android.preference.DialogPreference import android.preference.DialogPreference
import android.util.AttributeSet import android.util.AttributeSet
import android.view.ViewGroup import android.view.{ViewGroup, WindowManager}
import android.widget.NumberPicker import android.widget.NumberPicker
import com.github.shadowsocks.R import com.github.shadowsocks.R
...@@ -36,6 +37,10 @@ final class NumberPickerPreference(context: Context, attrs: AttributeSet = null) ...@@ -36,6 +37,10 @@ final class NumberPickerPreference(context: Context, attrs: AttributeSet = null)
def setMin(value: Int) = picker.setMinValue(value) def setMin(value: Int) = picker.setMinValue(value)
def setMax(value: Int) = picker.setMaxValue(value) def setMax(value: Int) = picker.setMaxValue(value)
override protected def showDialog(state: Bundle) {
super.showDialog(state)
getDialog.getWindow.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
}
override protected def onCreateDialogView = { override protected def onCreateDialogView = {
val parent = picker.getParent.asInstanceOf[ViewGroup] val parent = picker.getParent.asInstanceOf[ViewGroup]
if (parent != null) parent.removeView(picker) if (parent != null) parent.removeView(picker)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment