Merge "Make Recent Apps faster" into ics-mr0
This commit is contained in:
committed by
Android (Google) Code Review
commit
9a76afff4d
@@ -16,5 +16,5 @@
|
|||||||
|
|
||||||
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
|
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:fromAlpha="0.0" android:toAlpha="1.0"
|
android:fromAlpha="0.0" android:toAlpha="1.0"
|
||||||
android:duration="@android:integer/config_mediumAnimTime"
|
android:duration="@android:integer/config_shortAnimTime"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -39,11 +39,11 @@
|
|||||||
android:layout_marginTop="@dimen/status_bar_recents_thumbnail_top_margin"
|
android:layout_marginTop="@dimen/status_bar_recents_thumbnail_top_margin"
|
||||||
android:layout_marginLeft="@dimen/status_bar_recents_thumbnail_left_margin"
|
android:layout_marginLeft="@dimen/status_bar_recents_thumbnail_left_margin"
|
||||||
android:background="@drawable/recents_thumbnail_bg"
|
android:background="@drawable/recents_thumbnail_bg"
|
||||||
android:foreground="@drawable/recents_thumbnail_fg">
|
android:foreground="@drawable/recents_thumbnail_fg"
|
||||||
|
android:visibility="invisible">
|
||||||
<ImageView android:id="@+id/app_thumbnail_image"
|
<ImageView android:id="@+id/app_thumbnail_image"
|
||||||
android:layout_width="@dimen/status_bar_recents_thumbnail_width"
|
android:layout_width="@dimen/status_bar_recents_thumbnail_width"
|
||||||
android:layout_height="@dimen/status_bar_recents_thumbnail_height"
|
android:layout_height="@dimen/status_bar_recents_thumbnail_height"
|
||||||
android:visibility="invisible"
|
|
||||||
/>
|
/>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
@@ -58,7 +58,6 @@
|
|||||||
android:maxHeight="@dimen/status_bar_recents_app_icon_max_height"
|
android:maxHeight="@dimen/status_bar_recents_app_icon_max_height"
|
||||||
android:scaleType="centerInside"
|
android:scaleType="centerInside"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:visibility="invisible"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextView android:id="@+id/app_label"
|
<TextView android:id="@+id/app_label"
|
||||||
@@ -74,7 +73,6 @@
|
|||||||
android:layout_marginLeft="@dimen/status_bar_recents_app_label_left_margin"
|
android:layout_marginLeft="@dimen/status_bar_recents_app_label_left_margin"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:ellipsize="marquee"
|
android:ellipsize="marquee"
|
||||||
android:visibility="invisible"
|
|
||||||
android:textColor="@color/status_bar_recents_app_label_color"
|
android:textColor="@color/status_bar_recents_app_label_color"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -52,11 +52,11 @@
|
|||||||
android:layout_toRightOf="@id/app_label"
|
android:layout_toRightOf="@id/app_label"
|
||||||
android:layout_marginLeft="@dimen/status_bar_recents_thumbnail_left_margin"
|
android:layout_marginLeft="@dimen/status_bar_recents_thumbnail_left_margin"
|
||||||
android:background="@drawable/recents_thumbnail_bg"
|
android:background="@drawable/recents_thumbnail_bg"
|
||||||
android:foreground="@drawable/recents_thumbnail_fg">
|
android:foreground="@drawable/recents_thumbnail_fg"
|
||||||
|
android:visibility="invisible">
|
||||||
<ImageView android:id="@+id/app_thumbnail_image"
|
<ImageView android:id="@+id/app_thumbnail_image"
|
||||||
android:layout_width="@dimen/status_bar_recents_thumbnail_width"
|
android:layout_width="@dimen/status_bar_recents_thumbnail_width"
|
||||||
android:layout_height="@dimen/status_bar_recents_thumbnail_height"
|
android:layout_height="@dimen/status_bar_recents_thumbnail_height"
|
||||||
android:visibility="invisible"
|
|
||||||
/>
|
/>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
<View android:id="@+id/recents_callout_line"
|
<View android:id="@+id/recents_callout_line"
|
||||||
|
|||||||
@@ -31,11 +31,11 @@
|
|||||||
android:layout_marginLeft="@dimen/status_bar_recents_thumbnail_left_margin"
|
android:layout_marginLeft="@dimen/status_bar_recents_thumbnail_left_margin"
|
||||||
android:scaleType="center"
|
android:scaleType="center"
|
||||||
android:background="@drawable/recents_thumbnail_bg"
|
android:background="@drawable/recents_thumbnail_bg"
|
||||||
android:foreground="@drawable/recents_thumbnail_fg">
|
android:foreground="@drawable/recents_thumbnail_fg"
|
||||||
|
android:visibility="invisible">
|
||||||
<ImageView android:id="@+id/app_thumbnail_image"
|
<ImageView android:id="@+id/app_thumbnail_image"
|
||||||
android:layout_width="@dimen/status_bar_recents_thumbnail_width"
|
android:layout_width="@dimen/status_bar_recents_thumbnail_width"
|
||||||
android:layout_height="@dimen/status_bar_recents_thumbnail_height"
|
android:layout_height="@dimen/status_bar_recents_thumbnail_height"
|
||||||
android:visibility="invisible"
|
|
||||||
/>
|
/>
|
||||||
<ImageView android:id="@+id/app_icon"
|
<ImageView android:id="@+id/app_icon"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
@@ -86,8 +86,8 @@ public class RecentTasksLoader {
|
|||||||
mIconDpi = isTablet ? DisplayMetrics.DENSITY_HIGH : res.getDisplayMetrics().densityDpi;
|
mIconDpi = isTablet ? DisplayMetrics.DENSITY_HIGH : res.getDisplayMetrics().densityDpi;
|
||||||
|
|
||||||
// Render the default thumbnail background
|
// Render the default thumbnail background
|
||||||
int width = (int) res.getDimension(R.dimen.status_bar_recents_thumbnail_width);
|
int width = (int) res.getDimensionPixelSize(com.android.internal.R.dimen.thumbnail_width);
|
||||||
int height = (int) res.getDimension(R.dimen.status_bar_recents_thumbnail_height);
|
int height = (int) res.getDimensionPixelSize(com.android.internal.R.dimen.thumbnail_height);
|
||||||
int color = res.getColor(R.drawable.status_bar_recents_app_thumbnail_background);
|
int color = res.getColor(R.drawable.status_bar_recents_app_thumbnail_background);
|
||||||
|
|
||||||
mDefaultThumbnailBackground = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
|
mDefaultThumbnailBackground = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
|
||||||
@@ -106,6 +106,10 @@ public class RecentTasksLoader {
|
|||||||
mRecentsPanel = recentsPanel;
|
mRecentsPanel = recentsPanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Bitmap getDefaultThumbnail() {
|
||||||
|
return mDefaultThumbnailBackground;
|
||||||
|
}
|
||||||
|
|
||||||
// Create an TaskDescription, returning null if the title or icon is null, or if it's the
|
// Create an TaskDescription, returning null if the title or icon is null, or if it's the
|
||||||
// home activity
|
// home activity
|
||||||
TaskDescription createTaskDescription(int taskId, int persistentTaskId, Intent baseIntent,
|
TaskDescription createTaskDescription(int taskId, int persistentTaskId, Intent baseIntent,
|
||||||
@@ -278,7 +282,7 @@ public class RecentTasksLoader {
|
|||||||
TaskDescription td = descriptions.get(i);
|
TaskDescription td = descriptions.get(i);
|
||||||
loadThumbnail(td);
|
loadThumbnail(td);
|
||||||
long now = SystemClock.uptimeMillis();
|
long now = SystemClock.uptimeMillis();
|
||||||
nextTime += 150;
|
nextTime += 0;
|
||||||
if (nextTime > now) {
|
if (nextTime > now) {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(nextTime-now);
|
Thread.sleep(nextTime-now);
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.ViewConfiguration;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.accessibility.AccessibilityEvent;
|
import android.view.accessibility.AccessibilityEvent;
|
||||||
import android.view.animation.AnimationUtils;
|
import android.view.animation.AnimationUtils;
|
||||||
@@ -57,8 +58,8 @@ import com.android.systemui.statusbar.phone.PhoneStatusBar;
|
|||||||
import com.android.systemui.statusbar.tablet.StatusBarPanel;
|
import com.android.systemui.statusbar.tablet.StatusBarPanel;
|
||||||
import com.android.systemui.statusbar.tablet.TabletStatusBar;
|
import com.android.systemui.statusbar.tablet.TabletStatusBar;
|
||||||
|
|
||||||
public class RecentsPanelView extends RelativeLayout
|
public class RecentsPanelView extends RelativeLayout implements OnItemClickListener, RecentsCallback,
|
||||||
implements OnItemClickListener, RecentsCallback, StatusBarPanel, Animator.AnimatorListener {
|
StatusBarPanel, Animator.AnimatorListener, View.OnTouchListener {
|
||||||
static final String TAG = "RecentsPanelView";
|
static final String TAG = "RecentsPanelView";
|
||||||
static final boolean DEBUG = TabletStatusBar.DEBUG || PhoneStatusBar.DEBUG || false;
|
static final boolean DEBUG = TabletStatusBar.DEBUG || PhoneStatusBar.DEBUG || false;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
@@ -74,6 +75,7 @@ public class RecentsPanelView extends RelativeLayout
|
|||||||
|
|
||||||
private RecentTasksLoader mRecentTasksLoader;
|
private RecentTasksLoader mRecentTasksLoader;
|
||||||
private ArrayList<TaskDescription> mRecentTaskDescriptions;
|
private ArrayList<TaskDescription> mRecentTaskDescriptions;
|
||||||
|
private boolean mRecentTasksDirty = true;
|
||||||
private TaskDescriptionAdapter mListAdapter;
|
private TaskDescriptionAdapter mListAdapter;
|
||||||
private int mThumbnailWidth;
|
private int mThumbnailWidth;
|
||||||
|
|
||||||
@@ -94,6 +96,7 @@ public class RecentsPanelView extends RelativeLayout
|
|||||||
/* package */ final static class ViewHolder {
|
/* package */ final static class ViewHolder {
|
||||||
View thumbnailView;
|
View thumbnailView;
|
||||||
ImageView thumbnailViewImage;
|
ImageView thumbnailViewImage;
|
||||||
|
Bitmap thumbnailViewImageBitmap;
|
||||||
ImageView iconView;
|
ImageView iconView;
|
||||||
TextView labelView;
|
TextView labelView;
|
||||||
TextView descriptionView;
|
TextView descriptionView;
|
||||||
@@ -127,6 +130,10 @@ public class RecentsPanelView extends RelativeLayout
|
|||||||
holder.thumbnailView = convertView.findViewById(R.id.app_thumbnail);
|
holder.thumbnailView = convertView.findViewById(R.id.app_thumbnail);
|
||||||
holder.thumbnailViewImage = (ImageView) convertView.findViewById(
|
holder.thumbnailViewImage = (ImageView) convertView.findViewById(
|
||||||
R.id.app_thumbnail_image);
|
R.id.app_thumbnail_image);
|
||||||
|
// If we set the default thumbnail now, we avoid an onLayout when we update
|
||||||
|
// the thumbnail later (if they both have the same dimensions)
|
||||||
|
updateThumbnail(holder, mRecentTasksLoader.getDefaultThumbnail(), false, false);
|
||||||
|
|
||||||
holder.iconView = (ImageView) convertView.findViewById(R.id.app_icon);
|
holder.iconView = (ImageView) convertView.findViewById(R.id.app_icon);
|
||||||
holder.labelView = (TextView) convertView.findViewById(R.id.app_label);
|
holder.labelView = (TextView) convertView.findViewById(R.id.app_label);
|
||||||
holder.descriptionView = (TextView) convertView.findViewById(R.id.app_description);
|
holder.descriptionView = (TextView) convertView.findViewById(R.id.app_description);
|
||||||
@@ -139,12 +146,15 @@ public class RecentsPanelView extends RelativeLayout
|
|||||||
// index is reverse since most recent appears at the bottom...
|
// index is reverse since most recent appears at the bottom...
|
||||||
final int index = mRecentTaskDescriptions.size() - position - 1;
|
final int index = mRecentTaskDescriptions.size() - position - 1;
|
||||||
|
|
||||||
final TaskDescription taskDescription = mRecentTaskDescriptions.get(index);
|
final TaskDescription td = mRecentTaskDescriptions.get(index);
|
||||||
applyTaskDescription(holder, taskDescription, false);
|
holder.iconView.setImageDrawable(td.getIcon());
|
||||||
|
holder.labelView.setText(td.getLabel());
|
||||||
|
holder.thumbnailView.setContentDescription(td.getLabel());
|
||||||
|
updateThumbnail(holder, td.getThumbnail(), true, false);
|
||||||
|
|
||||||
holder.thumbnailView.setTag(taskDescription);
|
holder.thumbnailView.setTag(td);
|
||||||
holder.thumbnailView.setOnLongClickListener(new OnLongClickDelegate(convertView));
|
holder.thumbnailView.setOnLongClickListener(new OnLongClickDelegate(convertView));
|
||||||
holder.taskDescription = taskDescription;
|
holder.taskDescription = td;
|
||||||
|
|
||||||
return convertView;
|
return convertView;
|
||||||
}
|
}
|
||||||
@@ -193,6 +203,7 @@ public class RecentsPanelView extends RelativeLayout
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mRecentTasksLoader.cancelLoadingThumbnails();
|
mRecentTasksLoader.cancelLoadingThumbnails();
|
||||||
|
mRecentTasksDirty = true;
|
||||||
}
|
}
|
||||||
if (animate) {
|
if (animate) {
|
||||||
if (mShowing != show) {
|
if (mShowing != show) {
|
||||||
@@ -250,9 +261,7 @@ public class RecentsPanelView extends RelativeLayout
|
|||||||
createCustomAnimations(transitioner);
|
createCustomAnimations(transitioner);
|
||||||
} else {
|
} else {
|
||||||
((ViewGroup)mRecentsContainer).setLayoutTransition(null);
|
((ViewGroup)mRecentsContainer).setLayoutTransition(null);
|
||||||
// Clear memory used by screenshots
|
clearRecentTasksList();
|
||||||
mRecentTaskDescriptions.clear();
|
|
||||||
mListAdapter.notifyDataSetInvalidated();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -374,47 +383,33 @@ public class RecentsPanelView extends RelativeLayout
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateThumbnail(ViewHolder h, Bitmap thumbnail, boolean show, boolean anim) {
|
||||||
void applyTaskDescription(ViewHolder h, TaskDescription td, boolean anim) {
|
|
||||||
h.iconView.setImageDrawable(td.getIcon());
|
|
||||||
if (h.iconView.getVisibility() != View.VISIBLE) {
|
|
||||||
if (anim) {
|
|
||||||
h.iconView.setAnimation(AnimationUtils.loadAnimation(
|
|
||||||
mContext, R.anim.recent_appear));
|
|
||||||
}
|
|
||||||
h.iconView.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
h.labelView.setText(td.getLabel());
|
|
||||||
h.thumbnailView.setContentDescription(td.getLabel());
|
|
||||||
if (h.labelView.getVisibility() != View.VISIBLE) {
|
|
||||||
if (anim) {
|
|
||||||
h.labelView.setAnimation(AnimationUtils.loadAnimation(
|
|
||||||
mContext, R.anim.recent_appear));
|
|
||||||
}
|
|
||||||
h.labelView.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
Bitmap thumbnail = td.getThumbnail();
|
|
||||||
if (thumbnail != null) {
|
if (thumbnail != null) {
|
||||||
// Should remove the default image in the frame
|
// Should remove the default image in the frame
|
||||||
// that this now covers, to improve scrolling speed.
|
// that this now covers, to improve scrolling speed.
|
||||||
// That can't be done until the anim is complete though.
|
// That can't be done until the anim is complete though.
|
||||||
h.thumbnailViewImage.setImageBitmap(thumbnail);
|
h.thumbnailViewImage.setImageBitmap(thumbnail);
|
||||||
// scale to fill up the full width
|
|
||||||
Matrix scaleMatrix = new Matrix();
|
// scale the image to fill the full width of the ImageView. do this only if
|
||||||
float scale = mThumbnailWidth / (float) thumbnail.getWidth();
|
// we haven't set a bitmap before, or if the bitmap size has changed
|
||||||
scaleMatrix.setScale(scale, scale);
|
if (h.thumbnailViewImageBitmap == null ||
|
||||||
h.thumbnailViewImage.setScaleType(ScaleType.MATRIX);
|
h.thumbnailViewImageBitmap.getWidth() != thumbnail.getWidth() ||
|
||||||
h.thumbnailViewImage.setImageMatrix(scaleMatrix);
|
h.thumbnailViewImageBitmap.getHeight() != thumbnail.getHeight()) {
|
||||||
if (h.thumbnailViewImage.getVisibility() != View.VISIBLE) {
|
Matrix scaleMatrix = new Matrix();
|
||||||
if (anim) {
|
float scale = mThumbnailWidth / (float) thumbnail.getWidth();
|
||||||
h.thumbnailViewImage.setAnimation(
|
scaleMatrix.setScale(scale, scale);
|
||||||
AnimationUtils.loadAnimation(
|
h.thumbnailViewImage.setScaleType(ScaleType.MATRIX);
|
||||||
mContext, R.anim.recent_appear));
|
h.thumbnailViewImage.setImageMatrix(scaleMatrix);
|
||||||
}
|
|
||||||
h.thumbnailViewImage.setVisibility(View.VISIBLE);
|
|
||||||
}
|
}
|
||||||
|
if (show && h.thumbnailView.getVisibility() != View.VISIBLE) {
|
||||||
|
if (anim) {
|
||||||
|
h.thumbnailView.setAnimation(
|
||||||
|
AnimationUtils.loadAnimation(mContext, R.anim.recent_appear));
|
||||||
|
}
|
||||||
|
h.thumbnailView.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
h.thumbnailViewImageBitmap = thumbnail;
|
||||||
}
|
}
|
||||||
//h.descriptionView.setText(ad.description);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void onTaskThumbnailLoaded(TaskDescription ad) {
|
void onTaskThumbnailLoaded(TaskDescription ad) {
|
||||||
@@ -432,7 +427,11 @@ public class RecentsPanelView extends RelativeLayout
|
|||||||
if (v.getTag() instanceof ViewHolder) {
|
if (v.getTag() instanceof ViewHolder) {
|
||||||
ViewHolder h = (ViewHolder)v.getTag();
|
ViewHolder h = (ViewHolder)v.getTag();
|
||||||
if (h.taskDescription == ad) {
|
if (h.taskDescription == ad) {
|
||||||
applyTaskDescription(h, ad, true);
|
// only fade in the thumbnail if recents is already visible-- we
|
||||||
|
// show it immediately otherwise
|
||||||
|
boolean animateShow = mShowing &&
|
||||||
|
mRecentsGlowView.getAlpha() > ViewConfiguration.ALPHA_THRESHOLD;
|
||||||
|
updateThumbnail(h, ad.getThumbnail(), true, animateShow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -440,14 +439,55 @@ public class RecentsPanelView extends RelativeLayout
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void refreshRecentTasksList(ArrayList<TaskDescription> recentTasksList) {
|
// additional optimization when we have sofware system buttons - start loading the recent
|
||||||
if (recentTasksList != null) {
|
// tasks on touch down
|
||||||
mRecentTaskDescriptions = recentTasksList;
|
@Override
|
||||||
} else {
|
public boolean onTouch(View v, MotionEvent ev) {
|
||||||
mRecentTaskDescriptions = mRecentTasksLoader.getRecentTasks();
|
if (!mShowing) {
|
||||||
|
int action = ev.getAction() & MotionEvent.ACTION_MASK;
|
||||||
|
if (action == MotionEvent.ACTION_DOWN) {
|
||||||
|
// If we set our visibility to INVISIBLE here, we avoid an extra call to onLayout
|
||||||
|
// later when we become visible
|
||||||
|
setVisibility(INVISIBLE);
|
||||||
|
refreshRecentTasksList();
|
||||||
|
} else if (action == MotionEvent.ACTION_CANCEL) {
|
||||||
|
setVisibility(GONE);
|
||||||
|
clearRecentTasksList();
|
||||||
|
} else if (action == MotionEvent.ACTION_UP) {
|
||||||
|
if (!v.isPressed()) {
|
||||||
|
setVisibility(GONE);
|
||||||
|
clearRecentTasksList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clearRecentTasksList() {
|
||||||
|
// Clear memory used by screenshots
|
||||||
|
if (mRecentTaskDescriptions != null) {
|
||||||
|
mRecentTasksLoader.cancelLoadingThumbnails();
|
||||||
|
mRecentTaskDescriptions.clear();
|
||||||
|
mListAdapter.notifyDataSetInvalidated();
|
||||||
|
mRecentTasksDirty = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void refreshRecentTasksList() {
|
||||||
|
refreshRecentTasksList(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshRecentTasksList(ArrayList<TaskDescription> recentTasksList) {
|
||||||
|
if (mRecentTasksDirty) {
|
||||||
|
if (recentTasksList != null) {
|
||||||
|
mRecentTaskDescriptions = recentTasksList;
|
||||||
|
} else {
|
||||||
|
mRecentTaskDescriptions = mRecentTasksLoader.getRecentTasks();
|
||||||
|
}
|
||||||
|
mListAdapter.notifyDataSetInvalidated();
|
||||||
|
updateUiElements(getResources().getConfiguration());
|
||||||
|
mRecentTasksDirty = false;
|
||||||
}
|
}
|
||||||
mListAdapter.notifyDataSetInvalidated();
|
|
||||||
updateUiElements(getResources().getConfiguration());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<TaskDescription> getRecentTasksList() {
|
public ArrayList<TaskDescription> getRecentTasksList() {
|
||||||
|
|||||||
@@ -435,13 +435,18 @@ public class PhoneStatusBar extends StatusBar {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private void prepareNavigationBarView() {
|
||||||
|
mNavigationBarView.reorient();
|
||||||
|
|
||||||
|
mNavigationBarView.getRecentsButton().setOnClickListener(mRecentsClickListener);
|
||||||
|
mNavigationBarView.getRecentsButton().setOnTouchListener(mRecentsPanel);
|
||||||
|
}
|
||||||
|
|
||||||
// For small-screen devices (read: phones) that lack hardware navigation buttons
|
// For small-screen devices (read: phones) that lack hardware navigation buttons
|
||||||
private void addNavigationBar() {
|
private void addNavigationBar() {
|
||||||
if (mNavigationBarView == null) return;
|
if (mNavigationBarView == null) return;
|
||||||
|
|
||||||
mNavigationBarView.reorient();
|
prepareNavigationBarView();
|
||||||
|
|
||||||
mNavigationBarView.getRecentsButton().setOnClickListener(mRecentsClickListener);
|
|
||||||
|
|
||||||
WindowManagerImpl.getDefault().addView(
|
WindowManagerImpl.getDefault().addView(
|
||||||
mNavigationBarView, getNavigationBarLayoutParams());
|
mNavigationBarView, getNavigationBarLayoutParams());
|
||||||
@@ -450,9 +455,7 @@ public class PhoneStatusBar extends StatusBar {
|
|||||||
private void repositionNavigationBar() {
|
private void repositionNavigationBar() {
|
||||||
if (mNavigationBarView == null) return;
|
if (mNavigationBarView == null) return;
|
||||||
|
|
||||||
mNavigationBarView.reorient();
|
prepareNavigationBarView();
|
||||||
|
|
||||||
mNavigationBarView.getRecentsButton().setOnClickListener(mRecentsClickListener);
|
|
||||||
|
|
||||||
WindowManagerImpl.getDefault().updateViewLayout(
|
WindowManagerImpl.getDefault().updateViewLayout(
|
||||||
mNavigationBarView, getNavigationBarLayoutParams());
|
mNavigationBarView, getNavigationBarLayoutParams());
|
||||||
@@ -2007,8 +2010,8 @@ public class PhoneStatusBar extends StatusBar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void toggleRecentApps() {
|
public void toggleRecentApps() {
|
||||||
int msg = (mRecentsPanel.getVisibility() == View.GONE)
|
int msg = (mRecentsPanel.getVisibility() == View.VISIBLE)
|
||||||
? MSG_OPEN_RECENTS_PANEL : MSG_CLOSE_RECENTS_PANEL;
|
? MSG_CLOSE_RECENTS_PANEL : MSG_OPEN_RECENTS_PANEL;
|
||||||
mHandler.removeMessages(msg);
|
mHandler.removeMessages(msg);
|
||||||
mHandler.sendEmptyMessage(msg);
|
mHandler.sendEmptyMessage(msg);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -587,6 +587,7 @@ public class TabletStatusBar extends StatusBar implements
|
|||||||
|
|
||||||
// Add the windows
|
// Add the windows
|
||||||
addPanelWindows();
|
addPanelWindows();
|
||||||
|
mRecentButton.setOnTouchListener(mRecentsPanel);
|
||||||
|
|
||||||
mPile = (ViewGroup)mNotificationPanel.findViewById(R.id.content);
|
mPile = (ViewGroup)mNotificationPanel.findViewById(R.id.content);
|
||||||
mPile.removeAllViews();
|
mPile.removeAllViews();
|
||||||
@@ -1805,8 +1806,8 @@ public class TabletStatusBar extends StatusBar implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void toggleRecentApps() {
|
public void toggleRecentApps() {
|
||||||
int msg = (mRecentsPanel.getVisibility() == View.GONE)
|
int msg = (mRecentsPanel.getVisibility() == View.VISIBLE)
|
||||||
? MSG_OPEN_RECENTS_PANEL : MSG_CLOSE_RECENTS_PANEL;
|
? MSG_CLOSE_RECENTS_PANEL : MSG_OPEN_RECENTS_PANEL;
|
||||||
mHandler.removeMessages(msg);
|
mHandler.removeMessages(msg);
|
||||||
mHandler.sendEmptyMessage(msg);
|
mHandler.sendEmptyMessage(msg);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user