diff --git a/packages/SystemUI/res/drawable-hdpi/btn_fab_recents.png b/packages/SystemUI/res/drawable-hdpi/btn_fab_recents.png
new file mode 100644
index 0000000000000..b95fde57610fb
Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/btn_fab_recents.png differ
diff --git a/packages/SystemUI/res/drawable-mdpi/btn_fab_recents.png b/packages/SystemUI/res/drawable-mdpi/btn_fab_recents.png
new file mode 100644
index 0000000000000..6bbed06ce5857
Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/btn_fab_recents.png differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/btn_fab_recents.png b/packages/SystemUI/res/drawable-xhdpi/btn_fab_recents.png
new file mode 100644
index 0000000000000..4cdd0aaea1eeb
Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/btn_fab_recents.png differ
diff --git a/packages/SystemUI/res/drawable-xxhdpi/btn_fab_recents.png b/packages/SystemUI/res/drawable-xxhdpi/btn_fab_recents.png
new file mode 100644
index 0000000000000..2220d60143ee5
Binary files /dev/null and b/packages/SystemUI/res/drawable-xxhdpi/btn_fab_recents.png differ
diff --git a/packages/SystemUI/res/drawable/recents_dismiss_dark.xml b/packages/SystemUI/res/drawable/recents_dismiss_dark.xml
index 337c028b77c8b..ba09ebe2f88be 100644
--- a/packages/SystemUI/res/drawable/recents_dismiss_dark.xml
+++ b/packages/SystemUI/res/drawable/recents_dismiss_dark.xml
@@ -1,29 +1,24 @@
-
-
-
+ android:width="48.0dp"
+ android:height="48.0dp"
+ android:viewportWidth="48.0"
+ android:viewportHeight="48.0">
-
+ android:fillColor="@color/recents_task_bar_dark_dismiss_color"
+ android:pathData="M38.000000,12.800000l-2.799999,-2.800000 -11.200001,11.200001 -11.200000,-11.200001 -2.800000,2.800000 11.200001,11.200000 -11.200001,11.200001 2.800000,2.799999 11.200000,-11.200001 11.200001,11.200001 2.799999,-2.799999 -11.200001,-11.200001z"/>
\ No newline at end of file
diff --git a/packages/SystemUI/res/drawable/recents_dismiss_light.xml b/packages/SystemUI/res/drawable/recents_dismiss_light.xml
index 963ccf7be00d9..be0825cf953a2 100644
--- a/packages/SystemUI/res/drawable/recents_dismiss_light.xml
+++ b/packages/SystemUI/res/drawable/recents_dismiss_light.xml
@@ -1,30 +1,24 @@
-
-
-
-
+ android:width="48.0dp"
+ android:height="48.0dp"
+ android:viewportWidth="48.0"
+ android:viewportHeight="48.0">
-
+ android:fillColor="@color/recents_task_bar_light_dismiss_color"
+ android:pathData="M38.000000,12.800000l-2.799999,-2.800000 -11.200001,11.200001 -11.200000,-11.200001 -2.800000,2.800000 11.200001,11.200000 -11.200001,11.200001 2.800000,2.799999 11.200000,-11.200001 11.200001,11.200001 2.799999,-2.799999 -11.200001,-11.200001z"/>
\ No newline at end of file
diff --git a/packages/SystemUI/res/drawable/recents_lock_to_app_pin.xml b/packages/SystemUI/res/drawable/recents_lock_to_app_pin.xml
new file mode 100644
index 0000000000000..317f858f662de
--- /dev/null
+++ b/packages/SystemUI/res/drawable/recents_lock_to_app_pin.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
diff --git a/packages/SystemUI/res/drawable/recents_lock_to_task_button_bg.xml b/packages/SystemUI/res/drawable/recents_lock_to_task_button_bg.xml
index d38c8a4dec9ea..6424a65c5290b 100644
--- a/packages/SystemUI/res/drawable/recents_lock_to_task_button_bg.xml
+++ b/packages/SystemUI/res/drawable/recents_lock_to_task_button_bg.xml
@@ -15,6 +15,6 @@
-->
-
+ android:color="#ff9cdfd9">
+
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout/recents.xml b/packages/SystemUI/res/layout/recents.xml
index 47740ee94eec4..8f367a6c23c52 100644
--- a/packages/SystemUI/res/layout/recents.xml
+++ b/packages/SystemUI/res/layout/recents.xml
@@ -39,9 +39,9 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
-
-
+
diff --git a/packages/SystemUI/res/layout/recents_fullscreen_overlay.xml b/packages/SystemUI/res/layout/recents_debug_overlay.xml
similarity index 58%
rename from packages/SystemUI/res/layout/recents_fullscreen_overlay.xml
rename to packages/SystemUI/res/layout/recents_debug_overlay.xml
index 1d021f930892e..d23495e6043ed 100644
--- a/packages/SystemUI/res/layout/recents_fullscreen_overlay.xml
+++ b/packages/SystemUI/res/layout/recents_debug_overlay.xml
@@ -4,24 +4,32 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-
+
-
\ No newline at end of file
+ android:layout_height="wrap_content"
+ android:layout_gravity="top"
+ android:layout_marginTop="25dp" />
+
+
+
+
diff --git a/packages/SystemUI/res/layout/recents_task_view.xml b/packages/SystemUI/res/layout/recents_task_view.xml
index 93c55387812ce..f8dfd65cd535f 100644
--- a/packages/SystemUI/res/layout/recents_task_view.xml
+++ b/packages/SystemUI/res/layout/recents_task_view.xml
@@ -57,31 +57,27 @@
android:layout_height="48dp"
android:layout_marginEnd="4dp"
android:layout_gravity="center_vertical|end"
- android:padding="18dp"
+ android:padding="12dp"
android:background="@drawable/recents_button_bg"
android:visibility="invisible"
android:src="@drawable/recents_dismiss_light" />
-
-
-
+
+
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index bd10623712dd2..32474c90de9b5 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -208,7 +208,7 @@
100dp
- 1dp
+ 1.5dp
48dp
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
index 18dad3a818152..45348976d4989 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
@@ -32,9 +32,7 @@ import android.os.UserHandle;
import android.util.Pair;
import android.view.KeyEvent;
import android.view.View;
-import android.view.ViewGroup;
import android.view.ViewStub;
-import android.widget.FrameLayout;
import android.widget.Toast;
import com.android.systemui.R;
import com.android.systemui.recents.misc.DebugTrigger;
@@ -58,7 +56,8 @@ import java.util.ArrayList;
* The main Recents activity that is started from AlternateRecentsComponent.
*/
public class RecentsActivity extends Activity implements RecentsView.RecentsViewCallbacks,
- RecentsAppWidgetHost.RecentsAppWidgetHostCallbacks {
+ RecentsAppWidgetHost.RecentsAppWidgetHostCallbacks,
+ DebugOverlayView.DebugOverlayViewCallbacks {
// Actions and Extras sent from AlternateRecentsComponent
final static String EXTRA_TRIGGERED_FROM_ALT_TAB = "extra_triggered_from_alt_tab";
@@ -73,6 +72,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
RecentsView mRecentsView;
SystemBarScrimViews mScrimViews;
ViewStub mEmptyViewStub;
+ ViewStub mDebugOverlayStub;
View mEmptyView;
DebugOverlayView mDebugOverlay;
@@ -368,6 +368,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
mEmptyViewStub = (ViewStub) findViewById(R.id.empty_view_stub);
+ mDebugOverlayStub = (ViewStub) findViewById(R.id.debug_overlay_stub);
mScrimViews = new SystemBarScrimViews(this, mConfig);
inflateDebugOverlay();
@@ -405,12 +406,9 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
/** Inflates the debug overlay if debug mode is enabled. */
void inflateDebugOverlay() {
if (mConfig.debugModeEnabled && mDebugOverlay == null) {
- ViewGroup parent = (ViewGroup) findViewById(android.R.id.content).getRootView();
- mDebugOverlay = new DebugOverlayView(this);
- FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.MATCH_PARENT);
- parent.addView(mDebugOverlay, lp);
+ // Inflate the overlay and seek bars
+ mDebugOverlay = (DebugOverlayView) mDebugOverlayStub.inflate();
+ mDebugOverlay.setCallbacks(this);
mRecentsView.setDebugOverlay(mDebugOverlay);
}
}
@@ -599,4 +597,16 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
bindSearchBarAppWidget();
addSearchBarAppWidgetView();
}
+
+ /**** DebugOverlayView.DebugOverlayViewCallbacks ****/
+
+ @Override
+ public void onPrimarySeekBarChanged(float progress) {
+ // Do nothing
+ }
+
+ @Override
+ public void onSecondarySeekBarChanged(float progress) {
+ // Do nothing
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
index 36d06d59c1804..fbcbe2cf4bd1d 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
@@ -16,7 +16,6 @@
package com.android.systemui.recents;
-import android.content.ContentResolver;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
diff --git a/packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoader.java b/packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoader.java
index 9325947649a26..f30e22a0b1b7b 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoader.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoader.java
@@ -27,9 +27,6 @@ import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.UserHandle;
-import android.provider.Settings;
-import android.provider.Settings.SettingNotFoundException;
-
import com.android.systemui.recents.Constants;
import com.android.systemui.recents.RecentsConfiguration;
import com.android.systemui.recents.misc.SystemServicesProxy;
diff --git a/packages/SystemUI/src/com/android/systemui/recents/model/TaskStack.java b/packages/SystemUI/src/com/android/systemui/recents/model/TaskStack.java
index fdc577587207e..04ee9dda0ae2b 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/model/TaskStack.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/model/TaskStack.java
@@ -17,7 +17,6 @@
package com.android.systemui.recents.model;
import com.android.systemui.recents.Constants;
-import com.android.systemui.recents.RecentsConfiguration;
import com.android.systemui.recents.misc.NamedCounter;
import java.util.ArrayList;
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/DebugOverlayView.java b/packages/SystemUI/src/com/android/systemui/recents/views/DebugOverlayView.java
index 6c90fe36634a8..4c3fbf0af44e5 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/DebugOverlayView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/DebugOverlayView.java
@@ -20,9 +20,12 @@ import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
+import android.util.AttributeSet;
import android.util.Pair;
import android.view.View;
import android.widget.FrameLayout;
+import android.widget.SeekBar;
+import com.android.systemui.R;
import java.util.ArrayList;
@@ -30,33 +33,67 @@ import java.util.ArrayList;
* A full screen overlay layer that allows us to draw views from throughout the system on the top
* most layer.
*/
-public class DebugOverlayView extends FrameLayout {
+public class DebugOverlayView extends FrameLayout implements SeekBar.OnSeekBarChangeListener {
+
+ public interface DebugOverlayViewCallbacks {
+ public void onPrimarySeekBarChanged(float progress);
+ public void onSecondarySeekBarChanged(float progress);
+ }
final static int sCornerRectSize = 50;
+ DebugOverlayViewCallbacks mCb;
+
ArrayList> mRects = new ArrayList>();
Paint mDebugOutline = new Paint();
Paint mTmpPaint = new Paint();
boolean mEnabled = true;
+ SeekBar mPrimarySeekBar;
+ SeekBar mSecondarySeekBar;
+
public DebugOverlayView(Context context) {
- super(context);
+ this(context, null);
+ }
+
+ public DebugOverlayView(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public DebugOverlayView(Context context, AttributeSet attrs, int defStyleAttr) {
+ this(context, attrs, defStyleAttr, 0);
+ }
+
+ public DebugOverlayView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
+ super(context, attrs, defStyleAttr, defStyleRes);
mDebugOutline.setColor(0xFFff0000);
mDebugOutline.setStyle(Paint.Style.STROKE);
mDebugOutline.setStrokeWidth(8f);
setWillNotDraw(false);
}
+ public void setCallbacks(DebugOverlayViewCallbacks cb) {
+ mCb = cb;
+ }
+
+ @Override
+ protected void onFinishInflate() {
+ mPrimarySeekBar = (SeekBar) findViewById(R.id.debug_seek_bar_1);
+ mPrimarySeekBar.setOnSeekBarChangeListener(this);
+ mSecondarySeekBar = (SeekBar) findViewById(R.id.debug_seek_bar_2);
+ mSecondarySeekBar.setOnSeekBarChangeListener(this);
+ }
+
/** Enables the debug overlay drawing. */
public void enable() {
mEnabled = true;
- invalidate();
+ setVisibility(View.VISIBLE);
}
/** Disables the debug overlay drawing. */
public void disable() {
mEnabled = false;
- invalidate();
+ setVisibility(View.GONE);
}
/** Clears all debug rects. */
@@ -110,4 +147,25 @@ public class DebugOverlayView extends FrameLayout {
}
}
}
+
+ /**** SeekBar.OnSeekBarChangeListener Implementation ****/
+
+ @Override
+ public void onStopTrackingTouch(SeekBar seekBar) {
+ // Do nothing
+ }
+
+ @Override
+ public void onStartTrackingTouch(SeekBar seekBar) {
+ // Do nothing
+ }
+
+ @Override
+ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
+ if (seekBar == mPrimarySeekBar) {
+ mCb.onPrimarySeekBarChanged((float) progress / mPrimarySeekBar.getMax());
+ } else if (seekBar == mSecondarySeekBar) {
+ mCb.onSecondarySeekBarChanged((float) progress / mSecondarySeekBar.getMax());
+ }
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskBarView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskBarView.java
index dc8f0db33389b..492e3aa0ad423 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskBarView.java
@@ -35,7 +35,6 @@ import android.widget.TextView;
import com.android.systemui.R;
import com.android.systemui.recents.Constants;
import com.android.systemui.recents.RecentsConfiguration;
-import com.android.systemui.recents.misc.Utilities;
import com.android.systemui.recents.model.Task;
@@ -115,7 +114,7 @@ class TaskBarView extends FrameLayout {
protected void onDraw(Canvas canvas) {
if (!mIsFullscreen) {
// Draw the highlight at the top edge (but put the bottom edge just out of view)
- float offset = mConfig.taskViewHighlightPx / 2f;
+ float offset = (float) Math.ceil(mConfig.taskViewHighlightPx / 2f);
float radius = mConfig.taskViewRoundedCornerRadiusPx;
canvas.drawRoundRect(-offset, 0f, (float) getMeasuredWidth() + offset,
getMeasuredHeight() + radius, radius, radius, sHighlightPaint);
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
index ba90af3516d01..aa67c1e32c7db 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
@@ -27,7 +27,6 @@ import android.graphics.Rect;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
-import android.view.accessibility.AccessibilityEvent;
import android.widget.FrameLayout;
import android.widget.OverScroller;
import com.android.systemui.R;
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
index e97ce30f665ac..8a16d304c96e8 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
@@ -68,6 +68,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
TaskThumbnailView mThumbnailView;
TaskBarView mBarView;
TaskFooterView mFooterView;
+ View mActionButtonView;
TaskViewCallbacks mCb;
// Optimizations
@@ -122,11 +123,9 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
// Bind the views
mBarView = (TaskBarView) findViewById(R.id.task_view_bar);
mThumbnailView = (TaskThumbnailView) findViewById(R.id.task_view_thumbnail);
- mFooterView = (TaskFooterView) findViewById(R.id.lock_to_app);
- if (mConfig.lockToAppEnabled) {
+ mActionButtonView = findViewById(R.id.lock_to_app_fab);
+ if (mFooterView != null) {
mFooterView.setCallbacks(this);
- } else {
- mFooterView.setVisibility(View.GONE);
}
}
@@ -138,9 +137,13 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
// Measure the bar view, thumbnail, and footer
mBarView.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
MeasureSpec.makeMeasureSpec(mConfig.taskBarHeight, MeasureSpec.EXACTLY));
- mFooterView.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
- MeasureSpec.makeMeasureSpec(mConfig.taskViewLockToAppButtonHeight,
- MeasureSpec.EXACTLY));
+ if (mFooterView != null) {
+ mFooterView.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
+ MeasureSpec.makeMeasureSpec(mConfig.taskViewLockToAppButtonHeight,
+ MeasureSpec.EXACTLY));
+ }
+ mActionButtonView.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.AT_MOST),
+ MeasureSpec.makeMeasureSpec(height, MeasureSpec.AT_MOST));
if (mIsFullScreenView) {
// Measure the thumbnail height to be the full dimensions
mThumbnailView.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
@@ -208,7 +211,9 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
if (isTaskViewLaunchTargetTask) {
mBarView.prepareEnterRecentsAnimation();
// Hide the footer during the transition in, and animate it out afterwards?
- mFooterView.animateFooterVisibility(false, 0);
+ if (mFooterView != null) {
+ mFooterView.animateFooterVisibility(false, 0);
+ }
} else {
// Don't do anything for the side views when animating in
}
@@ -217,6 +222,8 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
if (isTaskViewLaunchTargetTask) {
// Hide the front most task bar view so we can animate it in
mBarView.prepareEnterRecentsAnimation();
+ // Hide the action button if it exists
+ mActionButtonView.setAlpha(0f);
// Set the dim to 0 so we can animate it in
setDim(0);
} else if (occludesLaunchTarget) {
@@ -334,6 +341,14 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
// Animate the footer into view
animateFooterVisibility(true, mConfig.taskBarEnterAnimDuration);
+
+ // Animate the action button in
+ mActionButtonView.animate().alpha(1f)
+ .setStartDelay(mConfig.taskBarEnterAnimDelay)
+ .setDuration(mConfig.taskBarEnterAnimDuration)
+ .setInterpolator(mConfig.fastOutLinearInInterpolator)
+ .withLayer()
+ .start();
} else {
// Enable the task bar clip
mThumbnailView.enableTaskBarClip(mBarView);
@@ -426,6 +441,14 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
anim.setInterpolator(mConfig.fastOutLinearInInterpolator);
anim.start();
}
+
+ // Animate the action button away
+ mActionButtonView.animate().alpha(0f)
+ .setStartDelay(0)
+ .setDuration(mConfig.taskBarExitAnimDuration)
+ .setInterpolator(mConfig.fastOutLinearInInterpolator)
+ .withLayer()
+ .start();
} else {
// Hide the dismiss button
mBarView.startLaunchTaskDismissAnimation();
@@ -514,7 +537,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
/** Gets the max footer height. */
public int getMaxFooterHeight() {
- if (mConfig.lockToAppEnabled) {
+ if (mFooterView != null) {
return mFooterView.mMaxFooterHeight;
} else {
return 0;
@@ -528,7 +551,9 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
// Hide the footer if the current task can not be locked to
if (!mTask.lockToTaskEnabled || !mTask.lockToThisTask) return;
// Otherwise, animate the visibility
- mFooterView.animateFooterVisibility(visible, duration);
+ if (mFooterView != null) {
+ mFooterView.animateFooterVisibility(visible, duration);
+ }
}
/** Returns the current dim. */
@@ -608,6 +633,10 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
} else {
animateFooterVisibility(t.lockToThisTask, mConfig.taskViewLockToAppLongAnimDuration);
}
+ // Hide the action button if lock to app is disabled
+ if (!t.lockToTaskEnabled && mActionButtonView.getVisibility() != View.GONE) {
+ mActionButtonView.setVisibility(View.GONE);
+ }
}
@Override
@@ -625,7 +654,10 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
mBarView.mApplicationIcon.setOnClickListener(this);
}
mBarView.mDismissButton.setOnClickListener(this);
- mFooterView.setOnClickListener(this);
+ if (mFooterView != null) {
+ mFooterView.setOnClickListener(this);
+ }
+ mActionButtonView.setOnClickListener(this);
if (Constants.DebugFlags.App.EnableDevAppInfoOnLongPress) {
if (mConfig.developerOptionsEnabled) {
mBarView.mApplicationIcon.setOnLongClickListener(this);
@@ -647,7 +679,10 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
mBarView.mApplicationIcon.setOnClickListener(null);
}
mBarView.mDismissButton.setOnClickListener(null);
- mFooterView.setOnClickListener(null);
+ if (mFooterView != null) {
+ mFooterView.setOnClickListener(null);
+ }
+ mActionButtonView.setOnClickListener(null);
if (Constants.DebugFlags.App.EnableDevAppInfoOnLongPress) {
mBarView.mApplicationIcon.setOnLongClickListener(null);
}
@@ -694,8 +729,9 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
});
// Hide the footer
tv.animateFooterVisibility(false, mConfig.taskViewRemoveAnimDuration);
- } else if (v == tv || v == mFooterView) {
- mCb.onTaskViewClicked(tv, tv.getTask(), (v == mFooterView));
+ } else if (v == tv || (v == mFooterView || v == mActionButtonView)) {
+ mCb.onTaskViewClicked(tv, tv.getTask(),
+ (v == mFooterView || v == mActionButtonView));
}
}
}, 125);