keyboardView with webview - android

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.

Related

Why does toggleSoftInput() work, but showSoftInput() doesn't?

I have an extremely simple linear layout view containing nothing but an EditText. When I open it up I want the soft keyboard to open too.
Android documentation says to use showSoftInput(), but nothing happens when I do. But if I replace that with toggleSoftInput(), the keyboard shows up properly.
Because toggleSoftInput() has been deprecated, I'd like to get my code working with showSoftInput(). What else must I do to make this work?

Android dialog : Is there a way to make background android UI clickable while dialog is displayed?

Currently, I am using Libgdx for making app with lots of animation. I am trying to use android Dialog for showing paragraph with html tags through Interface. While, I can change dim color of background UI back to normal with following code.
paragraphDialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
Is there anything I can do to make background UI work? (Button click, textview focus etc)
And, I have tried GlyphLayout of Libgdx for paragraph. It frequently crashes & also doesn't support html tags. I am using dialogs, as it is pretty easy to use xml layout easily with dialogs. If there are any other options, Please suggest.
Thanks,
your dialog is blocking the entire screen, doesn't matter if the edges/background are somewhat transparent or not 100% alpha, it is still the view that is currently on top. therefor, you can't click on it directly.
i think the best way to achieve your goal is with a fragment. not a dialog.

android : Customize dropdown's radiobutton open from webview

I am developing android application which is based on the webview.
The page loaded in the WebView has dropdown. When I click on the drop down, a dialog appears(it is the native Android dialog).i want to apply my them for that dropdown dialog item. i have searched but solution not found for that.
FYI, I have implemented it in the native activity but not able to implement it in webview.I want dropdown alert like displayed in below image.
Please help me, if anyone knows related to this issue.
You need to understand the concept of a Webview. It is just like a browser which you are loading inside your activity. Your other activities in the app can not interact with the webview. If you want to change the style of your dropdown for android's webview, use Media Queries in your website which will change the view of your website when loaded for smaller devices

How to get keyboard with Next, Previous and Done buttons at the top of keyboard in Android

In my application, I want to provide the functionality similar to Next, Previous and Done button at the top of keyboard. It is somewhat similar to this
Please let me know how can I achieve this.
I do not want to exactly implement the next,previous and done options. But using this three button click, I want to make three separate web service calls and fetch the results. Like, Active,Inactive and All kind of filters.
The standard Android way would be to provide an input method action with imeOptions. With the standard keyboard this will change the bottom right virtual keyboard button to the specified action. There's little point in trying to mimic iOS input behavior with the buttons above.
Do you want to just put the layout above the keyboard,so as to stop next,previous,etc button when keyboard is displayed.
If so,you can try adding below code inside your activity in android manifest,
android:windowSoftInputMode="adjustResize"
If you are looking for something else,then please show your xml code of the same.

How do you create the Browser layout (search bar on top, webview on bottom)?

I'm trying to mimic the default android Browser app layout, which has a "search_bar" on top and then a "webview" right below it. The user can scroll both items up, all the while the scroll bar only appears to the right of the webview (not both the webview and the search bar).
I've tried putting both the webview and the searchbar into a scrollview, but this shows the scrollbar next to the search_bar.
If you need to mimic the exact layout of default browser have a look at it's source code:
Where can I find Android source code online?
If you need only browser source have a look here:
https://android.googlesource.com/platform/packages/apps/Browser
From what I can see (a quick look at it) it is more complicated layout, but you may start analysing it from:
Browser\res\layout\browser_subwindow.xml
which directly includes WebView. This file is directly loaded by Tab... Go ahaed and analyse it on your own it is pretty simple as it is a regular Android application.
Hope it helps.

Categories

Resources