Skip to content

Commit

Permalink
Update MainActivity.java
Browse files Browse the repository at this point in the history
  • Loading branch information
InukaAsith authored Nov 29, 2023
1 parent 8951480 commit 6e7dc25
Showing 1 changed file with 12 additions and 66 deletions.
78 changes: 12 additions & 66 deletions app/src/main/java/com/ubetta/dtvfree/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,7 @@ public void onFinish() {
} else {

if (!webView.canGoBack()) {
Toast.makeText(MainActivity.this, "Long Press Back Button for menu", Toast.LENGTH_SHORT).show();
//hideView(dialogBack);
// create an array of items to display
new AlertDialog.Builder(this)
Expand Down Expand Up @@ -1397,10 +1398,12 @@ public void onClick(DialogInterface dialog, int which) {
// Set the error status to false
isError = false;
// Go back to the previous page in the WebView
Toast.makeText(MainActivity.this, "Long Press Back Button for menu", Toast.LENGTH_SHORT).show();
webView.loadUrl(lastSuccessUrl);

} else {
// Otherwise, call the super method
Toast.makeText(MainActivity.this, "Long Press Back Button for menu", Toast.LENGTH_SHORT).show();
webView.goBack();

}
Expand Down Expand Up @@ -1525,74 +1528,17 @@ public void onClick(DialogInterface dialog, int which) {
}
}
}
if (webClient.isFullScreen()) {
webClient.onHideCustomView();
} else {
// if (nocursor) {
// cursorButton.setBackground(ContextCompat.getDrawable(MainActivity.this,R.drawable.cursor_background));



if( nocursor) {

if (webClient.isFullScreen()) {
webClient.onHideCustomView();
break;
} else {
// if (nocursor) {
// cursorButton.setBackground(ContextCompat.getDrawable(MainActivity.this,R.drawable.cursor_background));

//}
dialogBack.setVisibility(View.VISIBLE);
panelViews[row][column].requestFocus();
}
break;
}
else{
if (webClient.isFullScreen()) {
webClient.onHideCustomView();
} else {

if (!webView.canGoBack()) {
//hideView(dialogBack);
// create an array of items to display
new AlertDialog.Builder(this)
.setIcon(android.R.drawable.ic_dialog_alert)
.setTitle("Closing Application")
.setMessage("Are you sure you want to close this application?")
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// call the finish method to end the activity
finish();
}
})
.setNegativeButton("No", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// cancel the dialog
dialog.cancel();
hideView(dialogBack);
}})
.show();
hideView(dialogBack);

break;

} else {
if (isError) {
// Set the error status to false
isError = false;
// Go back to the previous page in the WebView
webView.loadUrl(lastSuccessUrl);
} else {
// Otherwise, call the super method
Toast.makeText(MainActivity.this, "Long Press Back Button for menu", Toast.LENGTH_SHORT).show();
webView.goBack();

}
//webView.goBack();
break;
}
}


//}
dialogBack.setVisibility(View.VISIBLE);
panelViews[row][column].requestFocus();
}
break;

}

Expand Down

0 comments on commit 6e7dc25

Please sign in to comment.