diff options
| author | 2011-01-26 15:39:51 -0800 | |
|---|---|---|
| committer | 2011-01-26 15:39:51 -0800 | |
| commit | f1e22e5c78a59d01837c1859173b6ccfd13a89dd (patch) | |
| tree | 528a6f9734f6b69338ac5345220d7f06d5eb699a | |
| parent | b8942108826893657ca0b8b6d5d6d153739a76f6 (diff) | |
Fix 3354590: Add back button to dismiss RecentAppsPanel
Change-Id: I65337e8ebf823e7a92f810cd670b23edf8e70067
| -rw-r--r-- | packages/SystemUI/res/layout-xlarge/status_bar_recent_panel.xml | 18 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java | 22 |
2 files changed, 34 insertions, 6 deletions
diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_recent_panel.xml b/packages/SystemUI/res/layout-xlarge/status_bar_recent_panel.xml index a1216aa86029..ecd2b6f225c7 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar_recent_panel.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar_recent_panel.xml @@ -30,7 +30,7 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_alignParentBottom="true" - android:paddingBottom="48dip" + android:paddingBottom="@*android:dimen/status_bar_height" android:clipToPadding="false"> <LinearLayout android:id="@+id/recents_glow" @@ -52,4 +52,20 @@ </FrameLayout> + <!-- The outer FrameLayout is just used as an opaque background for the dismiss icon --> + <FrameLayout + android:layout_width="80px" + android:layout_height="@*android:dimen/status_bar_height" + android:layout_alignParentBottom="true" + android:layout_alignParentLeft="true" + android:background="#ff000000"> + + <View android:id="@+id/recents_dismiss_button" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@drawable/ic_sysbar_back_ime" + /> + + </FrameLayout> + </com.android.systemui.statusbar.tablet.RecentAppsPanel> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java index 7544f4621ebd..2d536a2975a7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java @@ -70,6 +70,7 @@ public class RecentAppsPanel extends RelativeLayout implements StatusBarPanel, O private Bitmap mGlowBitmap; private boolean mShowing; private Choreographer mChoreo; + private View mRecentsDismissButton; static class ActivityDescription { int id; @@ -270,6 +271,12 @@ public class RecentAppsPanel extends RelativeLayout implements StatusBarPanel, O mRecentsGlowView = findViewById(R.id.recents_glow); mRecentsScrim = (View) findViewById(R.id.recents_bg_protect); mChoreo = new Choreographer(this, mRecentsScrim, mRecentsGlowView); + mRecentsDismissButton = findViewById(R.id.recents_dismiss_button); + mRecentsDismissButton.setOnClickListener(new OnClickListener() { + public void onClick(View v) { + hide(true); + } + }); // In order to save space, we make the background texture repeat in the Y direction if (mRecentsScrim != null && mRecentsScrim.getBackground() instanceof BitmapDrawable) { @@ -397,8 +404,7 @@ public class RecentAppsPanel extends RelativeLayout implements StatusBarPanel, O } else { // Immediately hide this panel mShowing = false; - setVisibility(View.GONE); - // mBar.animateCollapse(); + hide(false); } } @@ -443,8 +449,8 @@ public class RecentAppsPanel extends RelativeLayout implements StatusBarPanel, O appIcon.setImageDrawable(activityDescription.icon); appLabel.setText(activityDescription.label); appDesc.setText(activityDescription.description); - view.setOnClickListener(this); - view.setTag(activityDescription); + appThumbnail.setOnClickListener(this); + appThumbnail.setTag(activityDescription); mRecentsContainer.addView(view); } @@ -467,7 +473,13 @@ public class RecentAppsPanel extends RelativeLayout implements StatusBarPanel, O if (DEBUG) Log.v(TAG, "Starting activity " + intent); getContext().startActivity(intent); } + hide(true); + } + + private void hide(boolean animate) { setVisibility(View.GONE); - mBar.animateCollapse(); + if (animate) { + mBar.animateCollapse(); + } } } |