diff options
author | William Bourke <billbourke@google.com> | 2014-10-17 11:13:11 -0700 |
---|---|---|
committer | William Bourke <billbourke@google.com> | 2014-10-17 21:57:23 +0000 |
commit | 33f577cfea7b5cc7c7167716522bf74c5e3219da (patch) | |
tree | 8059e094376df484d279f862421390ebaedc41ca /core/java/com | |
parent | 09cce6f509af58e3eeaf687b63e292c222a7d769 (diff) | |
download | frameworks_base-33f577cfea7b5cc7c7167716522bf74c5e3219da.zip frameworks_base-33f577cfea7b5cc7c7167716522bf74c5e3219da.tar.gz frameworks_base-33f577cfea7b5cc7c7167716522bf74c5e3219da.tar.bz2 |
Modified lollipop Easter egg for TV compatibility
Bug: 17997922
Change-Id: I0e2e34245183cdd146ecca02ab09b2c4867770ec
Diffstat (limited to 'core/java/com')
-rw-r--r-- | core/java/com/android/internal/app/PlatLogoActivity.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/core/java/com/android/internal/app/PlatLogoActivity.java b/core/java/com/android/internal/app/PlatLogoActivity.java index f92fd55..80bc5fe 100644 --- a/core/java/com/android/internal/app/PlatLogoActivity.java +++ b/core/java/com/android/internal/app/PlatLogoActivity.java @@ -36,6 +36,7 @@ import android.provider.Settings; import android.util.DisplayMetrics; import android.util.Log; import android.view.Gravity; +import android.view.KeyEvent; import android.view.View; import android.view.ViewGroup; import android.view.ViewOutlineProvider; @@ -54,6 +55,7 @@ public class PlatLogoActivity extends Activity { }; FrameLayout mLayout; int mTapCount; + int mKeyCount; PathInterpolator mInterpolator = new PathInterpolator(0f, 0f, 0.5f, 1f); static int newColorIndex() { @@ -203,6 +205,28 @@ public class PlatLogoActivity extends Activity { } }); + // Enable hardware keyboard input for TV compatibility. + im.setFocusable(true); + im.requestFocus(); + im.setOnKeyListener(new View.OnKeyListener() { + @Override + public boolean onKey(View v, int keyCode, KeyEvent event) { + if (keyCode != KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) { + ++mKeyCount; + if (mKeyCount > 2) { + if (mTapCount > 5) { + im.performLongClick(); + } else { + im.performClick(); + } + } + return true; + } else { + return false; + } + } + }); + mLayout.addView(im, new FrameLayout.LayoutParams(size, size, Gravity.CENTER)); im.animate().scaleX(0.3f).scaleY(0.3f) |