abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/LauncherActivity.java
diff options
context:
space:
mode:
authorJules Aguillon2024-02-10 17:33:42 +0100
committerJules Aguillon2024-02-10 17:33:42 +0100
commitd5676d683f031a2d23f4e01e0ada0afd58dc9b89 (patch)
tree983cebb866b28e1c6352b2bf639cf82432221484 /srcs/juloo.keyboard2/LauncherActivity.java
parent332413ed3c34b6e4021c3bad97625704edb8b5c6 (diff)
downloadunexpected-keyboard-d5676d683f031a2d23f4e01e0ada0afd58dc9b89.tar.gz
unexpected-keyboard-d5676d683f031a2d23f4e01e0ada0afd58dc9b89.zip
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'.
Diffstat (limited to 'srcs/juloo.keyboard2/LauncherActivity.java')
-rw-r--r--srcs/juloo.keyboard2/LauncherActivity.java4
1 files changed, 3 insertions, 1 deletions
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)