Change Nav bar style to use system nav (new style for Nexus N+)
Bug: 27612740

Change-Id: I309cf8252285130a0e1d2c03ca664706e73cce16
diff --git a/res/layout/accessibility_settings_for_suw.xml b/res/layout/accessibility_settings_for_suw.xml
deleted file mode 100644
index d566811..0000000
--- a/res/layout/accessibility_settings_for_suw.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-    Copyright (C) 2016 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"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical">
-
-    <FrameLayout
-        android:id="@+id/suw_main_content"
-        android:layout_width="match_parent"
-        android:layout_height="0dp"
-        android:layout_weight="1" />
-
-    <com.android.setupwizardlib.view.NavigationBar
-        android:id="@+id/suw_navigation_bar"
-        style="@style/SuwNavBarTheme"
-        android:layout_width="match_parent"
-        android:layout_height="@dimen/suw_navbar_height"
-        android:accessibilityTraversalAfter="@id/suw_main_content" />
-
-</LinearLayout>
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index d68b480..dc0b222 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -385,7 +385,6 @@
     private boolean mIsShowingDashboard;
     private boolean mIsShortcut;
 
-    private int mMainContentId = R.id.main_content;
     private ViewGroup mContent;
 
     private SearchView mSearchView;
@@ -558,7 +557,7 @@
         setContentView(mIsShowingDashboard ?
                 R.layout.settings_main_dashboard : R.layout.settings_main_prefs);
 
-        mContent = (ViewGroup) findViewById(mMainContentId);
+        mContent = (ViewGroup) findViewById(R.id.main_content);
 
         getFragmentManager().addOnBackStackChangedListener(this);
 
@@ -687,14 +686,6 @@
                 + " ms");
     }
 
-    /**
-     * Sets the id of the view containing the main content. Should be called before calling super's
-     * onCreate.
-     */
-    protected void setMainContentId(int contentId) {
-        mMainContentId = contentId;
-    }
-
     private void setTitleFromIntent(Intent intent) {
         final int initialTitleResId = intent.getIntExtra(EXTRA_SHOW_FRAGMENT_TITLE_RESID, -1);
         if (initialTitleResId > 0) {
@@ -975,7 +966,7 @@
      */
     public void startPreferenceFragment(Fragment fragment, boolean push) {
         FragmentTransaction transaction = getFragmentManager().beginTransaction();
-        transaction.replace(mMainContentId, fragment);
+        transaction.replace(R.id.main_content, fragment);
         if (push) {
             transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
             transaction.addToBackStack(BACK_STACK_PREFS);
@@ -996,7 +987,7 @@
         }
         Fragment f = Fragment.instantiate(this, fragmentName, args);
         FragmentTransaction transaction = getFragmentManager().beginTransaction();
-        transaction.replace(mMainContentId, f);
+        transaction.replace(R.id.main_content, f);
         if (withTransition) {
             TransitionManager.beginDelayedTransition(mContent);
         }
@@ -1193,7 +1184,7 @@
         if (mSearchResultsFragment != null) {
             return;
         }
-        Fragment current = getFragmentManager().findFragmentById(mMainContentId);
+        Fragment current = getFragmentManager().findFragmentById(R.id.main_content);
         if (current != null && current instanceof SearchResultsSummary) {
             mSearchResultsFragment = (SearchResultsSummary) current;
         } else {
diff --git a/src/com/android/settings/accessibility/AccessibilitySettingsForSetupWizardActivity.java b/src/com/android/settings/accessibility/AccessibilitySettingsForSetupWizardActivity.java
index edc0282..0ccf6d8 100644
--- a/src/com/android/settings/accessibility/AccessibilitySettingsForSetupWizardActivity.java
+++ b/src/com/android/settings/accessibility/AccessibilitySettingsForSetupWizardActivity.java
@@ -42,46 +42,11 @@
 
     @Override
     protected void onCreate(Bundle savedState) {
-        // Main content frame id should be set before calling super as that is where the first
-        // Fragment is inflated.
-        setMainContentId(R.id.suw_main_content);
         super.onCreate(savedState);
 
         // Finish configuring the content view.
-        FrameLayout parentLayout = (FrameLayout) findViewById(R.id.main_content);
-        LayoutInflater.from(this)
-                .inflate(R.layout.accessibility_settings_for_suw, parentLayout);
-
         getActionBar().setDisplayHomeAsUpEnabled(true);
         setIsDrawerPresent(false);
-
-        // Hide System Nav Bar.
-        SystemBarHelper.hideSystemBars(getWindow());
-        LinearLayout parentView = (LinearLayout) findViewById(R.id.content_parent);
-        parentView.setFitsSystemWindows(false);
-        // Adjust for the Status Bar.
-        parentView.setOnApplyWindowInsetsListener(new View.OnApplyWindowInsetsListener() {
-                @Override
-                public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
-                    parentView.setPadding(0, insets.getSystemWindowInsetTop(), 0, 0);
-                    return insets;
-                }
-            });
-
-        // Show SUW Nav Bar.
-        NavigationBar navigationBar = (NavigationBar) findViewById(R.id.suw_navigation_bar);
-        navigationBar.getNextButton().setVisibility(View.GONE);
-        navigationBar.setNavigationBarListener(new NavigationBar.NavigationBarListener() {
-            @Override
-            public void onNavigateBack() {
-                onNavigateUp();
-            }
-
-            @Override
-            public void onNavigateNext() {
-                // Do nothing. We don't show this button.
-            }
-        });
     }
 
     @Override