WhatsApp's new quick reply option, How it works? - java

I'm trying to get a text input from the user after he clicks a notification action button.
The problem is that I'm using a custom notification layout so the button is implemented by RemoteView and not by Notification.Action class, so I can't use RemoteInput.
So I was thinking to do something like WhatsApp's new quick reply option but I can't figure out how they have managed to do it...
Any ideas about that?
Any help will be appreciated!
Thank ahead

Related

Possible to determine if user has clicked on ANY notification (not just from my app) in real time?

I'm making my first Android app. Is it possible to listen to any commands that is triggered when a user clicks on any notification? I don't need to know which notification that was clicked, just the fact that any notification was clicked on.
Maybe it's possible to listen to FLAG_AUTO_CANCEL or similar.
I'm a beginner, so please excuse me if I'm not clear enough or using the wrong vocabulary.
When a notification is clicked the ContentIntent is executed and that's it, there will not be a Broadcast that a notification has been clicked.
So to answer the question, it's not possible

Edittext text input listener

Am developing an android chat application. Everything works well but except for one thing; I want to set the visibility of a layout to gone and then set a different layout to visible when user starts typing in the edittext like the one implemented on whatsapp.
But I cant seem to figure it out.
Any help will be appreciated
Basically, what I want to do is set the visibility of a layout which contains an image button to upload image to gone and then show a layout which contains an image button to send the message or text in the edittext to visible when the user starts typing
Can you explain in detail?
Do you wan edit text to come up when keyboard is hoped up.
then use below in your manifest.
<activity
android:name=".Activityname"
android:windowSoftInputMode="adjustPan">
If not, then please explain your question in more detail
Take a look at the TextChangedListener. With help of the TextWatcher you should be able to run commands when the input changes.
Please describe in more detail, if you need further assistance.

SearchView voice listener

I would like to know if it is possible to set voice listener on my searchView, like the suggestion listener:
http://developer.android.com/reference/android/support/v7/widget/SearchView.OnSuggestionListener.html
I want to overwrite the default behavior. I don't want to launch another activity. I just want to get the recorded voice as a string and use it.
I read what you ask for, but Why don't you want to use an activity?
Just in case this can help you, you should take a look at these if you havn't till now:
Andriod developers:
http://developer.android.com/guide/topics/search/search-dialog.html#VoiceSearch
Examples:
http://www.codeproject.com/Articles/821839/A-Beginners-Guide-to-Working-With-Speech-and-Audio
http://www.truiton.com/2014/06/android-speech-recognition-without-dialog-custom-activity/
Hope it helps,
yakobom
To show the microphone icon you need to add a search configuration and set it to your SearchView. See this question and my answer here https://stackoverflow.com/a/48527608/114549

How to set TextView inside custom ImageButton (FAB)?

I am trying to build an app using the new material design specs.
I am currently trying to get a cusdtom FAB layout working, similar to the one in the new Inbox app.
I have one main button, which when clicked, expands to several smaller ones.
However i want to add a textview to the left of the smaller buttons, like the inbox app.
I cant seem to find a way of doing this.
The floating action button i am using is based off this library, but with a few modifications https://github.com/futuresimple/android-floating-action-button/blob/master/README.md
If someone could suggest a way of doing this, it would be much appreciated.
Thanks
Corey :)

Android: onConnectionToInternet

I want to know if there any listener, like onClickListener , but for connection to the Internet. I want to start some function, only when there is a new connection to Internet.
Exactly like a Button, that till it is not pressed, it's not start the onClick.
Does someone know something like that?
Thanks in advance!
Check out BROADCAST RECIEVER
What happens is as soon if a change in network ex:Internet, android
fires an intent
You can use this Intent as per your wish to achieve your objective,
like performing some tasks
You can place the Broadcast reciever in your main activity
Don't forget to declare it in manifest
CHECK THIS STACKOVERFLOW POST- IT WILL GIVE YOU THE IDEA ON HOW TO USE
Hope this helps !, comment back if you need any more information

Categories

Resources