Search style EditText - android

I would like to use the "search" style EditText, with the thin line underneath and a microphone icon on the right (although I would replace that icon with a different function), used in apps like Youtube and Google maps.
Is this a native element of this in any versions of Android? I can't seem to find a reference to it anywhere, although I did find this:
Android EditText like Google Search EditText
Which basically says to create it yourself, which I've done, however if there's a more "native" search EditText I'm unaware of, I'd rather use that...
Thanks for your help.

If you want to have this Search-EditText inside of an app, here you will find all information needed:
http://developer.android.com/guide/topics/search/index.html
Google provides configuration examples for both Android 2.X without ActionBar and later Androids with ActionBar. Under "Creating a Search Interface" you will find the section "Adding Voice Search" which brings in the microphone icon, though I don't know how to override its functionality.

Related

Create menu that looks like Android App Shortcuts in App on button click

Basically, I'm trying to create the app shortcuts UI available in an android app.
I'll like to be able to have a similar popup when tapping the android basic activity (+) button, but the closest thing I've found is the ContextMenu.
I'm not certain if it's a context menu with styling or how to approach it. Any help would be appreciated.
I've had a good look around but could not find an answer.
Thanks!
Edit: To clarify since this was marked as a duplicate. I am not trying to create launcher shortcuts. I am trying to create a component that looks like launcher shortcuts in the app. For example if a Floating Action Button was pressed.
This launcher is part of AOSP and You're free to read thru the ArrowPopup.java source code.
It might take a bit of digging to find and extract referenced resources, but that's what it is.

Fix misspelled words on Android EditText

How can I implement an EditText that automatically fixes misspelled words when taping soft keyboard spacebar? I have seen this behavior on Whatsapp, for example if you write "aricle" and press spacebar it puts "article", same if you write "articl" or something like that, is that an Android behavior or a Whatsapp specialized behavior? I have tried with AutoCompleteTextView and setting autoText=true (although is deprecated I had to try)
Autocorrect is a feature of the keyboard that you use. But if you want to put this feature in your android application then you can use spelling checker framework offered by anroid. It lets you implement spelling checker in your android application with the help of android service.
For more details you can see below link
https://developer.android.com/guide/topics/text/spell-checker-framework.html#SpellCheckLifeCycle
And for example you can look into this link
https://code.tutsplus.com/tutorials/an-introduction-to-androids-spelling-checker-framework--cms-23754

How to implement the Android Material design's "inset Search box" using the Android's builtin Search Framework?

Note: I have seen this and this question, and my question is not their duplicate (They do not solve my confusion).
From the Android Material Design specification for search,
The search text field is presented inside of an inset search box,
ready to receive focus.
and this picture is shown:
They have also shown this kind of SearchViews at many different places in the material design specification e.g. here
But I can't locate a guide/tutorial describing how to make something like this. From my web search, I have found this SO answer, but they are using an EditText and ImageView, they are not even using a SearchView widget.
The biggest question in this case is that what about the Search Framework the Android API's provide, which is explained in this guide. This builtin search framework provides a very easy way to implement all the functionality associated with providing Search in an app, i.e. it provides a way to integrate our search with the Android system so that the system handles the user's search queries into SearchView, delivers them to the Searchable Activity, provides a way to add the voice search and search suggestions functionality, etc.
So now in order to use the Material design "inset search box", do we have to write code to handle user input into the SearchView/EditText, enable voice search, recent suggestions and suggestions from app's data? or is there a way to integrate the EditText (we are using as the search widget) with the system to have assisted search?

Icon Next to the Search Orb in Android TV App

How can I add an icon next to the search orb, just as displayed below? I'd like to display a login page when the user clicks on the icon.
You can't, if you want to use the standard widgets offered by the Leanback library, such as BrowseFragment.
There is a way of creating your own version of the BrowseFragment widget, so that it is fully customizable and you can add as many buttons as you like, but it is definitely not easy to do. I've written a series of posts on this subject, which you can find here:
Building for Android TV
There is also a demo project that already gives you a starting point for the custom interface. The code can be found on this GitHub repo (episode_4 is probably what you're looking for).

Android searchbar like google app

I want to develop search bar like bellow image just like showing in Google search bar. How to achieve this. Please some can provide sample code or related links to achieve it.
I assume the actual question here is not how to create a widget (if it is, check the official Android documentation on widgets), but how you can enable a widget to receive text input, which, as far as i am aware, is not possible using standard widget elements.
You will probably have to try the way discussed over here - creating a transparent activity when your widget is tapped.

Categories

Resources