@@ -60,6 +60,7 @@ Licensed to the Apache Software Foundation (ASF) under one
60
60
import android .widget .ImageButton ;
61
61
import android .widget .ImageView ;
62
62
import android .widget .LinearLayout ;
63
+ import android .widget .ProgressBar ;
63
64
import android .widget .RelativeLayout ;
64
65
import android .widget .TextView ;
65
66
@@ -916,12 +917,24 @@ public boolean onKey(View v, int keyCode, KeyEvent event) {
916
917
View footerClose = createCloseButton (7 );
917
918
footer .addView (footerClose );
918
919
920
+ // Progress of loading a page
921
+ ProgressBar progressBarLoadingPage = new ProgressBar (webView .getContext (), null , android .R .attr .progressBarStyleHorizontal );
922
+ progressBarLoadingPage .setLayoutParams ((new LinearLayout .LayoutParams (LayoutParams .MATCH_PARENT , LayoutParams .WRAP_CONTENT )));
923
+
919
924
// WebView
920
925
inAppWebView = new WebView (cordova .getActivity ());
926
+ inAppWebView .setBackgroundColor (Color .WHITE );
927
+ inAppWebView .addView (progressBarLoadingPage );
921
928
inAppWebView .setLayoutParams (new LinearLayout .LayoutParams (LayoutParams .MATCH_PARENT , LayoutParams .MATCH_PARENT ));
922
929
inAppWebView .setId (Integer .valueOf (6 ));
923
930
// File Chooser Implemented ChromeClient
924
931
inAppWebView .setWebChromeClient (new InAppChromeClient (thatWebView ) {
932
+ public void onProgressChanged (WebView view , int progress )
933
+ {
934
+ progressBarLoadingPage .setProgress (progress );
935
+ progressBarLoadingPage .setVisibility (progress == 100 ? ProgressBar .GONE : ProgressBar .VISIBLE );
936
+ }
937
+
925
938
public boolean onShowFileChooser (WebView webView , ValueCallback <Uri []> filePathCallback , WebChromeClient .FileChooserParams fileChooserParams )
926
939
{
927
940
LOG .d (LOG_TAG , "File Chooser 5.0+" );
0 commit comments