Merge "Change to use setupcompat and setupdesign for suw pages"
This commit is contained in:
@@ -15,14 +15,14 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<com.android.setupwizardlib.GlifLayout
|
||||
<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"
|
||||
style="?attr/fingerprint_layout_theme"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:suwFooter="@layout/fingerprint_enroll_find_sensor_base_footer">
|
||||
app:sucFooter="@layout/fingerprint_enroll_find_sensor_base_footer">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -77,4 +77,4 @@
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
</com.android.setupwizardlib.GlifLayout>
|
||||
</com.google.android.setupdesign.GlifLayout>
|
||||
|
||||
@@ -22,7 +22,9 @@ import android.content.Intent;
|
||||
import android.os.SystemProperties;
|
||||
|
||||
import com.android.settings.testutils.SettingsRobolectricTestRunner;
|
||||
import com.android.setupwizardlib.util.WizardManagerHelper;
|
||||
|
||||
import com.google.android.setupcompat.util.WizardManagerHelper;
|
||||
import com.google.android.setupdesign.util.ThemeHelper;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -47,9 +49,9 @@ public class SetupWizardUtilsTest {
|
||||
@Test
|
||||
public void testGetTheme_withIntentExtra_shouldReturnExtraTheme() {
|
||||
SystemProperties.set(SetupWizardUtils.SYSTEM_PROP_SETUPWIZARD_THEME,
|
||||
WizardManagerHelper.THEME_GLIF);
|
||||
ThemeHelper.THEME_GLIF);
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra(WizardManagerHelper.EXTRA_THEME, WizardManagerHelper.THEME_GLIF_V2);
|
||||
intent.putExtra(WizardManagerHelper.EXTRA_THEME, ThemeHelper.THEME_GLIF_V2);
|
||||
|
||||
assertThat(SetupWizardUtils.getTheme(intent)).isEqualTo(R.style.GlifV2Theme);
|
||||
}
|
||||
@@ -57,7 +59,7 @@ public class SetupWizardUtilsTest {
|
||||
@Test
|
||||
public void testGetTheme_withEmptyIntent_shouldReturnSystemProperty() {
|
||||
SystemProperties.set(SetupWizardUtils.SYSTEM_PROP_SETUPWIZARD_THEME,
|
||||
WizardManagerHelper.THEME_GLIF_V2_LIGHT);
|
||||
ThemeHelper.THEME_GLIF_V2_LIGHT);
|
||||
Intent intent = new Intent();
|
||||
|
||||
assertThat(SetupWizardUtils.getTheme(intent)).isEqualTo(R.style.GlifV2Theme_Light);
|
||||
@@ -66,7 +68,7 @@ public class SetupWizardUtilsTest {
|
||||
@Test
|
||||
public void testGetTheme_glifV3Light_shouldReturnThemeResource() {
|
||||
SystemProperties.set(SetupWizardUtils.SYSTEM_PROP_SETUPWIZARD_THEME,
|
||||
WizardManagerHelper.THEME_GLIF_V3_LIGHT);
|
||||
ThemeHelper.THEME_GLIF_V3_LIGHT);
|
||||
Intent intent = new Intent();
|
||||
|
||||
assertThat(SetupWizardUtils.getTheme(intent)).isEqualTo(R.style.GlifV3Theme_Light);
|
||||
|
||||
@@ -32,7 +32,8 @@ import com.android.settings.testutils.SettingsRobolectricTestRunner;
|
||||
import com.android.settings.testutils.shadow.SettingsShadowResources;
|
||||
import com.android.settings.testutils.shadow.SettingsShadowResourcesImpl;
|
||||
import com.android.settings.testutils.shadow.ShadowUtils;
|
||||
import com.android.setupwizardlib.GlifLayout;
|
||||
|
||||
import com.google.android.setupdesign.GlifLayout;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
|
||||
@@ -32,7 +32,8 @@ import com.android.settings.testutils.shadow.SettingsShadowResources;
|
||||
import com.android.settings.testutils.shadow.SettingsShadowResourcesImpl;
|
||||
import com.android.settings.testutils.shadow.ShadowUtils;
|
||||
import com.android.settingslib.testutils.DrawableTestHelper;
|
||||
import com.android.setupwizardlib.GlifLayout;
|
||||
|
||||
import com.google.android.setupdesign.GlifLayout;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@@ -19,7 +19,9 @@ import com.android.internal.widget.LockPatternUtils;
|
||||
import com.android.settings.testutils.SettingsRobolectricTestRunner;
|
||||
import com.android.settings.testutils.shadow.ShadowUserManager;
|
||||
import com.android.settings.testutils.shadow.ShadowUtils;
|
||||
import com.android.setupwizardlib.util.WizardManagerHelper;
|
||||
|
||||
import com.google.android.setupcompat.util.WizardManagerHelper;
|
||||
import com.google.android.setupdesign.util.ThemeHelper;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -109,7 +111,7 @@ public class ChooseLockSettingsHelperTest {
|
||||
@Test
|
||||
public void testLaunchConfirmationActivity_internal_shouldPropagateTheme() {
|
||||
Intent intent = new Intent()
|
||||
.putExtra(WizardManagerHelper.EXTRA_THEME, WizardManagerHelper.THEME_GLIF_V2);
|
||||
.putExtra(WizardManagerHelper.EXTRA_THEME, ThemeHelper.THEME_GLIF_V2);
|
||||
Activity activity = Robolectric.buildActivity(Activity.class, intent).get();
|
||||
ChooseLockSettingsHelper helper = getChooseLockSettingsHelper(activity);
|
||||
helper.launchConfirmationActivity(123, "test title", true, 0 /* userId */);
|
||||
@@ -118,7 +120,7 @@ public class ChooseLockSettingsHelperTest {
|
||||
IntentForResult startedActivity = shadowActivity.getNextStartedActivityForResult();
|
||||
assertThat(startedActivity.requestCode).isEqualTo(123);
|
||||
assertThat(startedActivity.intent.getStringExtra(WizardManagerHelper.EXTRA_THEME))
|
||||
.isEqualTo(WizardManagerHelper.THEME_GLIF_V2);
|
||||
.isEqualTo(ThemeHelper.THEME_GLIF_V2);
|
||||
}
|
||||
|
||||
private ChooseLockSettingsHelper getChooseLockSettingsHelper(Activity activity) {
|
||||
|
||||
@@ -72,9 +72,9 @@ public class SettingsRobolectricTestRunner extends RobolectricTestRunner {
|
||||
public static void addIncludedResourcePaths(List<ResourcePath> paths) {
|
||||
try {
|
||||
paths.add(new ResourcePath(null,
|
||||
Fs.fromURL(new URL("file:packages/apps/Settings/res")), null));
|
||||
Fs.fromURL(new URL("file:packages/apps/Settings/res")), null));
|
||||
paths.add(new ResourcePath(null,
|
||||
Fs.fromURL(new URL("file:frameworks/base/packages/SettingsLib/res")), null));
|
||||
Fs.fromURL(new URL("file:frameworks/base/packages/SettingsLib/res")), null));
|
||||
paths.add(new ResourcePath(null,
|
||||
Fs.fromURL(new URL("file:frameworks/base/packages/SettingsLib/AppPreference/res/")), null));
|
||||
paths.add(new ResourcePath(null,
|
||||
@@ -88,21 +88,19 @@ public class SettingsRobolectricTestRunner extends RobolectricTestRunner {
|
||||
paths.add(new ResourcePath(null,
|
||||
Fs.fromURL(new URL("file:frameworks/base/packages/SettingsLib/SettingsLayoutPreference/res")), null));
|
||||
paths.add(new ResourcePath(null,
|
||||
Fs.fromURL(new URL("file:frameworks/base/core/res/res")), null));
|
||||
Fs.fromURL(new URL("file:frameworks/base/core/res/res")), null));
|
||||
paths.add(new ResourcePath(null,
|
||||
Fs.fromURL(new URL("file:frameworks/opt/setupwizard/library/main/res")), null));
|
||||
Fs.fromURL(new URL("file:external/setupcompat/main/res")), null));
|
||||
paths.add(new ResourcePath(null,
|
||||
Fs.fromURL(new URL("file:external/setupdesign/main/res")), null));
|
||||
paths.add(new ResourcePath(null,
|
||||
Fs.fromURL(new URL("file:out/target/common/obj/JAVA_LIBRARIES/robolectric_android-all-stub_intermediates/classes/raw-res/res")), null));
|
||||
paths.add(new ResourcePath(null,
|
||||
Fs.fromURL(new URL("file:frameworks/opt/setupwizard/library/gingerbread/res")), null));
|
||||
Fs.fromURL(new URL("file:out/soong/.intermediates/prebuilts/sdk/current/androidx/androidx.appcompat_appcompat-nodeps/android_common/aar/res/")), null));
|
||||
paths.add(new ResourcePath(null,
|
||||
Fs.fromURL(new URL("file:frameworks/opt/setupwizard/library/recyclerview/res")), null));
|
||||
Fs.fromURL(new URL("file:out/soong/.intermediates/prebuilts/sdk/current/extras/material-design-x/com.google.android.material_material-nodeps/android_common/aar/res/")), null));
|
||||
paths.add(new ResourcePath(null,
|
||||
Fs.fromURL(new URL("file:out/soong/.intermediates/prebuilts/sdk/current/androidx/androidx.appcompat_appcompat-nodeps/android_common/aar/res/")), null));
|
||||
paths.add(new ResourcePath(null,
|
||||
Fs.fromURL(new URL("file:out/soong/.intermediates/prebuilts/sdk/current/extras/material-design-x/com.google.android.material_material-nodeps/android_common/aar/res/")), null));
|
||||
paths.add(new ResourcePath(null,
|
||||
Fs.fromURL(new URL("file:out/soong/.intermediates/prebuilts/sdk/current/androidx/androidx.cardview_cardview-nodeps/android_common/aar/res")), null));
|
||||
Fs.fromURL(new URL("file:out/soong/.intermediates/prebuilts/sdk/current/androidx/androidx.cardview_cardview-nodeps/android_common/aar/res")), null));
|
||||
paths.add(new ResourcePath(null,
|
||||
Fs.fromURL(new URL("file:out/soong/.intermediates/prebuilts/sdk/current/androidx/androidx.slice_slice-view-nodeps/android_common/aar/res")), null));
|
||||
paths.add(new ResourcePath(null,
|
||||
|
||||
Reference in New Issue
Block a user