关于FireFly-RK3399 :Android7.1代码发布和固件更新(2017/5/19)后的问题
本帖最后由 yfb1991 于 2017-6-5 11:08 编辑如下图 问题1:关闭不了打开过的应用,点击应用严重的拖动情况。
问题2:少了关闭最下控制按键的功能,想全屏显示都不可以了。
希望解决一下!谢谢!
顶起来 顶 相信他们后面会解决的{:5_247:} 我看了一下代码,这个是google原来的代码就是在这样设计的,很奇怪,那个x的图标并没有做点击监控,他点击响应的是整个taskview
下面是点击时的处理代码
frameworks/base/packages/SystemUI/src/com/android/systemui/recents/tv/views/TaskStackHorizontalViewAdapter.java
@Override
public void onClick(View v) {
try {
if (mTaskCardView.isInDismissState()) {<font color="#ff0000">//判断是否处于dismissstate,如处于则removeTask</font>
mTaskCardView.startDismissTaskAnimation(
getRemoveAtListener(getAdapterPosition(), mTaskCardView.getTask()));
} else {<font color="#ff0000">//否则launcherTask</font>
EventBus.getDefault().send(new LaunchTvTaskEvent(mTaskCardView, mTask,
null, INVALID_STACK_ID));
}
} catch (Exception e) {
Log.e(TAG, v.getContext()
.getString(R.string.recents_launch_error_message, mTask.title), e);
}
}而如何处于DismiaaState呢看一下代码
frameworks/base/packages/SystemUI/src/com/android/systemui/recents/tv/views/TaskCardView.java
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
// Override dispatchKeyEvent() instead of onKeyDown() to prevent warning from ViewRootImpl.
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_DPAD_DOWN : {
if (!isInDismissState() && event.getAction() == KeyEvent.ACTION_DOWN) {
setDismissState(true);<font color="#ff0000">//设DismissState = true</font>
return true;
}
break;
}
case KeyEvent.KEYCODE_DPAD_UP : {
if (event.getAction() == KeyEvent.ACTION_DOWN) {
if (isInDismissState()) {
setDismissState(false);
} else {
((RecentsTvActivity) getContext()).requestPipControlsFocus();
}
}
return true;
}
// Eat right and left key presses when we are in dismiss state
case KeyEvent.KEYCODE_DPAD_LEFT :
case KeyEvent.KEYCODE_DPAD_RIGHT : {
if (isInDismissState()) {
return true;
}
break;
}
}
return super.dispatchKeyEvent(event);
}
所以,很奇怪不知道为啥google这样设计的,但是确实是这样的。后面的话,我会做一下修改,改掉这个问题
风之空响 发表于 2017-6-5 16:52
我看了一下代码,这个是google原来的代码就是在这样设计的,很奇怪,那个x的图标并没有做点击监控,他点击 ...
加油!!真棒! yfb1991 发表于 2017-6-6 16:39
加油!!真棒!
后来又看了下,这个不是google自带的,是rk后加的,估计是为了tvbox操作的。但是没有考虑触摸操作和鼠标操作的场景 风之空响 发表于 2017-6-20 11:50
后来又看了下,这个不是google自带的,是rk后加的,估计是为了tvbox操作的。但是没有考虑触摸操作和鼠标 ...
那这个你们rk修改了哪里? 修改如下,以下是Git修改记录:
diff --git a/frameworks/base/packages/SystemUI/src/com/android/systemui/recents/tv/views/TaskStackHorizontalViewAdapter.java b/frameworks/base/pa
index 236d077..8b2f31b 100644
--- a/frameworks/base/packages/SystemUI/src/com/android/systemui/recents/tv/views/TaskStackHorizontalViewAdapter.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/recents/tv/views/TaskStackHorizontalViewAdapter.java
@@ -21,6 +21,7 @@ import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.ImageView;
import com.android.systemui.R;
import com.android.systemui.recents.Recents;
@@ -36,6 +37,7 @@ import java.util.List;
import static android.app.ActivityManager.StackId.INVALID_STACK_ID;
+
public class TaskStackHorizontalViewAdapter extends
RecyclerView.Adapter<TaskStackHorizontalViewAdapter.ViewHolder> {
@@ -47,31 +49,46 @@ public class TaskStackHorizontalViewAdapter extends
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener{
private TaskCardView mTaskCardView;
private Task mTask;
+ private ImageView dismissIcon;
+
public ViewHolder(View v) {
super(v);
mTaskCardView = (TaskCardView) v;
+ dismissIcon = (ImageView) v.findViewById(R.id.dismiss_icon);
}
public void init(Task task) {
mTaskCardView.init(task);
mTask = task;
mTaskCardView.setOnClickListener(this);
+ dismissIcon.setOnClickListener(this);
}
@Override
public void onClick(View v) {
- try {
- if (mTaskCardView.isInDismissState()) {
- mTaskCardView.startDismissTaskAnimation(
- getRemoveAtListener(getAdapterPosition(), mTaskCardView.getTask()));
- } else {
- EventBus.getDefault().send(new LaunchTvTaskEvent(mTaskCardView, mTask,
- null, INVALID_STACK_ID));
- }
- } catch (Exception e) {
- Log.e(TAG, v.getContext()
- .getString(R.string.recents_launch_error_message, mTask.title), e);
- }
+ if(v == mTaskCardView) { // 遥控器选择X按钮,modify by ZZP
+ try {
+ if (mTaskCardView.isInDismissState()) {
+ mTaskCardView.startDismissTaskAnimation(
+ getRemoveAtListener(getAdapterPosition(), mTaskCardView.getTask()));
+ } else {
+ EventBus.getDefault().send(new LaunchTvTaskEvent(mTaskCardView, mTask,
+ null, INVALID_STACK_ID));
+ }
+ } catch (Exception e) {
+ Log.e(TAG, v.getContext()
+ .getString(R.string.recents_launch_error_message, mTask.title), e);
+ }
+ } else if(v == dismissIcon){ // 鼠标点击X按钮
+ try{
+ mTaskCardView.startDismissTaskAnimation(
+ getRemoveAtListener(getAdapterPosition(), mTaskCardView.getTask()));
+ } catch(Exception e) {
+ Log.e(TAG, v.getContext()
+ .getString(R.string.recents_launch_error_message, mTask.title), e);
+ }
+ }
+
}
页:
[1]