Improve recents on sw600dp devices
Bug: 6405276 - Make thumbnails bigger - Make thumbnails higher-res - In landscape, start the thumbnails on the right - Fix issue where you'd sometimes see "No recent apps" flash before the thumbnails appeared - Fix issue where the first time recents was run you'd see double the amount of thumbnails Change-Id: I878caf57a955cb6a0c1b4f0a72b5b993609047f2
This commit is contained in:
@@ -18,6 +18,10 @@
|
||||
*/
|
||||
-->
|
||||
<resources>
|
||||
<!-- The width that is used when creating thumbnails of applications. -->
|
||||
<dimen name="thumbnail_width">200dp</dimen>
|
||||
<!-- The height that is used when creating thumbnails of applications. -->
|
||||
<dimen name="thumbnail_height">177dp</dimen>
|
||||
<!-- The maximum number of action buttons that should be permitted within
|
||||
an action bar/action mode. This will be used to determine how many
|
||||
showAsAction="ifRoom" items can fit. "always" items can override this. -->
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
-->
|
||||
<resources>
|
||||
<!-- The width that is used when creating thumbnails of applications. -->
|
||||
<dimen name="thumbnail_width">120dp</dimen>
|
||||
<dimen name="thumbnail_width">164dp</dimen>
|
||||
<!-- The height that is used when creating thumbnails of applications. -->
|
||||
<dimen name="thumbnail_height">120dp</dimen>
|
||||
<dimen name="thumbnail_height">145dp</dimen>
|
||||
<!-- The standard size (both width and height) of an application icon that
|
||||
will be displayed in the app launcher and elsewhere. -->
|
||||
<dimen name="app_icon_size">48dip</dimen>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
android:fadingEdge="horizontal"
|
||||
android:scrollbars="none"
|
||||
android:fadingEdgeLength="@dimen/status_bar_recents_scroll_fading_edge_length"
|
||||
android:layout_gravity="bottom|left"
|
||||
android:layout_gravity="bottom|right"
|
||||
android:orientation="horizontal"
|
||||
android:clipToPadding="false"
|
||||
android:clipChildren="false">
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
* Copyright (c) 2012, 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.
|
||||
*/
|
||||
-->
|
||||
<resources>
|
||||
<!-- Recent Applications parameters -->
|
||||
<dimen name="status_bar_recents_app_label_width">190dip</dimen>
|
||||
</resources>
|
||||
21
packages/SystemUI/res/values-sw600dp-port/dimens.xml
Normal file
21
packages/SystemUI/res/values-sw600dp-port/dimens.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
* Copyright (c) 2012, 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.
|
||||
*/
|
||||
-->
|
||||
<resources>
|
||||
<!-- Recent Applications parameters -->
|
||||
<dimen name="status_bar_recents_app_label_width">140dip</dimen>
|
||||
</resources>
|
||||
@@ -39,4 +39,7 @@
|
||||
<!-- Extra space above the clock in the panel; on this device, zero -->
|
||||
<dimen name="notification_panel_header_padding_top">0dp</dimen>
|
||||
|
||||
<!-- Size of application thumbnail -->
|
||||
<dimen name="status_bar_recents_thumbnail_width">200dp</dimen>
|
||||
<dimen name="status_bar_recents_thumbnail_height">177dp</dimen>
|
||||
</resources>
|
||||
|
||||
@@ -91,6 +91,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener
|
||||
private int mThumbnailWidth;
|
||||
private boolean mFitThumbnailToXY;
|
||||
private int mRecentItemLayoutId;
|
||||
private boolean mFirstScreenful = true;
|
||||
|
||||
public static interface OnRecentsPanelVisibilityChangedListener {
|
||||
public void onRecentsPanelVisibilityChanged(boolean visible);
|
||||
@@ -206,6 +207,22 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener
|
||||
}
|
||||
}
|
||||
|
||||
public RecentsPanelView(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public RecentsPanelView(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
mContext = context;
|
||||
updateValuesFromResources();
|
||||
|
||||
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.RecentsPanelView,
|
||||
defStyle, 0);
|
||||
|
||||
mRecentItemLayoutId = a.getResourceId(R.styleable.RecentsPanelView_recentItemLayout, 0);
|
||||
a.recycle();
|
||||
}
|
||||
|
||||
public int numItemsInOneScreenful() {
|
||||
if (mRecentsContainer instanceof RecentsScrollView){
|
||||
RecentsScrollView scrollView
|
||||
@@ -297,6 +314,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener
|
||||
mRecentTasksDirty = true;
|
||||
mWaitingToShow = false;
|
||||
mReadyToShow = false;
|
||||
mRecentsNoApps.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
if (animate) {
|
||||
if (mShowing != show) {
|
||||
@@ -415,21 +433,6 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener
|
||||
super.setVisibility(visibility);
|
||||
}
|
||||
|
||||
public RecentsPanelView(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public RecentsPanelView(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
mContext = context;
|
||||
updateValuesFromResources();
|
||||
|
||||
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.RecentsPanelView,
|
||||
defStyle, 0);
|
||||
|
||||
mRecentItemLayoutId = a.getResourceId(R.styleable.RecentsPanelView_recentItemLayout, 0);
|
||||
}
|
||||
|
||||
public void updateValuesFromResources() {
|
||||
final Resources res = mContext.getResources();
|
||||
mThumbnailWidth = Math.round(res.getDimension(R.dimen.status_bar_recents_thumbnail_width));
|
||||
@@ -572,7 +575,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener
|
||||
showIfReady();
|
||||
}
|
||||
|
||||
// additional optimization when we have sofware system buttons - start loading the recent
|
||||
// additional optimization when we have software system buttons - start loading the recent
|
||||
// tasks on touch down
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent ev) {
|
||||
@@ -631,7 +634,6 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener
|
||||
}
|
||||
}
|
||||
|
||||
boolean mFirstScreenful;
|
||||
public void onTasksLoaded(ArrayList<TaskDescription> tasks) {
|
||||
if (!mFirstScreenful && tasks.size() == 0) {
|
||||
return;
|
||||
|
||||
@@ -467,6 +467,9 @@ public class PhoneStatusBar extends BaseStatusBar {
|
||||
// .03, the item disappears entirely (as if alpha = 0) and that discontinuity looks
|
||||
// a bit jarring
|
||||
mRecentsPanel.setMinSwipeAlpha(0.03f);
|
||||
if (mNavigationBarView != null) {
|
||||
mNavigationBarView.getRecentsButton().setOnTouchListener(mRecentsPanel);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user