Loading api/current.txt +2 −2 Original line number Diff line number Diff line Loading @@ -7094,7 +7094,7 @@ package android.content.res { method public int getIndexCount(); method public int getInt(int, int); method public int getInteger(int, int); method public deprecated int getLayoutDimension(int, java.lang.String); method public int getLayoutDimension(int, java.lang.String); method public int getLayoutDimension(int, int); method public java.lang.String getNonResourceString(int); method public java.lang.String getPositionDescription(); Loading Loading @@ -16149,7 +16149,7 @@ package android.os { public class Looper { method public void dump(android.util.Printer, java.lang.String); method public static android.os.Looper getMainLooper(); method public static synchronized android.os.Looper getMainLooper(); method public java.lang.Thread getThread(); method public static void loop(); method public static android.os.Looper myLooper(); core/java/android/content/res/TypedArray.java +1 −8 Original line number Diff line number Diff line Loading @@ -475,14 +475,7 @@ public class TypedArray { * * @return Attribute dimension value multiplied by the appropriate * metric and truncated to integer pixels. * * @throws RuntimeException * if this TypedArray does not contain an entry for <code>index</code> * * @deprecated Use {@link #getLayoutDimension(int, int)} instead. * */ @Deprecated public int getLayoutDimension(int index, String name) { index *= AssetManager.STYLE_NUM_ENTRIES; final int[] data = mData; Loading core/java/android/view/LayoutInflater.java +53 −47 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.graphics.Canvas; import android.os.Handler; import android.os.Message; import android.widget.FrameLayout; import com.android.internal.R; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; Loading Loading @@ -811,14 +810,21 @@ public abstract class LayoutInflater { // We try to load the layout params set in the <include /> tag. If // they don't exist, we will rely on the layout params set in the // included XML file. TypedArray ta = getContext().obtainStyledAttributes(attrs, R.styleable.ViewGroup_Layout); boolean definesBothWidthAndHeight = ta.hasValue(R.styleable.ViewGroup_Layout_layout_width) && ta.hasValue(R.styleable.ViewGroup_Layout_layout_height); AttributeSet attributes = definesBothWidthAndHeight ? attrs : childAttrs; view.setLayoutParams(group.generateLayoutParams(attributes)); ta.recycle(); // During a layoutparams generation, a runtime exception is thrown // if either layout_width or layout_height is missing. We catch // this exception and set localParams accordingly: true means we // successfully loaded layout params from the <include /> tag, // false means we need to rely on the included layout params. ViewGroup.LayoutParams params = null; try { params = group.generateLayoutParams(attrs); } catch (RuntimeException e) { params = group.generateLayoutParams(childAttrs); } finally { if (params != null) { view.setLayoutParams(params); } } // Inflate all children. rInflate(childParser, view, childAttrs, true); Loading core/java/android/view/ViewGroup.java +3 −7 Original line number Diff line number Diff line Loading @@ -5611,19 +5611,15 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } /** * Extracts the <code>width</code> and <code>height</code> layout parameters * from the supplied TypedArray, <code>a</code>, and assigns them * to the appropriate fields. If, <code>a</code>, does not contain an * entry for either attribute, the value, {@link ViewGroup.LayoutParams#WRAP_CONTENT}, * is used as a default. * Extracts the layout parameters from the supplied attributes. * * @param a the style attributes to extract the parameters from * @param widthAttr the identifier of the width attribute * @param heightAttr the identifier of the height attribute */ protected void setBaseAttributes(TypedArray a, int widthAttr, int heightAttr) { width = a.getLayoutDimension(widthAttr, WRAP_CONTENT); height = a.getLayoutDimension(heightAttr, WRAP_CONTENT); width = a.getLayoutDimension(widthAttr, "layout_width"); height = a.getLayoutDimension(heightAttr, "layout_height"); } /** Loading core/java/android/widget/FrameLayout.java +0 −6 Original line number Diff line number Diff line Loading @@ -608,12 +608,6 @@ public class FrameLayout extends ViewGroup { */ public int gravity = -1; @Override protected void setBaseAttributes(TypedArray a, int widthAttr, int heightAttr) { width = a.getLayoutDimension(widthAttr, MATCH_PARENT); height = a.getLayoutDimension(heightAttr, MATCH_PARENT); } /** * {@inheritDoc} */ Loading Loading
api/current.txt +2 −2 Original line number Diff line number Diff line Loading @@ -7094,7 +7094,7 @@ package android.content.res { method public int getIndexCount(); method public int getInt(int, int); method public int getInteger(int, int); method public deprecated int getLayoutDimension(int, java.lang.String); method public int getLayoutDimension(int, java.lang.String); method public int getLayoutDimension(int, int); method public java.lang.String getNonResourceString(int); method public java.lang.String getPositionDescription(); Loading Loading @@ -16149,7 +16149,7 @@ package android.os { public class Looper { method public void dump(android.util.Printer, java.lang.String); method public static android.os.Looper getMainLooper(); method public static synchronized android.os.Looper getMainLooper(); method public java.lang.Thread getThread(); method public static void loop(); method public static android.os.Looper myLooper();
core/java/android/content/res/TypedArray.java +1 −8 Original line number Diff line number Diff line Loading @@ -475,14 +475,7 @@ public class TypedArray { * * @return Attribute dimension value multiplied by the appropriate * metric and truncated to integer pixels. * * @throws RuntimeException * if this TypedArray does not contain an entry for <code>index</code> * * @deprecated Use {@link #getLayoutDimension(int, int)} instead. * */ @Deprecated public int getLayoutDimension(int index, String name) { index *= AssetManager.STYLE_NUM_ENTRIES; final int[] data = mData; Loading
core/java/android/view/LayoutInflater.java +53 −47 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.graphics.Canvas; import android.os.Handler; import android.os.Message; import android.widget.FrameLayout; import com.android.internal.R; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; Loading Loading @@ -811,14 +810,21 @@ public abstract class LayoutInflater { // We try to load the layout params set in the <include /> tag. If // they don't exist, we will rely on the layout params set in the // included XML file. TypedArray ta = getContext().obtainStyledAttributes(attrs, R.styleable.ViewGroup_Layout); boolean definesBothWidthAndHeight = ta.hasValue(R.styleable.ViewGroup_Layout_layout_width) && ta.hasValue(R.styleable.ViewGroup_Layout_layout_height); AttributeSet attributes = definesBothWidthAndHeight ? attrs : childAttrs; view.setLayoutParams(group.generateLayoutParams(attributes)); ta.recycle(); // During a layoutparams generation, a runtime exception is thrown // if either layout_width or layout_height is missing. We catch // this exception and set localParams accordingly: true means we // successfully loaded layout params from the <include /> tag, // false means we need to rely on the included layout params. ViewGroup.LayoutParams params = null; try { params = group.generateLayoutParams(attrs); } catch (RuntimeException e) { params = group.generateLayoutParams(childAttrs); } finally { if (params != null) { view.setLayoutParams(params); } } // Inflate all children. rInflate(childParser, view, childAttrs, true); Loading
core/java/android/view/ViewGroup.java +3 −7 Original line number Diff line number Diff line Loading @@ -5611,19 +5611,15 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } /** * Extracts the <code>width</code> and <code>height</code> layout parameters * from the supplied TypedArray, <code>a</code>, and assigns them * to the appropriate fields. If, <code>a</code>, does not contain an * entry for either attribute, the value, {@link ViewGroup.LayoutParams#WRAP_CONTENT}, * is used as a default. * Extracts the layout parameters from the supplied attributes. * * @param a the style attributes to extract the parameters from * @param widthAttr the identifier of the width attribute * @param heightAttr the identifier of the height attribute */ protected void setBaseAttributes(TypedArray a, int widthAttr, int heightAttr) { width = a.getLayoutDimension(widthAttr, WRAP_CONTENT); height = a.getLayoutDimension(heightAttr, WRAP_CONTENT); width = a.getLayoutDimension(widthAttr, "layout_width"); height = a.getLayoutDimension(heightAttr, "layout_height"); } /** Loading
core/java/android/widget/FrameLayout.java +0 −6 Original line number Diff line number Diff line Loading @@ -608,12 +608,6 @@ public class FrameLayout extends ViewGroup { */ public int gravity = -1; @Override protected void setBaseAttributes(TypedArray a, int widthAttr, int heightAttr) { width = a.getLayoutDimension(widthAttr, MATCH_PARENT); height = a.getLayoutDimension(heightAttr, MATCH_PARENT); } /** * {@inheritDoc} */ Loading