Merge "Fix 3354590: Add back button to dismiss RecentAppsPanel" into honeycomb
This commit is contained in:
@@ -30,7 +30,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:paddingBottom="48dip"
|
android:paddingBottom="@*android:dimen/status_bar_height"
|
||||||
android:clipToPadding="false">
|
android:clipToPadding="false">
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/recents_glow"
|
<LinearLayout android:id="@+id/recents_glow"
|
||||||
@@ -52,4 +52,20 @@
|
|||||||
|
|
||||||
</FrameLayout>
|
</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>
|
</com.android.systemui.statusbar.tablet.RecentAppsPanel>
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ public class RecentAppsPanel extends RelativeLayout implements StatusBarPanel, O
|
|||||||
private Bitmap mGlowBitmap;
|
private Bitmap mGlowBitmap;
|
||||||
private boolean mShowing;
|
private boolean mShowing;
|
||||||
private Choreographer mChoreo;
|
private Choreographer mChoreo;
|
||||||
|
private View mRecentsDismissButton;
|
||||||
|
|
||||||
static class ActivityDescription {
|
static class ActivityDescription {
|
||||||
int id;
|
int id;
|
||||||
@@ -272,6 +273,12 @@ public class RecentAppsPanel extends RelativeLayout implements StatusBarPanel, O
|
|||||||
mRecentsGlowView = findViewById(R.id.recents_glow);
|
mRecentsGlowView = findViewById(R.id.recents_glow);
|
||||||
mRecentsScrim = (View) findViewById(R.id.recents_bg_protect);
|
mRecentsScrim = (View) findViewById(R.id.recents_bg_protect);
|
||||||
mChoreo = new Choreographer(this, mRecentsScrim, mRecentsGlowView);
|
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
|
// In order to save space, we make the background texture repeat in the Y direction
|
||||||
if (mRecentsScrim != null && mRecentsScrim.getBackground() instanceof BitmapDrawable) {
|
if (mRecentsScrim != null && mRecentsScrim.getBackground() instanceof BitmapDrawable) {
|
||||||
@@ -399,8 +406,7 @@ public class RecentAppsPanel extends RelativeLayout implements StatusBarPanel, O
|
|||||||
} else {
|
} else {
|
||||||
// Immediately hide this panel
|
// Immediately hide this panel
|
||||||
mShowing = false;
|
mShowing = false;
|
||||||
setVisibility(View.GONE);
|
hide(false);
|
||||||
// mBar.animateCollapse();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -445,8 +451,8 @@ public class RecentAppsPanel extends RelativeLayout implements StatusBarPanel, O
|
|||||||
appIcon.setImageDrawable(activityDescription.icon);
|
appIcon.setImageDrawable(activityDescription.icon);
|
||||||
appLabel.setText(activityDescription.label);
|
appLabel.setText(activityDescription.label);
|
||||||
appDesc.setText(activityDescription.description);
|
appDesc.setText(activityDescription.description);
|
||||||
view.setOnClickListener(this);
|
appThumbnail.setOnClickListener(this);
|
||||||
view.setTag(activityDescription);
|
appThumbnail.setTag(activityDescription);
|
||||||
mRecentsContainer.addView(view);
|
mRecentsContainer.addView(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -469,7 +475,13 @@ public class RecentAppsPanel extends RelativeLayout implements StatusBarPanel, O
|
|||||||
if (DEBUG) Log.v(TAG, "Starting activity " + intent);
|
if (DEBUG) Log.v(TAG, "Starting activity " + intent);
|
||||||
getContext().startActivity(intent);
|
getContext().startActivity(intent);
|
||||||
}
|
}
|
||||||
|
hide(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void hide(boolean animate) {
|
||||||
setVisibility(View.GONE);
|
setVisibility(View.GONE);
|
||||||
mBar.animateCollapse();
|
if (animate) {
|
||||||
|
mBar.animateCollapse();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user