author | Lei Qian <lei.qian@amlogic.com> | 2016-04-12 09:38:34 (GMT) |
---|---|---|
committer | Lei <lei.qian@amlogic.com> | 2016-04-12 10:22:51 (GMT) |
commit | 0d843f630e76c70626ddb1a9b2b06cd8e090b2a0 (patch) | |
tree | d547ac041be1dfcc4436fe667499adcc05f00e7e | |
parent | 7e1917619a1bdff32e5ca91ac7853c4f6463402d (diff) | |
download | MboxLauncher2-0d843f630e76c70626ddb1a9b2b06cd8e090b2a0.zip MboxLauncher2-0d843f630e76c70626ddb1a9b2b06cd8e090b2a0.tar.gz MboxLauncher2-0d843f630e76c70626ddb1a9b2b06cd8e090b2a0.tar.bz2 |
fix pd #122394, pd #122043
1. don't detect TV hardware hotplug
2. fix mouse scroll UI bug
Change-Id: I36d5de602965d26655dd28766922eb8b92b79f66
-rw-r--r-- | src/com/droidlogic/mboxlauncher/Launcher.java | 10 | ||||
-rw-r--r-- | src/com/droidlogic/mboxlauncher/MyGridLayout.java | 16 |
2 files changed, 21 insertions, 5 deletions
diff --git a/src/com/droidlogic/mboxlauncher/Launcher.java b/src/com/droidlogic/mboxlauncher/Launcher.java index bfd1219..b5337ae 100644 --- a/src/com/droidlogic/mboxlauncher/Launcher.java +++ b/src/com/droidlogic/mboxlauncher/Launcher.java @@ -137,7 +137,7 @@ public class Launcher extends Activity{ private boolean isRadioChannel = false; private ChannelObserver mChannelObserver; private TvInputManager mTvInputManager; - private TvInputChangeCallback mTvInputChangeCallback; + //private TvInputChangeCallback mTvInputChangeCallback; private TvDataBaseManager mTvDataBaseManager; private String mTvInputId; private Uri mChannelUri; @@ -788,8 +788,8 @@ public class Launcher extends Activity{ mTvInputId = null; mChannelUri = null; mTvInputManager = (TvInputManager) getSystemService(Context.TV_INPUT_SERVICE); - mTvInputChangeCallback = new TvInputChangeCallback(); - mTvInputManager.registerCallback(mTvInputChangeCallback, new Handler()); + //mTvInputChangeCallback = new TvInputChangeCallback(); + //mTvInputManager.registerCallback(mTvInputChangeCallback, new Handler()); int device_id, index_atv, index_dtv; device_id = Settings.System.getInt(getContentResolver(), DroidLogicTvUtils.TV_CURRENT_DEVICE_ID, 0); @@ -837,10 +837,10 @@ public class Launcher extends Activity{ private void releaseTvView() { tvView.setVisibility(View.GONE); - if (mTvInputChangeCallback != null) { + /*if (mTvInputChangeCallback != null) { mTvInputManager.unregisterCallback(mTvInputChangeCallback); mTvInputChangeCallback = null; - } + }*/ if (mChannelObserver != null) { getContentResolver().unregisterContentObserver(mChannelObserver); mChannelObserver = null; diff --git a/src/com/droidlogic/mboxlauncher/MyGridLayout.java b/src/com/droidlogic/mboxlauncher/MyGridLayout.java index 5f33cf8..ddffd3f 100644 --- a/src/com/droidlogic/mboxlauncher/MyGridLayout.java +++ b/src/com/droidlogic/mboxlauncher/MyGridLayout.java @@ -6,6 +6,8 @@ import android.content.Intent; import android.widget.GridLayout; import android.widget.TextView; import android.widget.ImageView; +import android.view.InputDevice; +import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.graphics.drawable.Drawable; @@ -43,6 +45,20 @@ public class MyGridLayout extends GridLayout{ } @Override + public boolean onGenericMotionEvent(MotionEvent event) { + //The input source is a pointing device associated with a display. + if (0 != (event.getSource() & InputDevice.SOURCE_CLASS_POINTER)) { + switch (event.getAction()) { + // process the scroll wheel movement + case MotionEvent.ACTION_SCROLL: + ((Launcher)mContext).getHoverView().clear(); + break; + } + } + return super.onGenericMotionEvent(event); + } + + @Override protected void onLayout (boolean changed, int left, int top, int right, int bottom) { super.onLayout (changed, left, top, right, bottom); } |