mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2025-01-31 02:44:53 +01:00
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
|
<activity
|
||||||
android:name=".activity.MainActivity"
|
android:name=".activity.MainActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|density|uiMode|keyboard|navigation"
|
android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|density|uiMode|keyboard|navigation"
|
||||||
android:windowSoftInputMode="stateHidden"
|
android:windowSoftInputMode="stateAlwaysHidden"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:label="@string/app_name">
|
android:label="@string/app_name">
|
||||||
</activity>
|
</activity>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package de.danoeh.antennapod.dialog;
|
package de.danoeh.antennapod.dialog;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
@ -137,6 +138,7 @@ public class SleepTimerDialog extends DialogFragment {
|
|||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
controller.setSleepTimer(time);
|
controller.setSleepTimer(time);
|
||||||
}
|
}
|
||||||
|
closeKeyboard(content);
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Snackbar.make(content, R.string.time_dialog_invalid_input, Snackbar.LENGTH_LONG).show();
|
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);
|
timeDisplay.setVisibility(controller.sleepTimerActive() ? View.VISIBLE : View.GONE);
|
||||||
time.setText(Converter.getDurationStringLong((int) controller.getSleepTimerTimeLeft()));
|
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…
x
Reference in New Issue
Block a user