mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2026-06-17 21:48:32 -04:00
fix: crash when keyboard close
This commit is contained in:
@@ -49,6 +49,7 @@ import android.view.inputmethod.InputConnection;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.webkit.MimeTypeMap;
|
||||
import android.widget.Button;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
@@ -994,7 +995,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
// Note: On some devices setting view to GONE creates a flicker in landscape.
|
||||
// Setting the View's sizes to 0 is similar to GONE but without the flicker.
|
||||
// The sizes will be set to useful values when the keyboard is shown again.
|
||||
mTextEdit.setLayoutParams(new RelativeLayout.LayoutParams(0, 0));
|
||||
mTextEdit.setLayoutParams(new FrameLayout.LayoutParams(0, 0));
|
||||
|
||||
|
||||
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
imm.hideSoftInputFromWindow(mTextEdit.getWindowToken(), 0);
|
||||
@@ -1458,9 +1460,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(w, h + HEIGHT_PADDING);
|
||||
params.leftMargin = x;
|
||||
params.topMargin = y;
|
||||
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(w, h + HEIGHT_PADDING);
|
||||
params.gravity = Gravity.TOP; // TODO: When setting up keyboard panning, set to BOTTOM
|
||||
|
||||
if (mTextEdit == null) {
|
||||
mTextEdit = new SDLDummyEdit(getContext());
|
||||
|
||||
Reference in New Issue
Block a user