summaryrefslogtreecommitdiff
path: root/library/main/res/values
diff options
context:
space:
mode:
authorMaurice Lam <yukl@google.com>2017-05-12 14:32:26 -0700
committerMaurice Lam <yukl@google.com>2017-05-12 17:22:11 -0700
commit2da78450d5e9723ca93fa39bfdc3f8dd27b41e89 (patch)
treeaaa15c458202e6776779b3f1ce27a17ed83eb84a /library/main/res/values
parente4aaa62e8f9b29e69d70668d9ce5da6ff7d35f5c (diff)
downloadsetupwizard-2da78450d5e9723ca93fa39bfdc3f8dd27b41e89.tar.gz
Add layout to size illustrations
- Add FillContentLayout, which is a (frame)layout which, when set to fill the remaining space of its parent, will make sure its children are sized between minWidth/minHeight and maxWidth/maxHeight. - Renamed styleable SuwIntrinsicSizeFrameLayout to be consistent with the name of the view that uses it. Test: ./gradlew connectedAndroidTest test Bug: 38210310 Change-Id: I5b2aa6cfe8b4a05843de25d39cae776609f3d161
Diffstat (limited to 'library/main/res/values')
-rw-r--r--library/main/res/values/attrs.xml8
-rw-r--r--library/main/res/values/dimens.xml6
-rw-r--r--library/main/res/values/styles.xml15
3 files changed, 28 insertions, 1 deletions
diff --git a/library/main/res/values/attrs.xml b/library/main/res/values/attrs.xml
index 0339469..ec6489e 100644
--- a/library/main/res/values/attrs.xml
+++ b/library/main/res/values/attrs.xml
@@ -39,6 +39,7 @@
</attr>
<attr name="suwCardBackground" format="color|reference" />
+ <attr name="suwFillContentLayoutStyle" format="reference" />
<attr name="suwDividerCondition">
<enum name="either" value="0" />
<enum name="both" value="1" />
@@ -103,11 +104,16 @@
<attr name="suwStatusBarBackground" format="color|reference" />
</declare-styleable>
- <declare-styleable name="SuwMaxSizeFrameLayout">
+ <declare-styleable name="SuwIntrinsicSizeFrameLayout">
<attr name="android:height" />
<attr name="android:width" />
</declare-styleable>
+ <declare-styleable name="SuwFillContentLayout">
+ <attr name="android:maxHeight" />
+ <attr name="android:maxWidth" />
+ </declare-styleable>
+
<declare-styleable name="SuwSetupWizardLayout">
<attr name="suwBackground" format="color|reference" />
<attr name="suwBackgroundTile" format="color|reference" />
diff --git a/library/main/res/values/dimens.xml b/library/main/res/values/dimens.xml
index 458e99c..14d7429 100644
--- a/library/main/res/values/dimens.xml
+++ b/library/main/res/values/dimens.xml
@@ -49,6 +49,12 @@
<dimen name="suw_description_glif_margin_top">3dp</dimen>
<dimen name="suw_description_glif_margin_bottom_lists">24dp</dimen>
+ <dimen name="suw_content_illustration_max_height">312dp</dimen>
+ <dimen name="suw_content_illustration_max_width">312dp</dimen>
+ <dimen name="suw_content_illustration_min_height">172dp</dimen>
+ <dimen name="suw_content_illustration_min_width">172dp</dimen>
+ <dimen name="suw_content_illustration_padding_vertical">24dp</dimen>
+
<!-- Margin on the start to offset for margin in the drawable -->
<dimen name="suw_radio_button_margin_start">-6dp</dimen>
<dimen name="suw_radio_button_margin_top">0dp</dimen>
diff --git a/library/main/res/values/styles.xml b/library/main/res/values/styles.xml
index bcdae0e..736bcc4 100644
--- a/library/main/res/values/styles.xml
+++ b/library/main/res/values/styles.xml
@@ -123,6 +123,21 @@
<item name="android:gravity">top</item>
</style>
+ <style name="SuwFillContentLayout">
+ <item name="android:minWidth">@dimen/suw_content_illustration_min_width</item>
+ <item name="android:minHeight">@dimen/suw_content_illustration_min_height</item>
+ <item name="android:maxWidth">@dimen/suw_content_illustration_max_width</item>
+ <item name="android:maxHeight">@dimen/suw_content_illustration_max_height</item>
+ <item name="android:paddingTop">@dimen/suw_content_illustration_padding_vertical</item>
+ <item name="android:paddingBottom">@dimen/suw_content_illustration_padding_vertical</item>
+ </style>
+
+ <!-- Ignore UnusedResources: used by clients -->
+ <style name="SuwContentIllustration" tools:ignore="UnusedResources">
+ <item name="android:layout_gravity">center</item>
+ <item name="android:scaleType">fitCenter</item>
+ </style>
+
<!-- Card layout (for tablets) -->
<style name="SuwBaseCardTitle">