Changed Help popup to use AlertDialog instead of Toaster.

This commit is contained in:
Stanislav 2021-11-03 03:28:22 +01:00 committed by emanuele-f
parent cff85f84ea
commit 14424a84ae
3 changed files with 15 additions and 1 deletions

View File

@ -391,6 +391,19 @@ public class Utils {
Toast.makeText(context, msg, Toast.LENGTH_LONG).show();
}
public static void showHelpDialog(Context context, int id){
String msg = context.getResources().getString(id);
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(R.string.hint);
builder.setMessage(msg);
builder.setCancelable(true);
builder.setNeutralButton(R.string.ok,
(dialog, id1) -> dialog.cancel());
AlertDialog alert= builder.create();
alert.show();
}
public static Dialog getAppSelectionDialog(Activity activity, List<AppDescriptor> appsData, AppsListView.OnSelectedAppListener listener) {
View dialogLayout = activity.getLayoutInflater().inflate(R.layout.apps_selector, null);
SearchView searchView = dialogLayout.findViewById(R.id.apps_search);

View File

@ -94,7 +94,7 @@ public class EditListActivity extends BaseActivity {
return true;
} else if(id == R.id.show_help) {
Utils.showToastLong(this, mListInfo.getHelpString());
Utils.showHelpDialog(this, mListInfo.getHelpString());
return true;
}

View File

@ -190,5 +190,6 @@
<string name="malware_detection_ad0">Ready to enhance the security of your device?</string>
<string name="malware_detection_ad1">Meet the PCAPdroid malware detection!</string>
<string name="show_me">Show me</string>
<string name="hint">Hint</string>
</resources>