Loading core/java/android/widget/ListView.java +23 −17 Original line number Diff line number Diff line Loading @@ -1143,8 +1143,8 @@ public class ListView extends AbsListView { // Sets up mListPadding super.onMeasure(widthMeasureSpec, heightMeasureSpec); int widthMode = MeasureSpec.getMode(widthMeasureSpec); int heightMode = MeasureSpec.getMode(heightMeasureSpec); final int widthMode = MeasureSpec.getMode(widthMeasureSpec); final int heightMode = MeasureSpec.getMode(heightMeasureSpec); int widthSize = MeasureSpec.getSize(widthMeasureSpec); int heightSize = MeasureSpec.getSize(heightMeasureSpec); Loading @@ -1153,10 +1153,12 @@ public class ListView extends AbsListView { int childState = 0; mItemCount = mAdapter == null ? 0 : mAdapter.getCount(); if (mItemCount > 0 && (widthMode == MeasureSpec.UNSPECIFIED || heightMode == MeasureSpec.UNSPECIFIED)) { if (mItemCount > 0 && (widthMode == MeasureSpec.UNSPECIFIED || heightMode == MeasureSpec.UNSPECIFIED)) { final View child = obtainView(0, mIsScrap); // Lay out child directly against the parent measure spec so that // we can obtain exected minimum width and height. measureScrapChild(child, 0, widthMeasureSpec, heightSize); childWidth = child.getMeasuredWidth(); Loading Loading @@ -1187,6 +1189,7 @@ public class ListView extends AbsListView { } setMeasuredDimension(widthSize, heightSize); mWidthMeasureSpec = widthMeasureSpec; } Loading @@ -1199,16 +1202,20 @@ public class ListView extends AbsListView { p.viewType = mAdapter.getItemViewType(position); p.forceAdd = true; int childWidthSpec = ViewGroup.getChildMeasureSpec(widthMeasureSpec, final int childWidthSpec = ViewGroup.getChildMeasureSpec(widthMeasureSpec, mListPadding.left + mListPadding.right, p.width); int lpHeight = p.height; int childHeightSpec; final int lpHeight = p.height; final int childHeightSpec; if (lpHeight > 0) { childHeightSpec = MeasureSpec.makeMeasureSpec(lpHeight, MeasureSpec.EXACTLY); } else { childHeightSpec = MeasureSpec.makeSafeMeasureSpec(heightHint, MeasureSpec.UNSPECIFIED); } child.measure(childWidthSpec, childHeightSpec); // Since this view was measured directly aginst the parent measure // spec, we must measure it again before reuse. child.forceLayout(); } /** Loading Loading @@ -1248,8 +1255,7 @@ public class ListView extends AbsListView { * @return The height of this ListView with the given children. */ final int measureHeightOfChildren(int widthMeasureSpec, int startPosition, int endPosition, final int maxHeight, int disallowPartialChildPosition) { int maxHeight, int disallowPartialChildPosition) { final ListAdapter adapter = mAdapter; if (adapter == null) { return mListPadding.top + mListPadding.bottom; Loading Loading @@ -1907,8 +1913,8 @@ public class ListView extends AbsListView { } p.viewType = mAdapter.getItemViewType(position); if ((recycled && !p.forceAdd) || (p.recycledHeaderFooter && p.viewType == AdapterView.ITEM_VIEW_TYPE_HEADER_OR_FOOTER)) { if ((recycled && !p.forceAdd) || (p.recycledHeaderFooter && p.viewType == AdapterView.ITEM_VIEW_TYPE_HEADER_OR_FOOTER)) { attachViewToParent(child, flowDown ? -1 : 0, p); } else { p.forceAdd = false; Loading Loading @@ -1936,10 +1942,10 @@ public class ListView extends AbsListView { } if (needToMeasure) { int childWidthSpec = ViewGroup.getChildMeasureSpec(mWidthMeasureSpec, final int childWidthSpec = ViewGroup.getChildMeasureSpec(mWidthMeasureSpec, mListPadding.left + mListPadding.right, p.width); int lpHeight = p.height; int childHeightSpec; final int lpHeight = p.height; final int childHeightSpec; if (lpHeight > 0) { childHeightSpec = MeasureSpec.makeMeasureSpec(lpHeight, MeasureSpec.EXACTLY); } else { Loading core/java/com/android/internal/widget/ViewPager.java +1 −1 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ import java.util.Comparator; */ public class ViewPager extends ViewGroup { private static final String TAG = "ViewPager"; private static final boolean DEBUG = true; private static final boolean DEBUG = false; private static final int MAX_SCROLL_X = 2 << 23; private static final boolean USE_CACHE = false; Loading core/res/res/layout/date_picker_view_animator_material.xml +2 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ <android.widget.YearPickerView android:id="@+id/date_picker_year_picker" android:layout_width="match_parent" android:layout_height="match_parent" /> android:layout_height="match_parent" android:scrollIndicators="bottom" /> </com.android.internal.widget.DialogViewAnimator> core/res/res/layout/year_label_text_view.xml +1 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ limitations under the License. --> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/month_text_view" android:id="@id/text1" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="?attr/listPreferredItemHeightSmall" Loading Loading
core/java/android/widget/ListView.java +23 −17 Original line number Diff line number Diff line Loading @@ -1143,8 +1143,8 @@ public class ListView extends AbsListView { // Sets up mListPadding super.onMeasure(widthMeasureSpec, heightMeasureSpec); int widthMode = MeasureSpec.getMode(widthMeasureSpec); int heightMode = MeasureSpec.getMode(heightMeasureSpec); final int widthMode = MeasureSpec.getMode(widthMeasureSpec); final int heightMode = MeasureSpec.getMode(heightMeasureSpec); int widthSize = MeasureSpec.getSize(widthMeasureSpec); int heightSize = MeasureSpec.getSize(heightMeasureSpec); Loading @@ -1153,10 +1153,12 @@ public class ListView extends AbsListView { int childState = 0; mItemCount = mAdapter == null ? 0 : mAdapter.getCount(); if (mItemCount > 0 && (widthMode == MeasureSpec.UNSPECIFIED || heightMode == MeasureSpec.UNSPECIFIED)) { if (mItemCount > 0 && (widthMode == MeasureSpec.UNSPECIFIED || heightMode == MeasureSpec.UNSPECIFIED)) { final View child = obtainView(0, mIsScrap); // Lay out child directly against the parent measure spec so that // we can obtain exected minimum width and height. measureScrapChild(child, 0, widthMeasureSpec, heightSize); childWidth = child.getMeasuredWidth(); Loading Loading @@ -1187,6 +1189,7 @@ public class ListView extends AbsListView { } setMeasuredDimension(widthSize, heightSize); mWidthMeasureSpec = widthMeasureSpec; } Loading @@ -1199,16 +1202,20 @@ public class ListView extends AbsListView { p.viewType = mAdapter.getItemViewType(position); p.forceAdd = true; int childWidthSpec = ViewGroup.getChildMeasureSpec(widthMeasureSpec, final int childWidthSpec = ViewGroup.getChildMeasureSpec(widthMeasureSpec, mListPadding.left + mListPadding.right, p.width); int lpHeight = p.height; int childHeightSpec; final int lpHeight = p.height; final int childHeightSpec; if (lpHeight > 0) { childHeightSpec = MeasureSpec.makeMeasureSpec(lpHeight, MeasureSpec.EXACTLY); } else { childHeightSpec = MeasureSpec.makeSafeMeasureSpec(heightHint, MeasureSpec.UNSPECIFIED); } child.measure(childWidthSpec, childHeightSpec); // Since this view was measured directly aginst the parent measure // spec, we must measure it again before reuse. child.forceLayout(); } /** Loading Loading @@ -1248,8 +1255,7 @@ public class ListView extends AbsListView { * @return The height of this ListView with the given children. */ final int measureHeightOfChildren(int widthMeasureSpec, int startPosition, int endPosition, final int maxHeight, int disallowPartialChildPosition) { int maxHeight, int disallowPartialChildPosition) { final ListAdapter adapter = mAdapter; if (adapter == null) { return mListPadding.top + mListPadding.bottom; Loading Loading @@ -1907,8 +1913,8 @@ public class ListView extends AbsListView { } p.viewType = mAdapter.getItemViewType(position); if ((recycled && !p.forceAdd) || (p.recycledHeaderFooter && p.viewType == AdapterView.ITEM_VIEW_TYPE_HEADER_OR_FOOTER)) { if ((recycled && !p.forceAdd) || (p.recycledHeaderFooter && p.viewType == AdapterView.ITEM_VIEW_TYPE_HEADER_OR_FOOTER)) { attachViewToParent(child, flowDown ? -1 : 0, p); } else { p.forceAdd = false; Loading Loading @@ -1936,10 +1942,10 @@ public class ListView extends AbsListView { } if (needToMeasure) { int childWidthSpec = ViewGroup.getChildMeasureSpec(mWidthMeasureSpec, final int childWidthSpec = ViewGroup.getChildMeasureSpec(mWidthMeasureSpec, mListPadding.left + mListPadding.right, p.width); int lpHeight = p.height; int childHeightSpec; final int lpHeight = p.height; final int childHeightSpec; if (lpHeight > 0) { childHeightSpec = MeasureSpec.makeMeasureSpec(lpHeight, MeasureSpec.EXACTLY); } else { Loading
core/java/com/android/internal/widget/ViewPager.java +1 −1 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ import java.util.Comparator; */ public class ViewPager extends ViewGroup { private static final String TAG = "ViewPager"; private static final boolean DEBUG = true; private static final boolean DEBUG = false; private static final int MAX_SCROLL_X = 2 << 23; private static final boolean USE_CACHE = false; Loading
core/res/res/layout/date_picker_view_animator_material.xml +2 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ <android.widget.YearPickerView android:id="@+id/date_picker_year_picker" android:layout_width="match_parent" android:layout_height="match_parent" /> android:layout_height="match_parent" android:scrollIndicators="bottom" /> </com.android.internal.widget.DialogViewAnimator>
core/res/res/layout/year_label_text_view.xml +1 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ limitations under the License. --> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/month_text_view" android:id="@id/text1" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="?attr/listPreferredItemHeightSmall" Loading