Merge "Some new API cleanup."

This commit is contained in:
Dianne Hackborn
2011-01-04 17:42:45 -08:00
committed by Android (Google) Code Review
9 changed files with 287 additions and 529 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -225,12 +225,11 @@ final class FragmentState implements Parcelable {
* {@sample development/samples/ApiDemos/src/com/example/android/apis/app/FragmentLayout.java
* main}
*
* <p>The titles fragment, showing a list of titles, is very simple, relying
* <p>The titles fragment, showing a list of titles, is fairly simple, relying
* on {@link ListFragment} for most of its work. Note the implementation of
* clicking an item, which can either update
* the content of the details fragment or start a new activity show the
* details depending on whether the current activity's layout can show the
* details.</p>
* clicking an item: depending on the current activity's layout, it can either
* create and display a new fragment to show the details in-place (more about
* this later), or start a new activity show the details.</p>
*
* {@sample development/samples/ApiDemos/src/com/example/android/apis/app/FragmentLayout.java
* titles}
@@ -243,7 +242,7 @@ final class FragmentState implements Parcelable {
* details}
*
* <p>In this case when the user clicks on a title, there is no details
* fragment in the current activity, so the title title fragment's click code will
* container in the current activity, so the title title fragment's click code will
* launch a new activity to display the details fragment:</p>
*
* {@sample development/samples/ApiDemos/src/com/example/android/apis/app/FragmentLayout.java
@@ -255,22 +254,25 @@ final class FragmentState implements Parcelable {
*
* {@sample development/samples/ApiDemos/res/layout-land/fragment_layout.xml layout}
*
* <p>Note how the prior code will adjust to this alternative UI flow: the
* titles fragment will now show its text inside of its activity, and the
* details activity will finish of it finds itself running in a configuration
* where the details can be shown inline.
* <p>Note how the prior code will adjust to this alternative UI flow: the titles
* fragment will now embed the details fragment inside of this activity, and the
* details activity will finish itself if it is running in a configuration
* where the details can be shown in-place.
*
* <p>When a configuration change causes the activity hosting these fragments
* to restart, its new instance may use a different layout that doesn't
* include the same fragments as the previous layout. In this case all of
* the previous fragments will still be instantiated and running in the new
* instance; however, any that are no longer associated with a &lt;fragment&gt;
* tag in the view hierarchy will not have their content view created and will
* return false from {@link #isInLayout}.
* instance. However, any that are no longer associated with a &lt;fragment&gt;
* tag in the view hierarchy will not have their content view created
* and will return false from {@link #isInLayout}. (The code here also shows
* how you can determine if a fragment placed in a container is no longer
* running in a layout with that container and avoid creating its view hierarchy
* in that case.)
*
* <p>The attributes of the &lt;fragment&gt; tag are used to control the
* LayoutParams provider when attaching the fragment's view to the parent
* container. They can alse be parsed by the fragment in {@link #onInflate}
* LayoutParams provided when attaching the fragment's view to the parent
* container. They can also be parsed by the fragment in {@link #onInflate}
* as parameters.
*
* <p>The fragment being instantiated must have some kind of unique identifier

View File

@@ -17,7 +17,7 @@
package android.text;
/**
* @deprecated Old text-only interace to the clipboard. See
* @deprecated Old text-only interface to the clipboard. See
* {@link android.content.ClipboardManager} for the modern API.
*/
@Deprecated

View File

@@ -39,6 +39,8 @@ import java.util.ArrayList;
import java.util.HashMap;
/**
* @hide -- not sure if we really want this in the framework.
*
* <p>This class can be used to load {@link android.widget.Adapter adapters} defined in
* XML resources. XML-defined adapters can be used to easily create adapters in your
* own application or to pass adapters to other processes.</p>
@@ -239,18 +241,18 @@ import java.util.HashMap;
* @see android.widget.Adapter
* @see android.content.ContentProvider
*
* @attr ref android.R.styleable#CursorAdapter_layout
* @attr ref android.R.styleable#CursorAdapter_selection
* @attr ref android.R.styleable#CursorAdapter_sortOrder
* @attr ref android.R.styleable#CursorAdapter_uri
* @attr ref android.R.styleable#CursorAdapter_BindItem_as
* @attr ref android.R.styleable#CursorAdapter_BindItem_from
* @attr ref android.R.styleable#CursorAdapter_BindItem_to
* @attr ref android.R.styleable#CursorAdapter_MapItem_fromValue
* @attr ref android.R.styleable#CursorAdapter_MapItem_toValue
* @attr ref android.R.styleable#CursorAdapter_SelectItem_column
* @attr ref android.R.styleable#CursorAdapter_TransformItem_withClass
* @attr ref android.R.styleable#CursorAdapter_TransformItem_withExpression
* attr ref android.R.styleable#CursorAdapter_layout
* attr ref android.R.styleable#CursorAdapter_selection
* attr ref android.R.styleable#CursorAdapter_sortOrder
* attr ref android.R.styleable#CursorAdapter_uri
* attr ref android.R.styleable#CursorAdapter_BindItem_as
* attr ref android.R.styleable#CursorAdapter_BindItem_from
* attr ref android.R.styleable#CursorAdapter_BindItem_to
* attr ref android.R.styleable#CursorAdapter_MapItem_fromValue
* attr ref android.R.styleable#CursorAdapter_MapItem_toValue
* attr ref android.R.styleable#CursorAdapter_SelectItem_column
* attr ref android.R.styleable#CursorAdapter_TransformItem_withClass
* attr ref android.R.styleable#CursorAdapter_TransformItem_withExpression
*/
@SuppressWarnings({"JavadocReference"})
public class Adapters {
@@ -614,12 +616,12 @@ public class Adapters {
throws IOException, XmlPullParserException {
Resources resources = mResources;
TypedArray a = resources.obtainAttributes(mAttrs, android.R.styleable.CursorAdapter);
TypedArray a = resources.obtainAttributes(mAttrs, com.android.internal.R.styleable.CursorAdapter);
String uri = a.getString(android.R.styleable.CursorAdapter_uri);
String selection = a.getString(android.R.styleable.CursorAdapter_selection);
String sortOrder = a.getString(android.R.styleable.CursorAdapter_sortOrder);
int layout = a.getResourceId(android.R.styleable.CursorAdapter_layout, 0);
String uri = a.getString(com.android.internal.R.styleable.CursorAdapter_uri);
String selection = a.getString(com.android.internal.R.styleable.CursorAdapter_selection);
String sortOrder = a.getString(com.android.internal.R.styleable.CursorAdapter_sortOrder);
int layout = a.getResourceId(com.android.internal.R.styleable.CursorAdapter_layout, 0);
if (layout == 0) {
throw new IllegalArgumentException("The layout specified in " +
resources.getResourceEntryName(mId) + " does not exist");
@@ -670,9 +672,9 @@ public class Adapters {
private void parseSelectTag() {
TypedArray a = mResources.obtainAttributes(mAttrs,
android.R.styleable.CursorAdapter_SelectItem);
com.android.internal.R.styleable.CursorAdapter_SelectItem);
String fromName = a.getString(android.R.styleable.CursorAdapter_SelectItem_column);
String fromName = a.getString(com.android.internal.R.styleable.CursorAdapter_SelectItem_column);
if (fromName == null) {
throw new IllegalArgumentException("A select item in " +
mResources.getResourceEntryName(mId) +
@@ -688,21 +690,21 @@ public class Adapters {
private void parseBindTag() throws IOException, XmlPullParserException {
Resources resources = mResources;
TypedArray a = resources.obtainAttributes(mAttrs,
android.R.styleable.CursorAdapter_BindItem);
com.android.internal.R.styleable.CursorAdapter_BindItem);
String fromName = a.getString(android.R.styleable.CursorAdapter_BindItem_from);
String fromName = a.getString(com.android.internal.R.styleable.CursorAdapter_BindItem_from);
if (fromName == null) {
throw new IllegalArgumentException("A bind item in " +
resources.getResourceEntryName(mId) + " does not have a 'from' attribute");
}
int toName = a.getResourceId(android.R.styleable.CursorAdapter_BindItem_to, 0);
int toName = a.getResourceId(com.android.internal.R.styleable.CursorAdapter_BindItem_to, 0);
if (toName == 0) {
throw new IllegalArgumentException("A bind item in " +
resources.getResourceEntryName(mId) + " does not have a 'to' attribute");
}
String asType = a.getString(android.R.styleable.CursorAdapter_BindItem_as);
String asType = a.getString(com.android.internal.R.styleable.CursorAdapter_BindItem_as);
if (asType == null) {
throw new IllegalArgumentException("A bind item in " +
resources.getResourceEntryName(mId) + " does not have an 'as' attribute");
@@ -796,9 +798,9 @@ public class Adapters {
Resources resources = mResources;
TypedArray a = resources.obtainAttributes(mAttrs,
android.R.styleable.CursorAdapter_MapItem);
com.android.internal.R.styleable.CursorAdapter_MapItem);
String from = a.getString(android.R.styleable.CursorAdapter_MapItem_fromValue);
String from = a.getString(com.android.internal.R.styleable.CursorAdapter_MapItem_fromValue);
if (from == null) {
throw new IllegalArgumentException("A map item in " +
resources.getResourceEntryName(mId) +
@@ -806,7 +808,7 @@ public class Adapters {
}
if (!drawable) {
String to = a.getString(android.R.styleable.CursorAdapter_MapItem_toValue);
String to = a.getString(com.android.internal.R.styleable.CursorAdapter_MapItem_toValue);
if (to == null) {
throw new IllegalArgumentException("A map item in " +
resources.getResourceEntryName(mId) +
@@ -814,7 +816,7 @@ public class Adapters {
}
transformation.addStringMapping(from, to);
} else {
int to = a.getResourceId(android.R.styleable.CursorAdapter_MapItem_toValue, 0);
int to = a.getResourceId(com.android.internal.R.styleable.CursorAdapter_MapItem_toValue, 0);
if (to == 0) {
throw new IllegalArgumentException("A map item in " +
resources.getResourceEntryName(mId) +
@@ -830,12 +832,12 @@ public class Adapters {
Resources resources = mResources;
CursorTransformation transformation = null;
TypedArray a = resources.obtainAttributes(mAttrs,
android.R.styleable.CursorAdapter_TransformItem);
com.android.internal.R.styleable.CursorAdapter_TransformItem);
String className = a.getString(android.R.styleable.CursorAdapter_TransformItem_withClass);
String className = a.getString(com.android.internal.R.styleable.CursorAdapter_TransformItem_withClass);
if (className == null) {
String expression = a.getString(
android.R.styleable.CursorAdapter_TransformItem_withExpression);
com.android.internal.R.styleable.CursorAdapter_TransformItem_withExpression);
transformation = createExpressionTransformation(expression);
} else if (!mContext.isRestricted()) {
try {

View File

@@ -65,7 +65,7 @@
android:layout_marginRight="@dimen/preference_screen_side_margin"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:background="?attr/preferencePanelBackground"
android:background="?attr/detailsElementBackground"
android:orientation="vertical"
android:visibility="gone" >

View File

@@ -40,7 +40,7 @@
<item name="android:layout_marginRight">@dimen/preference_screen_side_margin</item>
<item name="android:layout_marginTop">48dip</item>
<item name="android:layout_marginBottom">48dip</item>
<item name="android:background">?attr/preferencePanelBackground</item>
<item name="android:background">?attr/detailsElementBackground</item>
</style>
</resources>

View File

@@ -98,9 +98,9 @@
<!-- Text color for urls in search suggestions, used by things like global search and the browser. @hide -->
<attr name="textColorSearchUrl" format="reference|color" />
<!-- Color of highlighted text, when used in a light theme. @hide -->
<!-- Color of highlighted text, when used in a light theme. -->
<attr name="textColorHighlightInverse" format="reference|color" />
<!-- Color of link text (URLs), when used in a light theme. @hide -->
<!-- Color of link text (URLs), when used in a light theme. -->
<attr name="textColorLinkInverse" format="reference|color" />
<!-- Color of list item text in alert dialogs. -->
@@ -371,6 +371,17 @@
<attr name="alertDialogButtonGroupStyle" format="reference" />
<attr name="alertDialogCenterButtons" format="boolean" />
<!-- ============== -->
<!-- Image elements -->
<!-- ============== -->
<eat-comment />
<!-- Background that can be used behind parts of a UI that provide
details on data the user is selecting. For example, this is
the background element of PreferenceActivity's embedded
preference fragment. -->
<attr name="detailsElementBackground" format="reference" />
<!-- ============ -->
<!-- Panel styles -->
<!-- ============ -->
@@ -598,8 +609,6 @@
<attr name="ringtonePreferenceStyle" format="reference" />
<!-- The preference layout that has the child/tabbed effect. -->
<attr name="preferenceLayoutChild" format="reference" />
<!-- Preference panel background -->
<attr name="preferencePanelBackground" format="reference" />
<!-- Preference panel style -->
<attr name="preferencePanelStyle" format="reference" />
@@ -2022,7 +2031,8 @@
will use only the number of items in the adapter and the number of items visible
on screen to determine the scrollbar's properties. -->
<attr name="smoothScrollbar" format="boolean" />
<!-- A reference to an XML description of the adapter to attach to the list. -->
<!-- A reference to an XML description of the adapter to attach to the list.
XXX Should remove? -->
<attr name="adapter" format="reference" />
<!-- Defines the choice behavior for the view. By default, lists do not have
any choice behavior. By setting the choiceMode to singleChoice, the list
@@ -4555,7 +4565,8 @@
<!-- =============================== -->
<eat-comment />
<!-- Adapter used to bind cursors. -->
<!-- Adapter used to bind cursors.
@hide XXX should remove? -->
<declare-styleable name="CursorAdapter">
<!-- URI to get the cursor from. Optional. -->
<attr name="uri" format="string" />
@@ -4567,7 +4578,8 @@
<attr name="layout" />
</declare-styleable>
<!-- Attributes used in bind items for XML cursor adapters. -->
<!-- Attributes used in bind items for XML cursor adapters.
@hide XXX should remove? -->
<declare-styleable name="CursorAdapter_BindItem">
<!-- The name of the column to bind from. Mandatory. -->
<attr name="from" format="string" />
@@ -4589,13 +4601,15 @@
<attr name="as" format="string" />
</declare-styleable>
<!-- Attributes used in select items for XML cursor adapters. -->
<!-- Attributes used in select items for XML cursor adapters.
@hide XXX should remove? -->
<declare-styleable name="CursorAdapter_SelectItem">
<!-- The name of the column to select. Mandatory. -->
<attr name="column" format="string" />
</declare-styleable>
<!-- Attributes used to map values to new values in XML cursor adapters' bind items. -->
<!-- Attributes used to map values to new values in XML cursor adapters' bind items.
@hide XXX should remove? -->
<declare-styleable name="CursorAdapter_MapItem">
<!-- The original value from the column. Mandatory. -->
<attr name="fromValue" format="string" />
@@ -4603,7 +4617,8 @@
<attr name="toValue" format="string" />
</declare-styleable>
<!-- Attributes used to map values to new values in XML cursor adapters' bind items. -->
<!-- Attributes used to map values to new values in XML cursor adapters' bind items.
@hide XXX should remove? -->
<declare-styleable name="CursorAdapter_TransformItem">
<!-- The transformation expression. Mandatory if "withClass" is not specified. -->
<attr name="withExpression" format="string" />

View File

@@ -1231,7 +1231,7 @@
<public type="attr" name="expandableListViewWhiteStyle" id="0x010102b6" />
<!-- ===============================================================
Resources proposed for Froyo.
Resources added in version 8 of the platform (Froyo / 2.2)
=============================================================== -->
<eat-comment />
<public type="attr" name="installLocation" id="0x010102b7" />
@@ -1247,7 +1247,7 @@
<public type="anim" name="cycle_interpolator" id="0x010a000c" />
<!-- ===============================================================
Resources introduced in Gingerbread.
Resources added in version 9 of the platform (Gingerbread / 2.3)
=============================================================== -->
<eat-comment />
<public type="attr" name="logo" id="0x010102be" />
@@ -1282,18 +1282,6 @@
Resources proposed for Honeycomb.
=============================================================== -->
<eat-comment />
<public type="attr" name="adapter" />
<public type="attr" name="selection" />
<public type="attr" name="sortOrder" />
<public type="attr" name="uri" />
<public type="attr" name="from" />
<public type="attr" name="to" />
<public type="attr" name="as" />
<public type="attr" name="fromValue" />
<public type="attr" name="toValue" />
<public type="attr" name="column" />
<public type="attr" name="withExpression" />
<public type="attr" name="withClass" />
<public type="attr" name="allContactsName" />
<public type="attr" name="windowActionBar" />
<public type="attr" name="actionBarStyle" />
@@ -1426,6 +1414,12 @@
<public type="attr" name="spinnersShown" />
<public type="attr" name="calendarViewShown" />
<public type="attr" name="state_multiline" />
<public type="attr" name="detailsElementBackground" />
<public type="attr" name="textColorHighlightInverse" />
<public type="attr" name="textColorLinkInverse" />
<public type="attr" name="editTextColor" />
<public type="attr" name="editTextBackground" />
<public type="attr" name="horizontalScrollViewStyle" />
<public type="anim" name="animator_fade_in" />
<public type="anim" name="animator_fade_out" />

View File

@@ -234,7 +234,7 @@
<item name="ringtonePreferenceStyle">@android:style/Preference.RingtonePreference</item>
<item name="preferenceLayoutChild">@android:layout/preference_child</item>
<item name="preferencePanelStyle">@style/PreferencePanel</item>
<item name="preferencePanelBackground">@android:drawable/panel_bg_holo_dark</item>
<item name="detailsElementBackground">@android:drawable/panel_bg_holo_dark</item>
<!-- Search widget styles -->
<item name="searchWidgetCorpusItemBackground">@android:color/search_widget_corpus_item_background</item>
@@ -894,7 +894,7 @@
<item name="editTextPreferenceStyle">@android:style/Preference.DialogPreference.EditTextPreference</item>
<item name="ringtonePreferenceStyle">@android:style/Preference.RingtonePreference</item>
<item name="preferenceLayoutChild">@android:layout/preference_child</item>
<item name="preferencePanelBackground">@android:drawable/panel_bg_holo_dark</item>
<item name="detailsElementBackground">@android:drawable/panel_bg_holo_dark</item>
<!-- Search widget styles -->
<item name="searchWidgetCorpusItemBackground">@android:color/search_widget_corpus_item_background</item>
@@ -1150,7 +1150,7 @@
<item name="editTextPreferenceStyle">@android:style/Preference.DialogPreference.EditTextPreference</item>
<item name="ringtonePreferenceStyle">@android:style/Preference.RingtonePreference</item>
<item name="preferenceLayoutChild">@android:layout/preference_child</item>
<item name="preferencePanelBackground">@android:drawable/panel_bg_holo_light</item>
<item name="detailsElementBackground">@android:drawable/panel_bg_holo_light</item>
<!-- Search widget styles -->
<item name="searchWidgetCorpusItemBackground">@android:color/search_widget_corpus_item_background</item>