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

Commit a5dd37cd authored by Amith Yamasani's avatar Amith Yamasani Committed by Android Git Automerger
Browse files

am 7a4be122: Merge "Add some missing getters for XML/Java API consistency." into jb-dev

* commit '7a4be122':
  Add some missing getters for XML/Java API consistency.
parents d09fab85 7a4be122
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -27983,7 +27983,11 @@ package android.widget {
  public class SearchView extends android.widget.LinearLayout implements android.view.CollapsibleActionView {
    ctor public SearchView(android.content.Context);
    ctor public SearchView(android.content.Context, android.util.AttributeSet);
    method public int getImeOptions();
    method public int getInputType();
    method public int getMaxWidth();
    method public java.lang.CharSequence getQuery();
    method public java.lang.CharSequence getQueryHint();
    method public android.widget.CursorAdapter getSuggestionsAdapter();
    method public boolean isIconfiedByDefault();
    method public boolean isIconified();
+50 −0
Original line number Diff line number Diff line
@@ -380,6 +380,17 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
        mQueryTextView.setImeOptions(imeOptions);
    }

    /**
     * Returns the IME options set on the query text field.
     * @return the ime options
     * @see TextView#setImeOptions(int)
     *
     * @attr ref android.R.styleable#SearchView_imeOptions
     */
    public int getImeOptions() {
        return mQueryTextView.getImeOptions();
    }

    /**
     * Sets the input type on the query text field.
     *
@@ -392,6 +403,16 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
        mQueryTextView.setInputType(inputType);
    }

    /**
     * Returns the input type set on the query text field.
     * @return the input type
     *
     * @attr ref android.R.styleable#SearchView_inputType
     */
    public int getInputType() {
        return mQueryTextView.getInputType();
    }

    /** @hide */
    @Override
    public boolean requestFocus(int direction, Rect previouslyFocusedRect) {
@@ -513,6 +534,26 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
        updateQueryHint();
    }

    /**
     * Gets the hint text to display in the query text field.
     * @return the query hint text, if specified, null otherwise.
     *
     * @attr ref android.R.styleable#SearchView_queryHint
     */
    public CharSequence getQueryHint() {
        if (mQueryHint != null) {
            return mQueryHint;
        } else if (mSearchable != null) {
            CharSequence hint = null;
            int hintId = mSearchable.getHintId();
            if (hintId != 0) {
                hint = getContext().getString(hintId);
            }
            return hint;
        }
        return null;
    }

    /**
     * Sets the default or resting state of the search field. If true, a single search icon is
     * shown by default and expands to show the text field and other buttons when pressed. Also,
@@ -651,6 +692,15 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
        requestLayout();
    }

    /**
     * Gets the specified maximum width in pixels, if set. Returns zero if
     * no maximum width was specified.
     * @return the maximum width of the view
     */
    public int getMaxWidth() {
        return mMaxWidth;
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        // Let the standard measurements take effect in iconified state.