summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Fabrice Di Meglio <fdimeglio@google.com> 2012-09-12 13:25:21 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2012-09-12 13:25:22 -0700
commitb967464049d7a75face9237a89903342c4724f8a (patch)
tree0788336eb05de7ce3aa5e388192974af8a93ee56
parent4f8da32ffaf7aaf1f670e74caa7cd8a70ddb63c6 (diff)
parenta40627daee4891ab842fa509af254b349bff3a47 (diff)
Merge "Enforce encapsulation for MarginLayoutParams startMargin and endMargin" into jb-mr1-dev
-rw-r--r--api/current.txt4
-rw-r--r--core/java/android/view/ViewGroup.java26
2 files changed, 26 insertions, 4 deletions
diff --git a/api/current.txt b/api/current.txt
index 9c127b7b60ca..db378c824ffe 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -25551,12 +25551,12 @@ package android.view {
method protected boolean isLayoutRtl();
method public boolean isMarginRelative();
method public void setLayoutDirection(int);
+ method public void setMarginEnd(int);
+ method public void setMarginStart(int);
method public void setMargins(int, int, int, int);
field public int bottomMargin;
- field public int endMargin;
field public int leftMargin;
field public int rightMargin;
- field public int startMargin;
field public int topMargin;
}
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 62e138353328..395a2cb5fea9 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -5568,7 +5568,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
* to this field.
*/
@ViewDebug.ExportedProperty(category = "layout")
- public int startMargin = DEFAULT_RELATIVE;
+ private int startMargin = DEFAULT_RELATIVE;
/**
* The end margin in pixels of the child.
@@ -5576,7 +5576,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
* to this field.
*/
@ViewDebug.ExportedProperty(category = "layout")
- public int endMargin = DEFAULT_RELATIVE;
+ private int endMargin = DEFAULT_RELATIVE;
/**
* The default start and end margin.
@@ -5724,6 +5724,17 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
}
/**
+ * Sets the relative start margin.
+ *
+ * @param start the start marging size
+ *
+ * @attr ref android.R.styleable#ViewGroup_MarginLayout_layout_marginStart
+ */
+ public void setMarginStart(int start) {
+ startMargin = start;
+ }
+
+ /**
* Returns the start margin in pixels.
*
* @attr ref android.R.styleable#ViewGroup_MarginLayout_layout_marginStart
@@ -5742,6 +5753,17 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
}
/**
+ * Sets the relative end margin.
+ *
+ * @param end the end marging size
+ *
+ * @attr ref android.R.styleable#ViewGroup_MarginLayout_layout_marginEnd
+ */
+ public void setMarginEnd(int end) {
+ endMargin = end;
+ }
+
+ /**
* Returns the end margin in pixels.
*
* @attr ref android.R.styleable#ViewGroup_MarginLayout_layout_marginEnd