diff options
author | Winson Chung <winsonc@google.com> | 2014-07-28 11:01:57 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2014-07-28 22:26:36 +0000 |
commit | 2915b9d14876c8e63ca82415807bcfb602ebad43 (patch) | |
tree | a442611eed8cd46a39d0c4cdc841f7c04c18af6a /packages/SystemUI | |
parent | 62dc1768d6a2fcbed9e5dc4b26ecc4ccd22122fd (diff) | |
download | frameworks_base-2915b9d14876c8e63ca82415807bcfb602ebad43.zip frameworks_base-2915b9d14876c8e63ca82415807bcfb602ebad43.tar.gz frameworks_base-2915b9d14876c8e63ca82415807bcfb602ebad43.tar.bz2 |
Updating lock-to-app look.
- Adding seek bars for tweaking values when in debug mode
Change-Id: I92ae7b431ee170f5d8b31f34349d51a6b7f9ddef
Diffstat (limited to 'packages/SystemUI')
20 files changed, 232 insertions, 117 deletions
diff --git a/packages/SystemUI/res/drawable-hdpi/btn_fab_recents.png b/packages/SystemUI/res/drawable-hdpi/btn_fab_recents.png Binary files differnew file mode 100644 index 0000000..b95fde5 --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/btn_fab_recents.png diff --git a/packages/SystemUI/res/drawable-mdpi/btn_fab_recents.png b/packages/SystemUI/res/drawable-mdpi/btn_fab_recents.png Binary files differnew file mode 100644 index 0000000..6bbed06 --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/btn_fab_recents.png diff --git a/packages/SystemUI/res/drawable-xhdpi/btn_fab_recents.png b/packages/SystemUI/res/drawable-xhdpi/btn_fab_recents.png Binary files differnew file mode 100644 index 0000000..4cdd0aa --- /dev/null +++ b/packages/SystemUI/res/drawable-xhdpi/btn_fab_recents.png diff --git a/packages/SystemUI/res/drawable-xxhdpi/btn_fab_recents.png b/packages/SystemUI/res/drawable-xxhdpi/btn_fab_recents.png Binary files differnew file mode 100644 index 0000000..2220d60 --- /dev/null +++ b/packages/SystemUI/res/drawable-xxhdpi/btn_fab_recents.png diff --git a/packages/SystemUI/res/drawable/recents_dismiss_dark.xml b/packages/SystemUI/res/drawable/recents_dismiss_dark.xml index 337c028..ba09ebe 100644 --- a/packages/SystemUI/res/drawable/recents_dismiss_dark.xml +++ b/packages/SystemUI/res/drawable/recents_dismiss_dark.xml @@ -1,29 +1,24 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2014 The Android Open Source Project +<!-- +Copyright (C) 2014 The Android Open Source Project - 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 + 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 + 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. + 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. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - android:height="16dp" - android:width="16dp" - android:viewportHeight="100" - android:viewportWidth="100" > - + android:width="48.0dp" + android:height="48.0dp" + android:viewportWidth="48.0" + android:viewportHeight="48.0"> <path - android:name="x" - android:pathData="M0,0L100,100M0,100L100,0z" - android:strokeColor="@color/recents_task_bar_dark_dismiss_color" - android:strokeWidth="8.0" - android:strokeLineCap="square" /> - + 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"/> </vector>
\ 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 963ccf7..be0825c 100644 --- a/packages/SystemUI/res/drawable/recents_dismiss_light.xml +++ b/packages/SystemUI/res/drawable/recents_dismiss_light.xml @@ -1,30 +1,24 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2014 The Android Open Source Project +<!-- +Copyright (C) 2014 The Android Open Source Project - 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 + 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 + 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. + 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. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - android:height="16dp" - android:width="16dp" - android:viewportHeight="100" - android:viewportWidth="100" > - - + android:width="48.0dp" + android:height="48.0dp" + android:viewportWidth="48.0" + android:viewportHeight="48.0"> <path - android:name="x" - android:pathData="M0,0L100,100M0,100L100,0z" - android:strokeColor="@color/recents_task_bar_light_dismiss_color" - android:strokeWidth="8.0" - android:strokeLineCap="square" /> - + 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"/> </vector>
\ 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 0000000..317f858 --- /dev/null +++ b/packages/SystemUI/res/drawable/recents_lock_to_app_pin.xml @@ -0,0 +1,25 @@ +<!-- +Copyright (C) 2014 The Android Open Source Project + + 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. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24.0dp" + android:height="24.0dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + + <path + android:fillColor="#FFffffff" + android:pathData="M16.000000,12.000000L16.000000,4.000000l1.000000,0.000000L17.000000,2.000000L7.000000,2.000000l0.000000,2.000000l1.000000,0.000000l0.000000,8.000000l-2.000000,2.000000l0.000000,2.000000l5.200000,0.000000l0.000000,6.000000l1.600000,0.000000l0.000000,-6.000000L18.000000,16.000000l0.000000,-2.000000L16.000000,12.000000z"/> +</vector> 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 d38c8a4..6424a65 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 @@ --> <ripple xmlns:android="http://schemas.android.com/apk/res/android" - android:color="#ffdadada"> - <item android:drawable="@color/recents_task_view_lock_to_app_button_background_color" /> + android:color="#ff9cdfd9"> + <item android:drawable="@drawable/btn_fab_recents" /> </ripple>
\ No newline at end of file diff --git a/packages/SystemUI/res/layout/recents.xml b/packages/SystemUI/res/layout/recents.xml index 47740ee..8f367a6 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" /> - <!-- Fullscreen Transition View --> - <ViewStub android:id="@+id/fullscreen_overlay_stub" - android:layout="@layout/recents_fullscreen_overlay" + <!-- Debug Overlay View --> + <ViewStub android:id="@+id/debug_overlay_stub" + android:layout="@layout/recents_debug_overlay" 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 index 1d021f9..d23495e 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. --> - -<com.android.systemui.recents.views.FullscreenTransitionOverlayView +<com.android.systemui.recents.views.DebugOverlayView xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" + android:layout_width="match_parent" android:layout_height="match_parent" - android:visibility="gone"> - <ImageView - android:id="@+id/image" + android:focusable="false"> + <SeekBar + android:id="@+id/debug_seek_bar_1" android:layout_width="match_parent" - android:layout_height="match_parent" - android:scaleType="fitXY" /> -</com.android.systemui.recents.views.FullscreenTransitionOverlayView>
\ No newline at end of file + android:layout_height="wrap_content" + android:layout_gravity="top" + android:layout_marginTop="25dp" /> + <SeekBar + android:id="@+id/debug_seek_bar_2" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="top" + android:layout_marginTop="50dp" /> +</com.android.systemui.recents.views.DebugOverlayView> + + diff --git a/packages/SystemUI/res/layout/recents_task_view.xml b/packages/SystemUI/res/layout/recents_task_view.xml index 93c5538..f8dfd65 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" /> </com.android.systemui.recents.views.TaskBarView> - <com.android.systemui.recents.views.TaskFooterView - android:id="@+id/lock_to_app" - android:layout_width="match_parent" - android:layout_height="@dimen/recents_task_view_lock_to_app_button_height" - android:layout_gravity="center_horizontal|bottom" + <FrameLayout + android:id="@+id/lock_to_app_fab" + android:layout_width="48dp" + android:layout_height="48dp" + android:layout_gravity="bottom|right" + android:layout_marginRight="15dp" + android:layout_marginBottom="15dp" + android:translationZ="50dp" + android:contentDescription="@string/recents_lock_to_app_button_label" android:background="@drawable/recents_lock_to_task_button_bg"> - <TextView - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:layout_gravity="center_horizontal" - android:gravity="center" - android:drawableLeft="@drawable/ic_lock_to_app_24dp" - android:drawablePadding="8dp" - android:textSize="16sp" - android:textColor="@color/recents_task_view_lock_to_app_button_color" - android:text="@string/recents_lock_to_app_button_label" - android:fontFamily="sans-serif-medium" - android:singleLine="true" - android:textAllCaps="true" /> - </com.android.systemui.recents.views.TaskFooterView> + <ImageView + android:layout_width="24dp" + android:layout_height="24dp" + android:layout_gravity="center" + android:src="@drawable/recents_lock_to_app_pin" /> + </FrameLayout> </com.android.systemui.recents.views.TaskView> diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index bd10623..32474c9 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -208,7 +208,7 @@ <dimen name="recents_task_view_remove_anim_translation_x">100dp</dimen> <!-- The amount of highlight to make on each task view. --> - <dimen name="recents_task_view_highlight">1dp</dimen> + <dimen name="recents_task_view_highlight">1.5dp</dimen> <!-- The height of the lock-to-app button. --> <dimen name="recents_task_view_lock_to_app_button_height">48dp</dimen> diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java index 18dad3a..4534897 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 36d06d5..fbcbe2c 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 9325947..f30e22a 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 fdc5775..04ee9dd 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 6c90fe3..4c3fbf0 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<Pair<Rect, Integer>> mRects = new ArrayList<Pair<Rect, Integer>>(); 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 dc8f0db..492e3aa 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 ba90af3..aa67c1e 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 e97ce30..8a16d30 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); |