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: Id7ff602837dbe1d8a2aaec6ec49b667f11d01bc9
This commit is contained in:
Winson Chung
2011-09-14 17:56:27 -07:00
parent 286f2e1da9
commit eb00d4afdd
12 changed files with 33 additions and 9 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

+22
View File
@@ -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>
+1
View File
@@ -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" />
+10 -9
View File
@@ -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;
}