diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2018-05-16 07:21:58 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2018-05-16 07:21:58 +0000 |
commit | 30edb6eff712ae6f9bbf05a629915c55337ba9ff (patch) | |
tree | df968e360ec575fa0d4acd10a427c57d37dd6072 | |
parent | 8aebd6208f773d52b91d4c9e04c918f2d8f85235 (diff) | |
parent | a65273f3bdf0527b101e51b6c5fba0ff51585831 (diff) | |
download | setupwizard-30edb6eff712ae6f9bbf05a629915c55337ba9ff.tar.gz |
Snap for 4784261 from a65273f3bdf0527b101e51b6c5fba0ff51585831 to pi-release
Change-Id: Ifd614b494a473c2aaa886b1e430d91684b91e6b6
-rw-r--r-- | library/gingerbread/res/layout/suw_items_switch.xml | 1 | ||||
-rw-r--r-- | library/gingerbread/test/robotest/src/com/android/setupwizardlib/items/SwitchItemTest.java | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/library/gingerbread/res/layout/suw_items_switch.xml b/library/gingerbread/res/layout/suw_items_switch.xml index 3f101d7..319d7f7 100644 --- a/library/gingerbread/res/layout/suw_items_switch.xml +++ b/library/gingerbread/res/layout/suw_items_switch.xml @@ -20,6 +20,7 @@ style="@style/SuwItemContainer.Verbose" android:layout_width="match_parent" android:layout_height="wrap_content" + android:clipToPadding="false" android:orientation="horizontal"> <FrameLayout diff --git a/library/gingerbread/test/robotest/src/com/android/setupwizardlib/items/SwitchItemTest.java b/library/gingerbread/test/robotest/src/com/android/setupwizardlib/items/SwitchItemTest.java index fa5bbba..dd26af9 100644 --- a/library/gingerbread/test/robotest/src/com/android/setupwizardlib/items/SwitchItemTest.java +++ b/library/gingerbread/test/robotest/src/com/android/setupwizardlib/items/SwitchItemTest.java @@ -16,12 +16,15 @@ package com.android.setupwizardlib.items; +import static com.google.common.truth.Truth.assertThat; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.robolectric.RuntimeEnvironment.application; import android.annotation.TargetApi; +import android.os.Build.VERSION; import android.os.Build.VERSION_CODES; import android.support.v7.widget.SwitchCompat; import android.view.LayoutInflater; @@ -34,6 +37,7 @@ import android.widget.TextView; import com.android.setupwizardlib.R; import com.android.setupwizardlib.robolectric.SuwLibRobolectricTestRunner; +import org.junit.Assume; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.annotation.Config; @@ -45,6 +49,15 @@ public class SwitchItemTest { private SwitchCompat mSwitch; @Test + public void testLayout() { + Assume.assumeTrue(VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP); + SwitchItem item = new SwitchItem(); + LayoutInflater inflater = LayoutInflater.from(application); + ViewGroup layout = (ViewGroup) inflater.inflate(item.getDefaultLayoutResource(), null); + assertThat(layout.getClipToPadding()).isFalse(); + } + + @Test public void testChecked() { SwitchItem item = new SwitchItem(); item.setTitle("TestTitle"); |