Migrating to new footer button for storage migrated pages
Remove unused files storage_wizard_ready.xml and storage_wizard_navigation.xml Bug: 120805516 Test: RunSettingsRoboTests Change-Id: Ie3f0023413244dfc2b3f8dddae42977c920e93ac
This commit is contained in:
@@ -1,46 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
Copyright (C) 2017 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"
|
|
||||||
style="@style/SuwGlifButtonBar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/storage_back_button"
|
|
||||||
style="@style/SuwGlifButton.Secondary"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:onClick="onNavigateBack"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:text="@string/wizard_back" />
|
|
||||||
|
|
||||||
<Space
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/storage_next_button"
|
|
||||||
style="@style/SuwGlifButton.Primary"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:onClick="onNavigateNext"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:text="@string/wizard_next" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
@@ -19,8 +19,7 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/setup_wizard_layout"
|
android:id="@+id/setup_wizard_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
app:sucFooter="@layout/storage_wizard_footer">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
style="@style/SuwContentFrame"
|
style="@style/SuwContentFrame"
|
||||||
|
@@ -19,8 +19,7 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/setup_wizard_layout"
|
android:id="@+id/setup_wizard_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
app:sucFooter="@layout/storage_wizard_footer">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
style="@style/SuwContentFrame"
|
style="@style/SuwContentFrame"
|
||||||
|
@@ -1,52 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Copyright (C) 2015 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:id="@+id/suw_layout_navigation_bar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/suw_navbar_back"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/suw_navbar_more"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/suw_navbar_next"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
android:layout_marginBottom="16dp"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:text="@string/wizard_next"
|
|
||||||
android:textColor="@android:color/white"
|
|
||||||
android:backgroundTint="@color/storage_wizard_button" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
@@ -19,8 +19,7 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/setup_wizard_layout"
|
android:id="@+id/setup_wizard_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
app:sucFooter="@layout/storage_wizard_footer">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
style="@style/SuwContentFrame"
|
style="@style/SuwContentFrame"
|
||||||
|
@@ -1,41 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Copyright (C) 2015 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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<com.google.android.setupdesign.GlifLayout
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:id="@+id/setup_wizard_layout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
app:sucFooter="@layout/storage_wizard_footer">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
style="@style/SuwContentFrame"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/storage_wizard_ready_body"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="@dimen/suw_description_margin_top"
|
|
||||||
android:lineSpacingExtra="@dimen/suw_description_line_spacing_extra"
|
|
||||||
android:textColor="?android:attr/textColorPrimary" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</com.google.android.setupdesign.GlifLayout>
|
|
@@ -35,7 +35,6 @@ import android.text.TextUtils;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
@@ -45,6 +44,8 @@ import androidx.fragment.app.FragmentActivity;
|
|||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
import com.android.settingslib.Utils;
|
import com.android.settingslib.Utils;
|
||||||
|
|
||||||
|
import com.google.android.setupcompat.item.FooterButton;
|
||||||
|
import com.google.android.setupcompat.template.ButtonFooterMixin;
|
||||||
import com.google.android.setupdesign.GlifLayout;
|
import com.google.android.setupdesign.GlifLayout;
|
||||||
|
|
||||||
import java.text.NumberFormat;
|
import java.text.NumberFormat;
|
||||||
@@ -62,8 +63,9 @@ public abstract class StorageWizardBase extends FragmentActivity {
|
|||||||
protected VolumeInfo mVolume;
|
protected VolumeInfo mVolume;
|
||||||
protected DiskInfo mDisk;
|
protected DiskInfo mDisk;
|
||||||
|
|
||||||
private Button mBack;
|
private ButtonFooterMixin mButtonFooterMixin;
|
||||||
private Button mNext;
|
private FooterButton mBack;
|
||||||
|
private FooterButton mNext;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -92,8 +94,25 @@ public abstract class StorageWizardBase extends FragmentActivity {
|
|||||||
public void setContentView(@LayoutRes int layoutResID) {
|
public void setContentView(@LayoutRes int layoutResID) {
|
||||||
super.setContentView(layoutResID);
|
super.setContentView(layoutResID);
|
||||||
|
|
||||||
mBack = requireViewById(R.id.storage_back_button);
|
mButtonFooterMixin = getGlifLayout().getMixin(ButtonFooterMixin.class);
|
||||||
mNext = requireViewById(R.id.storage_next_button);
|
mButtonFooterMixin.setSecondaryButton(
|
||||||
|
new FooterButton(
|
||||||
|
this,
|
||||||
|
R.string.wizard_back,
|
||||||
|
this::onNavigateBack,
|
||||||
|
FooterButton.ButtonType.OTHER,
|
||||||
|
R.style.SuwGlifButton_Secondary)
|
||||||
|
);
|
||||||
|
mButtonFooterMixin.setPrimaryButton(
|
||||||
|
new FooterButton(
|
||||||
|
this,
|
||||||
|
R.string.wizard_next,
|
||||||
|
this::onNavigateNext,
|
||||||
|
FooterButton.ButtonType.NEXT,
|
||||||
|
R.style.SuwGlifButton_Primary)
|
||||||
|
);
|
||||||
|
mBack = mButtonFooterMixin.getSecondaryButton();
|
||||||
|
mNext = mButtonFooterMixin.getPrimaryButton();
|
||||||
|
|
||||||
setIcon(com.android.internal.R.drawable.ic_sd_card_48dp);
|
setIcon(com.android.internal.R.drawable.ic_sd_card_48dp);
|
||||||
}
|
}
|
||||||
@@ -104,11 +123,11 @@ public abstract class StorageWizardBase extends FragmentActivity {
|
|||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Button getBackButton() {
|
protected FooterButton getBackButton() {
|
||||||
return mBack;
|
return mBack;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Button getNextButton() {
|
protected FooterButton getNextButton() {
|
||||||
return mNext;
|
return mNext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,7 +30,6 @@ import com.android.settings.R;
|
|||||||
import com.android.settings.overlay.FeatureFactory;
|
import com.android.settings.overlay.FeatureFactory;
|
||||||
|
|
||||||
public class StorageWizardInit extends StorageWizardBase {
|
public class StorageWizardInit extends StorageWizardBase {
|
||||||
private Button mExternal;
|
|
||||||
private Button mInternal;
|
private Button mInternal;
|
||||||
|
|
||||||
private boolean mIsPermittedToAdopt;
|
private boolean mIsPermittedToAdopt;
|
||||||
@@ -49,7 +48,6 @@ public class StorageWizardInit extends StorageWizardBase {
|
|||||||
|
|
||||||
setHeaderText(R.string.storage_wizard_init_v2_title, getDiskShortDescription());
|
setHeaderText(R.string.storage_wizard_init_v2_title, getDiskShortDescription());
|
||||||
|
|
||||||
mExternal = requireViewById(R.id.storage_wizard_init_external);
|
|
||||||
mInternal = requireViewById(R.id.storage_wizard_init_internal);
|
mInternal = requireViewById(R.id.storage_wizard_init_internal);
|
||||||
|
|
||||||
setBackButtonText(R.string.storage_wizard_init_v2_later);
|
setBackButtonText(R.string.storage_wizard_init_v2_later);
|
||||||
|
Reference in New Issue
Block a user