Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2add9bcf authored by Alan Viverette's avatar Alan Viverette
Browse files

API review feedback for ThemedSpinnerAdapter, Spinner

Moves themed interface out of Spinner and extends SpinnerAdapter, updates
Spinner constructor to take a Theme rather than a Context.

Does NOT change BaseAdapter to implement ThemedSpinnerAdapter, because
the BaseAdapter class does not have any notion of layout inflation and
that would break the contract implied by ThemedSpinnerAdapter.

Bug: 21571899
Change-Id: Id7e8d630458857ce6c93a6a8b8f920e169ee1152
parent 54310008
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -39614,7 +39614,7 @@ package android.widget {
    ctor public AnalogClock(android.content.Context, android.util.AttributeSet, int, int);
  }
  public class ArrayAdapter extends android.widget.BaseAdapter implements android.widget.Filterable android.widget.Spinner.ThemedSpinnerAdapter {
  public class ArrayAdapter extends android.widget.BaseAdapter implements android.widget.Filterable android.widget.ThemedSpinnerAdapter {
    ctor public ArrayAdapter(android.content.Context, int);
    ctor public ArrayAdapter(android.content.Context, int, int);
    ctor public ArrayAdapter(android.content.Context, int, T[]);
@@ -39855,7 +39855,7 @@ package android.widget {
    method public abstract void onCheckedChanged(android.widget.CompoundButton, boolean);
  }
  public abstract class CursorAdapter extends android.widget.BaseAdapter implements android.widget.Filterable android.widget.Spinner.ThemedSpinnerAdapter {
  public abstract class CursorAdapter extends android.widget.BaseAdapter implements android.widget.Filterable android.widget.ThemedSpinnerAdapter {
    ctor public deprecated CursorAdapter(android.content.Context, android.database.Cursor);
    ctor public CursorAdapter(android.content.Context, android.database.Cursor, boolean);
    ctor public CursorAdapter(android.content.Context, android.database.Cursor, int);
@@ -41120,7 +41120,7 @@ package android.widget {
    method public abstract boolean onShareTargetSelected(android.widget.ShareActionProvider, android.content.Intent);
  }
  public class SimpleAdapter extends android.widget.BaseAdapter implements android.widget.Filterable android.widget.Spinner.ThemedSpinnerAdapter {
  public class SimpleAdapter extends android.widget.BaseAdapter implements android.widget.Filterable android.widget.ThemedSpinnerAdapter {
    ctor public SimpleAdapter(android.content.Context, java.util.List<? extends java.util.Map<java.lang.String, ?>>, int, java.lang.String[], int[]);
    method public int getCount();
    method public android.content.res.Resources.Theme getDropDownViewTheme();
@@ -41249,7 +41249,7 @@ package android.widget {
    ctor public Spinner(android.content.Context, android.util.AttributeSet, int);
    ctor public Spinner(android.content.Context, android.util.AttributeSet, int, int);
    ctor public Spinner(android.content.Context, android.util.AttributeSet, int, int, int);
    ctor public Spinner(android.content.Context, android.util.AttributeSet, int, int, int, android.content.Context);
    ctor public Spinner(android.content.Context, android.util.AttributeSet, int, int, int, android.content.res.Resources.Theme);
    method public int getDropDownHorizontalOffset();
    method public int getDropDownVerticalOffset();
    method public int getDropDownWidth();
@@ -41270,11 +41270,6 @@ package android.widget {
    field public static final int MODE_DROPDOWN = 1; // 0x1
  }
  public static abstract interface Spinner.ThemedSpinnerAdapter {
    method public abstract android.content.res.Resources.Theme getDropDownViewTheme();
    method public abstract void setDropDownViewTheme(android.content.res.Resources.Theme);
  }
  public abstract interface SpinnerAdapter implements android.widget.Adapter {
    method public abstract android.view.View getDropDownView(int, android.view.View, android.view.ViewGroup);
  }
@@ -41676,6 +41671,11 @@ package android.widget {
    field public static final android.os.Parcelable.Creator<android.widget.TextView.SavedState> CREATOR;
  }
  public abstract interface ThemedSpinnerAdapter implements android.widget.SpinnerAdapter {
    method public abstract android.content.res.Resources.Theme getDropDownViewTheme();
    method public abstract void setDropDownViewTheme(android.content.res.Resources.Theme);
  }
  public class TimePicker extends android.widget.FrameLayout {
    ctor public TimePicker(android.content.Context);
    ctor public TimePicker(android.content.Context, android.util.AttributeSet);
+9 −9
Original line number Diff line number Diff line
@@ -42186,7 +42186,7 @@ package android.widget {
    ctor public AnalogClock(android.content.Context, android.util.AttributeSet, int, int);
  }
  public class ArrayAdapter extends android.widget.BaseAdapter implements android.widget.Filterable android.widget.Spinner.ThemedSpinnerAdapter {
  public class ArrayAdapter extends android.widget.BaseAdapter implements android.widget.Filterable android.widget.ThemedSpinnerAdapter {
    ctor public ArrayAdapter(android.content.Context, int);
    ctor public ArrayAdapter(android.content.Context, int, int);
    ctor public ArrayAdapter(android.content.Context, int, T[]);
@@ -42427,7 +42427,7 @@ package android.widget {
    method public abstract void onCheckedChanged(android.widget.CompoundButton, boolean);
  }
  public abstract class CursorAdapter extends android.widget.BaseAdapter implements android.widget.Filterable android.widget.Spinner.ThemedSpinnerAdapter {
  public abstract class CursorAdapter extends android.widget.BaseAdapter implements android.widget.Filterable android.widget.ThemedSpinnerAdapter {
    ctor public deprecated CursorAdapter(android.content.Context, android.database.Cursor);
    ctor public CursorAdapter(android.content.Context, android.database.Cursor, boolean);
    ctor public CursorAdapter(android.content.Context, android.database.Cursor, int);
@@ -43692,7 +43692,7 @@ package android.widget {
    method public abstract boolean onShareTargetSelected(android.widget.ShareActionProvider, android.content.Intent);
  }
  public class SimpleAdapter extends android.widget.BaseAdapter implements android.widget.Filterable android.widget.Spinner.ThemedSpinnerAdapter {
  public class SimpleAdapter extends android.widget.BaseAdapter implements android.widget.Filterable android.widget.ThemedSpinnerAdapter {
    ctor public SimpleAdapter(android.content.Context, java.util.List<? extends java.util.Map<java.lang.String, ?>>, int, java.lang.String[], int[]);
    method public int getCount();
    method public android.content.res.Resources.Theme getDropDownViewTheme();
@@ -43821,7 +43821,7 @@ package android.widget {
    ctor public Spinner(android.content.Context, android.util.AttributeSet, int);
    ctor public Spinner(android.content.Context, android.util.AttributeSet, int, int);
    ctor public Spinner(android.content.Context, android.util.AttributeSet, int, int, int);
    ctor public Spinner(android.content.Context, android.util.AttributeSet, int, int, int, android.content.Context);
    ctor public Spinner(android.content.Context, android.util.AttributeSet, int, int, int, android.content.res.Resources.Theme);
    method public int getDropDownHorizontalOffset();
    method public int getDropDownVerticalOffset();
    method public int getDropDownWidth();
@@ -43842,11 +43842,6 @@ package android.widget {
    field public static final int MODE_DROPDOWN = 1; // 0x1
  }
  public static abstract interface Spinner.ThemedSpinnerAdapter {
    method public abstract android.content.res.Resources.Theme getDropDownViewTheme();
    method public abstract void setDropDownViewTheme(android.content.res.Resources.Theme);
  }
  public abstract interface SpinnerAdapter implements android.widget.Adapter {
    method public abstract android.view.View getDropDownView(int, android.view.View, android.view.ViewGroup);
  }
@@ -44248,6 +44243,11 @@ package android.widget {
    field public static final android.os.Parcelable.Creator<android.widget.TextView.SavedState> CREATOR;
  }
  public abstract interface ThemedSpinnerAdapter implements android.widget.SpinnerAdapter {
    method public abstract android.content.res.Resources.Theme getDropDownViewTheme();
    method public abstract void setDropDownViewTheme(android.content.res.Resources.Theme);
  }
  public class TimePicker extends android.widget.FrameLayout {
    ctor public TimePicker(android.content.Context);
    ctor public TimePicker(android.content.Context, android.util.AttributeSet);
+1 −2
Original line number Diff line number Diff line
@@ -50,8 +50,7 @@ import java.util.List;
 * or to have some of data besides toString() results fill the views,
 * override {@link #getView(int, View, ViewGroup)} to return the type of view you want.
 */
public class ArrayAdapter<T> extends BaseAdapter implements Filterable,
        Spinner.ThemedSpinnerAdapter {
public class ArrayAdapter<T> extends BaseAdapter implements Filterable, ThemedSpinnerAdapter {
    /**
     * Contains the list of objects that represent the data of this ArrayAdapter.
     * The content of this list is referred to as "the array" in the documentation.
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ import android.view.ViewGroup;
 * columns.
 */
public abstract class CursorAdapter extends BaseAdapter implements Filterable,
        CursorFilter.CursorFilterClient, Spinner.ThemedSpinnerAdapter {
        CursorFilter.CursorFilterClient, ThemedSpinnerAdapter {
    /**
     * This field should be made private, so it is hidden from the SDK.
     * {@hide}
+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ import java.util.Map;
 * </ul>
 * If no appropriate binding can be found, an {@link IllegalStateException} is thrown.
 */
public class SimpleAdapter extends BaseAdapter implements Filterable, Spinner.ThemedSpinnerAdapter {
public class SimpleAdapter extends BaseAdapter implements Filterable, ThemedSpinnerAdapter {
    private int[] mTo;
    private String[] mFrom;
    private ViewBinder mViewBinder;
Loading