switch SIM refactor to support MEP

To create new dialog for MEP. It is a simple UI for testing,
not the final version.

Bug: 199902896
Test: local build pass.
Change-Id: Ief4299e775c0758e4b886d5eff13bd482f8c8ab3
Merged-In: Ief4299e775c0758e4b886d5eff13bd482f8c8ab3
This commit is contained in:
SongFerngWang
2021-12-08 22:51:43 +08:00
committed by SongFerng Wang
parent 37358798bc
commit 59a6ecbde2
8 changed files with 181 additions and 23 deletions

View File

@@ -16,13 +16,14 @@
package com.android.settings.network.telephony;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.text.TextUtils;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.FragmentActivity;
/** Fragment to show an alert dialog which only has the positive button. */
public class AlertDialogFragment extends BaseDialogFragment
implements DialogInterface.OnClickListener {
@@ -37,13 +38,13 @@ public class AlertDialogFragment extends BaseDialogFragment
* @param title
* @param msg
*/
public static void show(Activity activity, String title, String msg) {
public static void show(FragmentActivity activity, String title, String msg) {
AlertDialogFragment fragment = new AlertDialogFragment();
Bundle arguments = new Bundle();
arguments.putString(ARG_TITLE, title);
arguments.putString(ARG_MSG, msg);
fragment.setArguments(arguments);
fragment.show(activity.getFragmentManager(), TAG);
fragment.show(activity.getSupportFragmentManager(), TAG);
}
@Override
@@ -55,7 +56,7 @@ public class AlertDialogFragment extends BaseDialogFragment
if (!TextUtils.isEmpty(getArguments().getString(ARG_MSG))) {
builder.setMessage(getArguments().getString(ARG_MSG));
}
return builder.show();
return builder.create();
}
@Override