I have a template in a webview
MainAcitivity
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
WebView myWebView = (WebView) findViewById(R.id.web_engine);
myWebView.setWebViewClient(new MyBrowser());
myWebView.clearCache(true);
myWebView.clearHistory();
myWebView.getSettings().setJavaScriptEnabled(true);
myWebView.getSettings().setLoadsImagesAutomatically(true);
myWebView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
myWebView.loadUrl("http://www.mundodamulher.com.br/");
}
private class MyBrowser extends WebViewClient {
@Override
public void onPageFinished(WebView view, String url) {
if (findViewById(R.id.splach_screen).getVisibility() == View.VISIBLE) {
// show webview
findViewById(R.id.main_view).setVisibility(View.VISIBLE);
// hide splash screen
findViewById(R.id.splach_screen).setVisibility(View.GONE);
}
}
}
}
activity_main
<?xml version="1.0" encoding="utf-8"?>
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="160dp"
android:layout_height="10dp"
android:id="@+id/webViewProgress"
android:indeterminateOnly="true"
android:max="100"
android:indeterminateTint="#e20400"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" />
</RelativeLayout>
<LinearLayout
android:id="@+id/main_view"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:visibility="invisible"
>
<WebView android:id="@+id/web_engine"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
I know the color change of the bar works above api 21, still looking for api's bottom