summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2012-04-26 15:28:52 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-04-26 15:28:52 -0700
commit7a4be122cd0073240122b9f9badc78df677ea791 (patch)
treed03385ca4c155698ce812334fc328ce9ad0940c7 /core/java
parent16fb5d444cea1c978257807910b96d4e47b78dce (diff)
parenteca59d39c3e92815002dd50aaf176100a02e5a47 (diff)
downloadframeworks_base-7a4be122cd0073240122b9f9badc78df677ea791.zip
frameworks_base-7a4be122cd0073240122b9f9badc78df677ea791.tar.gz
frameworks_base-7a4be122cd0073240122b9f9badc78df677ea791.tar.bz2
Merge "Add some missing getters for XML/Java API consistency." into jb-dev
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/widget/SearchView.java50
1 files changed, 50 insertions, 0 deletions
diff --git a/core/java/android/widget/SearchView.java b/core/java/android/widget/SearchView.java
index 99cd0b8..561326e 100644
--- a/core/java/android/widget/SearchView.java
+++ b/core/java/android/widget/SearchView.java
@@ -381,6 +381,17 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
}
/**
+ * 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.
*
* @see TextView#setInputType(int)
@@ -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) {
@@ -514,6 +535,26 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
}
/**
+ * 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,
* if the default state is iconified, then it collapses to that state when the close button
@@ -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.