feat: add typed data and views with scoped device power
This commit is contained in:
@@ -42,7 +42,7 @@ public class MainActivity extends Activity {
|
||||
web.getSettings().setMixedContentMode(android.webkit.WebSettings.MIXED_CONTENT_NEVER_ALLOW);
|
||||
web.setWebViewClient(new WebViewClient(){
|
||||
@Override public boolean shouldOverrideUrlLoading(WebView view,WebResourceRequest request){
|
||||
return !"https".equals(request.getUrl().getScheme()) || !"zhao.ucvl.cn".equals(request.getUrl().getHost()) || !request.getUrl().getPath().startsWith("/tv");
|
||||
return !ServerEndpoint.tvNavigation(request.getUrl().toString());
|
||||
}
|
||||
});
|
||||
LinearLayout layout=new LinearLayout(this);layout.setOrientation(LinearLayout.VERTICAL);
|
||||
@@ -58,7 +58,7 @@ public class MainActivity extends Activity {
|
||||
if(code!=null&&code.matches("[0-9]{8}")){intent.removeExtra("pairing_code");pair(code);return;}
|
||||
String token=getSharedPreferences("display",MODE_PRIVATE).getString("token","");
|
||||
// A changed fragment alone does not reload an existing WebView document.
|
||||
web.loadUrl("https://zhao.ucvl.cn/tv?client=android&load="+System.currentTimeMillis()+(token.isEmpty()?"":"#display="+token));
|
||||
web.loadUrl(ServerEndpoint.TV+"?client=android&load="+System.currentTimeMillis()+(token.isEmpty()?"":"#display="+token));
|
||||
if(!token.isEmpty())startForegroundService(new Intent(this,MonitorService.class));
|
||||
else pairDialog();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user