Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phonegap ChildBrowser plugin: Disable/Hide URL in Locationbar, but NOT back/forward/exit buttons

is there a way to hide or disable the URL field in the locationbar? In my case the device is a tablet run as a kiosk browser, so only one URL is allowed.

I fixed this by changing the code in the ChildBrowser.java to

private void navigate(String url) {
    InputMethodManager imm = (InputMethodManager)this.ctx.getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.hideSoftInputFromWindow(edittext.getWindowToken(), 0);
    if (!url.startsWith("http")) {
        this.webview.loadUrl("http://" + url);
    }
    this.webview.loadUrl("http://www.my-only-allowed-site.example.org");
    this.webview.requestFocus();
}

This works well, but is not nice. You can still see the URL. I´d like to have any of this possible solutions:
1) completely hide the URL field
2) hide the softkeyboard when clicking on the URL field
3) set the URL fonts color to black

Any idea?
thanks in advance

like image 772
user1127000 Avatar asked Oct 09 '22 02:10

user1127000


1 Answers

If you modify the source code for the plugin, you can hide the url field and close button by modifying the source code for the plugin and just comment out the following line:

toolbar.addView(back);       //shows the back button
toolbar.addView(forward);    //shows the forward button
//toolbar.addView(edittext); //shows the URL - comment this line out to hide the URL
toolbar.addView(close);      //shows the close button

Edit: oops, I just saw from your comment that you figured this out in the same way!

like image 105
xdumaine Avatar answered Dec 01 '22 01:12

xdumaine