Android Studio Webview with Adressbar and Close button - android

I currently have a webviewer in my app that works just fine, however, I wanted to see if there was a way to add the adressbar and a close button to the top of it. Kinda the same way Instagram does it, see image:
Right now, I have a close button but when scrolling through the webview that close button goes over the content of the website.
My current code:
btnOpenWebViewer.setOnClickListener{
btnCloseWebViewer.visibility = VISIBLE
webViewer.visibility = VISIBLE
webViewer.settings.javaScriptEnabled = true
webViewer.canGoBack()
webViewer.loadUrl("https://mysite/")
}

Related

How to disable onClick splash in Flutter WebView

I'm new to flutter and would appreciate some help.
I have simple app with WebView. And when I click some button or another widget on page, opened in WebView, this button is highlighted like this (not my screenshot, just an example)
(https://i.stack.imgur.com/nJ5dt.png)
Can I disable this highlight or change color to transparent?

Fullscreen Activity with titlebar backbutton

I am making a webview client app for my RSS website. The webview and splashscreen are working great in theme.notitlebar.fullscreen.
Because external links are opening in my webview, i want a back button in the titlebar. But i want to keep the full screen option, to remove the time and notifications, and the device buttons.
What i dont understand: Is it correct that the titlebar includes: the bar with time and notifications - bar with app name, back button and settings (extra) button - the device buttons (if available)?
If that is right. How can i add a new bar into the mainactivity with my webview client, with a back button in it.
I hope you understand my question.
You can use image view. set src to back icon. and finish(); activity on imageview click.

Creating an initial install page Android

I am attempting to include an on-install tutorial for my Android application. This tutorial would include the following:
A certain button will be highlighted (as if a spotlight was shone on it, with everything else dark / shadowy). The user will only be able to hit that button; no other button will be active. Once the button is click, another activity / fragment appears and a similar feature occurs with a single button highlighted.
How exactly would I go about implementing this?

Chrome custom tabs's close button feature override

Close button of "chrome custom tab" close the entire webview itself. However I want it to override its behaviour to work as hardware back button behaviour so that user can go back to previous page of web instead of closing webview.
I read so many posts and blogs but i could not get find any solution. I have found the solution to change the close button icon.
In my case my application does nothing but open the Chrome Custom Tab, so I was able to do this:
// This is called on boot, and when the Chrome Custom Tab's X button in the top left is clicked.
protected void onResume() {
super.onResume();
tryLaunch();
}
where tryLaunch launches Chrome
That's not currently possible.

Disable program back button after creating new intent

I am new to android programming and just starting with the basics following this guide
Android Starting Activity
The app allows the user to input a string and once the user clicks send, it takes you to a new intent displaying the message. Now at the bottom of the link where there are 2 pictures displayed, there is no visible back button, but on my emulator, the "My First App" is a button indicating it can go back. However, if I press it, it crashes the program. Is there anyway to disable the title message from being a button?
If I press the back button on the phone, the program works perfectly fine.
I think the title bar is just a regular view thats located in the android library rather than the res folder associated with your application. You should be able to find the title bar and disable clicks with the following:
View v = findViewById (android.R.id.title);
v.setClickable(false);
That should disable clicks on the title bar.
getActionBar().setDisplayHomeAsUpEnabled(true);
This is the line you are looking for. Mind you, it is commented appropriately, too.

Categories

Resources