mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-14 12:44:15 +02:00
show soft keys if dialog input is starting.
This commit is contained in:
@@ -27,6 +27,7 @@ import android.text.InputType;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
@@ -351,19 +352,34 @@ public abstract class MeasurementView extends TableLayout {
|
||||
@Override
|
||||
public void onShow(DialogInterface dialog) {
|
||||
|
||||
Button b = floatDialog.getButton(AlertDialog.BUTTON_POSITIVE);
|
||||
b.setOnClickListener(new View.OnClickListener() {
|
||||
Button positiveButton = floatDialog.getButton(AlertDialog.BUTTON_POSITIVE);
|
||||
positiveButton.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (validateInput(input)) {
|
||||
setValueOnView(input.getText().toString());
|
||||
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
imm.hideSoftInputFromWindow(input.getWindowToken(), 0);
|
||||
floatDialog.dismiss();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Button negativeButton = floatDialog.getButton(AlertDialog.BUTTON_NEGATIVE);
|
||||
negativeButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
imm.hideSoftInputFromWindow(input.getWindowToken(), 0);
|
||||
floatDialog.dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);
|
||||
|
||||
return floatDialog;
|
||||
}
|
||||
|
Reference in New Issue
Block a user