Skip to content

Commit

Permalink
Fix #109: Added resource ID for main FAB
Browse files Browse the repository at this point in the history
  • Loading branch information
leinardi committed Apr 6, 2019
1 parent 026a339 commit a23a16a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## next release
- fixed #100: Use unique view IDs
- fixed #109: Added resource ID for main FAB

## [2.0.1] - 2018-09-28
- fixed #95: support 28 workaround does not work on minified release apk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ private FloatingActionButton createMainFab() {
int marginHorizontal = UiUtils.dpToPx(getContext(), MAIN_FAB_HORIZONTAL_MARGIN_IN_DP);
int marginVertical = UiUtils.dpToPx(getContext(), MAIN_FAB_VERTICAL_MARGIN_IN_DP);
layoutParams.setMargins(marginHorizontal, marginVertical, marginHorizontal, marginVertical);
floatingActionButton.setId(R.id.sd_main_fab);
floatingActionButton.setUseCompatPadding(true);
floatingActionButton.setLayoutParams(layoutParams);
floatingActionButton.setClickable(true);
Expand Down
20 changes: 20 additions & 0 deletions library/src/main/res/values/ids.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2019 Roberto Leinardi.
~
~ 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>
<item name="sd_main_fab" type="id" />
</resources>

0 comments on commit a23a16a

Please sign in to comment.