From d5676d683f031a2d23f4e01e0ada0afd58dc9b89 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sat, 10 Feb 2024 17:33:42 +0100 Subject: Fix compatibility with Android 3.0 Incompatible APIs were used in the custom layouts and the extra keys options. Add @TargetApi annotations to help catch similar issues in the future with the help of 'gradle lint'. --- srcs/juloo.keyboard2/LauncherActivity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'srcs/juloo.keyboard2/LauncherActivity.java') diff --git a/srcs/juloo.keyboard2/LauncherActivity.java b/srcs/juloo.keyboard2/LauncherActivity.java index b8906b5..7b82d21 100644 --- a/srcs/juloo.keyboard2/LauncherActivity.java +++ b/srcs/juloo.keyboard2/LauncherActivity.java @@ -1,5 +1,6 @@ package juloo.keyboard2; +import android.annotation.TargetApi; import android.app.Activity; import android.content.Intent; import android.media.AudioManager; @@ -31,7 +32,7 @@ public class LauncherActivity extends Activity _intro_video = (VideoView)findViewById(R.id.launcher_intro_video); _tryhere_text = (TextView)findViewById(R.id.launcher_tryhere_text); _tryhere_area = (EditText)findViewById(R.id.launcher_tryhere_area); - if (VERSION.SDK_INT > 28) + if (VERSION.SDK_INT >= 28) _tryhere_area.addOnUnhandledKeyEventListener( this.new Tryhere_OnUnhandledKeyEventListener()); setup_intro_video(_intro_video); @@ -76,6 +77,7 @@ public class LauncherActivity extends Activity v.start(); } + @TargetApi(28) final class Tryhere_OnUnhandledKeyEventListener implements View.OnUnhandledKeyEventListener { public boolean onUnhandledKeyEvent(View v, KeyEvent ev) -- cgit v1.2.3