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
This commit is contained in:
SongFerngWang
2021-12-08 22:51:43 +08:00
parent 1e0e9021ac
commit 22ab05b420
8 changed files with 181 additions and 23 deletions

View File

@@ -455,6 +455,31 @@ public class ToggleSubscriptionDialogActivity extends SubscriptionActionDialogAc
private void showMepSwitchSimConfirmDialog() {
Log.i(TAG, "showMepSwitchSimConfirmDialog");
final CharSequence displayName = SubscriptionUtil.getUniqueSubscriptionDisplayName(
mSubInfo, this);
String title = getString(R.string.sim_action_switch_sub_dialog_mep_title, displayName);
final StringBuilder switchDialogMsg = new StringBuilder();
switchDialogMsg.append(
getString(R.string.sim_action_switch_sub_dialog_mep_text, displayName));
if (isRtlMode) {
/* There are two lines of message in the dialog, and the RTL symbols must be added
* before and after each sentence, so use the line break symbol to find the position.
* (Each message are all with two line break symbols)
*/
switchDialogMsg.insert(0, RTL_MARK)
.insert(switchDialogMsg.indexOf(LINE_BREAK) - LINE_BREAK_OFFSET_ONE, RTL_MARK)
.insert(switchDialogMsg.indexOf(LINE_BREAK) + LINE_BREAK_OFFSET_TWO, RTL_MARK)
.insert(switchDialogMsg.length(), RTL_MARK);
}
ConfirmDialogFragment.show(
this,
ConfirmDialogFragment.OnConfirmListener.class,
DIALOG_TAG_ENABLE_SIM_CONFIRMATION_MEP,
title,
switchDialogMsg.toString(),
null,
null,
getSwitchDialogBodyList());
}
private String getSwitchDialogPosBtnText() {