Skip to content

Commit

Permalink
Implement max width for bottom sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavpandey committed Jun 10, 2021
1 parent 25e82b7 commit ec73655
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 12 deletions.
4 changes: 3 additions & 1 deletion dynamic-support/src/main/res/values-v21/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
<dimen name="ads_card_view_margin">@dimen/ads_margin_tiny</dimen>
<dimen name="ads_card_view_margin_layout">@dimen/ads_margin_small</dimen>
<dimen name="ads_card_view_margin_dialog">@dimen/ads_margin_regular</dimen>
<dimen name="ads_margin_bottom_sheet">@dimen/ads_margin_medium</dimen>
<dimen name="ads_card_view_elevation">2.6dp</dimen>
<dimen name="ads_card_view_elevation_dialog">5dp</dimen>

<!-- Bottom Sheet -->
<dimen name="ads_bottom_sheet_margin">@dimen/ads_margin_medium</dimen>

</resources>
6 changes: 3 additions & 3 deletions dynamic-support/src/main/res/values-v24/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

<resources>

<!-- Margin presets -->
<dimen name="ads_margin_bottom_sheet">0dp</dimen>
<!-- Bottom Sheet -->
<dimen name="ads_bottom_sheet_margin">0dp</dimen>

<!-- Notification -->
<!-- Remote -->
<dimen name="ads_remote_margin_vertical">12dp</dimen>
<dimen name="ads_remote_margin_horizontal">16dp</dimen>
<dimen name="ads_remote_footer_margin_horizontal">12dp</dimen>
Expand Down
33 changes: 33 additions & 0 deletions dynamic-support/src/main/res/values-w600dp/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018-2021 Pranav Pandey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<resources>

<style name="Widget.DynamicApp.BottomSheet">
<item name="android:layout_width">@dimen/ads_bottom_sheet_max_width</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_gravity">center_horizontal</item>
<item name="android:padding">@dimen/ads_bottom_sheet_margin</item>
<item name="android:clipToPadding">false</item>
<item name="android:clickable">true</item>
<item name="layout_behavior">com.pranavpandey.android.dynamic.support.behavior.DynamicBottomSheetBehavior</item>
<item name="behavior_peekHeight">@dimen/ads_bottom_sheet_peek_height</item>
<item name="behavior_hideable">false</item>
<item name="gestureInsetBottomIgnored">true</item>
</style>

</resources>
3 changes: 3 additions & 0 deletions dynamic-support/src/main/res/values-w720dp/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@
<!-- Icon -->
<dimen name="ads_icon_tutorial">240dp</dimen>

<!-- Bottom Sheet -->
<dimen name="ads_bottom_sheet_max_width">520dp</dimen>

</resources>
3 changes: 3 additions & 0 deletions dynamic-support/src/main/res/values-w840dp/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@
<dimen name="ads_popup_max_width">380dp</dimen>
<dimen name="ads_popup_max_width_large">400dp</dimen>

<!-- Bottom Sheet -->
<dimen name="ads_bottom_sheet_max_width">560dp</dimen>

</resources>
4 changes: 2 additions & 2 deletions dynamic-support/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
<color name="ads_card_background_day_night">@color/ads_card_background_light</color>

<!-- Notification -->
<color name="notification_background">#323232</color>
<color name="notification_background_light">#F9F9F9</color>
<color name="ads_notification_background">#323232</color>
<color name="ads_notification_background_light">#F9F9F9</color>

<!-- App palette -->
<color name="ads_primary">#3F51B5</color>
Expand Down
13 changes: 8 additions & 5 deletions dynamic-support/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
<dimen name="ads_margin_extra_large">48dp</dimen>
<dimen name="ads_margin_huge">64dp</dimen>
<dimen name="ads_margin_header_icon_end">@dimen/ads_margin_large</dimen>
<dimen name="ads_margin_bottom_sheet">@dimen/ads_margin_regular</dimen>
<dimen name="ads_margin_fab">76dp</dimen>
<dimen name="ads_margin_fab_compat_mini">@dimen/ads_margin_small</dimen>
<dimen name="ads_margin_fab_compat_mini_bottom">@dimen/ads_margin_small</dimen>
Expand Down Expand Up @@ -75,9 +74,6 @@
<dimen name="ads_fab_margin_small">@dimen/ads_margin_small</dimen>
<dimen name="ads_margin_splash">@dimen/ads_margin_normal</dimen>
<dimen name="ads_margin_splash_small">@dimen/ads_margin_regular</dimen>
<dimen name="ads_bottom_sheet_peek_height">72dp</dimen>
<dimen name="ads_bottom_sheet_indicator_width">@dimen/ads_icon_normal</dimen>
<dimen name="ads_bottom_sheet_indicator_height">@dimen/ads_margin_tiny</dimen>

<!-- Font -->
<dimen name="ads_font_size_tiny">10sp</dimen>
Expand Down Expand Up @@ -224,9 +220,16 @@
<dimen name="ads_dialog_button_icon_size">@dimen/ads_icon_normal</dimen>

<!-- Popup -->
<dimen name="ads_popup_selector_icon_size">24dp</dimen>
<dimen name="ads_popup_max_width">300dp</dimen>
<dimen name="ads_popup_max_width_large">340dp</dimen>
<dimen name="ads_popup_selector_icon_size">24dp</dimen>

<!-- Bottom Sheet -->
<dimen name="ads_bottom_sheet_max_width">480dp</dimen>
<dimen name="ads_bottom_sheet_margin">@dimen/ads_margin_regular</dimen>
<dimen name="ads_bottom_sheet_peek_height">72dp</dimen>
<dimen name="ads_bottom_sheet_indicator_width">@dimen/ads_icon_normal</dimen>
<dimen name="ads_bottom_sheet_indicator_height">@dimen/ads_margin_tiny</dimen>

<!-- Picker -->
<dimen name="ads_picker_colors_size">@dimen/ads_icon_medium</dimen>
Expand Down
3 changes: 2 additions & 1 deletion dynamic-support/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,8 @@
<style name="Widget.DynamicApp.BottomSheet">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:padding">@dimen/ads_margin_bottom_sheet</item>
<item name="android:layout_gravity">center_horizontal</item>
<item name="android:padding">@dimen/ads_bottom_sheet_margin</item>
<item name="android:clipToPadding">false</item>
<item name="android:clickable">true</item>
<item name="layout_behavior">com.pranavpandey.android.dynamic.support.behavior.DynamicBottomSheetBehavior</item>
Expand Down

0 comments on commit ec73655

Please sign in to comment.