Skip to content

Commit

Permalink
Rounuded bottom sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
alorma committed Feb 1, 2023
1 parent ee92555 commit f3dd589
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 6 deletions.
6 changes: 3 additions & 3 deletions taggingviewer/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<application>
<activity
android:name="com.adevinta.android.taggingviewer.DetailedTaggingActivity"
android:theme="@style/Theme.MaterialComponents.Light.DarkActionBar"
android:theme="@style/Theme.TaggingViewer"
/>
<provider
android:name="com.adevinta.android.taggingviewer.internal.TaggingViewerInitProvider"
android:authorities="${applicationId}.taggingviewerinitprovider"
android:exported="false"
android:enabled="true"
android:name="com.adevinta.android.taggingviewer.internal.TaggingViewerInitProvider"
android:exported="false"
/>
</application>

Expand Down
46 changes: 43 additions & 3 deletions taggingviewer/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@
<resources>

<style name="Theme.TaggingViewer"
parent="Theme.AppCompat"></style>
parent="Theme.MaterialComponents.Light.DarkActionBar">
<item name="bottomSheetDialogTheme">@style/ThemeOverlay.TaggingViewer.BottomSheetStyle.Dialog</item>
<item name="bottomSheetStyle">@style/Widget.TaggingViewer.BottomSheetStyle</item>
</style>

<style name="tgv_item_tracking_name">
<item name="android:shadowColor">@color/tgv_item_tracking_shadow_color</item>
<item name="android:textSize">@dimen/tgv_item_tracking_name_text_size</item>
<item name="android:textColor">@color/tgv_item_tracking_name_text_color</item>
<item name="android:gravity">end</item>
<item name="android:shadowRadius"
type="dimen"
format="float">1.5
format="float"
type="dimen">1.5
</item>
</style>

Expand All @@ -22,4 +25,41 @@
<style name="tgv_view">
<item name="android:background">@color/tgv_view_background_color</item>
</style>

<style name="Widget.TaggingViewer.BottomSheetStyle"
parent="Widget.MaterialComponents.BottomSheet.Modal">
<item name="behavior_hideable">true</item>
<item name="behavior_peekHeight">auto</item>
<item name="shapeAppearance">@style/ShapeAppearance.TaggingViewer.BottomSheet</item>
</style>

<style name="ThemeOverlay.TaggingViewer.BottomSheetStyle.Dialog"
parent="ThemeOverlay.MaterialComponents.BottomSheetDialog">
<item name="bottomSheetStyle">@style/Widget.TaggingViewer.BottomSheetStyle.Shaped</item>
</style>

<style name="Widget.TaggingViewer.BottomSheetStyle.Shaped.Base"
parent="Widget.MaterialComponents.BottomSheet.Modal">
<item name="behavior_hideable">true</item>
<item name="shapeAppearance">@style/ShapeAppearance.TaggingViewer.BottomSheet.Shaped</item>
</style>

<style name="ShapeAppearance.TaggingViewer.BottomSheet"
parent="ShapeAppearance.MaterialComponents.LargeComponent">
<item name="cornerSize">0dp</item>
</style>

<style name="ShapeAppearance.TaggingViewer.BottomSheet.Shaped"
parent="ShapeAppearance.MaterialComponents.LargeComponent">
<item name="cornerFamily">rounded</item>
<item name="cornerSizeTopLeft">16dp</item>
<item name="cornerSizeTopRight">16dp</item>
</style>


<style name="Widget.TaggingViewer.BottomSheetStyle.Shaped"
parent="Widget.TaggingViewer.BottomSheetStyle.Shaped.Base">
<item name="behavior_peekHeight">auto</item>
</style>

</resources>

0 comments on commit f3dd589

Please sign in to comment.