File tree Expand file tree Collapse file tree 3 files changed +63
-2
lines changed
pythonforandroid/bootstraps/webview/build Expand file tree Collapse file tree 3 files changed +63
-2
lines changed Original file line number Diff line number Diff line change @@ -236,6 +236,7 @@ def make_package(args):
236236 tar_dirs .append ('private' )
237237 if exists ('crystax_python' ):
238238 tar_dirs .append ('crystax_python' )
239+ tar_dirs .append ('webview_includes' )
239240 if args .private :
240241 make_tar ('assets/private.mp3' , tar_dirs , args .ignore_path )
241242 # else:
@@ -408,7 +409,7 @@ def parse_args(args=None):
408409 ap .add_argument ('--wakelock' , dest = 'wakelock' , action = 'store_true' ,
409410 help = ('Indicate if the application needs the device '
410411 'to stay on' ))
411- ap .add_argument ('--window' , dest = 'window' , action = 'store_true ' ,
412+ ap .add_argument ('--window' , dest = 'window' , action = 'store_false ' ,
412413 help = 'Indicate if the application will be windowed' )
413414 ap .add_argument ('--blacklist' , dest = 'blacklist' ,
414415 default = join (curdir , 'blacklist.txt' ),
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ public void onClick(DialogInterface dialog,int id) {
130130 // Set up the webview
131131 mWebView = new WebView (this );
132132 mWebView .getSettings ().setJavaScriptEnabled (true );
133- mWebView .loadUrl ("file:///" + mActivity .getFilesDir ().getAbsolutePath () + "/load .html" );
133+ mWebView .loadUrl ("file:///" + mActivity .getFilesDir ().getAbsolutePath () + "/_load .html" );
134134
135135 mWebView .setLayoutParams (new LayoutParams (LayoutParams .FILL_PARENT , LayoutParams .FILL_PARENT ));
136136 mWebView .setWebViewClient (new WebViewClient () {
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < html >
4+ < head >
5+ < meta charset ="utf-8 ">
6+ < link href ="static/style.css " rel ="stylesheet " type ="text/css ">
7+ < title >
8+ Python WebView loader
9+ </ title >
10+
11+ </ head >
12+
13+ < body >
14+
15+ < div id ="load " style ="height:100% ">
16+ < div class ="loader " > Loading...</ div >
17+ </ div >
18+
19+
20+ < div id ="result " >
21+ </ div >
22+
23+ < script >
24+ console . log ( 'called!' ) ;
25+ var resultElem = document . getElementById ( 'result' ) ;
26+
27+ function queryFlask ( ) {
28+
29+ var request = new XMLHttpRequest ( ) ;
30+ request . open ( 'HEAD' , 'http://127.0.0.1:5000/' , true ) ;
31+ request . send ( ) ;
32+ request . onerror = function ( e ) {
33+ console . log ( 'error!' ) ;
34+ console . log ( e ) ;
35+ resultElem . innerHTML = 'workederr' ;
36+ }
37+ request . onreadystatechange = function ( ) {
38+ if ( request . status == 500 ) {
39+ console . log ( '500!!!!!' ) ;
40+ }
41+ if ( request . readyState == 4 & request . status == 200 ) {
42+ resultElem . innerHTML = 'worked' ;
43+ console . log ( 'worked' ) ;
44+ } else {
45+ resultElem . innerHTML = 'failed' ;
46+ console . log ( request . status ) ;
47+ console . log ( 'done' ) ;
48+ }
49+
50+
51+ }
52+ }
53+
54+ /* window.setInterval(queryFlask, 500); */
55+ window . setTimeout ( function ( ) { location . replace ( 'http://127.0.0.1:5000/' ) } , 1000 )
56+ </ script >
57+
58+ </ body >
59+
60+ </ html >
You can’t perform that action at this time.
0 commit comments