I have a working searchview in a fragment and decided to add voice to it. I followed the guide and created a separate activity to hold the result. This all works fine with the code private fun handleIntent(intent: Intent) { if (Intent.ACTION_SEARCH == intent.action) { intent.getStringExtra(SearchManager.QUERY)?.also { query -> // blahh blahh `blahhh` } } ..
Category : searchview
I want to filter recycle View by using search View which under the fragment and fragment is under the view pager, i try this but my search view not filtering the data i don’t know what I done wrong and where and here is my search_option under menu <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item ..
I have a SearchView in my Toolbar, then in the settings the user could enable or disable the virtual keyboard as he could use a device with the physical keyboard. For a common EditText i use the following code to disable the soft keyboard: if (!keyboard) { txtBarcode.showSoftInputOnFocus = false txtQta.showSoftInputOnFocus = false }else { ..
I am having a ton of issues trying to figure out how to change the text on my androidx searchview either via programmatically or within the xml theme. Below is my relevant code. How can I update the text from black to white so it shows on a black background like the screenshot? <menu xmlns:android="http://schemas.android.com/apk/res/android" ..
Based on the fact that Cloud Firestore does not support Full-Text Search to date, I decided to ask this question some time ago. Inspired by this write-up by Alex Mamo I was able to simulate a full-text search scenario on Cloud Firestore by implementation the following from the write-up. Now my question is: How can ..
i get really confused, why my search bar is not automatically displaying the result, it will display the result after im turn off the screen and turn it back on. screenshot here’s my code : @Override protected void onStart() { super.onStart(); adapter.startListening(); } @Override protected void onStop() { super.onStop(); } @Override protected void onCreate(Bundle savedInstanceState) ..
This is my theme: <style name="Theme.Cinemates" parent="Theme.AppCompat.NoActionBar"> <item name="colorPrimary">@color/yellow</item> <item name="colorPrimaryVariant">@color/black</item> <item name="colorOnPrimarySurface">@color/black</item> <item name="colorSecondary">@color/teal_200</item> <item name="colorSecondaryVariant">@color/teal_700</item> <item name="colorOnSecondary">@color/black</item> <item name="android:textColor">@color/black</item> <item name="editTextColor">@color/black</item> <item name="hintTextColor">@color/black</item> <item name="iconTint">@color/black</item> <item name="android:actionMenuTextColor">@color/black</item> </style> This is my toolbar: <androidx.appcompat.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" app:logo="@drawable/clapboard" app:titleTextColor="@color/black" app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent" app:titleMarginStart="35dp"/> This is my menu: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/ricerca_film" ..
first I know it’s a confusing title but hear me out I’m creating a song app where you have multiple songs and when you press on a song the app shows you the songs lyrics. I searched on google how to make a search bar and I got it working. What I don’t like about ..
I want the length of searchview to occupy full width of action bar when clicked but instead it shows the others items as well. This is xml file of the view <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/action_settings" android:title="Settings" app:showAsAction="never"/> <item android:id="@+id/about" android:title="About" app:showAsAction="never" /> <item android:id="@+id/edit" android:icon="@drawable/ic_baseline_sort_24" app:showAsAction="always" android:title="Edit"/> <item android:id="@+id/search" android:title="search_title" android:icon="@drawable/ic_search" app:showAsAction="always|collapseActionView" app:actionViewClass="androidx.appcompat.widget.SearchView" /> ..
I implemented RxJava/RxBinding in the SearchView that I created. here is the code val queryStream = RxSearchView.queryTextChanges(searchView) .observeOn(AndroidSchedulers.mainThread()) .debounce(400, TimeUnit.MILLISECONDS) queryStream.subscribe({ if (it.isNotEmpty()) { Log.e("queryStream", "ini querynya ${it}") getSearchUser(it.toString()) } }, { // Exception Log.e("Exception", "${it.message}") }) and here is the code for getSearchUser() function private fun getSearchUser(q: String) { viewModel.getSearchUser(q).observe(this, { user -> if ..
Recent Comments