am 8b2e37e5: Improve recents on sw600dp devices

* commit '8b2e37e5a0e10d234ffe6815e9a462283cad3d78':
  Improve recents on sw600dp devices
This commit is contained in:
Michael Jurka
2012-05-10 09:24:02 -07:00
committed by Android Git Automerger
8 changed files with 74 additions and 20 deletions

View File

@@ -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. -->

View File

@@ -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>

View File

@@ -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">

View 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">190dip</dimen>
</resources>

View 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>

View File

@@ -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>

View File

@@ -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;

View File

@@ -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