Merge "Remove duplicate layout mobile_network_settings_container_v2"

This commit is contained in:
TreeHugger Robot
2019-11-08 08:22:15 +00:00
committed by Android (Google) Code Review
6 changed files with 15 additions and 51 deletions

View File

@@ -1,39 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2019 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Toolbar
android:id="@+id/mobile_action_bar"
style="?android:attr/actionBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:navigationContentDescription="@*android:string/action_bar_up_description"
android:theme="?android:attr/actionBarTheme"/>
<FrameLayout
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"/>
</LinearLayout>

View File

@@ -56,7 +56,7 @@ public class NetworkDashboardFragment extends DashboardFragment implements
@Override
protected int getPreferenceScreenResId() {
return R.xml.network_and_internet_v2;
return R.xml.network_and_internet;
}
@Override
@@ -141,7 +141,7 @@ public class NetworkDashboardFragment extends DashboardFragment implements
}
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
new BaseSearchIndexProvider(R.xml.network_and_internet_v2) {
new BaseSearchIndexProvider(R.xml.network_and_internet) {
@Override
public List<AbstractPreferenceController> createPreferenceControllers(Context

View File

@@ -22,6 +22,8 @@ import android.os.Bundle;
import android.os.UserManager;
import android.provider.Settings;
import android.telephony.SubscriptionInfo;
import android.view.View;
import android.widget.Toolbar;
import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
@@ -74,8 +76,14 @@ public class MobileNetworkActivity extends SettingsBaseActivity
return;
}
setContentView(R.layout.mobile_network_settings_container_v2);
setActionBar(findViewById(R.id.mobile_action_bar));
final Toolbar toolbar = findViewById(R.id.action_bar);
toolbar.setVisibility(View.VISIBLE);
setActionBar(toolbar);
final ActionBar actionBar = getActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
}
mProxySubscriptionMgr = ProxySubscriptionManager.getInstance(this);
mProxySubscriptionMgr.setLifecycle(getLifecycle());
@@ -85,11 +93,6 @@ public class MobileNetworkActivity extends SettingsBaseActivity
? savedInstanceState.getInt(Settings.EXTRA_SUB_ID, SUB_ID_NULL)
: SUB_ID_NULL;
final ActionBar actionBar = getActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
}
final SubscriptionInfo subscription = getSubscription();
updateTitleAndNavigation(subscription);
}
@@ -178,7 +181,7 @@ public class MobileNetworkActivity extends SettingsBaseActivity
final Fragment fragment = new MobileNetworkSettings();
fragment.setArguments(bundle);
fragmentTransaction.replace(R.id.main_content, fragment, buildFragmentTag(subId));
fragmentTransaction.replace(R.id.content_frame, fragment, buildFragmentTag(subId));
fragmentTransaction.commit();
}

View File

@@ -195,7 +195,7 @@ public class MobileNetworkSettings extends RestrictedDashboardFragment {
@Override
protected int getPreferenceScreenResId() {
return R.xml.mobile_network_settings_v2;
return R.xml.mobile_network_settings;
}
@Override
@@ -259,7 +259,7 @@ public class MobileNetworkSettings extends RestrictedDashboardFragment {
}
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
new BaseSearchIndexProvider(R.xml.mobile_network_settings_v2) {
new BaseSearchIndexProvider(R.xml.mobile_network_settings) {
/** suppress full page if user is not admin */
@Override