FloatingActionButtonSpeedDial
FloatingActionButtonSpeedDial copied to clipboard
Transparent color innder circle
Step 1: Are you in the right place?
- [x] I have verified there are no duplicate active or recent bugs, questions, or requests
- [x] I have verified that I am using the latest version of the library.
Step 2: Describe your environment
- Library version:
1.0.2
- Android version:
23 and 28
- Support library version:
27.1.1
- Device brand:
Emulator
- Device model:
Emulator
Step 3: Describe the problem:
Steps to reproduce:
- Set alpha color to SpeedDialView or action item
- Views will have an inner circle
Observed Results:
Whenever you set a color with alpha channel to SpeedDialView (or it's actions), there will be an inner circle visible. This circle gets smaller, when you click hold the button(s).
Relevant Code:
Core sections of the code that I'm using:
private void initializeSpeedDial(){
@ColorInt int bgColor = Color.argb(119, 26, 255, 68);
SpeedDialView sdw = view.findViewById(R.id.speed_dial);
sdw.addActionItem(new SpeedDialActionItem.Builder(
R.id.some_id, R.drawable.ic_bubbles)
.setFabBackgroundColor(bgColor)
.setLabel("Test")
.setFabImageTintColor(Color.WHITE)
.create()
);
}
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.leinardi.android.speeddial.SpeedDialView
android:id="@+id/speed_dial"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:sdExpansionMode="top"
app:sdMainFabClosedBackgroundColor="#74F4"
app:sdMainFabOpenedBackgroundColor="#74F4"
app:sdMainFabClosedSrc="@drawable/ic_plus"
/>
</RelativeLayout>
Screenshot:
Hi @WildOrangutan, thanks for the report. Unfortunately I fear this is a side effect of the workaround that I am using to grant the same distances of the action items (the small FABs) for all the API levels. See the here for context:
https://github.com/leinardi/FloatingActionButtonSpeedDial/blob/07d61e40a0f7e87a51893db093be09423b01893c/library/src/main/java/com/leinardi/android/speeddial/FabWithLabelView.java#L290
This issue has been automatically marked as stale because it has not had activity in the last 60 days.
Hi @leinardi, is there a workaround for this? The inner circles are visible when adding colors that have a degree of transparency.
Thanks!
Hi @mateidediu93, unfortunately I'm not aware of any workaround.
Hi @leinardi .
I've managed to create a workaround by editing the sd_fab_with_label_view.xml and dimens.xml files.
In sd_fab_with_label_view.xml, I've set the elevation and borderWidth attributes to be equal to 0dp and corrected the alignment of the mini fabs in dimens.xml by increasing the sd_fab_side_margin to 16dp.
<android.support.design.widget.FloatingActionButton
android:id="@+id/sd_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end"
app:elevation="0dp"
app:borderWidth="0dp"
app:fabSize="mini"
app:useCompatPadding="true" />
<dimen name="sd_fab_side_margin">16dp</dimen>
This issue has been automatically marked as stale because it has not had activity in the last 60 days.
Hi @leinardi .
I've managed to create a workaround by editing the sd_fab_with_label_view.xml and dimens.xml files.
In sd_fab_with_label_view.xml, I've set the elevation and borderWidth attributes to be equal to 0dp and corrected the alignment of the mini fabs in dimens.xml by increasing the sd_fab_side_margin to 16dp.
<android.support.design.widget.FloatingActionButton android:id="@+id/sd_fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical|end" app:elevation="0dp" app:borderWidth="0dp" app:fabSize="mini" app:useCompatPadding="true" />
<dimen name="sd_fab_side_margin">16dp</dimen>
Having the same issue where did you find the sd_fab_with_label_view.xml file at?