Merge "Fix support for 64-bit integers."
diff --git a/api/current.xml b/api/current.xml
index f4eefae..375448c 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -2114,7 +2114,7 @@
type="int"
transient="false"
volatile="false"
- value="16843567"
+ value="16843566"
static="true"
final="true"
deprecated="not deprecated"
@@ -2136,7 +2136,7 @@
type="int"
transient="false"
volatile="false"
- value="16843576"
+ value="16843575"
static="true"
final="true"
deprecated="not deprecated"
@@ -2147,7 +2147,7 @@
type="int"
transient="false"
volatile="false"
- value="16843575"
+ value="16843574"
static="true"
final="true"
deprecated="not deprecated"
@@ -2158,18 +2158,7 @@
type="int"
transient="false"
volatile="false"
- value="16843577"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="actionButtonPadding"
- type="int"
- transient="false"
- volatile="false"
- value="16843547"
+ value="16843576"
static="true"
final="true"
deprecated="not deprecated"
@@ -2202,7 +2191,7 @@
type="int"
transient="false"
volatile="false"
- value="16843584"
+ value="16843582"
static="true"
final="true"
deprecated="not deprecated"
@@ -2213,7 +2202,7 @@
type="int"
transient="false"
volatile="false"
- value="16843549"
+ value="16843548"
static="true"
final="true"
deprecated="not deprecated"
@@ -2224,7 +2213,7 @@
type="int"
transient="false"
volatile="false"
- value="16843580"
+ value="16843578"
static="true"
final="true"
deprecated="not deprecated"
@@ -2235,7 +2224,7 @@
type="int"
transient="false"
volatile="false"
- value="16843550"
+ value="16843549"
static="true"
final="true"
deprecated="not deprecated"
@@ -2246,7 +2235,7 @@
type="int"
transient="false"
volatile="false"
- value="16843578"
+ value="16843577"
static="true"
final="true"
deprecated="not deprecated"
@@ -2257,7 +2246,7 @@
type="int"
transient="false"
volatile="false"
- value="16843585"
+ value="16843583"
static="true"
final="true"
deprecated="not deprecated"
@@ -2268,7 +2257,7 @@
type="int"
transient="false"
volatile="false"
- value="16843586"
+ value="16843584"
static="true"
final="true"
deprecated="not deprecated"
@@ -2367,7 +2356,7 @@
type="int"
transient="false"
volatile="false"
- value="16843598"
+ value="16843596"
static="true"
final="true"
deprecated="not deprecated"
@@ -2488,7 +2477,7 @@
type="int"
transient="false"
volatile="false"
- value="16843574"
+ value="16843573"
static="true"
final="true"
deprecated="not deprecated"
@@ -2829,7 +2818,7 @@
type="int"
transient="false"
volatile="false"
- value="16843593"
+ value="16843591"
static="true"
final="true"
deprecated="not deprecated"
@@ -2840,7 +2829,7 @@
type="int"
transient="false"
volatile="false"
- value="16843592"
+ value="16843590"
static="true"
final="true"
deprecated="not deprecated"
@@ -2869,6 +2858,17 @@
visibility="public"
>
</field>
+<field name="buttonGroupStyle"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843599"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="buttonStyle"
type="int"
transient="false"
@@ -3643,7 +3643,7 @@
type="int"
transient="false"
volatile="false"
- value="16843597"
+ value="16843595"
static="true"
final="true"
deprecated="not deprecated"
@@ -3760,6 +3760,17 @@
visibility="public"
>
</field>
+<field name="dividerVertical"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843598"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="drawSelectorOnTop"
type="int"
transient="false"
@@ -4501,7 +4512,7 @@
type="int"
transient="false"
volatile="false"
- value="16843557"
+ value="16843556"
static="true"
final="true"
deprecated="not deprecated"
@@ -4512,7 +4523,7 @@
type="int"
transient="false"
volatile="false"
- value="16843561"
+ value="16843560"
static="true"
final="true"
deprecated="not deprecated"
@@ -4523,7 +4534,7 @@
type="int"
transient="false"
volatile="false"
- value="16843562"
+ value="16843561"
static="true"
final="true"
deprecated="not deprecated"
@@ -4534,7 +4545,7 @@
type="int"
transient="false"
volatile="false"
- value="16843563"
+ value="16843562"
static="true"
final="true"
deprecated="not deprecated"
@@ -4545,7 +4556,7 @@
type="int"
transient="false"
volatile="false"
- value="16843564"
+ value="16843563"
static="true"
final="true"
deprecated="not deprecated"
@@ -4556,7 +4567,7 @@
type="int"
transient="false"
volatile="false"
- value="16843559"
+ value="16843558"
static="true"
final="true"
deprecated="not deprecated"
@@ -4567,7 +4578,7 @@
type="int"
transient="false"
volatile="false"
- value="16843560"
+ value="16843559"
static="true"
final="true"
deprecated="not deprecated"
@@ -4578,7 +4589,7 @@
type="int"
transient="false"
volatile="false"
- value="16843565"
+ value="16843564"
static="true"
final="true"
deprecated="not deprecated"
@@ -4589,7 +4600,7 @@
type="int"
transient="false"
volatile="false"
- value="16843566"
+ value="16843565"
static="true"
final="true"
deprecated="not deprecated"
@@ -5073,7 +5084,7 @@
type="int"
transient="false"
volatile="false"
- value="16843583"
+ value="16843581"
static="true"
final="true"
deprecated="not deprecated"
@@ -5194,7 +5205,7 @@
type="int"
transient="false"
volatile="false"
- value="16843570"
+ value="16843569"
static="true"
final="true"
deprecated="not deprecated"
@@ -5205,7 +5216,7 @@
type="int"
transient="false"
volatile="false"
- value="16843568"
+ value="16843567"
static="true"
final="true"
deprecated="not deprecated"
@@ -5216,7 +5227,7 @@
type="int"
transient="false"
volatile="false"
- value="16843569"
+ value="16843568"
static="true"
final="true"
deprecated="not deprecated"
@@ -5575,17 +5586,6 @@
visibility="public"
>
</field>
-<field name="itemPadding"
- type="int"
- transient="false"
- volatile="false"
- value="16843579"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
<field name="itemTextAppearance"
type="int"
transient="false"
@@ -6855,7 +6855,7 @@
type="int"
transient="false"
volatile="false"
- value="16843572"
+ value="16843571"
static="true"
final="true"
deprecated="not deprecated"
@@ -6899,7 +6899,7 @@
type="int"
transient="false"
volatile="false"
- value="16843594"
+ value="16843592"
static="true"
final="true"
deprecated="not deprecated"
@@ -6910,7 +6910,7 @@
type="int"
transient="false"
volatile="false"
- value="16843588"
+ value="16843586"
static="true"
final="true"
deprecated="not deprecated"
@@ -6998,7 +6998,7 @@
type="int"
transient="false"
volatile="false"
- value="16843596"
+ value="16843594"
static="true"
final="true"
deprecated="not deprecated"
@@ -7482,7 +7482,7 @@
type="int"
transient="false"
volatile="false"
- value="16843556"
+ value="16843555"
static="true"
final="true"
deprecated="not deprecated"
@@ -7812,7 +7812,7 @@
type="int"
transient="false"
volatile="false"
- value="16843589"
+ value="16843587"
static="true"
final="true"
deprecated="not deprecated"
@@ -7911,7 +7911,7 @@
type="int"
transient="false"
volatile="false"
- value="16843548"
+ value="16843547"
static="true"
final="true"
deprecated="not deprecated"
@@ -8076,7 +8076,7 @@
type="int"
transient="false"
volatile="false"
- value="16843555"
+ value="16843554"
static="true"
final="true"
deprecated="not deprecated"
@@ -9121,7 +9121,7 @@
type="int"
transient="false"
volatile="false"
- value="16843573"
+ value="16843572"
static="true"
final="true"
deprecated="not deprecated"
@@ -9143,7 +9143,7 @@
type="int"
transient="false"
volatile="false"
- value="16843571"
+ value="16843570"
static="true"
final="true"
deprecated="not deprecated"
@@ -9242,7 +9242,7 @@
type="int"
transient="false"
volatile="false"
- value="16843587"
+ value="16843585"
static="true"
final="true"
deprecated="not deprecated"
@@ -9473,7 +9473,7 @@
type="int"
transient="false"
volatile="false"
- value="16843582"
+ value="16843580"
static="true"
final="true"
deprecated="not deprecated"
@@ -9858,7 +9858,7 @@
type="int"
transient="false"
volatile="false"
- value="16843590"
+ value="16843588"
static="true"
final="true"
deprecated="not deprecated"
@@ -9935,7 +9935,7 @@
type="int"
transient="false"
volatile="false"
- value="16843591"
+ value="16843589"
static="true"
final="true"
deprecated="not deprecated"
@@ -9979,7 +9979,7 @@
type="int"
transient="false"
volatile="false"
- value="16843595"
+ value="16843593"
static="true"
final="true"
deprecated="not deprecated"
@@ -10173,6 +10173,17 @@
visibility="public"
>
</field>
+<field name="textLineHeight"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843597"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="textOff"
type="int"
transient="false"
@@ -10397,7 +10408,7 @@
type="int"
transient="false"
volatile="false"
- value="16843581"
+ value="16843579"
static="true"
final="true"
deprecated="not deprecated"
@@ -10672,7 +10683,7 @@
type="int"
transient="false"
volatile="false"
- value="16843552"
+ value="16843551"
static="true"
final="true"
deprecated="not deprecated"
@@ -10683,7 +10694,7 @@
type="int"
transient="false"
volatile="false"
- value="16843553"
+ value="16843552"
static="true"
final="true"
deprecated="not deprecated"
@@ -10694,7 +10705,7 @@
type="int"
transient="false"
volatile="false"
- value="16843554"
+ value="16843553"
static="true"
final="true"
deprecated="not deprecated"
@@ -11024,7 +11035,7 @@
type="int"
transient="false"
volatile="false"
- value="16843558"
+ value="16843557"
static="true"
final="true"
deprecated="not deprecated"
@@ -11035,7 +11046,7 @@
type="int"
transient="false"
volatile="false"
- value="16843551"
+ value="16843550"
static="true"
final="true"
deprecated="not deprecated"
@@ -16937,7 +16948,7 @@
type="int"
transient="false"
volatile="false"
- value="16973984"
+ value="16973987"
static="true"
final="true"
deprecated="not deprecated"
@@ -16948,7 +16959,7 @@
type="int"
transient="false"
volatile="false"
- value="16973985"
+ value="16973988"
static="true"
final="true"
deprecated="not deprecated"
@@ -17087,6 +17098,39 @@
visibility="public"
>
</field>
+<field name="Theme_Holo_Dialog"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16973981"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="Theme_Holo_Light"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16973980"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="Theme_Holo_Light_Dialog"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16973982"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="Theme_Holo_NoActionBar"
type="int"
transient="false"
@@ -17388,7 +17432,7 @@
type="int"
transient="false"
volatile="false"
- value="16973983"
+ value="16973986"
static="true"
final="true"
deprecated="not deprecated"
@@ -17399,7 +17443,7 @@
type="int"
transient="false"
volatile="false"
- value="16973982"
+ value="16973985"
static="true"
final="true"
deprecated="not deprecated"
@@ -17553,7 +17597,7 @@
type="int"
transient="false"
volatile="false"
- value="16973986"
+ value="16973989"
static="true"
final="true"
deprecated="not deprecated"
@@ -17619,7 +17663,7 @@
type="int"
transient="false"
volatile="false"
- value="16973980"
+ value="16973983"
static="true"
final="true"
deprecated="not deprecated"
@@ -17674,7 +17718,7 @@
type="int"
transient="false"
volatile="false"
- value="16973981"
+ value="16973984"
static="true"
final="true"
deprecated="not deprecated"
@@ -228700,6 +228744,51 @@
</parameter>
</constructor>
</class>
+<class name="ButtonGroup"
+ extends="android.widget.LinearLayout"
+ abstract="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<constructor name="ButtonGroup"
+ type="android.widget.ButtonGroup"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="context" type="android.content.Context">
+</parameter>
+</constructor>
+<constructor name="ButtonGroup"
+ type="android.widget.ButtonGroup"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="context" type="android.content.Context">
+</parameter>
+<parameter name="attrs" type="android.util.AttributeSet">
+</parameter>
+</constructor>
+<constructor name="ButtonGroup"
+ type="android.widget.ButtonGroup"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="context" type="android.content.Context">
+</parameter>
+<parameter name="attrs" type="android.util.AttributeSet">
+</parameter>
+<parameter name="defStyleRes" type="int">
+</parameter>
+</constructor>
+</class>
<class name="CheckBox"
extends="android.widget.CompoundButton"
abstract="false"
@@ -242958,6 +243047,19 @@
<parameter name="input" type="android.text.method.KeyListener">
</parameter>
</method>
+<method name="setLineHeight"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="lineHeight" type="int">
+</parameter>
+</method>
<method name="setLineSpacing"
return="void"
abstract="false"
diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java
index cce860b..7907ad2 100644
--- a/core/java/android/view/ViewRoot.java
+++ b/core/java/android/view/ViewRoot.java
@@ -1281,8 +1281,9 @@
if (mAttachInfo.mHardwareRenderer != null && mAttachInfo.mHardwareRenderer.isEnabled()) {
if (!dirty.isEmpty() || mIsAnimating) {
- mAttachInfo.mHardwareRenderer.draw(mView, mAttachInfo, yoff);
+ mIsAnimating = false;
dirty.setEmpty();
+ mAttachInfo.mHardwareRenderer.draw(mView, mAttachInfo, yoff);
}
if (scrolling) {
diff --git a/core/java/android/webkit/BrowserFrame.java b/core/java/android/webkit/BrowserFrame.java
index efe4b9d..bef5388 100644
--- a/core/java/android/webkit/BrowserFrame.java
+++ b/core/java/android/webkit/BrowserFrame.java
@@ -73,7 +73,7 @@
// that if the UI thread posts any messages after the message
// queue has been cleared,they are ignored.
private boolean mBlockMessages = false;
-
+ private int mOrientation = -1;
private static String sDatabaseDirectory;
private static String sCacheDirectory;
@@ -497,7 +497,10 @@
}
case ORIENTATION_CHANGED: {
- nativeOrientationChanged(msg.arg1);
+ if (mOrientation != msg.arg1) {
+ mOrientation = msg.arg1;
+ nativeOrientationChanged(msg.arg1);
+ }
break;
}
diff --git a/core/java/android/widget/ButtonGroup.java b/core/java/android/widget/ButtonGroup.java
new file mode 100644
index 0000000..a23ea07
--- /dev/null
+++ b/core/java/android/widget/ButtonGroup.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.widget;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.graphics.drawable.Drawable;
+import android.util.AttributeSet;
+import android.view.View;
+import android.view.ViewGroup;
+
+public class ButtonGroup extends LinearLayout {
+ private Drawable mDivider;
+ private Drawable mButtonBackground;
+
+ public ButtonGroup(Context context) {
+ this(context, null);
+ }
+
+ public ButtonGroup(Context context, AttributeSet attrs) {
+ this(context, attrs, com.android.internal.R.attr.buttonGroupStyle);
+ }
+
+ public ButtonGroup(Context context, AttributeSet attrs, int defStyleRes) {
+ super(context, attrs, defStyleRes);
+
+ TypedArray a = context.obtainStyledAttributes(attrs,
+ com.android.internal.R.styleable.ButtonGroup);
+
+ mDivider = a.getDrawable(com.android.internal.R.styleable.ButtonGroup_divider);
+ mButtonBackground = a.getDrawable(
+ com.android.internal.R.styleable.ButtonGroup_buttonBackground);
+ a.recycle();
+ }
+
+ @Override
+ public void addView(View child, int index, ViewGroup.LayoutParams params) {
+ if (getChildCount() > 0) {
+ super.addView(makeDividerView(), index, makeDividerLayoutParams());
+ if (index >= 0) {
+ index++;
+ }
+ }
+ child.setBackgroundDrawable(mButtonBackground);
+ super.addView(child, index, params);
+ }
+
+ private ImageView makeDividerView() {
+ ImageView result = new ImageView(mContext);
+ result.setImageDrawable(mDivider);
+ result.setScaleType(ImageView.ScaleType.FIT_XY);
+ return result;
+ }
+
+ private LayoutParams makeDividerLayoutParams() {
+ return new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
+ }
+}
diff --git a/core/java/android/widget/Spinner.java b/core/java/android/widget/Spinner.java
index c0cbb19..b51d21a 100644
--- a/core/java/android/widget/Spinner.java
+++ b/core/java/android/widget/Spinner.java
@@ -589,7 +589,7 @@
setAnchorView(Spinner.this);
setModal(true);
- setPromptPosition(POSITION_PROMPT_BELOW);
+ setPromptPosition(POSITION_PROMPT_ABOVE);
setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView parent, View v, int position, long id) {
Spinner.this.setSelection(position);
diff --git a/core/java/android/widget/TabHost.java b/core/java/android/widget/TabHost.java
index f720cee..ff31dec 100644
--- a/core/java/android/widget/TabHost.java
+++ b/core/java/android/widget/TabHost.java
@@ -144,6 +144,11 @@
}
}
+ @Override
+ public void sendAccessibilityEvent(int eventType) {
+ /* avoid super class behavior - TabWidget sends the right events */
+ }
+
/**
* If you are using {@link TabSpec#setContent(android.content.Intent)}, this
* must be called since the activityGroup is needed to launch the local activity.
diff --git a/core/java/android/widget/TabWidget.java b/core/java/android/widget/TabWidget.java
index afae7ef..594b1e6 100644
--- a/core/java/android/widget/TabWidget.java
+++ b/core/java/android/widget/TabWidget.java
@@ -28,6 +28,7 @@
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnFocusChangeListener;
+import android.view.accessibility.AccessibilityEvent;
/**
*
@@ -335,7 +336,7 @@
* @see #focusCurrentTab
*/
public void setCurrentTab(int index) {
- if (index < 0 || index >= getTabCount()) {
+ if (index < 0 || index >= getTabCount() || index == mSelectedTab) {
return;
}
@@ -343,6 +344,18 @@
mSelectedTab = index;
getChildTabViewAt(mSelectedTab).setSelected(true);
mStripMoved = true;
+
+ if (isShown()) {
+ sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
+ }
+ }
+
+ @Override
+ public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
+ event.setItemCount(getTabCount());
+ event.setCurrentItemIndex(mSelectedTab);
+ getChildTabViewAt(mSelectedTab).dispatchPopulateAccessibilityEvent(event);
+ return true;
}
/**
@@ -416,6 +429,15 @@
child.setOnFocusChangeListener(this);
}
+ @Override
+ public void sendAccessibilityEventUnchecked(AccessibilityEvent event) {
+ // this class fires events only when tabs are focused or selected
+ if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_FOCUSED && isFocused()) {
+ return;
+ }
+ super.sendAccessibilityEventUnchecked(event);
+ }
+
/**
* Provides a way for {@link TabHost} to be notified that the user clicked on a tab indicator.
*/
@@ -436,6 +458,10 @@
if (getChildTabViewAt(i) == v) {
setCurrentTab(i);
mSelectionChangedListener.onTabSelectionChanged(i, false);
+ if (isShown()) {
+ // a tab is focused so send an event to announce the tab widget state
+ sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED);
+ }
break;
}
i++;
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index e32c899..bacbb24 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -734,6 +734,12 @@
case com.android.internal.R.styleable.TextView_textSelectHandle:
mTextSelectHandleRes = a.getResourceId(attr, 0);
break;
+
+ case com.android.internal.R.styleable.TextView_textLineHeight:
+ int lineHeight = a.getDimensionPixelSize(attr, 0);
+ if (lineHeight != 0) {
+ setLineHeight(lineHeight);
+ }
}
}
a.recycle();
@@ -1063,6 +1069,9 @@
* or last-line padding.
*/
public int getLineHeight() {
+ if (mLineHeight != 0) {
+ return mLineHeight;
+ }
return FastMath.round(mTextPaint.getFontMetricsInt(null) * mSpacingMult
+ mSpacingAdd);
}
@@ -1655,10 +1664,27 @@
TextAppearance_textStyle, -1);
setTypefaceByIndex(typefaceIndex, styleIndex);
+
+ int lineHeight = appearance.getDimensionPixelSize(
+ com.android.internal.R.styleable.TextAppearance_textLineHeight, 0);
+ if (lineHeight != 0) {
+ setLineHeight(lineHeight);
+ }
+
appearance.recycle();
}
/**
+ * Set the height of a line of text in pixels. This value will override line height
+ * values stored in the font modified by lineSpacingExtra and lineSpacingMultiplier.
+ *
+ * @param lineHeight Desired height of a single line of text in pixels
+ */
+ public void setLineHeight(int lineHeight) {
+ mLineHeight = lineHeight;
+ }
+
+ /**
* @return the size (in pixels) of the default text size in this TextView.
*/
public float getTextSize() {
@@ -6732,10 +6758,7 @@
if (mInputContentType != null) {
mInputContentType.enterDown = false;
}
- hideInsertionPointCursorController();
- if (mSelectionModifierCursorController != null) {
- mSelectionModifierCursorController.hide();
- }
+ hideControllers();
}
startStopMarquee(hasWindowFocus);
@@ -6745,10 +6768,7 @@
protected void onVisibilityChanged(View changedView, int visibility) {
super.onVisibilityChanged(changedView, visibility);
if (visibility != VISIBLE) {
- hideInsertionPointCursorController();
- if (mSelectionModifierCursorController != null) {
- mSelectionModifierCursorController.hide();
- }
+ hideControllers();
}
}
@@ -8332,9 +8352,15 @@
}
}
+ private void hideSelectionModifierCursorController() {
+ if (mSelectionModifierCursorController != null) {
+ mSelectionModifierCursorController.hide();
+ }
+ }
+
private void hideControllers() {
hideInsertionPointCursorController();
- stopSelectionActionMode();
+ hideSelectionModifierCursorController();
}
private int getOffsetForHorizontal(int line, int x) {
@@ -8449,6 +8475,7 @@
private float mSpacingMult = 1;
private float mSpacingAdd = 0;
+ private int mLineHeight = 0;
private static final int LINES = 1;
private static final int EMS = LINES;
diff --git a/core/java/android/widget/Toast.java b/core/java/android/widget/Toast.java
index df957ac..29ca49a 100644
--- a/core/java/android/widget/Toast.java
+++ b/core/java/android/widget/Toast.java
@@ -30,6 +30,8 @@
import android.view.View;
import android.view.WindowManager;
import android.view.WindowManagerImpl;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityManager;
/**
* A toast is a view containing a quick little message for the user. The toast class
@@ -281,6 +283,21 @@
tv.setText(s);
}
+ private void trySendAccessibilityEvent() {
+ AccessibilityManager accessibilityManager = AccessibilityManager.getInstance(mContext);
+ if (!accessibilityManager.isEnabled()) {
+ return;
+ }
+ // treat toasts as notifications since they are used to
+ // announce a transient piece of information to the user
+ AccessibilityEvent event = AccessibilityEvent.obtain(
+ AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED);
+ event.setClassName(getClass().getName());
+ event.setPackageName(mContext.getPackageName());
+ mView.dispatchPopulateAccessibilityEvent(event);
+ accessibilityManager.sendAccessibilityEvent(event);
+ }
+
// =======================================================================================
// All the gunk below is the interaction with the Notification Service, which handles
// the proper ordering of these system-wide.
@@ -371,6 +388,7 @@
}
if (localLOGV) Log.v(TAG, "ADD! " + mView + " in " + this);
mWM.addView(mView, mParams);
+ trySendAccessibilityEvent();
}
}
diff --git a/core/java/com/android/internal/view/menu/ActionMenuItemView.java b/core/java/com/android/internal/view/menu/ActionMenuItemView.java
index af0438c..f97bfb4 100644
--- a/core/java/com/android/internal/view/menu/ActionMenuItemView.java
+++ b/core/java/com/android/internal/view/menu/ActionMenuItemView.java
@@ -43,7 +43,7 @@
}
public ActionMenuItemView(Context context, AttributeSet attrs) {
- this(context, attrs, com.android.internal.R.attr.actionButtonStyle);
+ super(context, attrs);
}
public ActionMenuItemView(Context context, AttributeSet attrs, int defStyle) {
@@ -113,6 +113,10 @@
mImageButton.setVisibility(GONE);
}
}
+
+ public boolean hasText() {
+ return mTextButton.getVisibility() != GONE;
+ }
public void setShortcut(boolean showShortcut, char shortcutKey) {
// Action buttons don't show text for shortcut keys.
diff --git a/core/java/com/android/internal/view/menu/ActionMenuView.java b/core/java/com/android/internal/view/menu/ActionMenuView.java
index 20939ab..3b34b7e 100644
--- a/core/java/com/android/internal/view/menu/ActionMenuView.java
+++ b/core/java/com/android/internal/view/menu/ActionMenuView.java
@@ -19,12 +19,15 @@
import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.TypedArray;
+import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
+import android.widget.ImageView;
import android.widget.LinearLayout;
+import android.widget.LinearLayout.LayoutParams;
import java.util.ArrayList;
@@ -33,15 +36,22 @@
*/
public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvoker, MenuView {
private static final String TAG = "ActionMenuView";
+
+ // TODO Theme/style this.
+ private static final int DIVIDER_PADDING = 12; // dips
private MenuBuilder mMenu;
- private int mItemPadding;
- private int mItemMargin;
private int mMaxItems;
private boolean mReserveOverflow;
private OverflowMenuButton mOverflowButton;
private MenuPopupHelper mOverflowPopup;
+
+ private float mButtonPaddingLeft;
+ private float mButtonPaddingRight;
+ private float mDividerPadding;
+
+ private Drawable mDivider;
private Runnable mShowOverflow = new Runnable() {
public void run() {
@@ -56,20 +66,34 @@
public ActionMenuView(Context context, AttributeSet attrs) {
super(context, attrs);
- TypedArray a = context.obtainStyledAttributes(attrs,
- com.android.internal.R.styleable.Theme);
- mItemPadding = a.getDimensionPixelOffset(
- com.android.internal.R.styleable.Theme_actionButtonPadding, 0);
- mItemMargin = mItemPadding / 2;
- a.recycle();
+ final Resources res = getResources();
// Measure for initial configuration
- mMaxItems = measureMaxActionButtons();
+ mMaxItems = getMaxActionButtons();
// TODO There has to be a better way to indicate that we don't have a hard menu key.
- final int screen = getResources().getConfiguration().screenLayout;
+ final int screen = res.getConfiguration().screenLayout;
mReserveOverflow = (screen & Configuration.SCREENLAYOUT_SIZE_MASK) ==
Configuration.SCREENLAYOUT_SIZE_XLARGE;
+
+ TypedArray a = context.obtainStyledAttributes(com.android.internal.R.styleable.Theme);
+ final int buttonStyle = a.getResourceId(
+ com.android.internal.R.styleable.Theme_actionButtonStyle, 0);
+ final int groupStyle = a.getResourceId(
+ com.android.internal.R.styleable.Theme_buttonGroupStyle, 0);
+ a.recycle();
+
+ a = context.obtainStyledAttributes(buttonStyle, com.android.internal.R.styleable.View);
+ mButtonPaddingLeft = a.getDimension(com.android.internal.R.styleable.View_paddingLeft, 0);
+ mButtonPaddingRight = a.getDimension(com.android.internal.R.styleable.View_paddingRight, 0);
+ a.recycle();
+
+ a = context.obtainStyledAttributes(groupStyle,
+ com.android.internal.R.styleable.ButtonGroup);
+ mDivider = a.getDrawable(com.android.internal.R.styleable.ButtonGroup_divider);
+ a.recycle();
+
+ mDividerPadding = DIVIDER_PADDING * res.getDisplayMetrics().density;
}
@Override
@@ -77,7 +101,7 @@
final int screen = newConfig.screenLayout;
mReserveOverflow = (screen & Configuration.SCREENLAYOUT_SIZE_MASK) ==
Configuration.SCREENLAYOUT_SIZE_XLARGE;
- mMaxItems = measureMaxActionButtons();
+ mMaxItems = getMaxActionButtons();
if (mMenu != null) {
mMenu.setMaxActionItems(mMaxItems);
updateChildren(false);
@@ -89,13 +113,8 @@
}
}
- private int measureMaxActionButtons() {
- final Resources res = getResources();
- final int size = res.getDimensionPixelSize(com.android.internal.R.dimen.action_icon_size);
- final int spaceAvailable = res.getDisplayMetrics().widthPixels / 2;
- final int itemSpace = size + mItemPadding;
-
- return spaceAvailable / (itemSpace > 0 ? itemSpace : 1);
+ private int getMaxActionButtons() {
+ return getResources().getInteger(com.android.internal.R.integer.max_action_buttons);
}
public boolean isOverflowReserved() {
@@ -105,24 +124,11 @@
public void setOverflowReserved(boolean reserveOverflow) {
mReserveOverflow = reserveOverflow;
}
-
- @Override
- protected boolean checkLayoutParams(ViewGroup.LayoutParams p) {
- if (p instanceof LayoutParams) {
- LayoutParams lp = (LayoutParams) p;
- return lp.leftMargin == mItemMargin && lp.rightMargin == mItemMargin &&
- lp.gravity == Gravity.CENTER_VERTICAL &&
- lp.width == LayoutParams.WRAP_CONTENT && lp.height == LayoutParams.WRAP_CONTENT;
- }
- return false;
- }
@Override
protected LayoutParams generateDefaultLayoutParams() {
LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT);
- params.leftMargin = mItemMargin;
- params.rightMargin = mItemMargin;
params.gravity = Gravity.CENTER_VERTICAL;
return params;
}
@@ -131,10 +137,6 @@
protected LayoutParams generateLayoutParams(ViewGroup.LayoutParams p) {
return generateDefaultLayoutParams();
}
-
- public int getItemMargin() {
- return mItemMargin;
- }
public boolean invokeItem(MenuItemImpl item) {
return mMenu.performItemAction(item, 0);
@@ -157,14 +159,19 @@
final ArrayList<MenuItemImpl> itemsToShow = mMenu.getActionItems(reserveOverflow);
final int itemCount = itemsToShow.size();
+ boolean needsDivider = false;
for (int i = 0; i < itemCount; i++) {
+ if (needsDivider) {
+ addView(makeDividerView(), makeDividerLayoutParams());
+ }
final MenuItemImpl itemData = itemsToShow.get(i);
final View actionView = itemData.getActionView();
if (actionView != null) {
- addView(actionView);
+ addView(actionView, makeActionViewLayoutParams());
} else {
- addItemView((ActionMenuItemView) itemData.getItemView(
- MenuBuilder.TYPE_ACTION_BUTTON, this));
+ needsDivider = addItemView(i == 0 || !needsDivider,
+ (ActionMenuItemView) itemData.getItemView(
+ MenuBuilder.TYPE_ACTION_BUTTON, this));
}
}
@@ -212,16 +219,43 @@
return false;
}
- private void addItemView(ActionMenuItemView view) {
+ private boolean addItemView(boolean needsDivider, ActionMenuItemView view) {
view.setItemInvoker(this);
+ boolean hasText = view.hasText();
+
+ if (hasText && needsDivider) {
+ addView(makeDividerView(), makeDividerLayoutParams());
+ }
addView(view);
+ return hasText;
+ }
+
+ private ImageView makeDividerView() {
+ ImageView result = new ImageView(mContext);
+ result.setImageDrawable(mDivider);
+ result.setScaleType(ImageView.ScaleType.FIT_XY);
+ return result;
+ }
+
+ private LayoutParams makeDividerLayoutParams() {
+ LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT,
+ LayoutParams.MATCH_PARENT);
+ params.topMargin = (int) mDividerPadding;
+ params.bottomMargin = (int) mDividerPadding;
+ return params;
+ }
+
+ private LayoutParams makeActionViewLayoutParams() {
+ LayoutParams params = generateDefaultLayoutParams();
+ params.leftMargin = (int) mButtonPaddingLeft;
+ params.rightMargin = (int) mButtonPaddingRight;
+ return params;
}
private class OverflowMenuButton extends ImageButton {
public OverflowMenuButton(Context context) {
super(context, null, com.android.internal.R.attr.actionOverflowButtonStyle);
- final Resources res = context.getResources();
setClickable(true);
setFocusable(true);
setVisibility(VISIBLE);
diff --git a/core/java/com/android/internal/view/menu/MenuBuilder.java b/core/java/com/android/internal/view/menu/MenuBuilder.java
index eaeb67f..d0faea6 100644
--- a/core/java/com/android/internal/view/menu/MenuBuilder.java
+++ b/core/java/com/android/internal/view/menu/MenuBuilder.java
@@ -236,14 +236,14 @@
int themeResForType = THEME_RES_FOR_TYPE[mMenuType];
switch (themeResForType) {
case THEME_APPLICATION:
- wrappedContext = new ContextThemeWrapper(mContext, themeResForType);
+ wrappedContext = mContext;
break;
case THEME_ALERT_DIALOG:
wrappedContext = new ContextThemeWrapper(mContext,
getAlertDialogTheme(mContext));
break;
default:
- wrappedContext = mContext;
+ wrappedContext = new ContextThemeWrapper(mContext, themeResForType);
break;
}
mInflater = (LayoutInflater) wrappedContext
diff --git a/core/java/com/android/internal/widget/ActionBarContextView.java b/core/java/com/android/internal/widget/ActionBarContextView.java
index b5e57c2..a824e92 100644
--- a/core/java/com/android/internal/widget/ActionBarContextView.java
+++ b/core/java/com/android/internal/widget/ActionBarContextView.java
@@ -36,8 +36,6 @@
* @hide
*/
public class ActionBarContextView extends ViewGroup {
- private int mItemPadding;
- private int mActionSpacing;
private int mContentHeight;
private CharSequence mTitle;
@@ -64,8 +62,6 @@
super(context, attrs, defStyle);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ActionMode, defStyle, 0);
- mItemPadding = a.getDimensionPixelOffset(
- com.android.internal.R.styleable.ActionMode_itemPadding, 0);
setBackgroundDrawable(a.getDrawable(
com.android.internal.R.styleable.ActionMode_background));
mTitleStyleRes = a.getResourceId(
@@ -219,7 +215,6 @@
}
final int contentWidth = MeasureSpec.getSize(widthMeasureSpec);
- final int itemMargin = mItemPadding;
int maxHeight = mContentHeight > 0 ?
mContentHeight : MeasureSpec.getSize(heightMeasureSpec);
@@ -230,13 +225,11 @@
final int childSpecHeight = MeasureSpec.makeMeasureSpec(height, MeasureSpec.AT_MOST);
if (mCloseButton != null) {
- availableWidth = measureChildView(mCloseButton, availableWidth,
- childSpecHeight, itemMargin);
+ availableWidth = measureChildView(mCloseButton, availableWidth, childSpecHeight, 0);
}
if (mTitleLayout != null && mCustomView == null) {
- availableWidth = measureChildView(mTitleLayout, availableWidth,
- childSpecHeight, itemMargin);
+ availableWidth = measureChildView(mTitleLayout, availableWidth, childSpecHeight, 0);
}
final int childCount = getChildCount();
@@ -246,7 +239,7 @@
continue;
}
- availableWidth = measureChildView(child, availableWidth, childSpecHeight, itemMargin);
+ availableWidth = measureChildView(child, availableWidth, childSpecHeight, 0);
}
if (mCustomView != null) {
@@ -284,25 +277,23 @@
int x = getPaddingLeft();
final int y = getPaddingTop();
final int contentHeight = b - t - getPaddingTop() - getPaddingBottom();
- final int itemMargin = mItemPadding;
if (mCloseButton != null && mCloseButton.getVisibility() != GONE) {
x += positionChild(mCloseButton, x, y, contentHeight);
}
if (mTitleLayout != null && mCustomView == null) {
- x += positionChild(mTitleLayout, x, y, contentHeight) + itemMargin;
+ x += positionChild(mTitleLayout, x, y, contentHeight);
}
if (mCustomView != null) {
- x += positionChild(mCustomView, x, y, contentHeight) + itemMargin;
+ x += positionChild(mCustomView, x, y, contentHeight);
}
x = r - l - getPaddingRight();
if (mMenuView != null) {
- x -= positionChildInverse(mMenuView, x + mActionSpacing, y, contentHeight)
- - mActionSpacing;
+ x -= positionChildInverse(mMenuView, x, y, contentHeight);
}
}
diff --git a/core/java/com/android/internal/widget/ActionBarView.java b/core/java/com/android/internal/widget/ActionBarView.java
index 308a709..054423c 100644
--- a/core/java/com/android/internal/widget/ActionBarView.java
+++ b/core/java/com/android/internal/widget/ActionBarView.java
@@ -53,12 +53,7 @@
*/
public class ActionBarView extends ViewGroup {
private static final String TAG = "ActionBarView";
-
- // TODO: This must be defined in the default theme
- private static final int CONTENT_PADDING_DIP = 3;
- private static final int CONTENT_SPACING_DIP = 6;
- private static final int CONTENT_ACTION_SPACING_DIP = 12;
-
+
/**
* Display options applied by default
*/
@@ -75,12 +70,11 @@
private int mNavigationMode;
private int mDisplayOptions;
- private int mSpacing;
- private int mActionSpacing;
private CharSequence mTitle;
private CharSequence mSubtitle;
private Drawable mIcon;
private Drawable mLogo;
+ private Drawable mDivider;
private ImageView mIconView;
private ImageView mLogoView;
@@ -126,8 +120,6 @@
public ActionBarView(Context context, AttributeSet attrs) {
super(context, attrs);
- final DisplayMetrics metrics = context.getResources().getDisplayMetrics();
-
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ActionBar);
final int colorFilter = a.getColor(R.styleable.ActionBar_colorFilter, 0);
@@ -171,12 +163,10 @@
}
mContentHeight = a.getLayoutDimension(R.styleable.ActionBar_height, 0);
+
+ mDivider = a.getDrawable(R.styleable.ActionBar_divider);
a.recycle();
-
- // TODO: Set this in the theme
- mSpacing = (int) (CONTENT_SPACING_DIP * metrics.density + 0.5f);
- mActionSpacing = (int) (CONTENT_ACTION_SPACING_DIP * metrics.density + 0.5f);
if (mLogo != null || mIcon != null || mTitle != null) {
mLogoNavItem = new ActionMenuItem(context, 0, android.R.id.home, 0, 0, mTitle);
@@ -210,7 +200,6 @@
}
final ActionMenuView menuView = (ActionMenuView) builder.getMenuView(
MenuBuilder.TYPE_ACTION_BUTTON, null);
- mActionSpacing = menuView.getItemMargin();
final LayoutParams layoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.MATCH_PARENT);
menuView.setLayoutParams(layoutParams);
@@ -452,7 +441,8 @@
if ((mDisplayOptions & ActionBar.DISPLAY_HIDE_HOME) == 0) {
if (mLogo != null && (mDisplayOptions & ActionBar.DISPLAY_USE_LOGO) != 0) {
- mLogoView = new ImageView(getContext());
+ mLogoView = new ImageView(getContext(), null,
+ com.android.internal.R.attr.actionButtonStyle);
mLogoView.setAdjustViewBounds(true);
mLogoView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.MATCH_PARENT));
@@ -462,7 +452,8 @@
mLogoView.setOnClickListener(mHomeClickListener);
addView(mLogoView);
} else if (mIcon != null) {
- mIconView = new ImageView(getContext());
+ mIconView = new ImageView(getContext(), null,
+ com.android.internal.R.attr.actionButtonStyle);
mIconView.setAdjustViewBounds(true);
mIconView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.MATCH_PARENT));
@@ -558,10 +549,10 @@
final int childSpecHeight = MeasureSpec.makeMeasureSpec(height, MeasureSpec.AT_MOST);
if (mLogoView != null && mLogoView.getVisibility() != GONE) {
- availableWidth = measureChildView(mLogoView, availableWidth, childSpecHeight, mSpacing);
+ availableWidth = measureChildView(mLogoView, availableWidth, childSpecHeight, 0);
}
if (mIconView != null && mIconView.getVisibility() != GONE) {
- availableWidth = measureChildView(mIconView, availableWidth, childSpecHeight, mSpacing);
+ availableWidth = measureChildView(mIconView, availableWidth, childSpecHeight, 0);
}
if (mMenuView != null) {
@@ -572,7 +563,7 @@
switch (mNavigationMode) {
case ActionBar.NAVIGATION_MODE_STANDARD:
if (mTitleLayout != null) {
- measureChildView(mTitleLayout, availableWidth, childSpecHeight, mSpacing);
+ measureChildView(mTitleLayout, availableWidth, childSpecHeight, 0);
}
break;
case ActionBar.NAVIGATION_MODE_DROPDOWN_LIST:
@@ -652,39 +643,38 @@
final int contentHeight = b - t - getPaddingTop() - getPaddingBottom();
if (mLogoView != null && mLogoView.getVisibility() != GONE) {
- x += positionChild(mLogoView, x, y, contentHeight) + mSpacing;
+ x += positionChild(mLogoView, x, y, contentHeight);
}
if (mIconView != null && mIconView.getVisibility() != GONE) {
- x += positionChild(mIconView, x, y, contentHeight) + mSpacing;
+ x += positionChild(mIconView, x, y, contentHeight);
}
switch (mNavigationMode) {
case ActionBar.NAVIGATION_MODE_STANDARD:
if (mTitleLayout != null) {
- x += positionChild(mTitleLayout, x, y, contentHeight) + mSpacing;
+ x += positionChild(mTitleLayout, x, y, contentHeight);
}
break;
case ActionBar.NAVIGATION_MODE_DROPDOWN_LIST:
if (mSpinner != null) {
- x += positionChild(mSpinner, x, y, contentHeight) + mSpacing;
+ x += positionChild(mSpinner, x, y, contentHeight);
}
break;
case ActionBar.NAVIGATION_MODE_CUSTOM:
if (mCustomNavView != null) {
- x += positionChild(mCustomNavView, x, y, contentHeight) + mSpacing;
+ x += positionChild(mCustomNavView, x, y, contentHeight);
}
break;
case ActionBar.NAVIGATION_MODE_TABS:
if (mTabScrollView != null) {
- x += positionChild(mTabScrollView, x, y, contentHeight) + mSpacing;
+ x += positionChild(mTabScrollView, x, y, contentHeight);
}
}
x = r - l - getPaddingRight();
if (mMenuView != null) {
- x -= positionChildInverse(mMenuView, x + mActionSpacing, y, contentHeight)
- - mActionSpacing;
+ x -= positionChildInverse(mMenuView, x, y, contentHeight);
}
}
diff --git a/core/res/res/drawable/list_selector_holo_dark.xml b/core/res/res/drawable/list_selector_holo_dark.xml
index ee59904..a046831 100644
--- a/core/res/res/drawable/list_selector_holo_dark.xml
+++ b/core/res/res/drawable/list_selector_holo_dark.xml
@@ -24,6 +24,6 @@
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/list_selector_background_transition" />
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/list_selector_background_transition" />
<item android:state_focused="true" android:drawable="@drawable/list_selector_focused_holo_dark" />
- <item android:drawable="@drawable/list_selector_focused_holo_dark" />
+ <item android:drawable="@color/transparent" />
</selector>
diff --git a/core/res/res/drawable/list_selector_holo_light.xml b/core/res/res/drawable/list_selector_holo_light.xml
index 2dc39f6..e0a3bec 100644
--- a/core/res/res/drawable/list_selector_holo_light.xml
+++ b/core/res/res/drawable/list_selector_holo_light.xml
@@ -24,6 +24,6 @@
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/list_selector_background_transition" />
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/list_selector_background_transition" />
<item android:state_focused="true" android:drawable="@drawable/list_selector_focused_holo_light" />
- <item android:drawable="@drawable/list_selector_focused_holo_light" />
+ <item android:drawable="@color/transparent" />
</selector>
diff --git a/core/res/res/layout-xlarge/alert_dialog_holo.xml b/core/res/res/layout-xlarge/alert_dialog_holo.xml
new file mode 100644
index 0000000..a01e03a
--- /dev/null
+++ b/core/res/res/layout-xlarge/alert_dialog_holo.xml
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<com.android.internal.widget.WeightedLinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/parentPanel"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:paddingTop="9dip"
+ android:paddingBottom="3dip"
+ android:paddingLeft="3dip"
+ android:paddingRight="1dip"
+ android:majorWeightMin="0.45"
+ android:minorWeightMin="0.72"
+ android:majorWeightMax="0.45"
+ android:minorWeightMax="0.72">
+
+ <LinearLayout android:id="@+id/topPanel"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="48dip"
+ android:orientation="vertical">
+ <LinearLayout android:id="@+id/title_template"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:gravity="center_vertical"
+ android:layout_marginTop="8dip"
+ android:layout_marginBottom="8dip"
+ android:layout_marginLeft="32dip"
+ android:layout_marginRight="32dip">
+ <ImageView android:id="@+id/icon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingRight="16dip"
+ android:src="@null" />
+ <com.android.internal.widget.DialogTitle android:id="@+id/alertTitle"
+ style="?android:attr/textAppearanceMedium"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
+ </LinearLayout>
+ <ImageView android:id="@+id/titleDivider"
+ android:layout_width="match_parent"
+ android:layout_height="1dip"
+ android:visibility="gone"
+ android:scaleType="fitXY"
+ android:gravity="fill_horizontal"
+ android:src="@android:drawable/divider_horizontal_dark" />
+ <!-- If the client uses a customTitle, it will be added here. -->
+ </LinearLayout>
+
+ <LinearLayout android:id="@+id/contentPanel"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:orientation="vertical">
+ <ScrollView android:id="@+id/scrollView"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="32dip"
+ android:paddingBottom="32dip"
+ android:paddingLeft="32dip"
+ android:paddingRight="32dip">
+ <TextView android:id="@+id/message"
+ style="?android:attr/textAppearanceMedium"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
+ </ScrollView>
+ </LinearLayout>
+
+ <FrameLayout android:id="@+id/customPanel"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1">
+ <FrameLayout android:id="@+android:id/custom"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="8dip"
+ android:paddingBottom="8dip" />
+ </FrameLayout>
+
+ <LinearLayout android:id="@+id/buttonPanel"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="54dip"
+ android:orientation="vertical" >
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:paddingTop="4dip"
+ android:paddingLeft="2dip"
+ android:paddingRight="2dip"
+ android:measureWithLargestChild="true">
+ <LinearLayout android:id="@+id/leftSpacer"
+ android:layout_weight="0.25"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:visibility="gone" />
+ <Button android:id="@+id/button1"
+ android:layout_width="0dip"
+ android:layout_gravity="left"
+ android:layout_weight="1"
+ android:maxLines="2"
+ android:layout_height="wrap_content" />
+ <Button android:id="@+id/button3"
+ android:layout_width="0dip"
+ android:layout_gravity="center_horizontal"
+ android:layout_weight="1"
+ android:maxLines="2"
+ android:layout_height="wrap_content" />
+ <Button android:id="@+id/button2"
+ android:layout_width="0dip"
+ android:layout_gravity="right"
+ android:layout_weight="1"
+ android:maxLines="2"
+ android:layout_height="wrap_content" />
+ <LinearLayout android:id="@+id/rightSpacer"
+ android:layout_width="0dip"
+ android:layout_weight="0.25"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:visibility="gone" />
+ </LinearLayout>
+ </LinearLayout>
+</com.android.internal.widget.WeightedLinearLayout>
diff --git a/core/res/res/layout/action_menu_item_layout.xml b/core/res/res/layout/action_menu_item_layout.xml
index 0d3cce5..e7b8a25 100644
--- a/core/res/res/layout/action_menu_item_layout.xml
+++ b/core/res/res/layout/action_menu_item_layout.xml
@@ -20,10 +20,13 @@
<ImageButton android:id="@+id/imageButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_gravity="center"
android:visibility="gone"
style="?attr/actionButtonStyle" />
<Button android:id="@+id/textButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:visibility="gone" />
+ android:layout_gravity="center"
+ android:visibility="gone"
+ android:background="?attr/listChoiceBackgroundIndicator" />
</com.android.internal.view.menu.ActionMenuItemView>
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index d9f0039..461fb5f 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -483,8 +483,6 @@
<!-- Action bar styles -->
<!-- =================== -->
<eat-comment />
- <!-- Default amount of padding to use between action buttons. -->
- <attr name="actionButtonPadding" format="dimension" />
<!-- Default style for tabs within an action bar -->
<attr name="actionBarTabStyle" format="reference" />
<attr name="actionBarTabBarStyle" format="reference" />
@@ -555,6 +553,12 @@
<attr name="dialogTheme" format="reference" />
<!-- Theme to use for alert dialogs spawned from this theme. -->
<attr name="alertDialogTheme" format="reference" />
+
+ <!-- Drawable to use for vertical dividers. -->
+ <attr name="dividerVertical" format="reference" />
+
+ <!-- Style for button groups -->
+ <attr name="buttonGroupStyle" format="reference" />
</declare-styleable>
<!-- **************************************************************** -->
@@ -600,6 +604,9 @@
<!-- Color of link text (URLs). -->
<attr name="textColorLink" format="reference|color" />
+ <!-- Height of a line of text. -->
+ <attr name="textLineHeight" format="dimension" />
+
<!-- Where to ellipsize text. -->
<attr name="ellipsize">
<enum name="none" value="0" />
@@ -2076,6 +2083,8 @@
<attr name="textColorHint" />
<!-- Color of the links. -->
<attr name="textColorLink" />
+ <!-- Height of a single line of text. -->
+ <attr name="textLineHeight" />
</declare-styleable>
<declare-styleable name="TextSwitcher">
</declare-styleable>
@@ -2312,6 +2321,9 @@
<!-- Reference to a drawable that will be used to display a text selection
anchor for positioning the cursor within text. -->
<attr name="textSelectHandle" />
+
+ <!-- Height of a line of text. -->
+ <attr name="textLineHeight" />
</declare-styleable>
<!-- An <code>input-extras</code> is a container for extra data to supply to
an input method. Contains
@@ -4177,8 +4189,6 @@
<attr name="background" />
<!-- Specifies a fixed height for the action mode bar. -->
<attr name="height" />
- <!-- Specifies a padding to use between elements on the bar. -->
- <attr name="itemPadding" format="dimension" />
</declare-styleable>
<declare-styleable name="SearchView">
@@ -4186,4 +4196,11 @@
use and expanded when clicked. -->
<attr name="iconifiedByDefault" format="boolean"/>
</declare-styleable>
+
+ <declare-styleable name="ButtonGroup">
+ <!-- Drawable to use as a vertical divider between buttons. -->
+ <attr name="divider" />
+ <!-- Drawable to use as a background for buttons added to this group. -->
+ <attr name="buttonBackground" format="reference" />
+ </declare-styleable>
</resources>
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index 171bb45..6ec8017 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -25,9 +25,10 @@
<!-- The standard size (both width and height) of an application icon that
will be displayed in the app launcher and elsewhere. -->
<dimen name="app_icon_size">48dip</dimen>
- <!-- The standard size (both width and height) of an action icon that will
- be displayed in application action bars. -->
- <dimen name="action_icon_size">48dip</dimen>
+ <!-- The maximum number of action buttons that should be permitted within
+ an action bar/action mode. This will be used to determine how many
+ showAsAction="ifRoom" items can fit. "always" items can override this. -->
+ <integer name="max_action_buttons">5</integer>
<dimen name="toast_y_offset">64dip</dimen>
<!-- Height of the status bar -->
<dimen name="status_bar_height">25dip</dimen>
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index ae25715..1080187 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -1316,7 +1316,6 @@
<public type="attr" name="actionDropDownStyle" />
<public type="attr" name="actionButtonStyle" />
<public type="attr" name="showAsAction" />
- <public type="attr" name="actionButtonPadding" />
<public type="attr" name="previewImage" />
<public type="attr" name="actionModeBackground" />
<public type="attr" name="actionModeCloseDrawable" />
@@ -1348,7 +1347,6 @@
<public type="attr" name="actionBarTabBarStyle" />
<public type="attr" name="actionBarTabTextStyle" />
<public type="attr" name="actionOverflowButtonStyle" />
- <public type="attr" name="itemPadding" />
<public type="attr" name="actionModeCloseButtonStyle" />
<public type="attr" name="titleTextStyle" />
<public type="attr" name="subtitleTextStyle" />
@@ -1368,6 +1366,9 @@
<public type="attr" name="loopViews" />
<public type="attr" name="dialogTheme" />
<public type="attr" name="alertDialogTheme" />
+ <public type="attr" name="textLineHeight" />
+ <public type="attr" name="dividerVertical" />
+ <public type="attr" name="buttonGroupStyle" />
<public type="anim" name="animator_fade_in" />
<public type="anim" name="animator_fade_out" />
@@ -1409,6 +1410,9 @@
<public type="style" name="Theme.Holo.NoActionBar.Fullscreen" />
<public type="style" name="Theme.Light.Holo.NoActionBar" />
<public type="style" name="Theme.Light.Holo.NoActionBar.Fullscreen" />
+ <public type="style" name="Theme.Holo.Light" />
+ <public type="style" name="Theme.Holo.Dialog" />
+ <public type="style" name="Theme.Holo.Light.Dialog" />
<public type="style" name="Widget.ListPopupWindow" />
<public type="style" name="Widget.PopupMenu" />
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index 8f7ace9..fdc8c47 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -905,9 +905,9 @@
<item name="android:displayOptions">useLogo</item>
<item name="android:divider">@android:drawable/action_bar_divider</item>
<item name="android:height">?android:attr/actionBarSize</item>
- <item name="android:paddingLeft">3dip</item>
+ <item name="android:paddingLeft">0dip</item>
<item name="android:paddingTop">0dip</item>
- <item name="android:paddingRight">3dip</item>
+ <item name="android:paddingRight">0dip</item>
<item name="android:paddingBottom">0dip</item>
<item name="android:titleTextStyle">@android:style/TextAppearance.Widget.ActionBar.Title</item>
<item name="android:subtitleTextStyle">@android:style/TextAppearance.Widget.ActionBar.Subtitle</item>
@@ -916,7 +916,6 @@
<style name="Widget.ActionMode">
<item name="android:background">?android:attr/actionModeBackground</item>
<item name="android:height">?android:attr/actionBarSize</item>
- <item name="android:itemPadding">?android:attr/actionButtonPadding</item>
<item name="android:titleTextStyle">@android:style/TextAppearance.Widget.ActionMode.Title</item>
<item name="android:subtitleTextStyle">@android:style/TextAppearance.Widget.ActionMode.Subtitle</item>
</style>
@@ -939,6 +938,8 @@
<style name="Widget.ActionButton">
<item name="android:background">@null</item>
+ <item name="android:paddingLeft">16dip</item>
+ <item name="android:paddingRight">16dip</item>
</style>
<style name="Widget.ActionButton.Overflow">
@@ -992,6 +993,11 @@
<item name="android:textColor">@android:color/secondary_text_light</item>
</style>
+ <style name="Widget.ButtonGroup">
+ <item name="divider">?android:attr/dividerVertical</item>
+ <item name="buttonBackground">?android:attr/listChoiceBackgroundIndicator</item>
+ </style>
+
<!-- Begin Holo theme styles -->
<!-- Text Styles -->
@@ -1009,6 +1015,7 @@
</style>
<style name="TextAppearance.Holo.Medium" parent="TextAppearance.Medium">
+ <item name="android:textLineHeight">24dip</item>
</style>
<style name="TextAppearance.Holo.Small" parent="TextAppearance.Small">
@@ -1073,16 +1080,16 @@
</style>
<style name="TextAppearance.Holo.Widget.DropDownHint">
- <item name="android:textColor">?textColorPrimaryInverse</item>
+ <item name="android:textColor">?textColorPrimary</item>
<item name="android:textSize">14sp</item>
</style>
<style name="TextAppearance.Holo.Widget.DropDownItem">
- <item name="android:textColor">@android:color/primary_text_light_disable_only</item>
+ <item name="android:textColor">?textColorPrimaryDisableOnly</item>
</style>
<style name="TextAppearance.Holo.Widget.TextView.SpinnerItem">
- <item name="android:textColor">@android:color/primary_text_light_disable_only</item>
+ <item name="android:textColor">?textColorPrimaryDisableOnly</item>
</style>
<style name="TextAppearance.Holo.Widget.EditText">
@@ -1142,13 +1149,13 @@
<item name="android:textColorLink">?textColorLinkInverse</item>
</style>
- <style name="TextAppearance.Holo.Light.Large" parent="TextAppearance.Large">
+ <style name="TextAppearance.Holo.Light.Large" parent="TextAppearance.Holo.Large">
</style>
- <style name="TextAppearance.Holo.Light.Medium" parent="TextAppearance.Medium">
+ <style name="TextAppearance.Holo.Light.Medium" parent="TextAppearance.Holo.Medium">
</style>
- <style name="TextAppearance.Holo.Light.Small" parent="TextAppearance.Small">
+ <style name="TextAppearance.Holo.Light.Small" parent="TextAppearance.Holo.Small">
</style>
<style name="TextAppearance.Holo.Light.Large.Inverse">
@@ -1260,6 +1267,9 @@
<item name="android:paddingRight">24dip</item>
</style>
+ <style name="Widget.Holo.ButtonGroup" parent="Widget.ButtonGroup">
+ </style>
+
<style name="Widget.Holo.TextView" parent="Widget.TextView">
</style>
@@ -1393,12 +1403,14 @@
</style>
<style name="Widget.Holo.DropDownItem" parent="Widget.DropDownItem">
+ <item name="android:textAppearance">@style/TextAppearance.Holo.Widget.DropDownItem</item>
</style>
<style name="Widget.Holo.DropDownItem.Spinner">
</style>
<style name="Widget.Holo.TextView.SpinnerItem" parent="Widget.TextView.SpinnerItem">
+ <item name="android:textAppearance">@style/TextAppearance.Holo.Widget.TextView.SpinnerItem</item>
</style>
<style name="Widget.Holo.KeyboardView" parent="Widget.KeyboardView">
@@ -1433,13 +1445,27 @@
<style name="Widget.Holo.PopupMenu" parent="Widget.Holo.ListPopupWindow">
</style>
- <style name="Widget.Holo.ActionButton" parent="Widget.ActionButton">
+ <style name="Widget.Holo.ButtonBar">
+ <item name="android:divider">?android:attr/dividerVertical</item>
</style>
- <style name="Widget.Holo.ActionButton.Overflow" parent="Widget.ActionButton.Overflow">
+ <style name="Widget.Holo.ButtonBar.Button">
+ </style>
+
+ <style name="Widget.Holo.ActionButton" parent="Widget.ActionButton">
+ <item name="android:paddingLeft">16dip</item>
+ <item name="android:paddingRight">16dip</item>
+ <item name="android:minWidth">64dip</item>
+ <item name="android:minHeight">56dip</item>
+ </style>
+
+ <style name="Widget.Holo.ActionButton.Overflow">
<item name="android:src">@android:drawable/ic_menu_moreoverflow_holo_dark</item>
</style>
+ <style name="Widget.Holo.ActionButton.TextButton" parent="Widget.Holo.ButtonBar.Button">
+ </style>
+
<style name="Widget.Holo.ActionBarView_TabView" parent="Widget.ActionBarView_TabView">
</style>
@@ -1458,7 +1484,7 @@
<item name="android:subtitleTextStyle">@android:style/TextAppearance.Holo.Widget.ActionMode.Subtitle</item>
</style>
- <style name="Widget.Holo.ActionButton.CloseMode" parent="Widget.ActionButton.CloseMode">
+ <style name="Widget.Holo.ActionButton.CloseMode">
<item name="android:src">@drawable/cab_ic_close_holo</item>
</style>
@@ -1466,6 +1492,7 @@
<item name="android:titleTextStyle">@android:style/TextAppearance.Holo.Widget.ActionBar.Title</item>
<item name="android:subtitleTextStyle">@android:style/TextAppearance.Holo.Widget.ActionBar.Subtitle</item>
<item name="android:background">@null</item>
+ <item name="android:divider">?android:attr/dividerVertical</item>
</style>
<!-- Light widget styles -->
@@ -1493,6 +1520,9 @@
<item name="android:paddingRight">24dip</item>
</style>
+ <style name="Widget.Holo.Light.ButtonGroup" parent="Widget.Holo.ButtonGroup">
+ </style>
+
<style name="Widget.Holo.Light.TextView" parent="Widget.TextView">
</style>
@@ -1619,13 +1649,13 @@
<style name="Widget.Holo.Light.WebView" parent="Widget.WebView">
</style>
- <style name="Widget.Holo.Light.DropDownItem" parent="Widget.DropDownItem">
+ <style name="Widget.Holo.Light.DropDownItem" parent="Widget.Holo.DropDownItem">
</style>
<style name="Widget.Holo.Light.DropDownItem.Spinner">
</style>
- <style name="Widget.Holo.Light.TextView.SpinnerItem" parent="Widget.TextView.SpinnerItem">
+ <style name="Widget.Holo.Light.TextView.SpinnerItem" parent="Widget.Holo.TextView.SpinnerItem">
</style>
<style name="Widget.Holo.Light.KeyboardView" parent="Widget.KeyboardView">
@@ -1660,10 +1690,10 @@
<style name="Widget.Holo.Light.PopupMenu" parent="Widget.Holo.Light.ListPopupWindow">
</style>
- <style name="Widget.Holo.Light.ActionButton" parent="Widget.ActionButton">
+ <style name="Widget.Holo.Light.ActionButton" parent="Widget.Holo.ActionButton">
</style>
- <style name="Widget.Holo.Light.ActionButton.Overflow" parent="Widget.ActionButton.Overflow">
+ <style name="Widget.Holo.Light.ActionButton.Overflow">
<item name="android:src">@android:drawable/ic_menu_moreoverflow_holo_light</item>
</style>
@@ -1676,16 +1706,16 @@
<style name="Widget.Holo.Light.ActionBarView_TabText" parent="Widget.ActionBarView_TabText">
</style>
- <style name="Widget.Holo.Light.ActionMode" parent="Widget.ActionMode">
+ <style name="Widget.Holo.Light.ActionMode" parent="Widget.Holo.ActionMode">
<item name="android:background">@android:drawable/cab_holo_light</item>
<item name="android:titleTextStyle">@android:style/TextAppearance.Holo.Widget.ActionMode.Title</item>
<item name="android:subtitleTextStyle">@android:style/TextAppearance.Holo.Widget.ActionMode.Subtitle</item>
</style>
- <style name="Widget.Holo.Light.ActionButton.CloseMode" parent="Widget.ActionButton.CloseMode">
+ <style name="Widget.Holo.Light.ActionButton.CloseMode">
</style>
- <style name="Widget.Holo.Light.ActionBar" parent="Widget.ActionBar">
+ <style name="Widget.Holo.Light.ActionBar" parent="Widget.Holo.ActionBar">
<item name="android:titleTextStyle">@android:style/TextAppearance.Holo.Widget.ActionBar.Title</item>
<item name="android:subtitleTextStyle">@android:style/TextAppearance.Holo.Widget.ActionBar.Subtitle</item>
<item name="android:background">@null</item>
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index 8daa802..5948a5b 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -234,7 +234,6 @@
<item name="actionDropDownStyle">@android:style/Widget.Spinner.DropDown</item>
<item name="actionButtonStyle">@android:style/Widget.ActionButton</item>
<item name="actionOverflowButtonStyle">@android:style/Widget.ActionButton.Overflow</item>
- <item name="actionButtonPadding">12dip</item>
<item name="actionModeBackground">@android:drawable/action_bar_context_background</item>
<item name="actionModeCloseDrawable">@android:drawable/ic_menu_close_clear_cancel</item>
<item name="actionBarTabStyle">@style/Widget.ActionBarView_TabView</item>
@@ -243,7 +242,10 @@
<item name="actionModeStyle">@style/Widget.ActionMode</item>
<item name="actionModeCloseButtonStyle">@style/Widget.ActionButton.CloseMode</item>
<item name="actionBarStyle">@android:style/Widget.ActionBar</item>
- <item name="actionBarSize">50dip</item>
+ <item name="actionBarSize">56dip</item>
+
+ <item name="dividerVertical">@drawable/divider_vertical_dark</item>
+ <item name="buttonGroupStyle">@android:style/Widget.ButtonGroup</item>
</style>
<!-- Variant of the default (dark) theme with no title bar -->
@@ -826,7 +828,6 @@
<item name="actionDropDownStyle">@android:style/Widget.Holo.Spinner.DropDown</item>
<item name="actionButtonStyle">@android:style/Widget.Holo.ActionButton</item>
<item name="actionOverflowButtonStyle">@android:style/Widget.Holo.ActionButton.Overflow</item>
- <item name="actionButtonPadding">12dip</item>
<item name="actionModeBackground">@android:drawable/cab_holo_dark</item>
<item name="actionModeCloseDrawable">@android:drawable/cab_ic_close_holo</item>
<item name="actionBarTabStyle">@style/Widget.Holo.ActionBarView_TabView</item>
@@ -835,8 +836,10 @@
<item name="actionModeStyle">@style/Widget.Holo.ActionMode</item>
<item name="actionModeCloseButtonStyle">@style/Widget.Holo.ActionButton.CloseMode</item>
<item name="actionBarStyle">@android:style/Widget.Holo.ActionBar</item>
- <item name="actionBarSize">50dip</item>
+ <item name="actionBarSize">56dip</item>
+ <item name="dividerVertical">@drawable/divider_vertical_holo_dark</item>
+ <item name="buttonGroupStyle">@android:style/Widget.Holo.ButtonGroup</item>
</style>
<!-- New Honeycomb holographic theme. Light version. The widgets in the
@@ -1052,7 +1055,6 @@
<item name="actionDropDownStyle">@android:style/Widget.Holo.Spinner.DropDown</item>
<item name="actionButtonStyle">@android:style/Widget.Holo.ActionButton</item>
<item name="actionOverflowButtonStyle">@android:style/Widget.Holo.ActionButton.Overflow</item>
- <item name="actionButtonPadding">12dip</item>
<item name="actionModeBackground">@android:drawable/cab_holo_light</item>
<item name="actionModeCloseDrawable">@android:drawable/cab_ic_close_holo</item>
<item name="actionBarTabStyle">@style/Widget.Holo.ActionBarView_TabView</item>
@@ -1061,8 +1063,10 @@
<item name="actionModeStyle">@style/Widget.Holo.Light.ActionMode</item>
<item name="actionModeCloseButtonStyle">@style/Widget.Holo.ActionButton.CloseMode</item>
<item name="actionBarStyle">@android:style/Widget.Holo.ActionBar</item>
- <item name="actionBarSize">50dip</item>
+ <item name="actionBarSize">56dip</item>
+ <item name="dividerVertical">@drawable/divider_vertical_holo_light</item>
+ <item name="buttonGroupStyle">@android:style/Widget.Holo.Light.ButtonGroup</item>
</style>
<!-- Development legacy name; if you're using this, switch. -->
diff --git a/media/java/android/media/videoeditor/EffectColor.java b/media/java/android/media/videoeditor/EffectColor.java
index f38cf75..ac48e37 100755
--- a/media/java/android/media/videoeditor/EffectColor.java
+++ b/media/java/android/media/videoeditor/EffectColor.java
@@ -25,7 +25,7 @@
/**
* Change the video frame color to the RGB color value provided
*/
- public static final int TYPE_COLOR = 1; // color as 888 RGB
+ public static final int TYPE_COLOR = 1;
/**
* Change the video frame color to a gradation from RGB color (at the top of
* the frame) to black (at the bottom of the frame).
@@ -44,7 +44,7 @@
*/
public static final int TYPE_FIFTIES = 5;
- // Colors for the color effect
+ // Predefined colors
public static final int GREEN = 0x0000ff00;
public static final int PINK = 0x00ff66cc;
public static final int GRAY = 0x007f7f7f;
@@ -52,8 +52,8 @@
// The effect type
private final int mType;
- // The effect parameter
- private final int mParam;
+ // The effect color
+ private final int mColor;
/**
* An object of this type cannot be instantiated by using the default
@@ -73,29 +73,47 @@
* is applied
* @param durationMs The duration of this effect in milliseconds
* @param type type of the effect. type is one of: TYPE_COLOR,
- * TYPE_GRADIENT, TYPE_SEPIA, TYPE_NEGATIVE, TYPE_FIFTIES. If
- * type is not supported, the argument is ignored
- * @param param if type is TYPE_COLOR, param is the RGB color as 888.
- * Otherwise, param is ignored
+ * TYPE_GRADIENT, TYPE_SEPIA, TYPE_NEGATIVE, TYPE_FIFTIES.
+ * @param color If type is TYPE_COLOR, color is the RGB color as 888.
+ * If type is TYPE_GRADIENT, color is the RGB color at the
+ * top of the frame. Otherwise, color is ignored
*/
public EffectColor(MediaItem mediaItem, String effectId, long startTimeMs, long durationMs,
- int type, int param) {
+ int type, int color) {
super(mediaItem, effectId, startTimeMs, durationMs);
+ switch (type) {
+ case TYPE_COLOR:
+ case TYPE_GRADIENT: {
+ mColor = color;
+ break;
+ }
+
+ case TYPE_SEPIA:
+ case TYPE_NEGATIVE:
+ case TYPE_FIFTIES: {
+ mColor = -1;
+ break;
+ }
+
+ default: {
+ throw new IllegalArgumentException("Invalid type: " + type);
+ }
+ }
+
mType = type;
- mParam = param;
}
/**
- * @return The type of this effect
+ * @return The effect type
*/
public int getType() {
return mType;
}
/**
- * @return the color as RGB 888 if type is TYPE_COLOR. Otherwise, ignore.
+ * @return the color as RGB 888 if type is TYPE_COLOR or TYPE_GRADIENT.
*/
- public int getParam() {
- return mParam;
+ public int getColor() {
+ return mColor;
}
}
diff --git a/media/java/android/media/videoeditor/VideoEditorTestImpl.java b/media/java/android/media/videoeditor/VideoEditorTestImpl.java
index c3cb82a..cf0e3ba 100644
--- a/media/java/android/media/videoeditor/VideoEditorTestImpl.java
+++ b/media/java/android/media/videoeditor/VideoEditorTestImpl.java
@@ -643,7 +643,7 @@
Integer.toString(colorEffect.getType()));
if (colorEffect.getType() == EffectColor.TYPE_COLOR) {
serializer.attribute("", ATTR_COLOR_EFFECT_VALUE,
- Integer.toString(colorEffect.getParam()));
+ Integer.toString(colorEffect.getColor()));
}
} else if (effect instanceof EffectKenBurns) {
final Rect startRect = ((EffectKenBurns)effect).getStartRect();
@@ -972,7 +972,8 @@
final int colorEffectType =
Integer.parseInt(parser.getAttributeValue("", ATTR_COLOR_EFFECT_TYPE));
final int color;
- if (colorEffectType == EffectColor.TYPE_COLOR) {
+ if (colorEffectType == EffectColor.TYPE_COLOR
+ || colorEffectType == EffectColor.TYPE_GRADIENT) {
color = Integer.parseInt(parser.getAttributeValue("", ATTR_COLOR_EFFECT_VALUE));
} else {
color = 0;
diff --git a/services/jni/com_android_server_location_GpsLocationProvider.cpp b/services/jni/com_android_server_location_GpsLocationProvider.cpp
index b9ceaa1..b312fb1 100755
--- a/services/jni/com_android_server_location_GpsLocationProvider.cpp
+++ b/services/jni/com_android_server_location_GpsLocationProvider.cpp
@@ -326,29 +326,45 @@
static void android_location_GpsLocationProvider_cleanup(JNIEnv* env, jobject obj)
{
- sGpsInterface->cleanup();
+ const GpsInterface* interface = GetGpsInterface();
+ if (interface)
+ interface->cleanup();
}
static jboolean android_location_GpsLocationProvider_set_position_mode(JNIEnv* env, jobject obj,
jint mode, jint recurrence, jint min_interval, jint preferred_accuracy, jint preferred_time)
{
- return (sGpsInterface->set_position_mode(mode, recurrence, min_interval, preferred_accuracy,
- preferred_time) == 0);
+ const GpsInterface* interface = GetGpsInterface();
+ if (interface)
+ return (interface->set_position_mode(mode, recurrence, min_interval, preferred_accuracy,
+ preferred_time) == 0);
+ else
+ return false;
}
static jboolean android_location_GpsLocationProvider_start(JNIEnv* env, jobject obj)
{
- return (sGpsInterface->start() == 0);
+ const GpsInterface* interface = GetGpsInterface();
+ if (interface)
+ return (interface->start() == 0);
+ else
+ return false;
}
static jboolean android_location_GpsLocationProvider_stop(JNIEnv* env, jobject obj)
{
- return (sGpsInterface->stop() == 0);
+ const GpsInterface* interface = GetGpsInterface();
+ if (interface)
+ return (interface->stop() == 0);
+ else
+ return false;
}
static void android_location_GpsLocationProvider_delete_aiding_data(JNIEnv* env, jobject obj, jint flags)
{
- sGpsInterface->delete_aiding_data(flags);
+ const GpsInterface* interface = GetGpsInterface();
+ if (interface)
+ interface->delete_aiding_data(flags);
}
static jint android_location_GpsLocationProvider_read_sv_status(JNIEnv* env, jobject obj,
@@ -456,19 +472,26 @@
static void android_location_GpsLocationProvider_inject_time(JNIEnv* env, jobject obj,
jlong time, jlong timeReference, jint uncertainty)
{
- sGpsInterface->inject_time(time, timeReference, uncertainty);
+ const GpsInterface* interface = GetGpsInterface();
+ if (interface)
+ interface->inject_time(time, timeReference, uncertainty);
}
static void android_location_GpsLocationProvider_inject_location(JNIEnv* env, jobject obj,
jdouble latitude, jdouble longitude, jfloat accuracy)
{
- sGpsInterface->inject_location(latitude, longitude, accuracy);
+ const GpsInterface* interface = GetGpsInterface();
+ if (interface)
+ interface->inject_location(latitude, longitude, accuracy);
}
static jboolean android_location_GpsLocationProvider_supports_xtra(JNIEnv* env, jobject obj)
{
if (!sGpsXtraInterface) {
- sGpsXtraInterface = (const GpsXtraInterface*)sGpsInterface->get_extension(GPS_XTRA_INTERFACE);
+ const GpsInterface* interface = GetGpsInterface();
+ if (!interface)
+ return false;
+ sGpsXtraInterface = (const GpsXtraInterface*)interface->get_extension(GPS_XTRA_INTERFACE);
if (sGpsXtraInterface) {
int result = sGpsXtraInterface->init(&sGpsXtraCallbacks);
if (result) {