Skip to content

Commit 54546f2

Browse files
author
Fabrice Di Meglio
committed
Make MarginLayoutParams startMargin and endMargin API public
Change-Id: I519f8ede818b068883ee1565d28e188298af9f0e
1 parent 308b1ea commit 54546f2

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

api/current.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,8 +614,10 @@ package android {
614614
field public static final int layout_height = 16842997; // 0x10100f5
615615
field public static final int layout_margin = 16842998; // 0x10100f6
616616
field public static final int layout_marginBottom = 16843002; // 0x10100fa
617+
field public static final int layout_marginEnd = 16843690; // 0x10103aa
617618
field public static final int layout_marginLeft = 16842999; // 0x10100f7
618619
field public static final int layout_marginRight = 16843001; // 0x10100f9
620+
field public static final int layout_marginStart = 16843689; // 0x10103a9
619621
field public static final int layout_marginTop = 16843000; // 0x10100f8
620622
field public static final int layout_row = 16843643; // 0x101037b
621623
field public static final int layout_rowSpan = 16843644; // 0x101037c
@@ -23849,10 +23851,15 @@ package android.view {
2384923851
ctor public ViewGroup.MarginLayoutParams(int, int);
2385023852
ctor public ViewGroup.MarginLayoutParams(android.view.ViewGroup.MarginLayoutParams);
2385123853
ctor public ViewGroup.MarginLayoutParams(android.view.ViewGroup.LayoutParams);
23854+
method public int getMarginEnd();
23855+
method public int getMarginStart();
23856+
method public boolean isMarginRelative();
2385223857
method public void setMargins(int, int, int, int);
2385323858
field public int bottomMargin;
23859+
field public int endMargin;
2385423860
field public int leftMargin;
2385523861
field public int rightMargin;
23862+
field public int startMargin;
2385623863
field public int topMargin;
2385723864
}
2385823865

core/java/android/view/ViewGroup.java

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5123,20 +5123,19 @@ public static class MarginLayoutParams extends ViewGroup.LayoutParams {
51235123

51245124
/**
51255125
* The start margin in pixels of the child.
5126-
*
5127-
* @hide
5128-
*
5126+
* Call {@link ViewGroup#setLayoutParams(LayoutParams)} after reassigning a new value
5127+
* to this field.
51295128
*/
51305129
@ViewDebug.ExportedProperty(category = "layout")
5131-
protected int startMargin = DEFAULT_RELATIVE;
5130+
public int startMargin = DEFAULT_RELATIVE;
51325131

51335132
/**
51345133
* The end margin in pixels of the child.
5135-
*
5136-
* @hide
5134+
* Call {@link ViewGroup#setLayoutParams(LayoutParams)} after reassigning a new value
5135+
* to this field.
51375136
*/
51385137
@ViewDebug.ExportedProperty(category = "layout")
5139-
protected int endMargin = DEFAULT_RELATIVE;
5138+
public int endMargin = DEFAULT_RELATIVE;
51405139

51415140
/**
51425141
* The default start and end margin.
@@ -5268,8 +5267,6 @@ public void setMarginsRelative(int start, int top, int end, int bottom) {
52685267
* @attr ref android.R.styleable#ViewGroup_MarginLayout_layout_marginStart
52695268
*
52705269
* @return the start margin in pixels.
5271-
*
5272-
* @hide
52735270
*/
52745271
public int getMarginStart() {
52755272
return startMargin;
@@ -5281,8 +5278,6 @@ public int getMarginStart() {
52815278
* @attr ref android.R.styleable#ViewGroup_MarginLayout_layout_marginEnd
52825279
*
52835280
* @return the end margin in pixels.
5284-
*
5285-
* @hide
52865281
*/
52875282
public int getMarginEnd() {
52885283
return endMargin;
@@ -5295,8 +5290,6 @@ public int getMarginEnd() {
52955290
* @attr ref android.R.styleable#ViewGroup_MarginLayout_layout_marginEnd
52965291
*
52975292
* @return true if either marginStart or marginEnd has been set
5298-
*
5299-
* @hide
53005293
*/
53015294
public boolean isMarginRelative() {
53025295
return (startMargin != DEFAULT_RELATIVE) || (endMargin != DEFAULT_RELATIVE);

core/res/res/values/public.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3502,4 +3502,7 @@
35023502
<public type="attr" name="paddingStart"/>
35033503
<public type="attr" name="paddingEnd"/>
35043504

3505+
<public type="attr" name="layout_marginStart"/>
3506+
<public type="attr" name="layout_marginEnd"/>
3507+
35053508
</resources>

0 commit comments

Comments
 (0)