From 33340366aa5270358c54538de38bd20f7d2cdf74 Mon Sep 17 00:00:00 2001 From: Antony Sargent Date: Mon, 14 Jan 2019 17:38:25 -0800 Subject: [PATCH] Remove the multi-SIM bottom nav in network and internet v2 mode When a device has multiple SIMs, at the bottom of the SIM details page we show a chooser with an icon for each SIM card. This UX design is being supplanted by the new network and internet v2 design where there is a list of networks you can get to from the Network & internet homepage. So when the v2 mode is turned on, we don't want that bottom navigation to appear. Bug: 116349402 Test: visual (will remove existing tests for this feature eventually) Change-Id: I9cae479a1f4e689adcc4f4262661b10edbbbf2d3 --- .../mobile_network_settings_container_v2.xml | 39 +++++++++++++++++++ .../telephony/MobileNetworkActivity.java | 14 +++++-- 2 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 res/layout/mobile_network_settings_container_v2.xml diff --git a/res/layout/mobile_network_settings_container_v2.xml b/res/layout/mobile_network_settings_container_v2.xml new file mode 100644 index 00000000000..ed7296b39ae --- /dev/null +++ b/res/layout/mobile_network_settings_container_v2.xml @@ -0,0 +1,39 @@ + + + + + + + + + + diff --git a/src/com/android/settings/network/telephony/MobileNetworkActivity.java b/src/com/android/settings/network/telephony/MobileNetworkActivity.java index c101db4b095..93ba9180310 100644 --- a/src/com/android/settings/network/telephony/MobileNetworkActivity.java +++ b/src/com/android/settings/network/telephony/MobileNetworkActivity.java @@ -37,7 +37,9 @@ import androidx.fragment.app.FragmentTransaction; import com.android.internal.telephony.TelephonyIntents; import com.android.internal.util.CollectionUtils; import com.android.settings.R; +import com.android.settings.core.FeatureFlags; import com.android.settings.core.SettingsBaseActivity; +import com.android.settings.development.featureflags.FeatureFlagPersistent; import com.google.android.material.bottomnavigation.BottomNavigationView; @@ -77,7 +79,11 @@ public class MobileNetworkActivity extends SettingsBaseActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.mobile_network_settings_container); + if (FeatureFlagPersistent.isEnabled(this, FeatureFlags.NETWORK_INTERNET_V2)) { + setContentView(R.layout.mobile_network_settings_container_v2); + } else { + setContentView(R.layout.mobile_network_settings_container); + } setActionBar(findViewById(R.id.mobile_action_bar)); mPhoneChangeReceiver = new PhoneChangeReceiver(); mSubscriptionManager = getSystemService(SubscriptionManager.class); @@ -132,7 +138,9 @@ public class MobileNetworkActivity extends SettingsBaseActivity { void updateSubscriptions(Bundle savedInstanceState) { mSubscriptionInfos = mSubscriptionManager.getActiveSubscriptionInfoList(); - updateBottomNavigationView(); + if (!FeatureFlagPersistent.isEnabled(this, FeatureFlags.NETWORK_INTERNET_V2)) { + updateBottomNavigationView(); + } if (savedInstanceState == null) { switchFragment(new MobileNetworkSettings(), getSubscriptionId()); @@ -237,4 +245,4 @@ public class MobileNetworkActivity extends SettingsBaseActivity { } } } -} \ No newline at end of file +}