From 2687be3bd870898d547a63fd2bbc09fd0b517317 Mon Sep 17 00:00:00 2001 From: pelya Date: Sun, 25 Aug 2013 00:05:34 +0300 Subject: [PATCH] Opaque text input window and thick borders for Ouya --- project/java/MainActivity.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/project/java/MainActivity.java b/project/java/MainActivity.java index 780b7971b..5a5954251 100644 --- a/project/java/MainActivity.java +++ b/project/java/MainActivity.java @@ -38,6 +38,7 @@ import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.FrameLayout; import android.graphics.drawable.Drawable; +import android.graphics.Color; import android.content.res.Configuration; import android.app.Notification; import android.app.NotificationManager; @@ -477,13 +478,17 @@ public class MainActivity extends Activity _screenKeyboard.setHint(hint != null ? hint : getString(R.string.text_edit_click_here)); _screenKeyboard.setText(oldText); _screenKeyboard.setOnKeyListener(new simpleKeyListener(this, sendBackspace)); + _screenKeyboard.setBackgroundColor(Color.BLACK); // Full opaque - do not show semi-transparent edit box, it's confusing + _screenKeyboard.setTextColor(Color.WHITE); // Just to be sure about gamma + if( isRunningOnOUYA() ) + _screenKeyboard.setPadding(100, 100, 100, 100); // Bad bad HDMI TVs all have cropped borders _videoLayout.addView(_screenKeyboard); //_screenKeyboard.setKeyListener(new TextKeyListener(TextKeyListener.Capitalize.NONE, false)); - _screenKeyboard.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); + _screenKeyboard.setInputType(InputType.TYPE_CLASS_TEXT); _screenKeyboard.setFocusableInTouchMode(true); _screenKeyboard.setFocusable(true); _screenKeyboard.requestFocus(); - _inputManager.showSoftInput(_screenKeyboard, InputMethodManager.SHOW_FORCED); + _inputManager.showSoftInput(_screenKeyboard, InputMethodManager.SHOW_IMPLICIT); }; public void hideScreenKeyboard()