From 50220de875b7f262abb2724e1efee121ed168c1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Mion?= Date: Sun, 3 Feb 2019 14:36:42 +0000 Subject: [PATCH] We can't use FloatingActionButton#setUseCompatPadding due an issue in Lollipop. For pre Lollipop we don't need margin. --- .../src/main/java/com/andremion/counterfab/CounterFab.java | 2 -- sample/src/main/res/values-v21/dimens.xml | 5 +++++ sample/src/main/res/values/dimens.xml | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 sample/src/main/res/values-v21/dimens.xml diff --git a/counterfab/src/main/java/com/andremion/counterfab/CounterFab.java b/counterfab/src/main/java/com/andremion/counterfab/CounterFab.java index 8741f4a..d5b5c43 100644 --- a/counterfab/src/main/java/com/andremion/counterfab/CounterFab.java +++ b/counterfab/src/main/java/com/andremion/counterfab/CounterFab.java @@ -109,8 +109,6 @@ public CounterFab(Context context, AttributeSet attrs) { public CounterFab(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); - setUseCompatPadding(true); - float density = getResources().getDisplayMetrics().density; mTextSize = TEXT_SIZE_DP * density; float textPadding = TEXT_PADDING_DP * density; diff --git a/sample/src/main/res/values-v21/dimens.xml b/sample/src/main/res/values-v21/dimens.xml new file mode 100644 index 0000000..35d738e --- /dev/null +++ b/sample/src/main/res/values-v21/dimens.xml @@ -0,0 +1,5 @@ + + + + 16dp + \ No newline at end of file diff --git a/sample/src/main/res/values/dimens.xml b/sample/src/main/res/values/dimens.xml index 812cb7b..1027c5a 100644 --- a/sample/src/main/res/values/dimens.xml +++ b/sample/src/main/res/values/dimens.xml @@ -2,5 +2,7 @@ 16dp 16dp - 16dp + + + 0dp