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.util.TypedValue;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
@@ -351,20 +352,35 @@ public abstract class MeasurementView extends TableLayout {
|
|||||||
@Override
|
@Override
|
||||||
public void onShow(DialogInterface dialog) {
|
public void onShow(DialogInterface dialog) {
|
||||||
|
|
||||||
Button b = floatDialog.getButton(AlertDialog.BUTTON_POSITIVE);
|
Button positiveButton = floatDialog.getButton(AlertDialog.BUTTON_POSITIVE);
|
||||||
b.setOnClickListener(new View.OnClickListener() {
|
positiveButton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
if (validateInput(input)) {
|
if (validateInput(input)) {
|
||||||
setValueOnView(input.getText().toString());
|
setValueOnView(input.getText().toString());
|
||||||
|
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
imm.hideSoftInputFromWindow(input.getWindowToken(), 0);
|
||||||
floatDialog.dismiss();
|
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;
|
return floatDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user