aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtyom Palvelev <artyompp@google.com>2024-03-20 20:41:20 +0000
committerArtyom Palvelev <artyompp@google.com>2024-03-20 20:43:03 +0000
commitfeac0cf0fc08a685b43219306bd383d2a51077d1 (patch)
treea0d0213045be5fab16d2191dc837bc9e295df965
parentebafbf53d267673fa35282431f94756e2310976e (diff)
downloadgamesdk-feac0cf0fc08a685b43219306bd383d2a51077d1.tar.gz
fix game_text_input_testbed sample
Various minor changes have been made here: * set proper project name in settings.gradle * increase font size * use proper logging Fix: 329216308 Test: build and run game_text_input_testbed Change-Id: Ib151a8543d1b52891b3df5ee3b84059da6ff326a
-rw-r--r--samples/game_text_input/game_text_input_testbed/app/src/main/java/com/gameinput/testbed/InputEnabledTextView.java11
-rw-r--r--samples/game_text_input/game_text_input_testbed/app/src/main/res/layout/activity_main.xml3
-rw-r--r--samples/game_text_input/game_text_input_testbed/settings.gradle2
3 files changed, 10 insertions, 6 deletions
diff --git a/samples/game_text_input/game_text_input_testbed/app/src/main/java/com/gameinput/testbed/InputEnabledTextView.java b/samples/game_text_input/game_text_input_testbed/app/src/main/java/com/gameinput/testbed/InputEnabledTextView.java
index 2a7e0108..6e106637 100644
--- a/samples/game_text_input/game_text_input_testbed/app/src/main/java/com/gameinput/testbed/InputEnabledTextView.java
+++ b/samples/game_text_input/game_text_input_testbed/app/src/main/java/com/gameinput/testbed/InputEnabledTextView.java
@@ -19,6 +19,7 @@ import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.inputmethod.EditorInfo;
+import android.util.Log;
import androidx.core.graphics.Insets;
import com.google.androidgamesdk.gametextinput.GameTextInput;
@@ -31,6 +32,8 @@ import static android.view.inputmethod.EditorInfo.IME_ACTION_NONE;
import static android.view.inputmethod.EditorInfo.IME_FLAG_NO_FULLSCREEN;
public class InputEnabledTextView extends View implements Listener {
+ private static final String LOG_TAG = "InputEnabledTextView";
+
public InputConnection mInputConnection;
public InputEnabledTextView(Context context, AttributeSet attrs) {
@@ -69,23 +72,23 @@ public class InputEnabledTextView extends View implements Listener {
// Called when the IME has changed the input
@Override
public void stateChanged(State newState, boolean dismissed) {
- System.out.println("stateChanged: " + newState + " dismissed: " + dismissed);
+ Log.d(LOG_TAG, "stateChanged: " + newState + " dismissed: " + dismissed);
onTextInputEventNative(newState);
}
@Override
public void onEditorAction(int action) {
- System.out.println("onEditorAction: " + action);
+ Log.d(LOG_TAG, "onEditorAction: " + action);
}
@Override
public void onImeInsetsChanged(Insets insets) {
- System.out.println("insetsChanged: " + insets);
+ Log.d(LOG_TAG, "insetsChanged: " + insets);
}
@Override
public void onSoftwareKeyboardVisibilityChanged(boolean visible) {
- System.out.println("onSoftwareKeyboardVisibilityChanged: " + visible);
+ Log.d(LOG_TAG, "onSoftwareKeyboardVisibilityChanged: " + visible);
}
private native void onTextInputEventNative(State softKeyboardEvent);
diff --git a/samples/game_text_input/game_text_input_testbed/app/src/main/res/layout/activity_main.xml b/samples/game_text_input/game_text_input_testbed/app/src/main/res/layout/activity_main.xml
index 3a0790ca..2ceefefa 100644
--- a/samples/game_text_input/game_text_input_testbed/app/src/main/res/layout/activity_main.xml
+++ b/samples/game_text_input/game_text_input_testbed/app/src/main/res/layout/activity_main.xml
@@ -99,7 +99,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
- android:text="Click on Show Keyboard and start typing" />
+ android:text="Click on Show Keyboard and start typing"
+ android:textAppearance="@style/TextAppearance.AppCompat.Large" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file
diff --git a/samples/game_text_input/game_text_input_testbed/settings.gradle b/samples/game_text_input/game_text_input_testbed/settings.gradle
index c28ef344..9ee02cda 100644
--- a/samples/game_text_input/game_text_input_testbed/settings.gradle
+++ b/samples/game_text_input/game_text_input_testbed/settings.gradle
@@ -1,5 +1,5 @@
include ':app'
-rootProject.name = "Game Text Input Testbed"
+rootProject.name = "game_text_input_testbed"
// Comment all the lines below to use a locally built .aar
// See app/build.gradle as well
include ':game-text-input'