|
发表于 2017-6-24 16:06:32
只看该作者
9#
修改如下,以下是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);
- + }
- + }
- +
- }
复制代码
|
|