Skip to content

Commit

Permalink
Moved the declare-styleable attributes to fluentui_core attrs.xml to …
Browse files Browse the repository at this point in the history
…reuse at the module level. Attributes are also prefixed with 'fluentui_' to avoid conflict with other UI library attributes
  • Loading branch information
mishramayank1 committed Feb 17, 2022
1 parent 6b66e93 commit 1245ffa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ class ContextualCommandBar @JvmOverloads constructor(

try {
groupSpace = styledAttributes.getDimensionPixelSize(
R.styleable.ContextualCommandBar_groupSpace,
R.styleable.ContextualCommandBar_fluentui_groupSpace,
resources.getDimensionPixelSize(R.dimen.fluentui_contextual_command_bar_default_group_space)
)
itemSpace = styledAttributes.getDimensionPixelSize(
R.styleable.ContextualCommandBar_itemSpace,
R.styleable.ContextualCommandBar_fluentui_itemSpace,
resources.getDimensionPixelSize(R.dimen.fluentui_contextual_command_bar_default_item_space)
)
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<resources>
<declare-styleable name="ContextualCommandBar">
<attr name="itemSpace" format="dimension"/>
<attr name="groupSpace" format="dimension"/>
<attr name="fluentui_itemSpace"/>
<attr name="fluentui_groupSpace"/>
</declare-styleable>
</resources>
8 changes: 8 additions & 0 deletions fluentui_core/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@

<!--fluentui_calendar End-->

<!--fluentui_ccb Start-->
<!--ContextualCommandBar-->
<attr name="fluentui_itemSpace" format="dimension"/>
<attr name="fluentui_groupSpace" format="dimension"/>
<!--ContextualCommandBar End-->

<!--fluentui_ccb End-->

<!--fluentui_drawer Start-->
<!--Drawer-->
<attr name="fluentui_cornerRadius" format="dimension"/>
Expand Down

0 comments on commit 1245ffa

Please sign in to comment.