diff options
author | Maurice Lam <yukl@google.com> | 2017-11-03 12:16:04 -0700 |
---|---|---|
committer | Maurice Lam <yukl@google.com> | 2017-11-03 17:00:02 -0700 |
commit | 00e551ce2deaeb4414fc5a387d8ea8de6a19876c (patch) | |
tree | 3dcd2601d45cd389507cde91beb0363396d08f15 /library/test/robotest/src/com | |
parent | 88d7f0d37007e13601b6ead3ca039ece20ef94d7 (diff) | |
download | setupwizard-00e551ce2deaeb4414fc5a387d8ea8de6a19876c.tar.gz |
Allow GlifLayout to not request fullscreen
For usage with app bars or inside another layout, GlifLayout should
not request fullscreen. Add a flag to allow disabling that.
Test: ./gradlew test
Bug: 68826871
Change-Id: Ie6a7f91628af5b861e8ba91e62a3f1c9c390aebf
Diffstat (limited to 'library/test/robotest/src/com')
-rw-r--r-- | library/test/robotest/src/com/android/setupwizardlib/GlifLayoutTest.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/library/test/robotest/src/com/android/setupwizardlib/GlifLayoutTest.java b/library/test/robotest/src/com/android/setupwizardlib/GlifLayoutTest.java index d46409d..967a52e 100644 --- a/library/test/robotest/src/com/android/setupwizardlib/GlifLayoutTest.java +++ b/library/test/robotest/src/com/android/setupwizardlib/GlifLayoutTest.java @@ -32,6 +32,7 @@ import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.os.Build; +import android.os.Build.VERSION_CODES; import android.support.annotation.IdRes; import android.view.ContextThemeWrapper; import android.view.View; @@ -266,6 +267,32 @@ public class GlifLayoutTest { assertNotNull(layout.findViewById(android.R.id.text1)); } + @Config(sdk = { VERSION_CODES.M, Config.NEWEST_SDK }) + @Test + public void createFromXml_shouldSetLayoutFullscreen_whenLayoutFullscreenIsNotSet() { + GlifLayout layout = new GlifLayout( + mContext, + Robolectric.buildAttributeSet() + .build()); + + assertEquals( + View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, + layout.getSystemUiVisibility() & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); + } + + @Test + public void createFromXml_shouldNotSetLayoutFullscreen_whenLayoutFullscreenIsFalse() { + GlifLayout layout = new GlifLayout( + mContext, + Robolectric.buildAttributeSet() + .addAttribute(R.attr.suwLayoutFullscreen, "false") + .build()); + + assertEquals( + 0, + layout.getSystemUiVisibility() & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); + } + private Drawable getPhoneBackground(GlifLayout layout) { final StatusBarBackgroundLayout patternBg = (StatusBarBackgroundLayout) layout.findManagedViewById(R.id.suw_pattern_bg); |