@@ -380,6 +380,17 @@ public void setImeOptions(int imeOptions) {
380380 mQueryTextView .setImeOptions (imeOptions );
381381 }
382382
383+ /**
384+ * Returns the IME options set on the query text field.
385+ * @return the ime options
386+ * @see TextView#setImeOptions(int)
387+ *
388+ * @attr ref android.R.styleable#SearchView_imeOptions
389+ */
390+ public int getImeOptions () {
391+ return mQueryTextView .getImeOptions ();
392+ }
393+
383394 /**
384395 * Sets the input type on the query text field.
385396 *
@@ -392,6 +403,16 @@ public void setInputType(int inputType) {
392403 mQueryTextView .setInputType (inputType );
393404 }
394405
406+ /**
407+ * Returns the input type set on the query text field.
408+ * @return the input type
409+ *
410+ * @attr ref android.R.styleable#SearchView_inputType
411+ */
412+ public int getInputType () {
413+ return mQueryTextView .getInputType ();
414+ }
415+
395416 /** @hide */
396417 @ Override
397418 public boolean requestFocus (int direction , Rect previouslyFocusedRect ) {
@@ -513,6 +534,26 @@ public void setQueryHint(CharSequence hint) {
513534 updateQueryHint ();
514535 }
515536
537+ /**
538+ * Gets the hint text to display in the query text field.
539+ * @return the query hint text, if specified, null otherwise.
540+ *
541+ * @attr ref android.R.styleable#SearchView_queryHint
542+ */
543+ public CharSequence getQueryHint () {
544+ if (mQueryHint != null ) {
545+ return mQueryHint ;
546+ } else if (mSearchable != null ) {
547+ CharSequence hint = null ;
548+ int hintId = mSearchable .getHintId ();
549+ if (hintId != 0 ) {
550+ hint = getContext ().getString (hintId );
551+ }
552+ return hint ;
553+ }
554+ return null ;
555+ }
556+
516557 /**
517558 * Sets the default or resting state of the search field. If true, a single search icon is
518559 * shown by default and expands to show the text field and other buttons when pressed. Also,
@@ -651,6 +692,15 @@ public void setMaxWidth(int maxpixels) {
651692 requestLayout ();
652693 }
653694
695+ /**
696+ * Gets the specified maximum width in pixels, if set. Returns zero if
697+ * no maximum width was specified.
698+ * @return the maximum width of the view
699+ */
700+ public int getMaxWidth () {
701+ return mMaxWidth ;
702+ }
703+
654704 @ Override
655705 protected void onMeasure (int widthMeasureSpec , int heightMeasureSpec ) {
656706 // Let the standard measurements take effect in iconified state.
0 commit comments