Merge pull request #4411 from asdoi/dialog_keyboard
Close keyboard when dialogs were dismissed
This commit is contained in:
commit
b7b63d7d31
|
@ -80,7 +80,7 @@
|
|||
<activity
|
||||
android:name=".activity.MainActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|density|uiMode|keyboard|navigation"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:windowSoftInputMode="stateAlwaysHidden"
|
||||
android:launchMode="singleTask"
|
||||
android:label="@string/app_name">
|
||||
</activity>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package de.danoeh.antennapod.dialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
|
@ -137,6 +138,7 @@ public class SleepTimerDialog extends DialogFragment {
|
|||
if (controller != null) {
|
||||
controller.setSleepTimer(time);
|
||||
}
|
||||
closeKeyboard(content);
|
||||
} catch (NumberFormatException e) {
|
||||
e.printStackTrace();
|
||||
Snackbar.make(content, R.string.time_dialog_invalid_input, Snackbar.LENGTH_LONG).show();
|
||||
|
@ -153,4 +155,9 @@ public class SleepTimerDialog extends DialogFragment {
|
|||
timeDisplay.setVisibility(controller.sleepTimerActive() ? View.VISIBLE : View.GONE);
|
||||
time.setText(Converter.getDurationStringLong((int) controller.getSleepTimerTimeLeft()));
|
||||
}
|
||||
|
||||
private void closeKeyboard(View content) {
|
||||
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Activity.INPUT_METHOD_SERVICE);
|
||||
imm.hideSoftInputFromWindow(content.getWindowToken(), 0);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue