Fix import statements in android.widget package.
Additionally this CL removes spaces at the end of the line.
Test: code still compiles.
Change-Id: I1ce98b4e70aa3ae614f87966c3bc6181fa4389a4
diff --git a/core/java/android/widget/AbsSeekBar.java b/core/java/android/widget/AbsSeekBar.java
index 8ee4334..5d136dc 100644
--- a/core/java/android/widget/AbsSeekBar.java
+++ b/core/java/android/widget/AbsSeekBar.java
@@ -16,8 +16,6 @@
package android.widget;
-import com.android.internal.R;
-
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
@@ -36,6 +34,8 @@
import android.view.ViewConfiguration;
import android.view.accessibility.AccessibilityNodeInfo;
+import com.android.internal.R;
+
/**
* AbsSeekBar extends the capabilities of ProgressBar by adding a draggable thumb.
diff --git a/core/java/android/widget/AbsSpinner.java b/core/java/android/widget/AbsSpinner.java
index 18db54e..bc3dfff 100644
--- a/core/java/android/widget/AbsSpinner.java
+++ b/core/java/android/widget/AbsSpinner.java
@@ -16,8 +16,6 @@
package android.widget;
-import com.android.internal.R;
-
import android.content.Context;
import android.content.res.TypedArray;
import android.database.DataSetObserver;
@@ -29,10 +27,12 @@
import android.view.View;
import android.view.ViewGroup;
+import com.android.internal.R;
+
/**
* An abstract base class for spinner widgets. SDK users will probably not
* need to use this class.
- *
+ *
* @attr ref android.R.styleable#AbsSpinner_entries
*/
public abstract class AbsSpinner extends AdapterView<SpinnerAdapter> {
@@ -104,12 +104,12 @@
mAdapter.unregisterDataSetObserver(mDataSetObserver);
resetList();
}
-
+
mAdapter = adapter;
-
+
mOldSelectedPosition = INVALID_POSITION;
mOldSelectedRowId = INVALID_ROW_ID;
-
+
if (mAdapter != null) {
mOldItemCount = mItemCount;
mItemCount = mAdapter.getCount();
@@ -122,14 +122,14 @@
setSelectedPositionInt(position);
setNextSelectedPositionInt(position);
-
+
if (mItemCount == 0) {
// Nothing selected
checkSelectionChanged();
}
-
+
} else {
- checkFocus();
+ checkFocus();
resetList();
// Nothing selected
checkSelectionChanged();
@@ -144,23 +144,23 @@
void resetList() {
mDataChanged = false;
mNeedSync = false;
-
+
removeAllViewsInLayout();
mOldSelectedPosition = INVALID_POSITION;
mOldSelectedRowId = INVALID_ROW_ID;
-
+
setSelectedPositionInt(INVALID_POSITION);
setNextSelectedPositionInt(INVALID_POSITION);
invalidate();
}
- /**
+ /**
* @see android.view.View#measure(int, int)
- *
+ *
* Figure out the dimensions of this Spinner. The width comes from
* the widthMeasureSpec as Spinnners can't have their width set to
* UNSPECIFIED. The height is based on the height of the selected item
- * plus padding.
+ * plus padding.
*/
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
@@ -180,11 +180,11 @@
if (mDataChanged) {
handleDataChanged();
}
-
+
int preferredHeight = 0;
int preferredWidth = 0;
boolean needsMeasuring = true;
-
+
int selectedPosition = getSelectedItemPosition();
if (selectedPosition >= 0 && mAdapter != null && selectedPosition < mAdapter.getCount()) {
// Try looking in the recycler. (Maybe we were measured once already)
@@ -208,14 +208,14 @@
mBlockLayoutRequests = false;
}
measureChild(view, widthMeasureSpec, heightMeasureSpec);
-
+
preferredHeight = getChildHeight(view) + mSpinnerPadding.top + mSpinnerPadding.bottom;
preferredWidth = getChildWidth(view) + mSpinnerPadding.left + mSpinnerPadding.right;
-
+
needsMeasuring = false;
}
}
-
+
if (needsMeasuring) {
// No views -- just use padding
preferredHeight = mSpinnerPadding.top + mSpinnerPadding.bottom;
@@ -238,18 +238,18 @@
int getChildHeight(View child) {
return child.getMeasuredHeight();
}
-
+
int getChildWidth(View child) {
return child.getMeasuredWidth();
}
-
+
@Override
protected ViewGroup.LayoutParams generateDefaultLayoutParams() {
return new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
}
-
+
void recycleAllViews() {
final int childCount = getChildCount();
final AbsSpinner.RecycleBin recycleBin = mRecycler;
@@ -260,7 +260,7 @@
View v = getChildAt(i);
int index = position + i;
recycleBin.put(index, v);
- }
+ }
}
/**
@@ -279,14 +279,14 @@
requestLayout();
invalidate();
}
-
+
/**
* Makes the item at the supplied position selected.
- *
+ *
* @param position Position to select
* @param animate Should the transition be animated
- *
+ *
*/
void setSelectionInt(int position, boolean animate) {
if (position != mOldSelectedPosition) {
@@ -308,11 +308,11 @@
return null;
}
}
-
+
/**
* Override to prevent spamming ourselves with layout requests
* as we place views
- *
+ *
* @see android.view.View#requestLayout()
*/
@Override
@@ -334,7 +334,7 @@
/**
* Maps a point to a position in the list.
- *
+ *
* @param x X in local coordinate
* @param y Y in local coordinate
* @return The position of the item which contains the specified point, or
@@ -378,7 +378,7 @@
SavedState(Parcelable superState) {
super(superState);
}
-
+
/**
* Constructor called from {@link #CREATOR}
*/
@@ -431,7 +431,7 @@
@Override
public void onRestoreInstanceState(Parcelable state) {
SavedState ss = (SavedState) state;
-
+
super.onRestoreInstanceState(ss.getSuperState());
if (ss.selectedId >= 0) {
@@ -450,7 +450,7 @@
public void put(int position, View v) {
mScrapHeap.put(position, v);
}
-
+
View get(int position) {
// System.out.print("Looking for " + position);
View result = mScrapHeap.get(position);
diff --git a/core/java/android/widget/ActionMenuPresenter.java b/core/java/android/widget/ActionMenuPresenter.java
index ac8d578..46269c6 100644
--- a/core/java/android/widget/ActionMenuPresenter.java
+++ b/core/java/android/widget/ActionMenuPresenter.java
@@ -39,6 +39,7 @@
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.accessibility.AccessibilityNodeInfo;
+
import com.android.internal.view.ActionBarPolicy;
import com.android.internal.view.menu.ActionMenuItemView;
import com.android.internal.view.menu.BaseMenuPresenter;
diff --git a/core/java/android/widget/ActionMenuView.java b/core/java/android/widget/ActionMenuView.java
index 4d0a1c8..c4bbdb0 100644
--- a/core/java/android/widget/ActionMenuView.java
+++ b/core/java/android/widget/ActionMenuView.java
@@ -31,6 +31,7 @@
import android.view.ViewGroup;
import android.view.ViewHierarchyEncoder;
import android.view.accessibility.AccessibilityEvent;
+
import com.android.internal.view.menu.ActionMenuItemView;
import com.android.internal.view.menu.MenuBuilder;
import com.android.internal.view.menu.MenuItemImpl;
@@ -45,7 +46,7 @@
*/
public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvoker, MenuView {
private static final String TAG = "ActionMenuView";
-
+
static final int MIN_CELL_SIZE = 56; // dips
static final int GENERATED_ITEM_PADDING = 4; // dips
@@ -71,7 +72,7 @@
public ActionMenuView(Context context) {
this(context, null);
}
-
+
public ActionMenuView(Context context, AttributeSet attrs) {
super(context, attrs);
setBaselineAligned(false);
@@ -579,7 +580,7 @@
params.gravity = Gravity.CENTER_VERTICAL;
return params;
}
-
+
@Override
public LayoutParams generateLayoutParams(AttributeSet attrs) {
return new LayoutParams(getContext(), attrs);
diff --git a/core/java/android/widget/ActivityChooserView.java b/core/java/android/widget/ActivityChooserView.java
index f5c46db..51587a7 100644
--- a/core/java/android/widget/ActivityChooserView.java
+++ b/core/java/android/widget/ActivityChooserView.java
@@ -16,9 +16,6 @@
package android.widget;
-import com.android.internal.R;
-import com.android.internal.view.menu.ShowableListMenu;
-
import android.annotation.StringRes;
import android.content.Context;
import android.content.Intent;
@@ -39,6 +36,9 @@
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.ActivityChooserModel.ActivityChooserModelClient;
+import com.android.internal.R;
+import com.android.internal.view.menu.ShowableListMenu;
+
/**
* This class is a view for choosing an activity for handling a given {@link Intent}.
* <p>
diff --git a/core/java/android/widget/AnalogClock.java b/core/java/android/widget/AnalogClock.java
index 7f5e2133..bde5f7f 100644
--- a/core/java/android/widget/AnalogClock.java
+++ b/core/java/android/widget/AnalogClock.java
@@ -16,15 +16,14 @@
package android.widget;
+import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
-import android.content.BroadcastReceiver;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
-import android.os.Handler;
import android.text.format.DateUtils;
import android.text.format.Time;
import android.util.AttributeSet;
@@ -258,7 +257,7 @@
}
onTimeChanged();
-
+
invalidate();
}
};
diff --git a/core/java/android/widget/AppSecurityPermissions.java b/core/java/android/widget/AppSecurityPermissions.java
index 1a1680a..68e6809 100644
--- a/core/java/android/widget/AppSecurityPermissions.java
+++ b/core/java/android/widget/AppSecurityPermissions.java
@@ -16,10 +16,6 @@
*/
package android.widget;
-import android.annotation.SystemApi;
-import android.os.UserHandle;
-import com.android.internal.R;
-
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
@@ -31,6 +27,7 @@
import android.content.pm.PermissionInfo;
import android.graphics.drawable.Drawable;
import android.os.Parcel;
+import android.os.UserHandle;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.util.AttributeSet;
@@ -39,6 +36,8 @@
import android.view.View;
import android.view.ViewGroup;
+import com.android.internal.R;
+
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
@@ -57,7 +56,7 @@
* extended information consisting of all groups and permissions.
* To use this view define a LinearLayout or any ViewGroup and add this
* view by instantiating AppSecurityPermissions and invoking getPermissionsView.
- *
+ *
* {@hide}
*/
public class AppSecurityPermissions {
@@ -324,7 +323,7 @@
return getPermissionItemViewOld(context, inflater, grpName,
description, dangerous, icon);
}
-
+
private void getAllUsedPermissions(int sharedUid, Set<MyPermissionInfo> permSet) {
String sharedPkgList[] = mPm.getPackagesForUid(sharedUid);
if(sharedPkgList == null || (sharedPkgList.length == 0)) {
@@ -334,7 +333,7 @@
getPermissionsForPackage(sharedPkg, permSet);
}
}
-
+
private void getPermissionsForPackage(String packageName, Set<MyPermissionInfo> permSet) {
try {
PackageInfo pkgInfo = mPm.getPackageInfo(packageName, PackageManager.GET_PERMISSIONS);
@@ -417,7 +416,7 @@
}
}
}
-
+
public int getPermissionCount() {
return getPermissionCount(WHICH_ALL);
}
@@ -570,7 +569,7 @@
}
return false;
}
-
+
private static class PermissionGroupInfoComparator implements Comparator<MyPermissionGroupInfo> {
private final Collator sCollator = Collator.getInstance();
@Override
@@ -578,7 +577,7 @@
return sCollator.compare(a.mLabel, b.mLabel);
}
}
-
+
private static class PermissionInfoComparator implements Comparator<MyPermissionInfo> {
private final Collator sCollator = Collator.getInstance();
PermissionInfoComparator() {
diff --git a/core/java/android/widget/AutoCompleteTextView.java b/core/java/android/widget/AutoCompleteTextView.java
index 6a4e36a..49741d4 100644
--- a/core/java/android/widget/AutoCompleteTextView.java
+++ b/core/java/android/widget/AutoCompleteTextView.java
@@ -39,7 +39,9 @@
import android.view.inputmethod.CompletionInfo;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
+
import com.android.internal.R;
+
import java.lang.ref.WeakReference;
/**
@@ -362,22 +364,22 @@
* <p>Returns the current width for the auto-complete drop down list. This can
* be a fixed width, or {@link ViewGroup.LayoutParams#MATCH_PARENT} to fill the screen, or
* {@link ViewGroup.LayoutParams#WRAP_CONTENT} to fit the width of its anchor view.</p>
- *
+ *
* @return the width for the drop down list
- *
+ *
* @attr ref android.R.styleable#AutoCompleteTextView_dropDownWidth
*/
public int getDropDownWidth() {
return mPopup.getWidth();
}
-
+
/**
* <p>Sets the current width for the auto-complete drop down list. This can
* be a fixed width, or {@link ViewGroup.LayoutParams#MATCH_PARENT} to fill the screen, or
* {@link ViewGroup.LayoutParams#WRAP_CONTENT} to fit the width of its anchor view.</p>
- *
+ *
* @param width the width to use
- *
+ *
* @attr ref android.R.styleable#AutoCompleteTextView_dropDownWidth
*/
public void setDropDownWidth(int width) {
@@ -411,68 +413,68 @@
public void setDropDownHeight(int height) {
mPopup.setHeight(height);
}
-
+
/**
* <p>Returns the id for the view that the auto-complete drop down list is anchored to.</p>
- *
+ *
* @return the view's id, or {@link View#NO_ID} if none specified
- *
+ *
* @attr ref android.R.styleable#AutoCompleteTextView_dropDownAnchor
*/
public int getDropDownAnchor() {
return mDropDownAnchorId;
}
-
+
/**
* <p>Sets the view to which the auto-complete drop down list should anchor. The view
* corresponding to this id will not be loaded until the next time it is needed to avoid
* loading a view which is not yet instantiated.</p>
- *
+ *
* @param id the id to anchor the drop down list view to
- *
- * @attr ref android.R.styleable#AutoCompleteTextView_dropDownAnchor
+ *
+ * @attr ref android.R.styleable#AutoCompleteTextView_dropDownAnchor
*/
public void setDropDownAnchor(int id) {
mDropDownAnchorId = id;
mPopup.setAnchorView(null);
}
-
+
/**
* <p>Gets the background of the auto-complete drop-down list.</p>
- *
+ *
* @return the background drawable
- *
+ *
* @attr ref android.R.styleable#PopupWindow_popupBackground
*/
public Drawable getDropDownBackground() {
return mPopup.getBackground();
}
-
+
/**
* <p>Sets the background of the auto-complete drop-down list.</p>
- *
+ *
* @param d the drawable to set as the background
- *
+ *
* @attr ref android.R.styleable#PopupWindow_popupBackground
*/
public void setDropDownBackgroundDrawable(Drawable d) {
mPopup.setBackgroundDrawable(d);
}
-
+
/**
* <p>Sets the background of the auto-complete drop-down list.</p>
- *
+ *
* @param id the id of the drawable to set as the background
- *
+ *
* @attr ref android.R.styleable#PopupWindow_popupBackground
*/
public void setDropDownBackgroundResource(@DrawableRes int id) {
mPopup.setBackgroundDrawable(getContext().getDrawable(id));
}
-
+
/**
* <p>Sets the vertical offset used for the auto-complete drop-down list.</p>
- *
+ *
* @param offset the vertical offset
*
* @attr ref android.R.styleable#ListPopupWindow_dropDownVerticalOffset
@@ -480,10 +482,10 @@
public void setDropDownVerticalOffset(int offset) {
mPopup.setVerticalOffset(offset);
}
-
+
/**
* <p>Gets the vertical offset used for the auto-complete drop-down list.</p>
- *
+ *
* @return the vertical offset
*
* @attr ref android.R.styleable#ListPopupWindow_dropDownVerticalOffset
@@ -491,10 +493,10 @@
public int getDropDownVerticalOffset() {
return mPopup.getVerticalOffset();
}
-
+
/**
* <p>Sets the horizontal offset used for the auto-complete drop-down list.</p>
- *
+ *
* @param offset the horizontal offset
*
* @attr ref android.R.styleable#ListPopupWindow_dropDownHorizontalOffset
@@ -502,10 +504,10 @@
public void setDropDownHorizontalOffset(int offset) {
mPopup.setHorizontalOffset(offset);
}
-
+
/**
* <p>Gets the horizontal offset used for the auto-complete drop-down list.</p>
- *
+ *
* @return the horizontal offset
*
* @attr ref android.R.styleable#ListPopupWindow_dropDownHorizontalOffset
@@ -567,10 +569,10 @@
public void setDropDownAlwaysVisible(boolean dropDownAlwaysVisible) {
mPopup.setDropDownAlwaysVisible(dropDownAlwaysVisible);
}
-
+
/**
* Checks whether the drop-down is dismissed when a suggestion is clicked.
- *
+ *
* @hide Pending API council approval
*/
public boolean isDropDownDismissedOnCompletion() {
@@ -578,17 +580,17 @@
}
/**
- * Sets whether the drop-down is dismissed when a suggestion is clicked. This is
+ * Sets whether the drop-down is dismissed when a suggestion is clicked. This is
* true by default.
- *
+ *
* @param dropDownDismissedOnCompletion Whether to dismiss the drop-down.
- *
+ *
* @hide Pending API council approval
*/
public void setDropDownDismissedOnCompletion(boolean dropDownDismissedOnCompletion) {
mDropDownDismissedOnCompletion = dropDownDismissedOnCompletion;
}
-
+
/**
* <p>Returns the number of characters the user must type before the drop
* down list is shown.</p>
@@ -720,13 +722,13 @@
/**
* <p>Changes the list of data used for auto completion. The provided list
* must be a filterable list adapter.</p>
- *
+ *
* <p>The caller is still responsible for managing any resources used by the adapter.
* Notably, when the AutoCompleteTextView is closed or released, the adapter is not notified.
* A common case is the use of {@link android.widget.CursorAdapter}, which
* contains a {@link android.database.Cursor} that must be closed. This can be done
- * automatically (see
- * {@link android.app.Activity#startManagingCursor(android.database.Cursor)
+ * automatically (see
+ * {@link android.app.Activity#startManagingCursor(android.database.Cursor)
* startManagingCursor()}),
* or by manually closing the cursor when the AutoCompleteTextView is dismissed.</p>
*
@@ -811,7 +813,7 @@
if (mPopup.onKeyDown(keyCode, event)) {
return true;
}
-
+
if (!isPopupShowing()) {
switch(keyCode) {
case KeyEvent.KEYCODE_DPAD_DOWN:
@@ -924,18 +926,18 @@
protected CharSequence convertSelectionToString(Object selectedItem) {
return mFilter.convertResultToString(selectedItem);
}
-
+
/**
- * <p>Clear the list selection. This may only be temporary, as user input will often bring
+ * <p>Clear the list selection. This may only be temporary, as user input will often bring
* it back.
*/
public void clearListSelection() {
mPopup.clearListSelection();
}
-
+
/**
* Set the position of the dropdown view selection.
- *
+ *
* @param position The position to move the selector to.
*/
public void setListSelection(int position) {
@@ -943,13 +945,13 @@
}
/**
- * Get the position of the dropdown view selection, if there is one. Returns
+ * Get the position of the dropdown view selection, if there is one. Returns
* {@link ListView#INVALID_POSITION ListView.INVALID_POSITION} if there is no dropdown or if
* there is no selection.
- *
- * @return the position of the current selection, if there is one, or
+ *
+ * @return the position of the current selection, if there is one, or
* {@link ListView#INVALID_POSITION ListView.INVALID_POSITION} if not.
- *
+ *
* @see ListView#getSelectedItemPosition()
*/
public int getListSelection() {
@@ -1020,7 +1022,7 @@
dismissDropDown();
}
}
-
+
/**
* Identifies whether the view is currently performing a text completion, so subclasses
* can decide whether to respond to text changed events.
@@ -1172,7 +1174,7 @@
public void showDropDownAfterLayout() {
mPopup.postShow();
}
-
+
/**
* Ensures that the drop down is not obscuring the IME.
* @param visible whether the ime should be in front. If false, the ime is pushed to
@@ -1220,7 +1222,7 @@
* Forces outside touches to be ignored. Normally if {@link #isDropDownAlwaysVisible()} is
* false, we allow outside touch to dismiss the dropdown. If this is set to true, then we
* ignore outside touch even when the drop down is not set to always visible.
- *
+ *
* @hide used only by SearchDialog
*/
public void setForceIgnoreOutsideTouch(boolean forceIgnoreOutsideTouch) {
@@ -1245,7 +1247,7 @@
realCount++;
}
}
-
+
if (realCount != count) {
CompletionInfo[] tmp = new CompletionInfo[realCount];
System.arraycopy(completions, 0, tmp, 0, realCount);
@@ -1340,7 +1342,7 @@
*/
CharSequence fixText(CharSequence invalidText);
}
-
+
/**
* Listener to respond to the AutoCompleteTextView's completion list being dismissed.
* @see AutoCompleteTextView#setOnDismissListener(OnDismissListener)
diff --git a/core/java/android/widget/CalendarView.java b/core/java/android/widget/CalendarView.java
index 6ef1576..db50e34 100644
--- a/core/java/android/widget/CalendarView.java
+++ b/core/java/android/widget/CalendarView.java
@@ -16,8 +16,6 @@
package android.widget;
-import com.android.internal.R;
-
import android.annotation.AttrRes;
import android.annotation.ColorInt;
import android.annotation.DrawableRes;
@@ -36,6 +34,8 @@
import android.util.AttributeSet;
import android.util.Log;
+import com.android.internal.R;
+
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
diff --git a/core/java/android/widget/CalendarViewLegacyDelegate.java b/core/java/android/widget/CalendarViewLegacyDelegate.java
index bcda83f..557d411 100644
--- a/core/java/android/widget/CalendarViewLegacyDelegate.java
+++ b/core/java/android/widget/CalendarViewLegacyDelegate.java
@@ -16,8 +16,6 @@
package android.widget;
-import com.android.internal.R;
-
import android.app.Service;
import android.content.Context;
import android.content.res.Configuration;
@@ -38,10 +36,12 @@
import android.view.View;
import android.view.ViewGroup;
-import java.util.Locale;
+import com.android.internal.R;
import libcore.icu.LocaleData;
+import java.util.Locale;
+
/**
* A delegate implementing the legacy CalendarView
*/
diff --git a/core/java/android/widget/CheckBox.java b/core/java/android/widget/CheckBox.java
index 15bbdd2..046f75f 100644
--- a/core/java/android/widget/CheckBox.java
+++ b/core/java/android/widget/CheckBox.java
@@ -19,7 +19,6 @@
import android.content.Context;
import android.util.AttributeSet;
-
/**
* <p>
* A checkbox is a specific type of two-states button that can be either
@@ -44,12 +43,12 @@
*
* <p>See the <a href="{@docRoot}guide/topics/ui/controls/checkbox.html">Checkboxes</a>
* guide.</p>
- *
- * <p><strong>XML attributes</strong></p>
+ *
+ * <p><strong>XML attributes</strong></p>
* <p>
- * See {@link android.R.styleable#CompoundButton CompoundButton Attributes},
- * {@link android.R.styleable#Button Button Attributes},
- * {@link android.R.styleable#TextView TextView Attributes},
+ * See {@link android.R.styleable#CompoundButton CompoundButton Attributes},
+ * {@link android.R.styleable#Button Button Attributes},
+ * {@link android.R.styleable#TextView TextView Attributes},
* {@link android.R.styleable#View View Attributes}
* </p>
*/
@@ -57,7 +56,7 @@
public CheckBox(Context context) {
this(context, null);
}
-
+
public CheckBox(Context context, AttributeSet attrs) {
this(context, attrs, com.android.internal.R.attr.checkboxStyle);
}
diff --git a/core/java/android/widget/CheckedTextView.java b/core/java/android/widget/CheckedTextView.java
index 21595d15..92bfd56 100644
--- a/core/java/android/widget/CheckedTextView.java
+++ b/core/java/android/widget/CheckedTextView.java
@@ -16,11 +16,8 @@
package android.widget;
-import android.annotation.NonNull;
-import android.view.ViewHierarchyEncoder;
-import com.android.internal.R;
-
import android.annotation.DrawableRes;
+import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
import android.content.res.ColorStateList;
@@ -34,9 +31,12 @@
import android.view.Gravity;
import android.view.RemotableViewMethod;
import android.view.ViewDebug;
+import android.view.ViewHierarchyEncoder;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
+import com.android.internal.R;
+
/**
* An extension to {@link TextView} that supports the {@link Checkable}
* interface and displays.
@@ -394,7 +394,7 @@
y = (getHeight() - height) / 2;
break;
}
-
+
final boolean checkMarkAtStart = isCheckMarkAtStart();
final int width = getWidth();
final int top = y;
@@ -417,7 +417,7 @@
}
}
}
-
+
@Override
protected int[] onCreateDrawableState(int extraSpace) {
final int[] drawableState = super.onCreateDrawableState(extraSpace + 1);
diff --git a/core/java/android/widget/Chronometer.java b/core/java/android/widget/Chronometer.java
index adcb012..b9224f3 100644
--- a/core/java/android/widget/Chronometer.java
+++ b/core/java/android/widget/Chronometer.java
@@ -24,7 +24,6 @@
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
-import android.view.accessibility.AccessibilityEvent;
import android.widget.RemoteViews.RemoteView;
import com.android.internal.R;
@@ -80,7 +79,7 @@
private OnChronometerTickListener mOnChronometerTickListener;
private StringBuilder mRecycle = new StringBuilder(8);
private boolean mCountDown;
-
+
/**
* Initialize this Chronometer object.
* Sets the base to the current time.
@@ -191,7 +190,7 @@
/**
* Sets the listener to be called when the chronometer changes.
- *
+ *
* @param listener The listener.
*/
public void setOnChronometerTickListener(OnChronometerTickListener listener) {
@@ -209,10 +208,10 @@
/**
* Start counting up. This does not affect the base as set from {@link #setBase}, just
* the view display.
- *
- * Chronometer works by regularly scheduling messages to the handler, even when the
- * Widget is not visible. To make sure resource leaks do not occur, the user should
- * make sure that each start() call has a reciprocal call to {@link #stop}.
+ *
+ * Chronometer works by regularly scheduling messages to the handler, even when the
+ * Widget is not visible. To make sure resource leaks do not occur, the user should
+ * make sure that each start() call has a reciprocal call to {@link #stop}.
*/
public void start() {
mStarted = true;
@@ -222,9 +221,9 @@
/**
* Stop counting up. This does not affect the base as set from {@link #setBase}, just
* the view display.
- *
+ *
* This stops the messages to the handler, effectively releasing resources that would
- * be held as the chronometer is running, via {@link #start}.
+ * be held as the chronometer is running, via {@link #start}.
*/
public void stop() {
mStarted = false;
diff --git a/core/java/android/widget/CompoundButton.java b/core/java/android/widget/CompoundButton.java
index 0357834..dd63fef 100644
--- a/core/java/android/widget/CompoundButton.java
+++ b/core/java/android/widget/CompoundButton.java
@@ -19,14 +19,11 @@
import android.annotation.DrawableRes;
import android.annotation.NonNull;
import android.annotation.Nullable;
-import android.graphics.PorterDuff;
-import android.view.ViewHierarchyEncoder;
-import com.android.internal.R;
-
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Canvas;
+import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Parcel;
import android.os.Parcelable;
@@ -34,9 +31,12 @@
import android.view.Gravity;
import android.view.SoundEffectConstants;
import android.view.ViewDebug;
+import android.view.ViewHierarchyEncoder;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
+import com.android.internal.R;
+
/**
* <p>
* A button with two states, checked and unchecked. When the button is pressed
@@ -159,7 +159,7 @@
mOnCheckedChangeWidgetListener.onCheckedChanged(this, mChecked);
}
- mBroadcasting = false;
+ mBroadcasting = false;
}
}
@@ -492,7 +492,7 @@
SavedState(Parcelable superState) {
super(superState);
}
-
+
/**
* Constructor called from {@link #CREATOR}
*/
diff --git a/core/java/android/widget/DatePicker.java b/core/java/android/widget/DatePicker.java
index 80f25d4..517e20cd 100644
--- a/core/java/android/widget/DatePicker.java
+++ b/core/java/android/widget/DatePicker.java
@@ -16,8 +16,6 @@
package android.widget;
-import com.android.internal.R;
-
import android.annotation.IntDef;
import android.annotation.Nullable;
import android.annotation.TestApi;
@@ -35,6 +33,8 @@
import android.view.View;
import android.view.accessibility.AccessibilityEvent;
+import com.android.internal.R;
+
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Locale;
diff --git a/core/java/android/widget/DatePickerCalendarDelegate.java b/core/java/android/widget/DatePickerCalendarDelegate.java
index 1bf0c87..f712685 100755
--- a/core/java/android/widget/DatePickerCalendarDelegate.java
+++ b/core/java/android/widget/DatePickerCalendarDelegate.java
@@ -16,8 +16,6 @@
package android.widget;
-import com.android.internal.R;
-
import android.annotation.Nullable;
import android.content.Context;
import android.content.res.ColorStateList;
@@ -40,6 +38,8 @@
import android.widget.DayPickerView.OnDaySelectedListener;
import android.widget.YearPickerView.OnYearSelectedListener;
+import com.android.internal.R;
+
import java.util.Locale;
/**
diff --git a/core/java/android/widget/DatePickerSpinnerDelegate.java b/core/java/android/widget/DatePickerSpinnerDelegate.java
index 9ecf8a5..702b2a5 100644
--- a/core/java/android/widget/DatePickerSpinnerDelegate.java
+++ b/core/java/android/widget/DatePickerSpinnerDelegate.java
@@ -33,14 +33,14 @@
import android.widget.DatePicker.AbstractDatePickerDelegate;
import android.widget.NumberPicker.OnValueChangeListener;
+import libcore.icu.ICU;
+
import java.text.DateFormatSymbols;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Locale;
-import libcore.icu.ICU;
-
/**
* A delegate implementing the basic DatePicker
*/
diff --git a/core/java/android/widget/DayPickerPagerAdapter.java b/core/java/android/widget/DayPickerPagerAdapter.java
index f748d3a..8d5bf8f 100644
--- a/core/java/android/widget/DayPickerPagerAdapter.java
+++ b/core/java/android/widget/DayPickerPagerAdapter.java
@@ -16,9 +16,6 @@
package android.widget;
-import android.graphics.Rect;
-import com.android.internal.widget.PagerAdapter;
-
import android.annotation.IdRes;
import android.annotation.LayoutRes;
import android.annotation.NonNull;
@@ -26,6 +23,7 @@
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
+import android.graphics.Rect;
import android.icu.util.Calendar;
import android.util.SparseArray;
import android.view.LayoutInflater;
@@ -33,6 +31,8 @@
import android.view.ViewGroup;
import android.widget.SimpleMonthView.OnDayClickListener;
+import com.android.internal.widget.PagerAdapter;
+
/**
* An adapter for a list of {@link android.widget.SimpleMonthView} items.
*/
diff --git a/core/java/android/widget/DayPickerView.java b/core/java/android/widget/DayPickerView.java
index 0c02a2b..919c1e2 100644
--- a/core/java/android/widget/DayPickerView.java
+++ b/core/java/android/widget/DayPickerView.java
@@ -18,15 +18,11 @@
import static android.os.Build.VERSION_CODES.N_MR1;
-import android.graphics.Rect;
-import com.android.internal.R;
-import com.android.internal.widget.ViewPager;
-import com.android.internal.widget.ViewPager.OnPageChangeListener;
-
import android.annotation.Nullable;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
+import android.graphics.Rect;
import android.icu.util.Calendar;
import android.util.AttributeSet;
import android.util.MathUtils;
@@ -35,10 +31,14 @@
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityManager;
-import java.util.Locale;
+import com.android.internal.R;
+import com.android.internal.widget.ViewPager;
+import com.android.internal.widget.ViewPager.OnPageChangeListener;
import libcore.icu.LocaleData;
+import java.util.Locale;
+
class DayPickerView extends ViewGroup {
private static final int DEFAULT_LAYOUT = R.layout.day_picker_content_material;
private static final int DEFAULT_START_YEAR = 1900;
diff --git a/core/java/android/widget/DayPickerViewPager.java b/core/java/android/widget/DayPickerViewPager.java
index 5f0ae29..94022ae 100644
--- a/core/java/android/widget/DayPickerViewPager.java
+++ b/core/java/android/widget/DayPickerViewPager.java
@@ -16,17 +16,12 @@
package android.widget;
-import android.annotation.Nullable;
import android.content.Context;
-import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.View;
-import android.view.ViewGroup;
-import android.view.ViewGroup.LayoutParams;
import com.android.internal.util.Predicate;
-import com.android.internal.widget.PagerAdapter;
import com.android.internal.widget.ViewPager;
import java.util.ArrayList;
diff --git a/core/java/android/widget/DialerFilter.java b/core/java/android/widget/DialerFilter.java
index e37e3ba7..8f9c96c 100644
--- a/core/java/android/widget/DialerFilter.java
+++ b/core/java/android/widget/DialerFilter.java
@@ -17,7 +17,7 @@
package android.widget;
import android.content.Context;
-import android.view.KeyEvent;
+import android.graphics.Rect;
import android.text.Editable;
import android.text.InputFilter;
import android.text.Selection;
@@ -28,8 +28,8 @@
import android.text.method.KeyListener;
import android.text.method.TextKeyListener;
import android.util.AttributeSet;
+import android.view.KeyEvent;
import android.view.View;
-import android.graphics.Rect;
/**
* This widget is a layout that contains several specifically-named child views that
@@ -169,7 +169,7 @@
// Only check to see if the digit is valid if the key is a printing key
// in the TextKeyListener. This prevents us from hiding the digits
// line when keys like UP and DOWN are hit.
- // XXX note that KEYCODE_TAB is special-cased here for
+ // XXX note that KEYCODE_TAB is special-cased here for
// devices that share tab and 0 on a single key.
boolean isPrint = event.isPrintingKey();
if (isPrint || keyCode == KeyEvent.KEYCODE_SPACE
diff --git a/core/java/android/widget/DigitalClock.java b/core/java/android/widget/DigitalClock.java
index 1df1643..c503ef2 100644
--- a/core/java/android/widget/DigitalClock.java
+++ b/core/java/android/widget/DigitalClock.java
@@ -23,6 +23,7 @@
import android.provider.Settings;
import android.text.format.DateFormat;
import android.util.AttributeSet;
+
import java.util.Calendar;
/**
diff --git a/core/java/android/widget/DropDownListView.java b/core/java/android/widget/DropDownListView.java
index 69e4218..e9c4728 100644
--- a/core/java/android/widget/DropDownListView.java
+++ b/core/java/android/widget/DropDownListView.java
@@ -17,13 +17,13 @@
package android.widget;
-import com.android.internal.widget.AutoScrollHelper.AbsListViewAutoScroller;
-
import android.annotation.NonNull;
import android.content.Context;
import android.view.MotionEvent;
import android.view.View;
+import com.android.internal.widget.AutoScrollHelper.AbsListViewAutoScroller;
+
/**
* Wrapper class for a ListView. This wrapper can hijack the focus to
* make sure the list uses the appropriate drawables and states when
diff --git a/core/java/android/widget/EdgeEffect.java b/core/java/android/widget/EdgeEffect.java
index 9019f31..98d8a13 100644
--- a/core/java/android/widget/EdgeEffect.java
+++ b/core/java/android/widget/EdgeEffect.java
@@ -17,14 +17,13 @@
package android.widget;
import android.annotation.ColorInt;
+import android.content.Context;
import android.content.res.TypedArray;
+import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
-
-import android.content.Context;
-import android.graphics.Canvas;
import android.view.animation.AnimationUtils;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.Interpolator;
@@ -103,7 +102,7 @@
private int mState = STATE_IDLE;
private float mPullDistance;
-
+
private final Rect mBounds = new Rect();
private final Paint mPaint = new Paint();
private float mRadius;
diff --git a/core/java/android/widget/EditText.java b/core/java/android/widget/EditText.java
index 24d8618..a8d3984 100644
--- a/core/java/android/widget/EditText.java
+++ b/core/java/android/widget/EditText.java
@@ -17,7 +17,6 @@
package android.widget;
import android.content.Context;
-import android.os.Bundle;
import android.text.Editable;
import android.text.Selection;
import android.text.Spannable;
diff --git a/core/java/android/widget/ExpandableListView.java b/core/java/android/widget/ExpandableListView.java
index fac36c5..8d9848d 100644
--- a/core/java/android/widget/ExpandableListView.java
+++ b/core/java/android/widget/ExpandableListView.java
@@ -16,7 +16,7 @@
package android.widget;
-import com.android.internal.R;
+import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1;
import android.content.Context;
import android.content.res.TypedArray;
@@ -27,14 +27,14 @@
import android.os.Parcelable;
import android.util.AttributeSet;
import android.view.ContextMenu;
+import android.view.ContextMenu.ContextMenuInfo;
import android.view.SoundEffectConstants;
import android.view.View;
-import android.view.ContextMenu.ContextMenuInfo;
import android.widget.ExpandableListConnector.PositionMetadata;
-import java.util.ArrayList;
+import com.android.internal.R;
-import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1;
+import java.util.ArrayList;
/**
* A view that shows items in a vertically scrolling two-level list. This
@@ -68,7 +68,7 @@
* wrap_content since it also can be any length. However, you can use
* wrap_content if the ExpandableListView parent has a specific size, such as
* 100 pixels.
- *
+ *
* @attr ref android.R.styleable#ExpandableListView_groupIndicator
* @attr ref android.R.styleable#ExpandableListView_indicatorLeft
* @attr ref android.R.styleable#ExpandableListView_indicatorRight
@@ -87,7 +87,7 @@
* The packed position represents a group.
*/
public static final int PACKED_POSITION_TYPE_GROUP = 0;
-
+
/**
* The packed position represents a child.
*/
@@ -97,14 +97,14 @@
* The packed position represents a neither/null/no preference.
*/
public static final int PACKED_POSITION_TYPE_NULL = 2;
-
+
/**
* The value for a packed position that represents neither/null/no
* preference. This value is not otherwise possible since a group type
* (first bit 0) should not have a child position filled.
*/
public static final long PACKED_POSITION_VALUE_NULL = 0x00000000FFFFFFFFL;
-
+
/** The mask (in packed position representation) for the child */
private static final long PACKED_POSITION_MASK_CHILD = 0x00000000FFFFFFFFL;
@@ -125,13 +125,13 @@
/** The mask (in integer group position representation) for the group */
private static final long PACKED_POSITION_INT_MASK_GROUP = 0x7FFFFFFF;
-
+
/** Serves as the glue/translator between a ListView and an ExpandableListView */
private ExpandableListConnector mConnector;
-
- /** Gives us Views through group+child positions */
+
+ /** Gives us Views through group+child positions */
private ExpandableListAdapter mAdapter;
-
+
/** Left bound for drawing the indicator. */
private int mIndicatorLeft;
@@ -210,7 +210,7 @@
/** State indicating the child is the last within its group. */
private static final int[] CHILD_LAST_STATE_SET =
{R.attr.state_last};
-
+
/** Drawable to be used as a divider when it is adjacent to any children */
private Drawable mChildDivider;
@@ -367,16 +367,16 @@
}
final int headerViewsCount = getHeaderViewsCount();
-
+
final int lastChildFlPos = mItemCount - getFooterViewsCount() - headerViewsCount - 1;
- final int myB = mBottom;
-
+ final int myB = mBottom;
+
PositionMetadata pos;
View item;
- Drawable indicator;
+ Drawable indicator;
int t, b;
-
+
// Start at a value that is neither child nor group
int lastItemType = ~(ExpandableListPosition.CHILD | ExpandableListPosition.GROUP);
@@ -385,7 +385,7 @@
// The "child" mentioned in the following two lines is this
// View's child, not referring to an expandable list's
// notion of a child (as opposed to a group)
- final int childCount = getChildCount();
+ final int childCount = getChildCount();
for (int i = 0, childFlPos = mFirstPosition - headerViewsCount; i < childCount;
i++, childFlPos++) {
@@ -396,11 +396,11 @@
// This child is footer, so are all subsequent children
break;
}
-
+
item = getChildAt(i);
t = item.getTop();
b = item.getBottom();
-
+
// This item isn't on the screen
if ((b < 0) || (t > myB)) continue;
@@ -435,7 +435,7 @@
indicatorRect.right += mPaddingLeft;
}
- lastItemType = pos.position.type;
+ lastItemType = pos.position.type;
}
if (indicatorRect.left != indicatorRect.right) {
@@ -448,7 +448,7 @@
indicatorRect.top = t;
indicatorRect.bottom = b;// + mDividerHeight;
}
-
+
// Get the indicator (with its state set to the item's state)
indicator = getIndicator(pos);
if (indicator != null) {
@@ -468,24 +468,24 @@
/**
* Gets the indicator for the item at the given position. If the indicator
* is stateful, the state will be given to the indicator.
- *
+ *
* @param pos The flat list position of the item whose indicator
* should be returned.
* @return The indicator in the proper state.
*/
private Drawable getIndicator(PositionMetadata pos) {
Drawable indicator;
-
+
if (pos.position.type == ExpandableListPosition.GROUP) {
indicator = mGroupIndicator;
-
+
if (indicator != null && indicator.isStateful()) {
// Empty check based on availability of data. If the groupMetadata isn't null,
// we do a check on it. Otherwise, the group is collapsed so we consider it
// empty for performance reasons.
boolean isEmpty = (pos.groupMetadata == null) ||
(pos.groupMetadata.lastChildFlPos == pos.groupMetadata.flPos);
-
+
final int stateSetIndex =
(pos.isExpanded() ? 1 : 0) | // Expanded?
(isEmpty ? 2 : 0); // Empty?
@@ -493,7 +493,7 @@
}
} else {
indicator = mChildIndicator;
-
+
if (indicator != null && indicator.isStateful()) {
// No need for a state sets array for the child since it only has two states
final int stateSet[] = pos.position.flatListPos == pos.groupMetadata.lastChildFlPos
@@ -502,15 +502,15 @@
indicator.setState(stateSet);
}
}
-
+
return indicator;
}
-
+
/**
* Sets the drawable that will be drawn adjacent to every child in the list. This will
* be drawn using the same height as the normal divider ({@link #setDivider(Drawable)}) or
* if it does not have an intrinsic height, the height set by {@link #setDividerHeight(int)}.
- *
+ *
* @param childDivider The drawable to use.
*/
public void setChildDivider(Drawable childDivider) {
@@ -520,7 +520,7 @@
@Override
void drawDivider(Canvas canvas, Rect bounds, int childIndex) {
int flatListPosition = childIndex + mFirstPosition;
-
+
// Only proceed as possible child if the divider isn't above all items (if it is above
// all items, then the item below it has to be a group)
if (flatListPosition >= 0) {
@@ -538,7 +538,7 @@
}
pos.recycle();
}
-
+
// Otherwise draw the default divider
super.drawDivider(canvas, bounds, flatListPosition);
}
@@ -589,18 +589,18 @@
public void setAdapter(ExpandableListAdapter adapter) {
// Set member variable
mAdapter = adapter;
-
+
if (adapter != null) {
// Create the connector
mConnector = new ExpandableListConnector(adapter);
} else {
mConnector = null;
}
-
+
// Link the ListView (superclass) to the expandable list data through the connector
super.setAdapter(mConnector);
}
-
+
/**
* Gets the adapter that provides data to this view.
* @return The adapter that provides data to this view.
@@ -608,7 +608,7 @@
public ExpandableListAdapter getExpandableListAdapter() {
return mAdapter;
}
-
+
/**
* @param position An absolute (including header and footer) flat list position.
* @return true if the position corresponds to a header or a footer item.
@@ -621,7 +621,7 @@
/**
* Converts an absolute item flat position into a group/child flat position, shifting according
* to the number of header items.
- *
+ *
* @param flatListPosition The absolute flat position
* @return A group/child flat position as expected by the connector.
*/
@@ -632,7 +632,7 @@
/**
* Converts a group/child flat position into an absolute flat position, that takes into account
* the possible headers.
- *
+ *
* @param flatListPosition The child/group flat position
* @return An absolute flat position.
*/
@@ -647,25 +647,25 @@
// Clicked on a header/footer, so ignore pass it on to super
return super.performItemClick(v, position, id);
}
-
+
// Internally handle the item click
final int adjustedPosition = getFlatPositionForConnector(position);
return handleItemClick(v, adjustedPosition, id);
}
-
+
/**
* This will either expand/collapse groups (if a group was clicked) or pass
* on the click to the proper child (if a child was clicked)
- *
+ *
* @param position The flat list position. This has already been factored to
* remove the header/footer.
* @param id The ListAdapter ID, not the group or child ID.
*/
boolean handleItemClick(View v, int position, long id) {
final PositionMetadata posMetadata = mConnector.getUnflattenedPos(position);
-
+
id = getChildOrGroupId(posMetadata.position);
-
+
boolean returnValue;
if (posMetadata.position.type == ExpandableListPosition.GROUP) {
/* It's a group, so handle collapsing/expanding */
@@ -697,11 +697,11 @@
if (mOnGroupExpandListener != null) {
mOnGroupExpandListener.onGroupExpand(posMetadata.position.groupPos);
}
-
+
final int groupPos = posMetadata.position.groupPos;
final int groupFlatPos = posMetadata.position.flatListPos;
- final int shiftedGroupPosition = groupFlatPos + getHeaderViewsCount();
+ final int shiftedGroupPosition = groupFlatPos + getHeaderViewsCount();
smoothScrollToPosition(shiftedGroupPosition + mAdapter.getChildrenCount(groupPos),
shiftedGroupPosition);
}
@@ -764,17 +764,17 @@
return retValue;
}
-
+
/**
* Collapse a group in the grouped list view
- *
+ *
* @param groupPos position of the group to collapse
* @return True if the group was collapsed, false otherwise (if the group
* was already collapsed, this will return false)
*/
public boolean collapseGroup(int groupPos) {
boolean retValue = mConnector.collapseGroup(groupPos);
-
+
if (mOnGroupCollapseListener != null) {
mOnGroupCollapseListener.onGroupCollapse(groupPos);
}
@@ -787,14 +787,14 @@
/**
* Callback method to be invoked when a group in this expandable list has
* been collapsed.
- *
+ *
* @param groupPosition The group position that was collapsed
*/
void onGroupCollapse(int groupPosition);
}
-
+
private OnGroupCollapseListener mOnGroupCollapseListener;
-
+
public void setOnGroupCollapseListener(
OnGroupCollapseListener onGroupCollapseListener) {
mOnGroupCollapseListener = onGroupCollapseListener;
@@ -805,14 +805,14 @@
/**
* Callback method to be invoked when a group in this expandable list has
* been expanded.
- *
+ *
* @param groupPosition The group position that was expanded
*/
void onGroupExpand(int groupPosition);
}
-
+
private OnGroupExpandListener mOnGroupExpandListener;
-
+
public void setOnGroupExpandListener(
OnGroupExpandListener onGroupExpandListener) {
mOnGroupExpandListener = onGroupExpandListener;
@@ -826,7 +826,7 @@
/**
* Callback method to be invoked when a group in this expandable list has
* been clicked.
- *
+ *
* @param parent The ExpandableListConnector where the click happened
* @param v The view within the expandable list/ListView that was clicked
* @param groupPosition The group position that was clicked
@@ -836,13 +836,13 @@
boolean onGroupClick(ExpandableListView parent, View v, int groupPosition,
long id);
}
-
+
private OnGroupClickListener mOnGroupClickListener;
public void setOnGroupClickListener(OnGroupClickListener onGroupClickListener) {
mOnGroupClickListener = onGroupClickListener;
}
-
+
/**
* Interface definition for a callback to be invoked when a child in this
* expandable list has been clicked.
@@ -851,7 +851,7 @@
/**
* Callback method to be invoked when a child in this expandable list has
* been clicked.
- *
+ *
* @param parent The ExpandableListView where the click happened
* @param v The view within the expandable list/ListView that was clicked
* @param groupPosition The group position that contains the child that
@@ -863,13 +863,13 @@
boolean onChildClick(ExpandableListView parent, View v, int groupPosition,
int childPosition, long id);
}
-
+
private OnChildClickListener mOnChildClickListener;
public void setOnChildClickListener(OnChildClickListener onChildClickListener) {
mOnChildClickListener = onChildClickListener;
}
-
+
/**
* Converts a flat list position (the raw position of an item (child or group)
* in the list) to a group and/or child position (represented in a
@@ -878,7 +878,7 @@
* {@link ExpandableListView#getPackedPositionType} ,
* {@link ExpandableListView#getPackedPositionChild},
* {@link ExpandableListView#getPackedPositionGroup} to unpack.
- *
+ *
* @param flatListPosition The flat list position to be converted.
* @return The group and/or child position for the given flat list position
* in packed position representation. #PACKED_POSITION_VALUE_NULL if
@@ -895,12 +895,12 @@
pm.recycle();
return packedPos;
}
-
+
/**
* Converts a group and/or child position to a flat list position. This is
* useful in situations where the caller needs to use the underlying
* {@link ListView}'s methods.
- *
+ *
* @param packedPosition The group and/or child positions to be converted in
* packed position representation. Use
* {@link #getPackedPositionForChild(int, int)} or
@@ -920,7 +920,7 @@
/**
* Gets the position of the currently selected group or child (along with
* its type). Can return {@link #PACKED_POSITION_VALUE_NULL} if no selection.
- *
+ *
* @return A packed position containing the currently selected group or
* child's position and type. #PACKED_POSITION_VALUE_NULL if no selection
* or if selection is on a header or a footer item.
@@ -931,11 +931,11 @@
// The case where there is no selection (selectedPos == -1) is also handled here.
return getExpandableListPosition(selectedPos);
}
-
+
/**
* Gets the ID of the currently selected group or child. Can return -1 if no
* selection.
- *
+ *
* @return The ID of the currently selected group or child. -1 if no
* selection.
*/
@@ -944,7 +944,7 @@
if (packedPos == PACKED_POSITION_VALUE_NULL) return -1;
int groupPos = getPackedPositionGroup(packedPos);
-
+
if (getPackedPositionType(packedPos) == PACKED_POSITION_TYPE_GROUP) {
// It's a group
return mAdapter.getGroupId(groupPos);
@@ -953,7 +953,7 @@
return mAdapter.getChildId(groupPos, getPackedPositionChild(packedPos));
}
}
-
+
/**
* Sets the selection to the specified group.
* @param groupPosition The position of the group that should be selected.
@@ -967,12 +967,12 @@
super.setSelection(absoluteFlatPosition);
pm.recycle();
}
-
+
/**
* Sets the selection to the specified child. If the child is in a collapsed
* group, the group will only be expanded and child subsequently selected if
* shouldExpandGroup is set to true, otherwise the method will return false.
- *
+ *
* @param groupPosition The position of the group that contains the child.
* @param childPosition The position of the child within the group.
* @param shouldExpandGroup Whether the child's group should be expanded if
@@ -981,48 +981,48 @@
*/
public boolean setSelectedChild(int groupPosition, int childPosition, boolean shouldExpandGroup) {
ExpandableListPosition elChildPos = ExpandableListPosition.obtainChildPosition(
- groupPosition, childPosition);
+ groupPosition, childPosition);
PositionMetadata flatChildPos = mConnector.getFlattenedPos(elChildPos);
-
+
if (flatChildPos == null) {
// The child's group isn't expanded
-
+
// Shouldn't expand the group, so return false for we didn't set the selection
- if (!shouldExpandGroup) return false;
+ if (!shouldExpandGroup) return false;
expandGroup(groupPosition);
-
+
flatChildPos = mConnector.getFlattenedPos(elChildPos);
-
+
// Sanity check
if (flatChildPos == null) {
throw new IllegalStateException("Could not find child");
}
}
-
+
int absoluteFlatPosition = getAbsoluteFlatPosition(flatChildPos.position.flatListPos);
super.setSelection(absoluteFlatPosition);
-
+
elChildPos.recycle();
flatChildPos.recycle();
-
+
return true;
}
/**
* Whether the given group is currently expanded.
- *
+ *
* @param groupPosition The group to check.
* @return Whether the group is currently expanded.
*/
public boolean isGroupExpanded(int groupPosition) {
return mConnector.isGroupExpanded(groupPosition);
}
-
+
/**
* Gets the type of a packed position. See
* {@link #getPackedPositionForChild(int, int)}.
- *
+ *
* @param packedPosition The packed position for which to return the type.
* @return The type of the position contained within the packed position,
* either {@link #PACKED_POSITION_TYPE_CHILD}, {@link #PACKED_POSITION_TYPE_GROUP}, or
@@ -1032,7 +1032,7 @@
if (packedPosition == PACKED_POSITION_VALUE_NULL) {
return PACKED_POSITION_TYPE_NULL;
}
-
+
return (packedPosition & PACKED_POSITION_MASK_TYPE) == PACKED_POSITION_MASK_TYPE
? PACKED_POSITION_TYPE_CHILD
: PACKED_POSITION_TYPE_GROUP;
@@ -1041,7 +1041,7 @@
/**
* Gets the group position from a packed position. See
* {@link #getPackedPositionForChild(int, int)}.
- *
+ *
* @param packedPosition The packed position from which the group position
* will be returned.
* @return The group position portion of the packed position. If this does
@@ -1050,7 +1050,7 @@
public static int getPackedPositionGroup(long packedPosition) {
// Null
if (packedPosition == PACKED_POSITION_VALUE_NULL) return -1;
-
+
return (int) ((packedPosition & PACKED_POSITION_MASK_GROUP) >> PACKED_POSITION_SHIFT_GROUP);
}
@@ -1060,7 +1060,7 @@
* To get the group that this child belongs to, use
* {@link #getPackedPositionGroup(long)}. See
* {@link #getPackedPositionForChild(int, int)}.
- *
+ *
* @param packedPosition The packed position from which the child position
* will be returned.
* @return The child position portion of the packed position. If this does
@@ -1069,7 +1069,7 @@
public static int getPackedPositionChild(long packedPosition) {
// Null
if (packedPosition == PACKED_POSITION_VALUE_NULL) return -1;
-
+
// Group since a group type clears this bit
if ((packedPosition & PACKED_POSITION_MASK_TYPE) != PACKED_POSITION_MASK_TYPE) return -1;
@@ -1087,7 +1087,7 @@
* {@link #getPackedPositionChild(long)},
* {@link #getPackedPositionGroup(long)}, and
* {@link #getPackedPositionType(long)}.
- *
+ *
* @param groupPosition The child's parent group's position.
* @param childPosition The child position within the group.
* @return The packed position representation of the child (and parent group).
@@ -1096,20 +1096,20 @@
return (((long)PACKED_POSITION_TYPE_CHILD) << PACKED_POSITION_SHIFT_TYPE)
| ((((long)groupPosition) & PACKED_POSITION_INT_MASK_GROUP)
<< PACKED_POSITION_SHIFT_GROUP)
- | (childPosition & PACKED_POSITION_INT_MASK_CHILD);
+ | (childPosition & PACKED_POSITION_INT_MASK_CHILD);
}
/**
* Returns the packed position representation of a group's position. See
* {@link #getPackedPositionForChild(int, int)}.
- *
+ *
* @param groupPosition The child's parent group's position.
* @return The packed position representation of the group.
*/
public static long getPackedPositionForGroup(int groupPosition) {
// No need to OR a type in because PACKED_POSITION_GROUP == 0
return ((((long)groupPosition) & PACKED_POSITION_INT_MASK_GROUP)
- << PACKED_POSITION_SHIFT_GROUP);
+ << PACKED_POSITION_SHIFT_GROUP);
}
@Override
@@ -1122,12 +1122,12 @@
final int adjustedPosition = getFlatPositionForConnector(flatListPosition);
PositionMetadata pm = mConnector.getUnflattenedPos(adjustedPosition);
ExpandableListPosition pos = pm.position;
-
+
id = getChildOrGroupId(pos);
long packedPosition = pos.getPackedPosition();
pm.recycle();
-
+
return new ExpandableListContextMenuInfo(view, packedPosition, id);
}
@@ -1135,7 +1135,7 @@
* Gets the ID of the group or child at the given <code>position</code>.
* This is useful since there is no ListAdapter ID -> ExpandableListAdapter
* ID conversion mechanism (in some cases, it isn't possible).
- *
+ *
* @param position The position of the child or group whose ID should be
* returned.
*/
@@ -1146,10 +1146,10 @@
return mAdapter.getGroupId(position.groupPos);
}
}
-
+
/**
* Sets the indicator to be drawn next to a child.
- *
+ *
* @param childIndicator The drawable to be used as an indicator. If the
* child is the last child for a group, the state
* {@link android.R.attr#state_last} will be set.
@@ -1157,7 +1157,7 @@
public void setChildIndicator(Drawable childIndicator) {
mChildIndicator = childIndicator;
}
-
+
/**
* Sets the drawing bounds for the child indicator. For either, you can
* specify {@link #CHILD_INDICATOR_INHERIT} to use inherit from the general
@@ -1194,7 +1194,7 @@
/**
* Sets the indicator to be drawn next to a group.
- *
+ *
* @param groupIndicator The drawable to be used as an indicator. If the
* group is empty, the state {@link android.R.attr#state_empty} will be
* set. If the group is expanded, the state
@@ -1211,8 +1211,8 @@
* Sets the drawing bounds for the indicators (at minimum, the group indicator
* is affected by this; the child indicator is affected by this if the
* child indicator bounds are set to inherit).
- *
- * @see #setChildIndicatorBounds(int, int)
+ *
+ * @see #setChildIndicatorBounds(int, int)
* @param left The left position (relative to the left bounds of this View)
* to start drawing the indicator.
* @param right The right position (relative to the left bounds of this
@@ -1248,13 +1248,13 @@
* callback when a context menu is brought up for this AdapterView.
*/
public static class ExpandableListContextMenuInfo implements ContextMenu.ContextMenuInfo {
-
+
public ExpandableListContextMenuInfo(View targetView, long packedPosition, long id) {
this.targetView = targetView;
this.packedPosition = packedPosition;
this.id = id;
}
-
+
/**
* The view for which the context menu is being displayed. This
* will be one of the children Views of this {@link ExpandableListView}.
@@ -1276,10 +1276,10 @@
*/
public long id;
}
-
+
static class SavedState extends BaseSavedState {
ArrayList<ExpandableListConnector.GroupMetadata> expandedGroupMetadataList;
-
+
/**
* Constructor called from {@link ExpandableListView#onSaveInstanceState()}
*/
@@ -1333,7 +1333,7 @@
SavedState ss = (SavedState) state;
super.onRestoreInstanceState(ss.getSuperState());
-
+
if (mConnector != null && ss.expandedGroupMetadataList != null) {
mConnector.setExpandedGroupMetadataList(ss.expandedGroupMetadataList);
}
diff --git a/core/java/android/widget/FrameLayout.java b/core/java/android/widget/FrameLayout.java
index b8c74d8..dc8ee01 100644
--- a/core/java/android/widget/FrameLayout.java
+++ b/core/java/android/widget/FrameLayout.java
@@ -16,8 +16,6 @@
package android.widget;
-import com.android.internal.R;
-
import android.annotation.AttrRes;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -34,6 +32,8 @@
import android.view.ViewHierarchyEncoder;
import android.widget.RemoteViews.RemoteView;
+import com.android.internal.R;
+
import java.util.ArrayList;
/**
diff --git a/core/java/android/widget/GridLayout.java b/core/java/android/widget/GridLayout.java
index af2852c..1c15c7a 100644
--- a/core/java/android/widget/GridLayout.java
+++ b/core/java/android/widget/GridLayout.java
@@ -16,6 +16,20 @@
package android.widget;
+import static android.view.Gravity.AXIS_PULL_AFTER;
+import static android.view.Gravity.AXIS_PULL_BEFORE;
+import static android.view.Gravity.AXIS_SPECIFIED;
+import static android.view.Gravity.AXIS_X_SHIFT;
+import static android.view.Gravity.AXIS_Y_SHIFT;
+import static android.view.Gravity.HORIZONTAL_GRAVITY_MASK;
+import static android.view.Gravity.RELATIVE_LAYOUT_DIRECTION;
+import static android.view.Gravity.VERTICAL_GRAVITY_MASK;
+import static android.view.View.MeasureSpec.EXACTLY;
+import static android.view.View.MeasureSpec.makeMeasureSpec;
+
+import static java.lang.Math.max;
+import static java.lang.Math.min;
+
import android.annotation.IntDef;
import android.content.Context;
import android.content.res.TypedArray;
@@ -32,6 +46,7 @@
import android.view.View;
import android.view.ViewGroup;
import android.widget.RemoteViews.RemoteView;
+
import com.android.internal.R;
import java.lang.annotation.Retention;
@@ -43,12 +58,6 @@
import java.util.List;
import java.util.Map;
-import static android.view.Gravity.*;
-import static android.view.View.MeasureSpec.EXACTLY;
-import static android.view.View.MeasureSpec.makeMeasureSpec;
-import static java.lang.Math.max;
-import static java.lang.Math.min;
-
/**
* A layout that places its children in a rectangular <em>grid</em>.
* <p>
diff --git a/core/java/android/widget/GridView.java b/core/java/android/widget/GridView.java
index b95aa52..20543fb 100644
--- a/core/java/android/widget/GridView.java
+++ b/core/java/android/widget/GridView.java
@@ -36,9 +36,9 @@
import android.view.ViewRootImpl;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction;
-import android.view.accessibility.AccessibilityNodeProvider;
import android.view.accessibility.AccessibilityNodeInfo.CollectionInfo;
import android.view.accessibility.AccessibilityNodeInfo.CollectionItemInfo;
+import android.view.accessibility.AccessibilityNodeProvider;
import android.view.animation.GridLayoutAnimationController;
import android.widget.RemoteViews.RemoteView;
@@ -54,7 +54,7 @@
*
* <p>See the <a href="{@docRoot}guide/topics/ui/layout/gridview.html">Grid
* View</a> guide.</p>
- *
+ *
* @attr ref android.R.styleable#GridView_horizontalSpacing
* @attr ref android.R.styleable#GridView_verticalSpacing
* @attr ref android.R.styleable#GridView_stretchMode
@@ -71,33 +71,33 @@
/**
* Disables stretching.
- *
- * @see #setStretchMode(int)
+ *
+ * @see #setStretchMode(int)
*/
public static final int NO_STRETCH = 0;
/**
* Stretches the spacing between columns.
- *
- * @see #setStretchMode(int)
+ *
+ * @see #setStretchMode(int)
*/
public static final int STRETCH_SPACING = 1;
/**
* Stretches columns.
- *
- * @see #setStretchMode(int)
+ *
+ * @see #setStretchMode(int)
*/
public static final int STRETCH_COLUMN_WIDTH = 2;
/**
* Stretches the spacing between columns. The spacing is uniform.
- *
- * @see #setStretchMode(int)
+ *
+ * @see #setStretchMode(int)
*/
public static final int STRETCH_SPACING_UNIFORM = 3;
/**
* Creates as many columns as can fit on screen.
- *
- * @see #setNumColumns(int)
+ *
+ * @see #setNumColumns(int)
*/
public static final int AUTO_FIT = -1;
@@ -161,7 +161,7 @@
if (index >= 0) {
setGravity(index);
}
-
+
a.recycle();
}
@@ -192,7 +192,7 @@
}
resetList();
- mRecycler.clear();
+ mRecycler.clear();
mAdapter = adapter;
mOldSelectedPosition = INVALID_POSITION;
@@ -222,7 +222,7 @@
setNextSelectedPositionInt(position);
checkSelectionChanged();
} else {
- checkFocus();
+ checkFocus();
// Nothing selected
checkSelectionChanged();
}
@@ -376,7 +376,7 @@
}
mReferenceView = child;
-
+
if (selectedView != null) {
mReferenceViewInSelectedRow = mReferenceView;
}
@@ -515,7 +515,7 @@
offsetChildrenTopAndBottom(offset);
}
}
- }
+ }
@Override
int findMotionRow(int y) {
@@ -624,7 +624,7 @@
// This is how far the bottom edge of the last view is from the bottom of the
// drawable area
- int bottomOffset = end - lastBottom;
+ int bottomOffset = end - lastBottom;
final View firstChild = getChildAt(0);
final int firstTop = firstChild.getTop();
@@ -636,7 +636,7 @@
// Don't pull the top too far down
bottomOffset = Math.min(bottomOffset, mListPadding.top - firstTop);
}
-
+
// Move everything down
offsetChildrenTopAndBottom(bottomOffset);
if (mFirstPosition > 0) {
@@ -679,7 +679,7 @@
// Don't pull the bottom too far up
topOffset = Math.min(topOffset, lastBottom - end);
}
-
+
// Move everything up
offsetChildrenTopAndBottom(-topOffset);
if (lastPosition < mItemCount - 1) {
@@ -965,7 +965,7 @@
final int stretchMode = mStretchMode;
final int requestedColumnWidth = mRequestedColumnWidth;
boolean didNotInitiallyFit = false;
-
+
if (mRequestedNumColumns == AUTO_FIT) {
if (requestedColumnWidth > 0) {
// Client told us to pick the number of columns
@@ -979,57 +979,57 @@
// We picked the columns
mNumColumns = mRequestedNumColumns;
}
-
+
if (mNumColumns <= 0) {
mNumColumns = 1;
}
switch (stretchMode) {
- case NO_STRETCH:
- // Nobody stretches
- mColumnWidth = requestedColumnWidth;
- mHorizontalSpacing = requestedHorizontalSpacing;
- break;
-
- default:
- int spaceLeftOver = availableSpace - (mNumColumns * requestedColumnWidth) -
- ((mNumColumns - 1) * requestedHorizontalSpacing);
-
- if (spaceLeftOver < 0) {
- didNotInitiallyFit = true;
- }
-
- switch (stretchMode) {
- case STRETCH_COLUMN_WIDTH:
- // Stretch the columns
- mColumnWidth = requestedColumnWidth + spaceLeftOver / mNumColumns;
+ case NO_STRETCH:
+ // Nobody stretches
+ mColumnWidth = requestedColumnWidth;
mHorizontalSpacing = requestedHorizontalSpacing;
break;
- case STRETCH_SPACING:
- // Stretch the spacing between columns
- mColumnWidth = requestedColumnWidth;
- if (mNumColumns > 1) {
- mHorizontalSpacing = requestedHorizontalSpacing +
- spaceLeftOver / (mNumColumns - 1);
- } else {
- mHorizontalSpacing = requestedHorizontalSpacing + spaceLeftOver;
- }
- break;
+ default:
+ int spaceLeftOver = availableSpace - (mNumColumns * requestedColumnWidth)
+ - ((mNumColumns - 1) * requestedHorizontalSpacing);
- case STRETCH_SPACING_UNIFORM:
- // Stretch the spacing between columns
- mColumnWidth = requestedColumnWidth;
- if (mNumColumns > 1) {
- mHorizontalSpacing = requestedHorizontalSpacing +
- spaceLeftOver / (mNumColumns + 1);
- } else {
- mHorizontalSpacing = requestedHorizontalSpacing + spaceLeftOver;
+ if (spaceLeftOver < 0) {
+ didNotInitiallyFit = true;
}
- break;
- }
- break;
+ switch (stretchMode) {
+ case STRETCH_COLUMN_WIDTH:
+ // Stretch the columns
+ mColumnWidth = requestedColumnWidth + spaceLeftOver / mNumColumns;
+ mHorizontalSpacing = requestedHorizontalSpacing;
+ break;
+
+ case STRETCH_SPACING:
+ // Stretch the spacing between columns
+ mColumnWidth = requestedColumnWidth;
+ if (mNumColumns > 1) {
+ mHorizontalSpacing = requestedHorizontalSpacing
+ + spaceLeftOver / (mNumColumns - 1);
+ } else {
+ mHorizontalSpacing = requestedHorizontalSpacing + spaceLeftOver;
+ }
+ break;
+
+ case STRETCH_SPACING_UNIFORM:
+ // Stretch the spacing between columns
+ mColumnWidth = requestedColumnWidth;
+ if (mNumColumns > 1) {
+ mHorizontalSpacing = requestedHorizontalSpacing
+ + spaceLeftOver / (mNumColumns + 1);
+ } else {
+ mHorizontalSpacing = requestedHorizontalSpacing + spaceLeftOver;
+ }
+ break;
+ }
+
+ break;
}
return didNotInitiallyFit;
}
@@ -1052,7 +1052,7 @@
}
widthSize += getVerticalScrollbarWidth();
}
-
+
int childWidth = widthSize - mListPadding.left - mListPadding.right;
boolean didNotInitiallyFit = determineColumns(childWidth);
@@ -1087,7 +1087,7 @@
mRecycler.addScrapView(child, -1);
}
}
-
+
if (heightMode == MeasureSpec.UNSPECIFIED) {
heightSize = mListPadding.top + mListPadding.bottom + childHeight +
getVerticalFadingEdgeLength() * 2;
@@ -1095,7 +1095,7 @@
if (heightMode == MeasureSpec.AT_MOST) {
int ourSize = mListPadding.top + mListPadding.bottom;
-
+
final int numColumns = mNumColumns;
for (int i = 0; i < count; i += numColumns) {
ourSize += childHeight;
@@ -1574,9 +1574,9 @@
/**
* Sets the currently selected item
- *
+ *
* @param position Index (starting at 0) of the data item to be selected.
- *
+ *
* If in touch mode, the item will not be selected but it will still be positioned
* appropriately.
*/
@@ -1609,8 +1609,8 @@
setNextSelectedPositionInt(position);
layoutChildren();
-
- final int next = mStackFromBottom ? mItemCount - 1 - mNextSelectedPosition :
+
+ final int next = mStackFromBottom ? mItemCount - 1 - mNextSelectedPosition :
mNextSelectedPosition;
final int previous = mStackFromBottom ? mItemCount - 1
- previousSelectedPosition : previousSelectedPosition;
@@ -1802,7 +1802,7 @@
invokeOnItemScrollListener();
moved = true;
}
-
+
if (moved) {
awakenScrollBars();
}
@@ -1874,7 +1874,7 @@
if (moved) {
awakenScrollBars();
}
-
+
return moved;
}
@@ -2216,17 +2216,17 @@
requestLayoutIfNecessary();
}
}
-
+
/**
- * Get the number of columns in the grid.
+ * Get the number of columns in the grid.
* Returns {@link #AUTO_FIT} if the Grid has never been laid out.
*
* @attr ref android.R.styleable#GridView_numColumns
- *
+ *
* @see #setNumColumns(int)
*/
@ViewDebug.ExportedProperty
- public int getNumColumns() {
+ public int getNumColumns() {
return mNumColumns;
}
@@ -2259,13 +2259,13 @@
// we are too high, slide all views down to align with bottom
child = getChildAt(childCount - 1);
delta = child.getBottom() - (getHeight() - mListPadding.bottom);
-
+
if (mFirstPosition + childCount < mItemCount) {
// It's OK to have some space below the last item if it is
// part of the vertical spacing
delta += mVerticalSpacing;
}
-
+
if (delta > 0) {
// We only are looking to see if we are too high, not too low
delta = 0;
@@ -2277,14 +2277,14 @@
}
}
}
-
+
@Override
protected int computeVerticalScrollExtent() {
final int count = getChildCount();
if (count > 0) {
final int numColumns = mNumColumns;
final int rowCount = (count + numColumns - 1) / numColumns;
-
+
int extent = rowCount * 100;
View view = getChildAt(0);
diff --git a/core/java/android/widget/LinearLayout.java b/core/java/android/widget/LinearLayout.java
index 6511de8..544e591 100644
--- a/core/java/android/widget/LinearLayout.java
+++ b/core/java/android/widget/LinearLayout.java
@@ -16,8 +16,6 @@
package android.widget;
-import com.android.internal.R;
-
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -34,15 +32,17 @@
import android.view.ViewHierarchyEncoder;
import android.widget.RemoteViews.RemoteView;
+import com.android.internal.R;
+
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
- * A Layout that arranges its children in a single column or a single row. The direction of
- * the row can be set by calling {@link #setOrientation(int) setOrientation()}.
+ * A Layout that arranges its children in a single column or a single row. The direction of
+ * the row can be set by calling {@link #setOrientation(int) setOrientation()}.
* You can also specify gravity, which specifies the alignment of all the child elements by
- * calling {@link #setGravity(int) setGravity()} or specify that specific children
+ * calling {@link #setGravity(int) setGravity()} or specify that specific children
* grow to fill up any remaining space in the layout by setting the <em>weight</em> member of
* {@link android.widget.LinearLayout.LayoutParams LinearLayout.LayoutParams}.
* The default orientation is horizontal.
@@ -202,7 +202,7 @@
public LinearLayout(Context context, @Nullable AttributeSet attrs) {
this(context, attrs, 0);
}
-
+
public LinearLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
this(context, attrs, defStyleAttr, 0);
}
@@ -497,7 +497,7 @@
* When true, all children with a weight will be considered having
* the minimum size of the largest child. If false, all children are
* measured normally.
- *
+ *
* @return True to measure children with a weight using the minimum
* size of the largest child, false otherwise.
*
@@ -511,9 +511,9 @@
* When set to true, all children with a weight will be considered having
* the minimum size of the largest child. If false, all children are
* measured normally.
- *
+ *
* Disabled by default.
- *
+ *
* @param enabled True to measure children with a weight using the
* minimum size of the largest child, false otherwise.
*
@@ -589,7 +589,7 @@
/**
* @param i The index of the child that will be used if this layout is
* part of a larger layout that is baseline aligned.
- *
+ *
* @attr ref android.R.styleable#LinearLayout_baselineAlignedChildIndex
*/
@android.view.RemotableViewMethod
@@ -720,14 +720,14 @@
float totalWeight = 0;
final int count = getVirtualChildCount();
-
+
final int widthMode = MeasureSpec.getMode(widthMeasureSpec);
final int heightMode = MeasureSpec.getMode(heightMeasureSpec);
boolean matchWidth = false;
boolean skippedMeasure = false;
- final int baselineChildIndex = mBaselineAlignedChildIndex;
+ final int baselineChildIndex = mBaselineAlignedChildIndex;
final boolean useLargestChild = mUseLargestChild;
int largestChildHeight = Integer.MIN_VALUE;
@@ -886,7 +886,7 @@
// Check against our minimum height
heightSize = Math.max(heightSize, getSuggestedMinimumHeight());
-
+
// Reconcile our calculated size with the heightMeasureSpec
int heightSizeAndState = resolveSizeAndState(heightSize, heightMeasureSpec, 0);
heightSize = heightSizeAndState & MEASURED_SIZE_MASK;
@@ -991,12 +991,12 @@
if (!allFillParent && widthMode != MeasureSpec.EXACTLY) {
maxWidth = alternativeMaxWidth;
}
-
+
maxWidth += mPaddingLeft + mPaddingRight;
// Check against our minimum width
maxWidth = Math.max(maxWidth, getSuggestedMinimumWidth());
-
+
setMeasuredDimension(resolveSizeAndState(maxWidth, widthMeasureSpec, childState),
heightSizeAndState);
@@ -1013,13 +1013,13 @@
final View child = getVirtualChildAt(i);
if (child != null && child.getVisibility() != GONE) {
LinearLayout.LayoutParams lp = ((LinearLayout.LayoutParams)child.getLayoutParams());
-
+
if (lp.width == LayoutParams.MATCH_PARENT) {
// Temporarily force children to reuse their old measured height
// FIXME: this may not be right for something like wrapping text?
int oldHeight = lp.height;
lp.height = child.getMeasuredHeight();
-
+
// Remeasue with new dimensions
measureChildWithMargins(child, uniformMeasureSpec, 0, heightMeasureSpec, 0);
lp.height = oldHeight;
@@ -1037,7 +1037,7 @@
*
* @see #getOrientation()
* @see #setOrientation(int)
- * @see #onMeasure(int, int)
+ * @see #onMeasure(int, int)
*/
void measureHorizontal(int widthMeasureSpec, int heightMeasureSpec) {
mTotalLength = 0;
@@ -1049,7 +1049,7 @@
float totalWeight = 0;
final int count = getVirtualChildCount();
-
+
final int widthMode = MeasureSpec.getMode(widthMeasureSpec);
final int heightMode = MeasureSpec.getMode(heightMeasureSpec);
@@ -1069,7 +1069,7 @@
final boolean baselineAligned = mBaselineAligned;
final boolean useLargestChild = mUseLargestChild;
-
+
final boolean isExactly = widthMode == MeasureSpec.EXACTLY;
int largestChildWidth = Integer.MIN_VALUE;
@@ -1084,7 +1084,7 @@
mTotalLength += measureNullChild(i);
continue;
}
-
+
if (child.getVisibility() == GONE) {
i += getChildrenSkipCount(child, i);
continue;
@@ -1263,16 +1263,16 @@
// Add in our padding
mTotalLength += mPaddingLeft + mPaddingRight;
-
+
int widthSize = mTotalLength;
-
+
// Check against our minimum width
widthSize = Math.max(widthSize, getSuggestedMinimumWidth());
-
+
// Reconcile our calculated size with the widthMeasureSpec
int widthSizeAndState = resolveSizeAndState(widthSize, widthMeasureSpec, 0);
widthSize = widthSizeAndState & MEASURED_SIZE_MASK;
-
+
// Either expand children with weight to take up available space or
// shrink them if they extend beyond our current bounds. If we skipped
// measurement on any children, we need to measure them now.
@@ -1409,12 +1409,12 @@
if (!allFillParent && heightMode != MeasureSpec.EXACTLY) {
maxHeight = alternativeMaxHeight;
}
-
+
maxHeight += mPaddingTop + mPaddingBottom;
// Check against our minimum height
maxHeight = Math.max(maxHeight, getSuggestedMinimumHeight());
-
+
setMeasuredDimension(widthSizeAndState | (childState&MEASURED_STATE_MASK),
resolveSizeAndState(maxHeight, heightMeasureSpec,
(childState<<MEASURED_HEIGHT_STATE_SHIFT)));
@@ -1434,13 +1434,13 @@
final View child = getVirtualChildAt(i);
if (child != null && child.getVisibility() != GONE) {
LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) child.getLayoutParams();
-
+
if (lp.height == LayoutParams.MATCH_PARENT) {
// Temporarily force children to reuse their old measured width
// FIXME: this may not be right for something like wrapping text?
int oldWidth = lp.width;
lp.width = child.getMeasuredWidth();
-
+
// Remeasure with new dimensions
measureChildWithMargins(child, widthMeasureSpec, 0, uniformMeasureSpec, 0);
lp.width = oldWidth;
@@ -1541,14 +1541,14 @@
int childTop;
int childLeft;
-
+
// Where right end of child should go
final int width = right - left;
int childRight = width - mPaddingRight;
-
+
// Space available for child
int childSpace = width - paddingLeft - mPaddingRight;
-
+
final int count = getVirtualChildCount();
final int majorGravity = mGravity & Gravity.VERTICAL_GRAVITY_MASK;
@@ -1578,10 +1578,10 @@
} else if (child.getVisibility() != GONE) {
final int childWidth = child.getMeasuredWidth();
final int childHeight = child.getMeasuredHeight();
-
+
final LinearLayout.LayoutParams lp =
(LinearLayout.LayoutParams) child.getLayoutParams();
-
+
int gravity = lp.gravity;
if (gravity < 0) {
gravity = minorGravity;
@@ -1647,11 +1647,11 @@
int childTop;
int childLeft;
-
+
// Where bottom of child should go
final int height = bottom - top;
- int childBottom = height - mPaddingBottom;
-
+ int childBottom = height - mPaddingBottom;
+
// Space available for child
int childSpace = height - paddingTop - mPaddingBottom;
@@ -1707,12 +1707,12 @@
if (baselineAligned && lp.height != LayoutParams.MATCH_PARENT) {
childBaseline = child.getBaseline();
}
-
+
int gravity = lp.gravity;
if (gravity < 0) {
gravity = minorGravity;
}
-
+
switch (gravity & Gravity.VERTICAL_GRAVITY_MASK) {
case Gravity.TOP:
childTop = paddingTop + lp.topMargin;
@@ -1764,15 +1764,15 @@
}
}
- private void setChildFrame(View child, int left, int top, int width, int height) {
+ private void setChildFrame(View child, int left, int top, int width, int height) {
child.layout(left, top, left + width, top + height);
}
-
+
/**
* Should the layout be a column or a row.
* @param orientation Pass {@link #HORIZONTAL} or {@link #VERTICAL}. Default
* value is {@link #HORIZONTAL}.
- *
+ *
* @attr ref android.R.styleable#LinearLayout_orientation
*/
public void setOrientation(@OrientationMode int orientation) {
@@ -1784,7 +1784,7 @@
/**
* Returns the current orientation.
- *
+ *
* @return either {@link #HORIZONTAL} or {@link #VERTICAL}
*/
@OrientationMode
@@ -1797,9 +1797,9 @@
* this layout has a VERTICAL orientation, this controls where all the child
* views are placed if there is extra vertical space. If this layout has a
* HORIZONTAL orientation, this controls the alignment of the children.
- *
+ *
* @param gravity See {@link android.view.Gravity}
- *
+ *
* @attr ref android.R.styleable#LinearLayout_gravity
*/
@android.view.RemotableViewMethod
@@ -1845,7 +1845,7 @@
requestLayout();
}
}
-
+
@Override
public LayoutParams generateLayoutParams(AttributeSet attrs) {
return new LinearLayout.LayoutParams(getContext(), attrs);
@@ -1909,7 +1909,7 @@
/**
* Per-child layout information associated with ViewLinearLayout.
- *
+ *
* @attr ref android.R.styleable#LinearLayout_Layout_layout_weight
* @attr ref android.R.styleable#LinearLayout_Layout_layout_gravity
*/
diff --git a/core/java/android/widget/ListPopupWindow.java b/core/java/android/widget/ListPopupWindow.java
index 6a10743..0bde983 100644
--- a/core/java/android/widget/ListPopupWindow.java
+++ b/core/java/android/widget/ListPopupWindow.java
@@ -16,9 +16,6 @@
package android.widget;
-import com.android.internal.R;
-import com.android.internal.view.menu.ShowableListMenu;
-
import android.annotation.AttrRes;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -42,14 +39,17 @@
import android.view.WindowManager;
import android.widget.AdapterView.OnItemSelectedListener;
+import com.android.internal.R;
+import com.android.internal.view.menu.ShowableListMenu;
+
/**
* A ListPopupWindow anchors itself to a host view and displays a
* list of choices.
- *
+ *
* <p>ListPopupWindow contains a number of tricky behaviors surrounding
* positioning, scrolling parents to fit the dropdown, interacting
* sanely with the IME if present, and others.
- *
+ *
* @see android.widget.AutoCompleteTextView
* @see android.widget.Spinner
*/
@@ -116,7 +116,7 @@
/**
* The provided prompt view should appear above list content.
- *
+ *
* @see #setPromptPosition(int)
* @see #getPromptPosition()
* @see #setPromptView(View)
@@ -125,7 +125,7 @@
/**
* The provided prompt view should appear below list content.
- *
+ *
* @see #setPromptPosition(int)
* @see #getPromptPosition()
* @see #setPromptView(View)
@@ -138,13 +138,13 @@
* If used to specify a popup height, the popup will fill available space.
*/
public static final int MATCH_PARENT = ViewGroup.LayoutParams.MATCH_PARENT;
-
+
/**
* Alias for {@link ViewGroup.LayoutParams#WRAP_CONTENT}.
* If used to specify a popup width, the popup will use the width of its content.
*/
public static final int WRAP_CONTENT = ViewGroup.LayoutParams.WRAP_CONTENT;
-
+
/**
* Mode for {@link #setInputMethodMode(int)}: the requirements for the
* input method should be based on the focusability of the popup. That is
@@ -152,7 +152,7 @@
* it doesn't.
*/
public static final int INPUT_METHOD_FROM_FOCUSABLE = PopupWindow.INPUT_METHOD_FROM_FOCUSABLE;
-
+
/**
* Mode for {@link #setInputMethodMode(int)}: this popup always needs to
* work with an input method, regardless of whether it is focusable. This
@@ -160,7 +160,7 @@
* the input method while it is shown.
*/
public static final int INPUT_METHOD_NEEDED = PopupWindow.INPUT_METHOD_NEEDED;
-
+
/**
* Mode for {@link #setInputMethodMode(int)}: this popup never needs to
* work with an input method, regardless of whether it is focusable. This
@@ -172,7 +172,7 @@
/**
* Create a new, empty popup window capable of displaying items from a ListAdapter.
* Backgrounds should be set using {@link #setBackgroundDrawable(Drawable)}.
- *
+ *
* @param context Context used for contained views.
*/
public ListPopupWindow(@NonNull Context context) {
@@ -182,7 +182,7 @@
/**
* Create a new, empty popup window capable of displaying items from a ListAdapter.
* Backgrounds should be set using {@link #setBackgroundDrawable(Drawable)}.
- *
+ *
* @param context Context used for contained views.
* @param attrs Attributes from inflating parent views used to style the popup.
*/
@@ -193,7 +193,7 @@
/**
* Create a new, empty popup window capable of displaying items from a ListAdapter.
* Backgrounds should be set using {@link #setBackgroundDrawable(Drawable)}.
- *
+ *
* @param context Context used for contained views.
* @param attrs Attributes from inflating parent views used to style the popup.
* @param defStyleAttr Default style attribute to use for popup content.
@@ -206,7 +206,7 @@
/**
* Create a new, empty popup window capable of displaying items from a ListAdapter.
* Backgrounds should be set using {@link #setBackgroundDrawable(Drawable)}.
- *
+ *
* @param context Context used for contained views.
* @param attrs Attributes from inflating parent views used to style the popup.
* @param defStyleAttr Style attribute to read for default styling of popup content.
@@ -248,7 +248,7 @@
if (mAdapter != null) {
adapter.registerDataSetObserver(mObserver);
}
-
+
if (mDropDownList != null) {
mDropDownList.setAdapter(mAdapter);
}
@@ -257,9 +257,9 @@
/**
* Set where the optional prompt view should appear. The default is
* {@link #POSITION_PROMPT_ABOVE}.
- *
+ *
* @param position A position constant declaring where the prompt should be displayed.
- *
+ *
* @see #POSITION_PROMPT_ABOVE
* @see #POSITION_PROMPT_BELOW
*/
@@ -269,7 +269,7 @@
/**
* @return Where the optional prompt view should appear.
- *
+ *
* @see #POSITION_PROMPT_ABOVE
* @see #POSITION_PROMPT_BELOW
*/
@@ -279,11 +279,11 @@
/**
* Set whether this window should be modal when shown.
- *
+ *
* <p>If a popup window is modal, it will receive all touch and key input.
* If the user touches outside the popup window's content area the popup window
* will be dismissed.
- *
+ *
* @param modal {@code true} if the popup window should be modal, {@code false} otherwise.
*/
public void setModal(boolean modal) {
@@ -293,7 +293,7 @@
/**
* Returns whether the popup window will be modal when shown.
- *
+ *
* @return {@code true} if the popup window will be modal, {@code false} otherwise.
*/
public boolean isModal() {
@@ -304,7 +304,7 @@
* Forces outside touches to be ignored. Normally if {@link #isDropDownAlwaysVisible()} is
* false, we allow outside touch to dismiss the dropdown. If this is set to true, then we
* ignore outside touch even when the drop down is not set to always visible.
- *
+ *
* @hide Used only by AutoCompleteTextView to handle some internal special cases.
*/
public void setForceIgnoreOutsideTouch(boolean forceIgnoreOutsideTouch) {
@@ -361,7 +361,7 @@
/**
* Sets a drawable to use as the list item selector.
- *
+ *
* @param selector List selector drawable to use in the popup.
*/
public void setListSelector(Drawable selector) {
@@ -377,7 +377,7 @@
/**
* Sets a drawable to be the background for the popup window.
- *
+ *
* @param d A drawable to set as the background.
*/
public void setBackgroundDrawable(@Nullable Drawable d) {
@@ -386,7 +386,7 @@
/**
* Set an animation style to use when the popup window is shown or dismissed.
- *
+ *
* @param animationStyle Animation style to use.
*/
public void setAnimationStyle(@StyleRes int animationStyle) {
@@ -396,7 +396,7 @@
/**
* Returns the animation style that will be used when the popup window is
* shown or dismissed.
- *
+ *
* @return Animation style that will be used.
*/
public @StyleRes int getAnimationStyle() {
@@ -405,7 +405,7 @@
/**
* Returns the view that will be used to anchor this popup.
- *
+ *
* @return The popup's anchor view
*/
public @Nullable View getAnchorView() {
@@ -415,7 +415,7 @@
/**
* Sets the popup's anchor view. This popup will always be positioned relative to
* the anchor view when shown.
- *
+ *
* @param anchor The view to use as an anchor.
*/
public void setAnchorView(@Nullable View anchor) {
@@ -431,7 +431,7 @@
/**
* Set the horizontal offset of this popup from its anchor view in pixels.
- *
+ *
* @param offset The horizontal offset of the popup from its anchor.
*/
public void setHorizontalOffset(int offset) {
@@ -450,7 +450,7 @@
/**
* Set the vertical offset of this popup from its anchor view in pixels.
- *
+ *
* @param offset The vertical offset of the popup from its anchor.
*/
public void setVerticalOffset(int offset) {
@@ -489,7 +489,7 @@
/**
* Sets the width of the popup window in pixels. Can also be {@link #MATCH_PARENT}
* or {@link #WRAP_CONTENT}.
- *
+ *
* @param width Width of the popup window.
*/
public void setWidth(int width) {
@@ -521,7 +521,7 @@
/**
* Sets the height of the popup window in pixels. Can also be {@link #MATCH_PARENT}.
- *
+ *
* @param height Height of the popup window.
*/
public void setHeight(int height) {
@@ -543,9 +543,9 @@
/**
* Sets a listener to receive events when a list item is clicked.
- *
+ *
* @param clickListener Listener to register
- *
+ *
* @see ListView#setOnItemClickListener(android.widget.AdapterView.OnItemClickListener)
*/
public void setOnItemClickListener(@Nullable AdapterView.OnItemClickListener clickListener) {
@@ -554,9 +554,9 @@
/**
* Sets a listener to receive events when a list item is selected.
- *
+ *
* @param selectedListener Listener to register.
- *
+ *
* @see ListView#setOnItemSelectedListener(OnItemSelectedListener)
*/
public void setOnItemSelectedListener(@Nullable OnItemSelectedListener selectedListener) {
@@ -566,7 +566,7 @@
/**
* Set a view to act as a user prompt for this popup window. Where the prompt view will appear
* is controlled by {@link #setPromptPosition(int)}.
- *
+ *
* @param prompt View to use as an informational prompt.
*/
public void setPromptView(@Nullable View prompt) {
@@ -662,7 +662,7 @@
mPopup.setWidth(widthSpec);
mPopup.setHeight(heightSpec);
mPopup.setClipToScreenEnabled(true);
-
+
// use outside touchable to dismiss drop down when touching outside of it, so
// only set this if the dropdown is not always visible
mPopup.setOutsideTouchable(!mForceIgnoreOutsideTouch && !mDropDownAlwaysVisible);
@@ -671,7 +671,7 @@
mPopup.showAsDropDown(getAnchorView(), mDropDownHorizontalOffset,
mDropDownVerticalOffset, mDropDownGravity);
mDropDownList.setSelection(ListView.INVALID_POSITION);
-
+
if (!mModal || mDropDownList.isInTouchMode()) {
clearListSelection();
}
@@ -716,11 +716,11 @@
* Control how the popup operates with an input method: one of
* {@link #INPUT_METHOD_FROM_FOCUSABLE}, {@link #INPUT_METHOD_NEEDED},
* or {@link #INPUT_METHOD_NOT_NEEDED}.
- *
+ *
* <p>If the popup is showing, calling this method will take effect only
* the next time the popup is shown or through a manual call to the {@link #show()}
* method.</p>
- *
+ *
* @see #getInputMethodMode()
* @see #show()
*/
@@ -730,7 +730,7 @@
/**
* Return the current value in {@link #setInputMethodMode(int)}.
- *
+ *
* @see #setInputMethodMode(int)
*/
public int getInputMethodMode() {
@@ -740,7 +740,7 @@
/**
* Set the selected position of the list.
* Only valid when {@link #isShowing()} == {@code true}.
- *
+ *
* @param position List position to set as selected.
*/
public void setSelection(int position) {
@@ -786,7 +786,7 @@
/**
* Perform an item click operation on the specified list adapter position.
- *
+ *
* @param position Adapter position for performing the click
* @return true if the click action could be performed, false if not.
* (e.g. if the popup was not showing, this method would return false.)
@@ -817,7 +817,7 @@
/**
* @return The position of the currently selected item or {@link ListView#INVALID_POSITION}
* if {@link #isShowing()} == {@code false}.
- *
+ *
* @see ListView#getSelectedItemPosition()
*/
public int getSelectedItemPosition() {
@@ -830,7 +830,7 @@
/**
* @return The ID of the currently selected item or {@link ListView#INVALID_ROW_ID}
* if {@link #isShowing()} == {@code false}.
- *
+ *
* @see ListView#getSelectedItemId()
*/
public long getSelectedItemId() {
@@ -843,7 +843,7 @@
/**
* @return The View for the currently selected item or null if
* {@link #isShowing()} == {@code false}.
- *
+ *
* @see ListView#getSelectedView()
*/
public @Nullable View getSelectedView() {
@@ -904,7 +904,7 @@
final boolean below = !mPopup.isAboveAnchor();
final ListAdapter adapter = mAdapter;
-
+
boolean allEnabled;
int firstItem = Integer.MAX_VALUE;
int lastItem = Integer.MIN_VALUE;
@@ -914,9 +914,9 @@
firstItem = allEnabled ? 0 :
mDropDownList.lookForSelectablePosition(0, true);
lastItem = allEnabled ? adapter.getCount() - 1 :
- mDropDownList.lookForSelectablePosition(adapter.getCount() - 1, false);
+ mDropDownList.lookForSelectablePosition(adapter.getCount() - 1, false);
}
-
+
if ((below && keyCode == KeyEvent.KEYCODE_DPAD_UP && curIndex <= firstItem) ||
(!below && keyCode == KeyEvent.KEYCODE_DPAD_DOWN && curIndex >= lastItem)) {
// When the selection is at the top, we block the key
@@ -1132,18 +1132,18 @@
LinearLayout.LayoutParams hintParams = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, 0, 1.0f
);
-
+
switch (mPromptPosition) {
case POSITION_PROMPT_BELOW:
hintContainer.addView(dropDownView, hintParams);
hintContainer.addView(hintView);
break;
-
+
case POSITION_PROMPT_ABOVE:
hintContainer.addView(hintView);
hintContainer.addView(dropDownView, hintParams);
break;
-
+
default:
Log.e(TAG, "Invalid hint position " + mPromptPosition);
break;
@@ -1249,7 +1249,7 @@
show();
}
}
-
+
@Override
public void onInvalidated() {
dismiss();
@@ -1278,7 +1278,7 @@
final int action = event.getAction();
final int x = (int) event.getX();
final int y = (int) event.getY();
-
+
if (action == MotionEvent.ACTION_DOWN &&
mPopup != null && mPopup.isShowing() &&
(x >= 0 && x < mPopup.getWidth() && y >= 0 && y < mPopup.getHeight())) {
diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java
index b0f19d7..e88c7ef 100644
--- a/core/java/android/widget/ListView.java
+++ b/core/java/android/widget/ListView.java
@@ -16,11 +16,6 @@
package android.widget;
-import com.google.android.collect.Lists;
-
-import com.android.internal.R;
-import com.android.internal.util.Predicate;
-
import android.annotation.IdRes;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -53,6 +48,11 @@
import android.view.accessibility.AccessibilityNodeProvider;
import android.widget.RemoteViews.RemoteView;
+import com.android.internal.R;
+import com.android.internal.util.Predicate;
+
+import com.google.android.collect.Lists;
+
import java.util.ArrayList;
import java.util.List;
@@ -464,7 +464,7 @@
* data backing this list and for producing a view to represent an
* item in that data set.
*
- * @see #getAdapter()
+ * @see #getAdapter()
*/
@Override
public void setAdapter(ListAdapter adapter) {
@@ -1532,7 +1532,7 @@
adjustViewsUpOrDown();
}
} else if (lastPosition == mItemCount - 1) {
- adjustViewsUpOrDown();
+ adjustViewsUpOrDown();
}
}
}
@@ -1857,7 +1857,7 @@
&& focusLayoutRestoreView.getWindowToken() != null) {
focusLayoutRestoreView.dispatchFinishTemporaryDetach();
}
-
+
mLayoutMode = LAYOUT_NORMAL;
mDataChanged = false;
if (mPositionScrollAfterLayout != null) {
@@ -2109,7 +2109,7 @@
/**
* Makes the item at the supplied position selected.
- *
+ *
* @param position the position of the item to select
*/
@Override
@@ -2960,7 +2960,7 @@
if (startPos < firstPosition) {
startPos = firstPosition;
}
-
+
final int lastVisiblePos = getLastVisiblePosition();
final ListAdapter adapter = getAdapter();
for (int pos = startPos; pos <= lastVisiblePos; pos++) {
@@ -3129,7 +3129,7 @@
/**
* Determine the distance to the nearest edge of a view in a particular
* direction.
- *
+ *
* @param descendant A descendant of this list.
* @return The distance, or 0 if the nearest edge is already on screen.
*/
@@ -3386,7 +3386,7 @@
final int listBottom = mBottom - mTop - effectivePaddingBottom + mScrollY;
if (!mStackFromBottom) {
int bottom = 0;
-
+
// Draw top divider or header for overscroll
final int scrollY = mScrollY;
if (count > 0 && scrollY < 0) {
@@ -3483,7 +3483,7 @@
}
}
}
-
+
if (count > 0 && scrollY > 0) {
if (drawOverscrollFooter) {
final int absListBottom = mBottom;
@@ -3567,7 +3567,7 @@
public int getDividerHeight() {
return mDividerHeight;
}
-
+
/**
* Sets the height of the divider that will be drawn between each item in the list. Calling
* this will override the intrinsic height as set by {@link #setDivider(Drawable)}
@@ -3625,7 +3625,7 @@
public boolean areFooterDividersEnabled() {
return mFooterDividersEnabled;
}
-
+
/**
* Sets the drawable that will be drawn above all other list content.
* This area can become visible when the user overscrolls the list.
@@ -3878,10 +3878,10 @@
/**
* Returns the set of checked items ids. The result is only valid if the
* choice mode has not been set to {@link #CHOICE_MODE_NONE}.
- *
+ *
* @return A new array which contains the id of each checked item in the
* list.
- *
+ *
* @deprecated Use {@link #getCheckedItemIds()} instead.
*/
@Deprecated
diff --git a/core/java/android/widget/MenuItemHoverListener.java b/core/java/android/widget/MenuItemHoverListener.java
index 13f0e6a..835e4cd 100644
--- a/core/java/android/widget/MenuItemHoverListener.java
+++ b/core/java/android/widget/MenuItemHoverListener.java
@@ -1,10 +1,10 @@
package android.widget;
-import com.android.internal.view.menu.MenuBuilder;
-
import android.annotation.NonNull;
import android.view.MenuItem;
+import com.android.internal.view.menu.MenuBuilder;
+
/**
* An interface notified when a menu item is hovered. Useful for cases when hover should trigger
* some behavior at a higher level, like managing the opening and closing of submenus.
diff --git a/core/java/android/widget/NumberPicker.java b/core/java/android/widget/NumberPicker.java
index 72b2e31..662e640 100644
--- a/core/java/android/widget/NumberPicker.java
+++ b/core/java/android/widget/NumberPicker.java
@@ -16,8 +16,6 @@
package android.widget;
-import com.android.internal.R;
-
import android.annotation.CallSuper;
import android.annotation.IntDef;
import android.annotation.TestApi;
@@ -32,12 +30,10 @@
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
-import android.text.Editable;
import android.text.InputFilter;
import android.text.InputType;
import android.text.Spanned;
import android.text.TextUtils;
-import android.text.TextWatcher;
import android.text.method.NumberKeyListener;
import android.util.AttributeSet;
import android.util.SparseArray;
@@ -57,6 +53,10 @@
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
+import com.android.internal.R;
+
+import libcore.icu.LocaleData;
+
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
@@ -64,8 +64,6 @@
import java.util.List;
import java.util.Locale;
-import libcore.icu.LocaleData;
-
/**
* A widget that enables the user to select a number from a predefined range.
* There are two flavors of this widget and which one is presented to the user
diff --git a/core/java/android/widget/PopupMenu.java b/core/java/android/widget/PopupMenu.java
index 027f874..eb27533 100644
--- a/core/java/android/widget/PopupMenu.java
+++ b/core/java/android/widget/PopupMenu.java
@@ -16,11 +16,6 @@
package android.widget;
-import com.android.internal.R;
-import com.android.internal.view.menu.MenuBuilder;
-import com.android.internal.view.menu.MenuPopupHelper;
-import com.android.internal.view.menu.ShowableListMenu;
-
import android.annotation.MenuRes;
import android.content.Context;
import android.view.Gravity;
@@ -30,6 +25,11 @@
import android.view.View;
import android.view.View.OnTouchListener;
+import com.android.internal.R;
+import com.android.internal.view.menu.MenuBuilder;
+import com.android.internal.view.menu.MenuPopupHelper;
+import com.android.internal.view.menu.ShowableListMenu;
+
/**
* A PopupMenu displays a {@link Menu} in a modal popup window anchored to a
* {@link View}. The popup will appear below the anchor view if there is room,
diff --git a/core/java/android/widget/PopupWindow.java b/core/java/android/widget/PopupWindow.java
index 5e73a63..fc1520b 100644
--- a/core/java/android/widget/PopupWindow.java
+++ b/core/java/android/widget/PopupWindow.java
@@ -16,7 +16,11 @@
package android.widget;
-import com.android.internal.R;
+import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
+import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
+import static android.view.WindowManager.LayoutParams
+ .PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME;
+import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_WILL_NOT_REPLACE_ON_RELAUNCH;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -50,12 +54,9 @@
import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;
-import java.lang.ref.WeakReference;
+import com.android.internal.R;
-import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME;
-import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_WILL_NOT_REPLACE_ON_RELAUNCH;
-import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
-import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
+import java.lang.ref.WeakReference;
/**
* <p>
diff --git a/core/java/android/widget/ProgressBar.java b/core/java/android/widget/ProgressBar.java
index f9275f8..266ff75 100644
--- a/core/java/android/widget/ProgressBar.java
+++ b/core/java/android/widget/ProgressBar.java
@@ -22,9 +22,7 @@
import android.annotation.Nullable;
import android.content.Context;
import android.content.res.ColorStateList;
-import android.content.res.Resources;
import android.content.res.TypedArray;
-import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.PorterDuff;
import android.graphics.Rect;
@@ -60,6 +58,7 @@
import android.view.animation.LinearInterpolator;
import android.view.animation.Transformation;
import android.widget.RemoteViews.RemoteView;
+
import com.android.internal.R;
import java.util.ArrayList;
diff --git a/core/java/android/widget/QuickContactBadge.java b/core/java/android/widget/QuickContactBadge.java
index 8c15cde..8f6b0d5 100644
--- a/core/java/android/widget/QuickContactBadge.java
+++ b/core/java/android/widget/QuickContactBadge.java
@@ -16,8 +16,6 @@
package android.widget;
-import com.android.internal.R;
-
import android.content.AsyncQueryHandler;
import android.content.ContentResolver;
import android.content.Context;
@@ -38,6 +36,8 @@
import android.view.View;
import android.view.View.OnClickListener;
+import com.android.internal.R;
+
/**
* Widget used to show an image with the standard QuickContact badge
* and on-click behavior.
diff --git a/core/java/android/widget/RadialTimePickerView.java b/core/java/android/widget/RadialTimePickerView.java
index 5a0e1f9..757a4ca 100644
--- a/core/java/android/widget/RadialTimePickerView.java
+++ b/core/java/android/widget/RadialTimePickerView.java
@@ -16,10 +16,6 @@
package android.widget;
-import android.view.PointerIcon;
-import com.android.internal.R;
-import com.android.internal.widget.ExploreByTouchHelper;
-
import android.animation.ObjectAnimator;
import android.annotation.IntDef;
import android.content.Context;
@@ -43,11 +39,15 @@
import android.util.TypedValue;
import android.view.HapticFeedbackConstants;
import android.view.MotionEvent;
+import android.view.PointerIcon;
import android.view.View;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction;
+import com.android.internal.R;
+import com.android.internal.widget.ExploreByTouchHelper;
+
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Calendar;
diff --git a/core/java/android/widget/RadioGroup.java b/core/java/android/widget/RadioGroup.java
index 065feb8..54b57631 100644
--- a/core/java/android/widget/RadioGroup.java
+++ b/core/java/android/widget/RadioGroup.java
@@ -16,8 +16,6 @@
package android.widget;
-import com.android.internal.R;
-
import android.annotation.IdRes;
import android.content.Context;
import android.content.res.TypedArray;
@@ -25,6 +23,8 @@
import android.view.View;
import android.view.ViewGroup;
+import com.android.internal.R;
+
/**
* <p>This class is used to create a multiple-exclusion scope for a set of radio
@@ -39,14 +39,14 @@
* in the XML layout file.</p>
*
* <p><strong>XML Attributes</strong></p>
- * <p>See {@link android.R.styleable#RadioGroup RadioGroup Attributes},
+ * <p>See {@link android.R.styleable#RadioGroup RadioGroup Attributes},
* {@link android.R.styleable#LinearLayout LinearLayout Attributes},
* {@link android.R.styleable#ViewGroup ViewGroup Attributes},
* {@link android.R.styleable#View View Attributes}</p>
* <p>Also see
* {@link android.widget.LinearLayout.LayoutParams LinearLayout.LayoutParams}
* for layout attributes.</p>
- *
+ *
* @see RadioButton
*
*/
@@ -310,7 +310,7 @@
} else {
width = WRAP_CONTENT;
}
-
+
if (a.hasValue(heightAttr)) {
height = a.getLayoutDimension(heightAttr, "layout_height");
} else {
diff --git a/core/java/android/widget/RatingBar.java b/core/java/android/widget/RatingBar.java
index 62dd90f..3b7fe86 100644
--- a/core/java/android/widget/RatingBar.java
+++ b/core/java/android/widget/RatingBar.java
@@ -22,6 +22,7 @@
import android.graphics.drawable.shapes.Shape;
import android.util.AttributeSet;
import android.view.accessibility.AccessibilityNodeInfo;
+
import com.android.internal.R;
/**
diff --git a/core/java/android/widget/RelativeLayout.java b/core/java/android/widget/RelativeLayout.java
index a189d3c..b424101 100644
--- a/core/java/android/widget/RelativeLayout.java
+++ b/core/java/android/widget/RelativeLayout.java
@@ -16,20 +16,14 @@
package android.widget;
+import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1;
+
import android.annotation.NonNull;
-import android.util.ArrayMap;
-import com.android.internal.R;
-
-import java.util.ArrayDeque;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Rect;
import android.os.Build;
+import android.util.ArrayMap;
import android.util.AttributeSet;
import android.util.Pools.SynchronizedPool;
import android.util.SparseArray;
@@ -41,7 +35,13 @@
import android.view.accessibility.AccessibilityEvent;
import android.widget.RemoteViews.RemoteView;
-import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1;
+import com.android.internal.R;
+
+import java.util.ArrayDeque;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.SortedSet;
+import java.util.TreeSet;
/**
* A Layout where the positions of the children can be described in relation to each other or to the
@@ -209,7 +209,7 @@
private int mIgnoreGravity;
private SortedSet<View> mTopToBottomLeftToRightSet = null;
-
+
private boolean mDirtyHierarchy;
private View[] mSortedHorizontalChildren;
private View[] mSortedVerticalChildren;
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java
index 2a6e01f..6543d0c 100644
--- a/core/java/android/widget/RemoteViews.java
+++ b/core/java/android/widget/RemoteViews.java
@@ -59,11 +59,12 @@
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AdapterView.OnItemClickListener;
-import libcore.util.Objects;
import com.android.internal.R;
import com.android.internal.util.Preconditions;
+import libcore.util.Objects;
+
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
diff --git a/core/java/android/widget/RemoteViewsAdapter.java b/core/java/android/widget/RemoteViewsAdapter.java
index 10abbab..e0f94fd 100644
--- a/core/java/android/widget/RemoteViewsAdapter.java
+++ b/core/java/android/widget/RemoteViewsAdapter.java
@@ -16,13 +16,6 @@
package android.widget;
-import java.lang.ref.WeakReference;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-
import android.Manifest;
import android.appwidget.AppWidgetHostView;
import android.appwidget.AppWidgetManager;
@@ -48,6 +41,11 @@
import com.android.internal.widget.IRemoteViewsAdapterConnection;
import com.android.internal.widget.IRemoteViewsFactory;
+import java.lang.ref.WeakReference;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.LinkedList;
+
/**
* An adapter to a RemoteViewsService which fetches and caches RemoteViews
* to be later inflated as child views.
diff --git a/core/java/android/widget/RemoteViewsService.java b/core/java/android/widget/RemoteViewsService.java
index 07bd918..2827f63 100644
--- a/core/java/android/widget/RemoteViewsService.java
+++ b/core/java/android/widget/RemoteViewsService.java
@@ -16,14 +16,14 @@
package android.widget;
-import java.util.HashMap;
-
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import com.android.internal.widget.IRemoteViewsFactory;
+import java.util.HashMap;
+
/**
* The service to be connected to for a remote adapter to request RemoteViews. Users should
* extend the RemoteViewsService to provide the appropriate RemoteViewsFactory's used to
@@ -46,7 +46,7 @@
* An interface for an adapter between a remote collection view (ListView, GridView, etc) and
* the underlying data for that view. The implementor is responsible for making a RemoteView
* for each item in the data set. This interface is a thin wrapper around {@link Adapter}.
- *
+ *
* @see android.widget.Adapter
* @see android.appwidget.AppWidgetManager
*/
diff --git a/core/java/android/widget/ResourceCursorAdapter.java b/core/java/android/widget/ResourceCursorAdapter.java
index 100f919..9732bb1 100644
--- a/core/java/android/widget/ResourceCursorAdapter.java
+++ b/core/java/android/widget/ResourceCursorAdapter.java
@@ -20,9 +20,9 @@
import android.content.res.Resources;
import android.database.Cursor;
import android.view.ContextThemeWrapper;
+import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.view.LayoutInflater;
/**
@@ -148,7 +148,7 @@
public void setViewResource(int layout) {
mLayout = layout;
}
-
+
/**
* <p>Sets the layout resource of the drop down views.</p>
*
diff --git a/core/java/android/widget/ResourceCursorTreeAdapter.java b/core/java/android/widget/ResourceCursorTreeAdapter.java
index ddce515..0894dba 100644
--- a/core/java/android/widget/ResourceCursorTreeAdapter.java
+++ b/core/java/android/widget/ResourceCursorTreeAdapter.java
@@ -18,9 +18,9 @@
import android.content.Context;
import android.database.Cursor;
+import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.view.LayoutInflater;
/**
* A fairly simple ExpandableListAdapter that creates views defined in an XML
@@ -32,10 +32,10 @@
private int mChildLayout;
private int mLastChildLayout;
private LayoutInflater mInflater;
-
+
/**
* Constructor.
- *
+ *
* @param context The context where the ListView associated with this
* SimpleListItemFactory is running
* @param cursor The database cursor
@@ -51,18 +51,18 @@
public ResourceCursorTreeAdapter(Context context, Cursor cursor, int collapsedGroupLayout,
int expandedGroupLayout, int childLayout, int lastChildLayout) {
super(cursor, context);
-
+
mCollapsedGroupLayout = collapsedGroupLayout;
mExpandedGroupLayout = expandedGroupLayout;
mChildLayout = childLayout;
mLastChildLayout = lastChildLayout;
-
+
mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
/**
* Constructor.
- *
+ *
* @param context The context where the ListView associated with this
* SimpleListItemFactory is running
* @param cursor The database cursor
@@ -80,7 +80,7 @@
/**
* Constructor.
- *
+ *
* @param context The context where the ListView associated with this
* SimpleListItemFactory is running
* @param cursor The database cursor
@@ -93,7 +93,7 @@
int childLayout) {
this(context, cursor, groupLayout, groupLayout, childLayout, childLayout);
}
-
+
@Override
public View newChildView(Context context, Cursor cursor, boolean isLastChild,
ViewGroup parent) {
diff --git a/core/java/android/widget/ScrollBarDrawable.java b/core/java/android/widget/ScrollBarDrawable.java
index 11eab2a..2ae38c9 100644
--- a/core/java/android/widget/ScrollBarDrawable.java
+++ b/core/java/android/widget/ScrollBarDrawable.java
@@ -16,8 +16,6 @@
package android.widget;
-import com.android.internal.widget.ScrollBarUtils;
-
import android.annotation.NonNull;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
@@ -25,6 +23,8 @@
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
+import com.android.internal.widget.ScrollBarUtils;
+
/**
* This is only used by View for displaying its scroll bars. It should probably
* be moved in to the view package since it is used in that lower-level layer.
diff --git a/core/java/android/widget/ScrollView.java b/core/java/android/widget/ScrollView.java
index e696ff7..d8f3379 100644
--- a/core/java/android/widget/ScrollView.java
+++ b/core/java/android/widget/ScrollView.java
@@ -17,18 +17,16 @@
package android.widget;
import android.annotation.NonNull;
-import android.content.res.Configuration;
-import android.os.Build;
-import android.os.Build.VERSION_CODES;
-import android.os.Parcel;
-import android.os.Parcelable;
-import com.android.internal.R;
-
import android.content.Context;
+import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
+import android.os.Build;
+import android.os.Build.VERSION_CODES;
import android.os.Bundle;
+import android.os.Parcel;
+import android.os.Parcelable;
import android.os.StrictMode;
import android.util.AttributeSet;
import android.util.Log;
@@ -47,6 +45,8 @@
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.animation.AnimationUtils;
+import com.android.internal.R;
+
import java.util.List;
/**
diff --git a/core/java/android/widget/SimpleAdapter.java b/core/java/android/widget/SimpleAdapter.java
index 3bf9485..9190117 100644
--- a/core/java/android/widget/SimpleAdapter.java
+++ b/core/java/android/widget/SimpleAdapter.java
@@ -20,11 +20,11 @@
import android.annotation.LayoutRes;
import android.content.Context;
import android.content.res.Resources;
+import android.net.Uri;
import android.view.ContextThemeWrapper;
+import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.view.LayoutInflater;
-import android.net.Uri;
import java.util.ArrayList;
import java.util.List;
@@ -40,7 +40,7 @@
* Binding data to views occurs in two phases. First, if a
* {@link android.widget.SimpleAdapter.ViewBinder} is available,
* {@link ViewBinder#setViewValue(android.view.View, Object, String)}
- * is invoked. If the returned value is true, binding has occurred.
+ * is invoked. If the returned value is true, binding has occurred.
* If the returned value is false, the following views are then tried in order:
* <ul>
* <li> A view that implements Checkable (e.g. CheckBox). The expected bind value is a boolean.
@@ -223,7 +223,7 @@
setViewText((TextView) v, text);
} else if (v instanceof ImageView) {
if (data instanceof Integer) {
- setViewImage((ImageView) v, (Integer) data);
+ setViewImage((ImageView) v, (Integer) data);
} else {
setViewImage((ImageView) v, text);
}
@@ -291,7 +291,7 @@
* @param v ImageView to receive an image
* @param value the value retrieved from the data set
*
- * @see #setViewImage(ImageView, int)
+ * @see #setViewImage(ImageView, int)
*/
public void setViewImage(ImageView v, String value) {
try {
@@ -381,18 +381,18 @@
for (int i = 0; i < count; i++) {
Map<String, ?> h = unfilteredValues.get(i);
if (h != null) {
-
+
int len = mTo.length;
for (int j=0; j<len; j++) {
String str = (String)h.get(mFrom[j]);
-
+
String[] words = str.split(" ");
int wordCount = words.length;
-
+
for (int k = 0; k < wordCount; k++) {
String word = words[k];
-
+
if (word.toLowerCase().startsWith(prefixString)) {
newValues.add(h);
break;
diff --git a/core/java/android/widget/SimpleExpandableListAdapter.java b/core/java/android/widget/SimpleExpandableListAdapter.java
index 015c169..597502b 100644
--- a/core/java/android/widget/SimpleExpandableListAdapter.java
+++ b/core/java/android/widget/SimpleExpandableListAdapter.java
@@ -17,9 +17,9 @@
package android.widget;
import android.content.Context;
+import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.view.LayoutInflater;
import java.util.List;
import java.util.Map;
@@ -42,18 +42,18 @@
private int mCollapsedGroupLayout;
private String[] mGroupFrom;
private int[] mGroupTo;
-
+
private List<? extends List<? extends Map<String, ?>>> mChildData;
private int mChildLayout;
private int mLastChildLayout;
private String[] mChildFrom;
private int[] mChildTo;
-
+
private LayoutInflater mInflater;
-
+
/**
* Constructor
- *
+ *
* @param context The context where the {@link ExpandableListView}
* associated with this {@link SimpleExpandableListAdapter} is
* running
@@ -98,7 +98,7 @@
/**
* Constructor
- *
+ *
* @param context The context where the {@link ExpandableListView}
* associated with this {@link SimpleExpandableListAdapter} is
* running
@@ -147,7 +147,7 @@
/**
* Constructor
- *
+ *
* @param context The context where the {@link ExpandableListView}
* associated with this {@link SimpleExpandableListAdapter} is
* running
@@ -200,16 +200,16 @@
mCollapsedGroupLayout = collapsedGroupLayout;
mGroupFrom = groupFrom;
mGroupTo = groupTo;
-
+
mChildData = childData;
mChildLayout = childLayout;
mLastChildLayout = lastChildLayout;
mChildFrom = childFrom;
mChildTo = childTo;
-
+
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
-
+
public Object getChild(int groupPosition, int childPosition) {
return mChildData.get(groupPosition).get(childPosition);
}
@@ -239,7 +239,7 @@
public View newChildView(boolean isLastChild, ViewGroup parent) {
return mInflater.inflate((isLastChild) ? mLastChildLayout : mChildLayout, parent, false);
}
-
+
private void bindView(View view, Map<String, ?> data, String[] from, int[] to) {
int len = to.length;
diff --git a/core/java/android/widget/SimpleMonthView.java b/core/java/android/widget/SimpleMonthView.java
index 8c43782..855d1d2 100644
--- a/core/java/android/widget/SimpleMonthView.java
+++ b/core/java/android/widget/SimpleMonthView.java
@@ -16,10 +16,6 @@
package android.widget;
-import android.view.PointerIcon;
-import com.android.internal.R;
-import com.android.internal.widget.ExploreByTouchHelper;
-
import android.annotation.Nullable;
import android.content.Context;
import android.content.res.ColorStateList;
@@ -43,17 +39,21 @@
import android.util.StateSet;
import android.view.KeyEvent;
import android.view.MotionEvent;
+import android.view.PointerIcon;
import android.view.View;
import android.view.ViewParent;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction;
-import java.text.NumberFormat;
-import java.util.Locale;
+import com.android.internal.R;
+import com.android.internal.widget.ExploreByTouchHelper;
import libcore.icu.LocaleData;
+import java.text.NumberFormat;
+import java.util.Locale;
+
/**
* A calendar-like view displaying a specified month and the appropriate selectable day numbers
* within the specified month.
diff --git a/core/java/android/widget/Spinner.java b/core/java/android/widget/Spinner.java
index dc5e5a2..28cc693 100644
--- a/core/java/android/widget/Spinner.java
+++ b/core/java/android/widget/Spinner.java
@@ -16,13 +16,9 @@
package android.widget;
-import android.annotation.TestApi;
-import android.view.PointerIcon;
-import com.android.internal.R;
-import com.android.internal.view.menu.ShowableListMenu;
-
import android.annotation.DrawableRes;
import android.annotation.Nullable;
+import android.annotation.TestApi;
import android.annotation.Widget;
import android.app.AlertDialog;
import android.content.Context;
@@ -42,6 +38,7 @@
import android.view.ContextThemeWrapper;
import android.view.Gravity;
import android.view.MotionEvent;
+import android.view.PointerIcon;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
@@ -49,6 +46,9 @@
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.PopupWindow.OnDismissListener;
+import com.android.internal.R;
+import com.android.internal.view.menu.ShowableListMenu;
+
/**
* A view that displays one child at a time and lets the user pick among them.
* The items in the Spinner come from the {@link Adapter} associated with
@@ -123,7 +123,7 @@
* access the current theme, resources, etc.
* @param mode Constant describing how the user will select choices from
* the spinner.
- *
+ *
* @see #MODE_DIALOG
* @see #MODE_DROPDOWN
*/
@@ -563,7 +563,7 @@
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
-
+
if (mPopup != null && mPopup.isShowing()) {
mPopup.dismiss();
}
@@ -772,7 +772,7 @@
@Override
public boolean performClick() {
boolean handled = super.performClick();
-
+
if (!handled) {
handled = true;
@@ -1011,7 +1011,7 @@
/**
* If the wrapped SpinnerAdapter is also a ListAdapter, delegate this call.
- * Otherwise, return true.
+ * Otherwise, return true.
*/
public boolean areAllItemsEnabled() {
final ListAdapter adapter = mListAdapter;
@@ -1042,19 +1042,19 @@
public int getViewTypeCount() {
return 1;
}
-
+
public boolean isEmpty() {
return getCount() == 0;
}
}
-
+
/**
* Implements some sort of popup selection interface for selecting a spinner option.
* Allows for different spinner modes.
*/
private interface SpinnerPopup {
public void setAdapter(ListAdapter adapter);
-
+
/**
* Show the popup
*/
@@ -1064,12 +1064,12 @@
* Dismiss the popup
*/
public void dismiss();
-
+
/**
* @return true if the popup is showing, false otherwise.
*/
public boolean isShowing();
-
+
/**
* Set hint text to be displayed to the user. This should provide
* a description of the choice being made.
@@ -1129,7 +1129,7 @@
listView.setTextAlignment(textAlignment);
mPopup.show();
}
-
+
public void onClick(DialogInterface dialog, int which) {
setSelection(which);
if (mOnItemClickListener != null) {
@@ -1168,7 +1168,7 @@
return 0;
}
}
-
+
private class DropdownPopup extends ListPopupWindow implements SpinnerPopup {
private CharSequence mHintText;
private ListAdapter mAdapter;
@@ -1190,7 +1190,7 @@
}
});
}
-
+
@Override
public void setAdapter(ListAdapter adapter) {
super.setAdapter(adapter);
@@ -1200,7 +1200,7 @@
public CharSequence getHintText() {
return mHintText;
}
-
+
public void setPromptText(CharSequence hintText) {
// Hint text is ignored for dropdowns, but maintain it here.
mHintText = hintText;
diff --git a/core/java/android/widget/StackView.java b/core/java/android/widget/StackView.java
index 2bd3143..0e99c02 100644
--- a/core/java/android/widget/StackView.java
+++ b/core/java/android/widget/StackView.java
@@ -15,8 +15,6 @@
package android.widget;
-import java.lang.ref.WeakReference;
-
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.content.Context;
@@ -45,6 +43,8 @@
import android.view.animation.LinearInterpolator;
import android.widget.RemoteViews.RemoteView;
+import java.lang.ref.WeakReference;
+
@RemoteView
/**
* A view that displays its children in a stack and allows users to discretely swipe
@@ -670,12 +670,12 @@
activeIndex = (swipeGestureType == GESTURE_SLIDE_DOWN) ? 1 : 0;
}
- boolean endOfStack = mLoopViews && adapterCount == 1 &&
- ((mStackMode == ITEMS_SLIDE_UP && swipeGestureType == GESTURE_SLIDE_UP) ||
- (mStackMode == ITEMS_SLIDE_DOWN && swipeGestureType == GESTURE_SLIDE_DOWN));
- boolean beginningOfStack = mLoopViews && adapterCount == 1 &&
- ((mStackMode == ITEMS_SLIDE_DOWN && swipeGestureType == GESTURE_SLIDE_UP) ||
- (mStackMode == ITEMS_SLIDE_UP && swipeGestureType == GESTURE_SLIDE_DOWN));
+ boolean endOfStack = mLoopViews && adapterCount == 1
+ && ((mStackMode == ITEMS_SLIDE_UP && swipeGestureType == GESTURE_SLIDE_UP)
+ || (mStackMode == ITEMS_SLIDE_DOWN && swipeGestureType == GESTURE_SLIDE_DOWN));
+ boolean beginningOfStack = mLoopViews && adapterCount == 1
+ && ((mStackMode == ITEMS_SLIDE_DOWN && swipeGestureType == GESTURE_SLIDE_UP)
+ || (mStackMode == ITEMS_SLIDE_UP && swipeGestureType == GESTURE_SLIDE_DOWN));
int stackMode;
if (mLoopViews && !beginningOfStack && !endOfStack) {
diff --git a/core/java/android/widget/SuggestionsAdapter.java b/core/java/android/widget/SuggestionsAdapter.java
index aad0625..f833d1b 100644
--- a/core/java/android/widget/SuggestionsAdapter.java
+++ b/core/java/android/widget/SuggestionsAdapter.java
@@ -21,8 +21,8 @@
import android.app.SearchableInfo;
import android.content.ComponentName;
import android.content.ContentResolver;
-import android.content.Context;
import android.content.ContentResolver.OpenResourceIdResult;
+import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
@@ -39,8 +39,8 @@
import android.util.Log;
import android.util.TypedValue;
import android.view.View;
-import android.view.ViewGroup;
import android.view.View.OnClickListener;
+import android.view.ViewGroup;
import com.android.internal.R;
@@ -111,7 +111,7 @@
mProviderContext = mSearchable.getProviderContext(mContext, activityContext);
mOutsideDrawablesCache = outsideDrawablesCache;
-
+
// mStartSpinnerRunnable = new Runnable() {
// public void run() {
// // mSearchView.setWorking(true); // TODO:
diff --git a/core/java/android/widget/Switch.java b/core/java/android/widget/Switch.java
index d51c5be..fcc1667 100644
--- a/core/java/android/widget/Switch.java
+++ b/core/java/android/widget/Switch.java
@@ -30,8 +30,8 @@
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.Rect;
-import android.graphics.Typeface;
import android.graphics.Region.Op;
+import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.text.Layout;
import android.text.StaticLayout;
@@ -46,8 +46,8 @@
import android.view.MotionEvent;
import android.view.SoundEffectConstants;
import android.view.VelocityTracker;
-import android.view.ViewStructure;
import android.view.ViewConfiguration;
+import android.view.ViewStructure;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
diff --git a/core/java/android/widget/TabHost.java b/core/java/android/widget/TabHost.java
index 583f037..32418cd 100644
--- a/core/java/android/widget/TabHost.java
+++ b/core/java/android/widget/TabHost.java
@@ -16,8 +16,6 @@
package android.widget;
-import com.android.internal.R;
-
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.LocalActivityManager;
@@ -35,6 +33,9 @@
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.Window;
+
+import com.android.internal.R;
+
import java.util.ArrayList;
import java.util.List;
diff --git a/core/java/android/widget/TabWidget.java b/core/java/android/widget/TabWidget.java
index 1f0cb7c..05f7c0a 100644
--- a/core/java/android/widget/TabWidget.java
+++ b/core/java/android/widget/TabWidget.java
@@ -16,10 +16,6 @@
package android.widget;
-import android.view.MotionEvent;
-import android.view.PointerIcon;
-import com.android.internal.R;
-
import android.annotation.DrawableRes;
import android.annotation.Nullable;
import android.content.Context;
@@ -29,11 +25,15 @@
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.AttributeSet;
+import android.view.MotionEvent;
+import android.view.PointerIcon;
import android.view.View;
import android.view.View.OnFocusChangeListener;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
+import com.android.internal.R;
+
/**
*
* Displays a list of tab labels representing each page in the parent's tab
diff --git a/core/java/android/widget/TableLayout.java b/core/java/android/widget/TableLayout.java
index eed3c2d..8bb4d16 100644
--- a/core/java/android/widget/TableLayout.java
+++ b/core/java/android/widget/TableLayout.java
@@ -16,14 +16,15 @@
package android.widget;
-import com.android.internal.R;
-
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.util.SparseBooleanArray;
import android.view.View;
import android.view.ViewGroup;
+
+import com.android.internal.R;
+
import java.util.regex.Pattern;
/**
diff --git a/core/java/android/widget/TextClock.java b/core/java/android/widget/TextClock.java
index 5003c61..a6a9db4 100644
--- a/core/java/android/widget/TextClock.java
+++ b/core/java/android/widget/TextClock.java
@@ -16,6 +16,9 @@
package android.widget;
+import static android.view.ViewDebug.ExportedProperty;
+import static android.widget.RemoteViews.RemoteView;
+
import android.annotation.NonNull;
import android.app.ActivityManager;
import android.content.BroadcastReceiver;
@@ -37,13 +40,10 @@
import com.android.internal.R;
-import java.util.Calendar;
-import java.util.TimeZone;
-
import libcore.icu.LocaleData;
-import static android.view.ViewDebug.ExportedProperty;
-import static android.widget.RemoteViews.*;
+import java.util.Calendar;
+import java.util.TimeZone;
/**
* <p><code>TextClock</code> can display the current date and/or time as
diff --git a/core/java/android/widget/TimePicker.java b/core/java/android/widget/TimePicker.java
index 6a76c5b..e6cd798 100644
--- a/core/java/android/widget/TimePicker.java
+++ b/core/java/android/widget/TimePicker.java
@@ -16,8 +16,6 @@
package android.widget;
-import com.android.internal.R;
-
import android.annotation.IntDef;
import android.annotation.IntRange;
import android.annotation.NonNull;
@@ -32,12 +30,14 @@
import android.view.View;
import android.view.accessibility.AccessibilityEvent;
+import com.android.internal.R;
+
+import libcore.icu.LocaleData;
+
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Locale;
-import libcore.icu.LocaleData;
-
/**
* A widget for selecting the time of day, in either 24-hour or AM/PM mode.
* <p>
diff --git a/core/java/android/widget/TimePickerSpinnerDelegate.java b/core/java/android/widget/TimePickerSpinnerDelegate.java
index 26e1564..6a68f60 100644
--- a/core/java/android/widget/TimePickerSpinnerDelegate.java
+++ b/core/java/android/widget/TimePickerSpinnerDelegate.java
@@ -16,6 +16,9 @@
package android.widget;
+import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_AUTO;
+import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_YES;
+
import android.annotation.TestApi;
import android.content.Context;
import android.content.res.TypedArray;
@@ -29,14 +32,12 @@
import android.view.accessibility.AccessibilityEvent;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
-import com.android.internal.R;
-import java.util.Calendar;
+import com.android.internal.R;
import libcore.icu.LocaleData;
-import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_AUTO;
-import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_YES;
+import java.util.Calendar;
/**
* A delegate implementing the basic spinner-based TimePicker.
diff --git a/core/java/android/widget/TwoLineListItem.java b/core/java/android/widget/TwoLineListItem.java
index 69ff488..0445ebd 100644
--- a/core/java/android/widget/TwoLineListItem.java
+++ b/core/java/android/widget/TwoLineListItem.java
@@ -20,22 +20,21 @@
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
-import android.widget.RelativeLayout;
/**
- * <p>A view group with two children, intended for use in ListViews. This item has two
- * {@link android.widget.TextView TextViews} elements (or subclasses) with the ID values
+ * <p>A view group with two children, intended for use in ListViews. This item has two
+ * {@link android.widget.TextView TextViews} elements (or subclasses) with the ID values
* {@link android.R.id#text1 text1}
- * and {@link android.R.id#text2 text2}. There is an optional third View element with the
- * ID {@link android.R.id#selectedIcon selectedIcon}, which can be any View subclass
+ * and {@link android.R.id#text2 text2}. There is an optional third View element with the
+ * ID {@link android.R.id#selectedIcon selectedIcon}, which can be any View subclass
* (though it is typically a graphic View, such as {@link android.widget.ImageView ImageView})
- * that can be displayed when a TwoLineListItem has focus. Android supplies a
- * {@link android.R.layout#two_line_list_item standard layout resource for TwoLineListView}
+ * that can be displayed when a TwoLineListItem has focus. Android supplies a
+ * {@link android.R.layout#two_line_list_item standard layout resource for TwoLineListView}
* (which does not include a selected item icon), but you can design your own custom XML
* layout for this object.
- *
+ *
* @attr ref android.R.styleable#TwoLineListItem_mode
- *
+ *
* @deprecated This class can be implemented easily by apps using a {@link RelativeLayout}
* or a {@link LinearLayout}.
*/
@@ -51,7 +50,7 @@
}
public TwoLineListItem(Context context, AttributeSet attrs) {
- this(context, attrs, 0);
+ this(context, attrs, 0);
}
public TwoLineListItem(Context context, AttributeSet attrs, int defStyleAttr) {
@@ -70,11 +69,11 @@
@Override
protected void onFinishInflate() {
super.onFinishInflate();
-
+
mText1 = (TextView) findViewById(com.android.internal.R.id.text1);
mText2 = (TextView) findViewById(com.android.internal.R.id.text2);
}
-
+
/**
* Returns a handle to the item with ID text1.
* @return A handle to the item with ID text1.
@@ -82,7 +81,7 @@
public TextView getText1() {
return mText1;
}
-
+
/**
* Returns a handle to the item with ID text2.
* @return A handle to the item with ID text2.
diff --git a/core/java/android/widget/ViewFlipper.java b/core/java/android/widget/ViewFlipper.java
index 65af7aa..e769d71 100644
--- a/core/java/android/widget/ViewFlipper.java
+++ b/core/java/android/widget/ViewFlipper.java
@@ -21,7 +21,7 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.TypedArray;
-import android.os.*;
+import android.os.Message;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.RemoteViews.RemoteView;
diff --git a/core/java/android/widget/YearPickerView.java b/core/java/android/widget/YearPickerView.java
index a3f5a67..824fec8 100644
--- a/core/java/android/widget/YearPickerView.java
+++ b/core/java/android/widget/YearPickerView.java
@@ -16,8 +16,6 @@
package android.widget;
-import com.android.internal.R;
-
import android.content.Context;
import android.content.res.Resources;
import android.icu.util.Calendar;
@@ -27,6 +25,8 @@
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
+import com.android.internal.R;
+
/**
* Displays a selectable list of years.
*/
diff --git a/core/java/android/widget/ZoomButtonsController.java b/core/java/android/widget/ZoomButtonsController.java
index fb912a4..69b79971 100644
--- a/core/java/android/widget/ZoomButtonsController.java
+++ b/core/java/android/widget/ZoomButtonsController.java
@@ -30,11 +30,11 @@
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
+import android.view.View.OnClickListener;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.ViewRootImpl;
import android.view.WindowManager;
-import android.view.View.OnClickListener;
import android.view.WindowManager.LayoutParams;
/*