OSDN Git Service

Fix ActionBar attribute parsing
authorAdam Powell <adamp@google.com>
Fri, 4 Apr 2014 19:23:42 +0000 (12:23 -0700)
committerAdam Powell <adamp@google.com>
Fri, 4 Apr 2014 19:23:42 +0000 (12:23 -0700)
Lost in some prior refactoring. Also fixes doc builds for the removed
styleable.

Change-Id: Ice27a978cd5c22c6ad1fc0b45557c6cac77b5985

core/java/android/app/ActionBar.java
core/res/res/values/attrs.xml

index 13ae352..34b0f3a 100644 (file)
@@ -1224,6 +1224,13 @@ public abstract class ActionBar {
 
         public LayoutParams(@NonNull Context c, AttributeSet attrs) {
             super(c, attrs);
+
+            TypedArray a = c.obtainStyledAttributes(attrs,
+                    com.android.internal.R.styleable.ActionBar_LayoutParams);
+            gravity = a.getInt(
+                    com.android.internal.R.styleable.ActionBar_LayoutParams_layout_gravity,
+                    Gravity.NO_GRAVITY);
+            a.recycle();
         }
 
         public LayoutParams(int width, int height) {
index 00b61a5..0fc198e 100644 (file)
         <attr name="layout_gravity" />
     </declare-styleable>
 
+    <declare-styleable name="ActionBar_LayoutParams">
+        <attr name="layout_gravity" />
+    </declare-styleable>
+
 </resources>