Only display options to save and cancel edits to the displayed APN if the APN is editable.

Test: mp settingsg and look at the UI. This class does not yet have
tests.

Current design:
 - https://screenshot.googleplex.com/BgrLPsz3ebxBnMa
 - https://screenshot.googleplex.com/AeRQe6Rh8SxjjMw

Updated design: https://screenshot.googleplex.com/3bhmWwMjhEXh2Eu

Change-Id: Ic9794ca14534adde92a641560a00b1bd876d52cb
This commit is contained in:
Jeremy Goldman
2020-10-23 07:18:56 +00:00
committed by Tom Hsu
parent ce3f58cc68
commit 77f5ae6dc7

View File

@@ -805,8 +805,11 @@ public class ApnEditor extends SettingsPreferenceFragment
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
if (mReadOnlyApn) {
return;
}
// If it's a new APN, then cancel will delete the new entry in onPause
if (!mNewApn && !mReadOnlyApn) {
if (!mNewApn) {
menu.add(0, MENU_DELETE, 0, R.string.menu_delete)
.setIcon(R.drawable.ic_delete);
}