Skip to content

Commit

Permalink
Cleanup after merging mypads to help #48
Browse files Browse the repository at this point in the history
  • Loading branch information
mikifus committed Mar 18, 2018
1 parent 0914b45 commit 31ec6b4
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions app/src/main/java/com/mikifus/padland/PadViewActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ public void onCreate(Bundle savedInstanceState) {
// Checks if the url is a valid pad
this._makePadUrl();

// Forces landscape view
// this.setRequestedOrientation( ActivityInfo.SCREEN_ORIENTATION_PORTRAIT );
handler = new Handler();

titanPadCheck();
Expand Down Expand Up @@ -180,7 +178,7 @@ public void onCreate(Bundle savedInstanceState, PersistableBundle persistentStat
* Loads the fancy ProgressWheel to show it's loading.
*/
private void _loadProgressWheel() {
pwheel = (ProgressWheel) findViewById(R.id.progress_wheel);
pwheel = findViewById(R.id.progress_wheel);
pwheel.spin();
}

Expand All @@ -193,10 +191,6 @@ private void _setProgressWheelProgress(int progress) {

Log.d("LOAD_PROGRESS_LOG", String.valueOf(progress));
pwheel.setProgress(p);

// if (progress > 99) {
// _hideProgressWheel();
// }
}

public void _showProgressWheel() {
Expand Down Expand Up @@ -374,14 +368,13 @@ private boolean _updateViewedPad() {
*/
private WebView _makeWebView() {
// final String current_padUrl = this.getCurrentPadUrl();
webView = (WebView) findViewById(R.id.activity_main_webview);
// webView = new WebView(PadViewActivity.this);
webView = findViewById(R.id.activity_main_webview);
webView.setLayoutParams(new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));

// The WebViewClient requires now a whitelist of urls that can interact with the Java side of the code
String[] url_whitelist = getServerWhiteList();
webView.setWebViewClient(new PadLandSaferWebViewClient(url_whitelist) {
private boolean done_auth;
// private boolean done_auth;

@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
Expand Down Expand Up @@ -424,7 +417,6 @@ public void onReceivedError(WebView view, WebResourceRequest request, WebResourc
super.onReceivedError(view, request, error);
--webview_http_connections[0];
_hideProgressWheel();
// Log.d(TAG, "Removed connection " + webview_http_connections[0]);
Log.e(TAG, "WebView Error " + error.toString() +", Request: "+ request.toString());
}

Expand All @@ -441,7 +433,6 @@ public void onReceivedError(WebView view, int errorCode, String description, Str
super.onReceivedError(view, errorCode, description, failingUrl);
--webview_http_connections[0];
_hideProgressWheel();
// Log.d(TAG, "Removed connection " + webview_http_connections[0]);
Log.e(TAG, "WebView Error ("+errorCode+") " + description +", Request: "+ failingUrl);
}

Expand Down

0 comments on commit 31ec6b4

Please # to comment.