Is there any way to play a video as a background of a custom keyboard view in android?
i need any resource or tutorials or even apps that has this feature
A custom keyboard can have any view it wants to. Which could include a video if you wanted. Just return a layout including a VideoView (or other similar view) from onCreateInputView.
Please note you do NOT have to use KeybaordView. That's a convenience class for if you have a very standard looking keyboard. None of the big keyboard makers use it.
Related
I´m working on a custom system keyboard based on this tutorial. Which creates a basic custom keyboard. How would I be able to add a webview over the keyboard? Basically I want a small row like this on top of the keyboard, but instead emojis, I want a (small) webview to be there.
I have tried to add a webview decleration in the number_pad file without it making any differanse, tried the same with keyboard_view, but it also din´t work. I tried to change webview to textview to see if it would show anything then, but still nothing. Then I thought I might be able to use a popupWindow, but I wasn't able to get that to work either :/.
Any ideas? Any tips? i´m new to android programing so a little code POC with the answer would be nice.
I want to develop a custom keyboard where I can add other views above it. how can I achieve this? what will be the main container layout?
I basically want to add banner ads on top of the keyboard. you can provide be a general example to put any view with keyboard view.
like this keyboard
Keyboards must implement an InputMethodService. One of the functions on it is onCreateInputView. That returns the View to display. This can be any View you want, including q layout with ads.
That said- nobody will ever use a keyboard with ads on it. I really don't suggest it.
I want to create my customized own controls apart from standard Android views/widgets including View, ScrollBar, TextView, EditText, ...
And already completed others but not TextView/EditText yet.
The two controls interact with soft-keyboard on focus or not. Plus, you can type/edit the text of the control by the keyboard. More challenging part is about controlling the caret. These problems happen because the control inherits View, not TextView/EditText.
You may ask why I chose such difficult way, not using standard ones and customize only some part of them?
That's because of one fatal problem that standard TextView/EditText cannot support large files(a few MB files) and are lagging with them. Additionally, some of the important member functions are private, not protected or public. So we cannot customize fully them as we want.
That's why I created one customized text viewer/editor that supports large files (even over 100 MB). Viewer feature already has been implemented and works well.
Now the editor feature is remaining and it's the reason why I'm here to request your help.
Please let me know what's the best solution and I'd appreciate if you can provide with some sample codes.
Thanks
P.S. This is what I've done so far.
screenshot
apk
I have seen lots of answers on SO and tutorials on internet on custom keyboard development. However, all of them use KeyboardView for displaying keyboard. It is difficult to manage KeyboardView and KeyboardView does not show custom layouts. Is there any other way to implement custom keyboard app that shows custom layouts?
In your InputMethodService, there's a function onCreateInputView. It returns the main view of your keyboard. You can have it return any view you want, including a custom one. In fact I don't think any serious keyboards actually use KeyboardView- it's too limiting.
On Video players such as Youtube, I often see that when the user taps on the video view a sort of overlay shows up where the user can choose actions like: “share”, “add to playlist”, “pause”, etc. Basically it’s whatever the developer wants. The developer seems to be able to choose what the icons are, where they go, etc.
I would like to know how it’s done. For example, are they using a VideoView with an overlay? Are they using a FrameLayout with a VideoView and a RelativeLayout on top of the VideoView? I just need some advice in the right direction as I don’t know where to start. Thanks. For simplicity, I am looking to add a Youtube style video player to my activity. And by Youtube style, I am referring to the aforementioned interactions.
I would like to know how it’s done
I am sure that the implementation varies widely.
For example, are they using a VideoView with an overlay?
AFAIK, few professional-grade apps use VideoView, simply because VideoView offers little in the way of events or control. More likely, they are using something else backed by MediaPlayer or third-party media libraries (e.g., ExoPlayer).
Are they using a FrameLayout with a VideoView and a RelativeLayout on top of the VideoView?
No, because that would be two VideoView widgets. However, whatever their video surface is probably resides in a RelativeLayout or FrameLayout, with the overlay as another child of that same container, though I am sure that there are other approaches.
You are welcome to use uiautomatorviewer to try to learn more about the view hierarchy of particular apps of interest.