DO NOT MERGE: Fixing regression where scroll position would be offset when rotated.
- Fixes the scrolling issue only in conjunction with framework measure fix - Updating the wallpaper gallery item background Change-Id: I156de59a3eadfdaa61018c0a74ad0614d76cde6d
|
After Width: | Height: | Size: 200 B |
|
After Width: | Height: | Size: 184 B |
|
After Width: | Height: | Size: 202 B |
|
After Width: | Height: | Size: 170 B |
|
After Width: | Height: | Size: 165 B |
|
After Width: | Height: | Size: 165 B |
|
After Width: | Height: | Size: 193 B |
|
After Width: | Height: | Size: 190 B |
|
After Width: | Height: | Size: 199 B |
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2011 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.
|
||||
-->
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_focused="true" android:drawable="@drawable/grid_focused" />
|
||||
<item android:state_pressed="true" android:drawable="@drawable/grid_pressed" />
|
||||
<item android:state_selected="true" android:drawable="@drawable/grid_selected" />
|
||||
<item android:drawable="@android:color/transparent" />
|
||||
</selector>
|
||||
@@ -18,5 +18,6 @@
|
||||
android:id="@+id/wallpaper_image"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/wallpaper_gallery_item"
|
||||
android:scaleType="fitXY"
|
||||
android:focusable="true" />
|
||||
|
||||
@@ -539,15 +539,6 @@ public abstract class PagedView extends ViewGroup {
|
||||
}
|
||||
|
||||
if (DEBUG) Log.d(TAG, "PagedView.onLayout()");
|
||||
if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) {
|
||||
setHorizontalScrollBarEnabled(false);
|
||||
int newX = getChildOffset(mCurrentPage) - getRelativeChildOffset(mCurrentPage);
|
||||
scrollTo(newX, 0);
|
||||
mScroller.setFinalX(newX);
|
||||
setHorizontalScrollBarEnabled(true);
|
||||
mFirstLayout = false;
|
||||
}
|
||||
|
||||
final int verticalPadding = mPaddingTop + mPaddingBottom;
|
||||
final int childCount = getChildCount();
|
||||
int childLeft = 0;
|
||||
@@ -578,6 +569,16 @@ public abstract class PagedView extends ViewGroup {
|
||||
childLeft += childWidth + mPageSpacing;
|
||||
}
|
||||
}
|
||||
|
||||
if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) {
|
||||
setHorizontalScrollBarEnabled(false);
|
||||
int newX = getChildOffset(mCurrentPage) - getRelativeChildOffset(mCurrentPage);
|
||||
scrollTo(newX, 0);
|
||||
mScroller.setFinalX(newX);
|
||||
setHorizontalScrollBarEnabled(true);
|
||||
mFirstLayout = false;
|
||||
}
|
||||
|
||||
if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) {
|
||||
mFirstLayout = false;
|
||||
}
|
||||
|
||||