Merge "Change to use footer button of setupcompat"
This commit is contained in:
@@ -39,6 +39,6 @@
|
|||||||
style="@style/SuwGlifButton.Primary"
|
style="@style/SuwGlifButton.Primary"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/suw_next_button_label" />
|
android:text="@string/wizard_next" />
|
||||||
|
|
||||||
</com.google.android.setupdesign.view.ButtonBarLayout>
|
</com.google.android.setupdesign.view.ButtonBarLayout>
|
||||||
|
@@ -39,6 +39,6 @@
|
|||||||
style="@style/SuwGlifButton.Primary"
|
style="@style/SuwGlifButton.Primary"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/suw_next_button_label" />
|
android:text="@string/wizard_next" />
|
||||||
|
|
||||||
</com.google.android.setupdesign.view.ButtonBarLayout>
|
</com.google.android.setupdesign.view.ButtonBarLayout>
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:onClick="onNavigateBack"
|
android:onClick="onNavigateBack"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:text="@string/suw_back_button_label" />
|
android:text="@string/wizard_back" />
|
||||||
|
|
||||||
<Space
|
<Space
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
@@ -41,6 +41,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:onClick="onNavigateNext"
|
android:onClick="onNavigateNext"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:text="@string/suw_next_button_label" />
|
android:text="@string/wizard_next" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@@ -6746,7 +6746,7 @@
|
|||||||
<string name="wizard_back">Back</string>
|
<string name="wizard_back">Back</string>
|
||||||
<!-- Wizard next button label [CHAR LIMIT=25] -->
|
<!-- Wizard next button label [CHAR LIMIT=25] -->
|
||||||
<string name="wizard_next">Next</string>
|
<string name="wizard_next">Next</string>
|
||||||
<!-- Wizard next button label [CHAR LIMIT=25] -->
|
<!-- Wizard finish button label [CHAR LIMIT=25] -->
|
||||||
<string name="wizard_finish">Finish</string>
|
<string name="wizard_finish">Finish</string>
|
||||||
|
|
||||||
<!-- An option in a photo selection dialog, if there is no photo yet [CHAR LIMIT=50] -->
|
<!-- An option in a photo selection dialog, if there is no photo yet [CHAR LIMIT=50] -->
|
||||||
|
@@ -66,7 +66,9 @@ import com.android.settings.password.ConfirmLockPattern;
|
|||||||
import com.android.settingslib.RestrictedLockUtilsInternal;
|
import com.android.settingslib.RestrictedLockUtilsInternal;
|
||||||
|
|
||||||
import com.google.android.setupcompat.TemplateLayout;
|
import com.google.android.setupcompat.TemplateLayout;
|
||||||
import com.google.android.setupdesign.template.ButtonFooterMixin;
|
import com.google.android.setupcompat.item.FooterButton;
|
||||||
|
import com.google.android.setupcompat.item.FooterButton.ButtonType;
|
||||||
|
import com.google.android.setupcompat.template.ButtonFooterMixin;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -96,7 +98,7 @@ public class MasterClear extends InstrumentedFragment implements OnGlobalLayoutL
|
|||||||
|
|
||||||
private View mContentView;
|
private View mContentView;
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
Button mInitiateButton;
|
FooterButton mInitiateButton;
|
||||||
private View mExternalStorageContainer;
|
private View mExternalStorageContainer;
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
CheckBox mExternalStorage;
|
CheckBox mExternalStorage;
|
||||||
@@ -416,12 +418,15 @@ public class MasterClear extends InstrumentedFragment implements OnGlobalLayoutL
|
|||||||
|
|
||||||
final TemplateLayout layout = mContentView.findViewById(R.id.setup_wizard_layout);
|
final TemplateLayout layout = mContentView.findViewById(R.id.setup_wizard_layout);
|
||||||
final ButtonFooterMixin buttonFooterMixin = layout.getMixin(ButtonFooterMixin.class);
|
final ButtonFooterMixin buttonFooterMixin = layout.getMixin(ButtonFooterMixin.class);
|
||||||
buttonFooterMixin.removeAllViews();
|
buttonFooterMixin.setPrimaryButton(
|
||||||
buttonFooterMixin.addSpace();
|
new FooterButton(
|
||||||
buttonFooterMixin.addSpace();
|
getActivity(),
|
||||||
mInitiateButton = buttonFooterMixin.addButton(R.string.master_clear_button_text,
|
R.string.master_clear_button_text,
|
||||||
R.style.SuwGlifButton_Primary);
|
mInitiateListener,
|
||||||
mInitiateButton.setOnClickListener(mInitiateListener);
|
ButtonType.OTHER,
|
||||||
|
R.style.SuwGlifButton_Primary)
|
||||||
|
);
|
||||||
|
mInitiateButton = buttonFooterMixin.getPrimaryButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getContentDescription(View v, StringBuffer description) {
|
private void getContentDescription(View v, StringBuffer description) {
|
||||||
|
@@ -45,7 +45,9 @@ import com.android.settings.enterprise.ActionDisabledByAdminDialogHelper;
|
|||||||
import com.android.settingslib.RestrictedLockUtilsInternal;
|
import com.android.settingslib.RestrictedLockUtilsInternal;
|
||||||
|
|
||||||
import com.google.android.setupcompat.TemplateLayout;
|
import com.google.android.setupcompat.TemplateLayout;
|
||||||
import com.google.android.setupdesign.template.ButtonFooterMixin;
|
import com.google.android.setupcompat.item.FooterButton;
|
||||||
|
import com.google.android.setupcompat.item.FooterButton.ButtonType;
|
||||||
|
import com.google.android.setupcompat.template.ButtonFooterMixin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Confirm and execute a reset of the device to a clean "just out of the box"
|
* Confirm and execute a reset of the device to a clean "just out of the box"
|
||||||
@@ -153,11 +155,14 @@ public class MasterClearConfirm extends InstrumentedFragment {
|
|||||||
final TemplateLayout layout = mContentView.findViewById(R.id.setup_wizard_layout);
|
final TemplateLayout layout = mContentView.findViewById(R.id.setup_wizard_layout);
|
||||||
|
|
||||||
final ButtonFooterMixin buttonFooterMixin = layout.getMixin(ButtonFooterMixin.class);
|
final ButtonFooterMixin buttonFooterMixin = layout.getMixin(ButtonFooterMixin.class);
|
||||||
buttonFooterMixin.removeAllViews();
|
buttonFooterMixin.setPrimaryButton(
|
||||||
buttonFooterMixin.addSpace();
|
new FooterButton(
|
||||||
buttonFooterMixin.addSpace();
|
getActivity(),
|
||||||
buttonFooterMixin.addButton(R.string.master_clear_button_text,
|
R.string.master_clear_button_text,
|
||||||
R.style.SuwGlifButton_Primary).setOnClickListener(mFinalClickListener);
|
mFinalClickListener,
|
||||||
|
ButtonType.OTHER,
|
||||||
|
R.style.SuwGlifButton_Primary)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpActionBarAndTitle() {
|
private void setUpActionBarAndTitle() {
|
||||||
|
@@ -51,6 +51,7 @@ import android.widget.ScrollView;
|
|||||||
import androidx.fragment.app.FragmentActivity;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
import com.android.settings.testutils.shadow.ShadowUtils;
|
import com.android.settings.testutils.shadow.ShadowUtils;
|
||||||
|
import com.google.android.setupcompat.item.FooterButton;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@@ -386,7 +387,7 @@ public class MasterClearTest {
|
|||||||
public void testOnGlobalLayout_shouldNotRemoveListener() {
|
public void testOnGlobalLayout_shouldNotRemoveListener() {
|
||||||
final ViewTreeObserver viewTreeObserver = mock(ViewTreeObserver.class);
|
final ViewTreeObserver viewTreeObserver = mock(ViewTreeObserver.class);
|
||||||
mMasterClear.mScrollView = mScrollView;
|
mMasterClear.mScrollView = mScrollView;
|
||||||
mMasterClear.mInitiateButton = mock(Button.class);
|
mMasterClear.mInitiateButton = mock(FooterButton.class);
|
||||||
doReturn(true).when(mMasterClear).hasReachedBottom(any());
|
doReturn(true).when(mMasterClear).hasReachedBottom(any());
|
||||||
when(mScrollView.getViewTreeObserver()).thenReturn(viewTreeObserver);
|
when(mScrollView.getViewTreeObserver()).thenReturn(viewTreeObserver);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user