IT. Expert System.

Android Reference

SearchView


android.widget

Class SearchView

    • Method Detail

      • setSearchableInfo

        public void setSearchableInfo(SearchableInfo searchable)
        Sets the SearchableInfo for this SearchView. Properties in the SearchableInfo are used to display labels, hints, suggestions, create intents for launching search results screens and controlling other affordances such as a voice button.
        Parameters:
        searchable - a SearchableInfo can be retrieved from the SearchManager, for a specific activity or a global search provider.
      • setAppSearchData

        public void setAppSearchData(Bundle appSearchData)
        Sets the APP_DATA for legacy SearchDialog use.
        Parameters:
        appSearchData - bundle provided by the app when launching the search dialog
      • setImeOptions

        public void setImeOptions(int imeOptions)
        Sets the IME options on the query text field.
        Parameters:
        imeOptions - the options to set on the query text field
        See Also:
        TextView.setImeOptions(int)
      • getImeOptions

        public int getImeOptions()
        Returns the IME options set on the query text field.
        Returns:
        the ime options
        See Also:
        TextView.setImeOptions(int)
      • setInputType

        public void setInputType(int inputType)
        Sets the input type on the query text field.
        Parameters:
        inputType - the input type to set on the query text field
        See Also:
        TextView.setInputType(int)
      • getInputType

        public int getInputType()
        Returns the input type set on the query text field.
        Returns:
        the input type
      • clearFocus

        public void clearFocus()
        Description copied from class: ViewGroup
        Called when this view wants to give up focus. If focus is cleared View.onFocusChanged(boolean, int, android.graphics.Rect) is called.

        Note: When a View clears focus the framework is trying to give focus to the first focusable View from the top. Hence, if this View is the first from the top that can take focus, then all callbacks related to clearing focus will be invoked after wich the framework will give focus to this view.

        Overrides:
        clearFocus in class ViewGroup
      • setOnQueryTextListener

        public void setOnQueryTextListener(SearchView.OnQueryTextListener listener)
        Sets a listener for user actions within the SearchView.
        Parameters:
        listener - the listener object that receives callbacks when the user performs actions in the SearchView such as clicking on buttons or typing a query.
      • setOnCloseListener

        public void setOnCloseListener(SearchView.OnCloseListener listener)
        Sets a listener to inform when the user closes the SearchView.
        Parameters:
        listener - the listener to call when the user closes the SearchView.
      • setOnQueryTextFocusChangeListener

        public void setOnQueryTextFocusChangeListener(View.OnFocusChangeListener listener)
        Sets a listener to inform when the focus of the query text field changes.
        Parameters:
        listener - the listener to inform of focus changes.
      • setOnSuggestionListener

        public void setOnSuggestionListener(SearchView.OnSuggestionListener listener)
        Sets a listener to inform when a suggestion is focused or clicked.
        Parameters:
        listener - the listener to inform of suggestion selection events.
      • setOnSearchClickListener

        public void setOnSearchClickListener(View.OnClickListener listener)
        Sets a listener to inform when the search button is pressed. This is only relevant when the text field is not visible by default. Calling setIconified(false) can also cause this listener to be informed.
        Parameters:
        listener - the listener to inform when the search button is clicked or the text field is programmatically de-iconified.
      • getQuery

        public CharSequence getQuery()
        Returns the query string currently in the text field.
        Returns:
        the query string
      • setQuery

        public void setQuery(CharSequence query,
                    boolean submit)
        Sets a query string in the text field and optionally submits the query as well.
        Parameters:
        query - the query string. This replaces any query text already present in the text field.
        submit - whether to submit the query right now or only update the contents of text field.
      • setQueryHint

        public void setQueryHint(CharSequence hint)
        Sets the hint text to display in the query text field. This overrides any hint specified in the SearchableInfo.
        Parameters:
        hint - the hint text to display
      • getQueryHint

        public CharSequence getQueryHint()
        Gets the hint text to display in the query text field.
        Returns:
        the query hint text, if specified, null otherwise.
      • setIconifiedByDefault

        public void setIconifiedByDefault(boolean iconified)
        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 is pressed. Changes to this property will take effect immediately.

        The default value is true.

        Parameters:
        iconified - whether the search field should be iconified by default
      • isIconfiedByDefault

        public boolean isIconfiedByDefault()
        Returns the default iconified state of the search field.
        Returns:
      • setIconified

        public void setIconified(boolean iconify)
        Iconifies or expands the SearchView. Any query text is cleared when iconified. This is a temporary state and does not override the default iconified state set by setIconifiedByDefault(boolean). If the default state is iconified, then a false here will only be valid until the user closes the field. And if the default state is expanded, then a true here will only clear the text field and not close it.
        Parameters:
        iconify - a true value will collapse the SearchView to an icon, while a false will expand it.
      • isIconified

        public boolean isIconified()
        Returns the current iconified state of the SearchView.
        Returns:
        true if the SearchView is currently iconified, false if the search field is fully visible.
      • setSubmitButtonEnabled

        public void setSubmitButtonEnabled(boolean enabled)
        Enables showing a submit button when the query is non-empty. In cases where the SearchView is being used to filter the contents of the current activity and doesn't launch a separate results activity, then the submit button should be disabled.
        Parameters:
        enabled - true to show a submit button for submitting queries, false if a submit button is not required.
      • isSubmitButtonEnabled

        public boolean isSubmitButtonEnabled()
        Returns whether the submit button is enabled when necessary or never displayed.
        Returns:
        whether the submit button is enabled automatically when necessary
      • setQueryRefinementEnabled

        public void setQueryRefinementEnabled(boolean enable)
        Specifies if a query refinement button should be displayed alongside each suggestion or if it should depend on the flags set in the individual items retrieved from the suggestions provider. Clicking on the query refinement button will replace the text in the query text field with the text from the suggestion. This flag only takes effect if a SearchableInfo has been specified with setSearchableInfo(SearchableInfo) and not when using a custom adapter.
        Parameters:
        enable - true if all items should have a query refinement button, false if only those items that have a query refinement flag set should have the button.
        See Also:
        SearchManager.SUGGEST_COLUMN_FLAGS, SearchManager.FLAG_QUERY_REFINEMENT
      • isQueryRefinementEnabled

        public boolean isQueryRefinementEnabled()
        Returns whether query refinement is enabled for all items or only specific ones.
        Returns:
        true if enabled for all items, false otherwise.
      • setSuggestionsAdapter

        public void setSuggestionsAdapter(CursorAdapter adapter)
        You can set a custom adapter if you wish. Otherwise the default adapter is used to display the suggestions from the suggestions provider associated with the SearchableInfo.
        See Also:
        setSearchableInfo(SearchableInfo)
      • getSuggestionsAdapter

        public CursorAdapter getSuggestionsAdapter()
        Returns the adapter used for suggestions, if any.
        Returns:
        the suggestions adapter
      • setMaxWidth

        public void setMaxWidth(int maxpixels)
        Makes the view at most this many pixels wide
      • getMaxWidth

        public int getMaxWidth()
        Gets the specified maximum width in pixels, if set. Returns zero if no maximum width was specified.
        Returns:
        the maximum width of the view
      • onDetachedFromWindow

        protected void onDetachedFromWindow()
        Description copied from class: View
        This is called when the view is detached from a window. At this point it no longer has a surface for drawing.
        Overrides:
        onDetachedFromWindow in class View
        See Also:
        View.onAttachedToWindow()
      • onKeyDown

        public boolean onKeyDown(int keyCode,
                        KeyEvent event)
        Handles the key down event for dealing with action keys.
        Specified by:
        onKeyDown in interface KeyEvent.Callback
        Overrides:
        onKeyDown in class View
        Parameters:
        keyCode - This is the keycode of the typed key, and is the same value as found in the KeyEvent parameter.
        event - The complete event record for the typed key
        Returns:
        true if the event was handled here, or false if not.
      • onWindowFocusChanged

        public void onWindowFocusChanged(boolean hasWindowFocus)
        Description copied from class: View
        Called when the window containing this view gains or loses focus. Note that this is separate from view focus: to receive key events, both your view and its window must have focus. If a window is displayed on top of yours that takes input focus, then your own window will lose focus but the view focus will remain unchanged.
        Overrides:
        onWindowFocusChanged in class View
        Parameters:
        hasWindowFocus - True if the window containing this view now has focus, false otherwise.
      • onRtlPropertiesChanged

        public void onRtlPropertiesChanged(int layoutDirection)
        Description copied from class: View
        Called when any RTL property (layout direction or text direction or text alignment) has been changed. Subclasses need to override this method to take care of cached information that depends on the resolved layout direction, or to inform child views that inherit their layout direction. The default implementation does nothing.
        Overrides:
        onRtlPropertiesChanged in class View
        Parameters:
        layoutDirection - the direction of the layout
        See Also:
        View.LAYOUT_DIRECTION_LTR, View.LAYOUT_DIRECTION_RTL


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 261 / 158801557. Delta: 0.04754 с