question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stack overflow and fabImageResource not working.

See original GitHub issue

Step 1: Are you in the right place?

  • I have verified there are no duplicate active or recent bugs, questions, or requests
  • I have verified that I am using the latest version of the library.

Step 2: Describe your environment

  • Library version: 3.2.0
  • Android version: 10
  • Support library version: com.google.android.material:material:1.3.0
  • Device brand: OnePlus
  • Device model: 7 Pro (Also tested not working on a Xiaomi device)

Step 3: Describe the problem:

Steps to reproduce:

  1. setContentDescription on SpeedDialView
  2. use new SpeedDialActionItem.Builder() as before (unchanged)
  3. Run app and it crashes due to stack overflow by setContentDescription calling itself too many times
  4. Removing the setContentDescription line works, but the icons on the FAB are missing

Relevant Code:

        SpeedDialView speedDialView = findViewById(R.id.speedDial1);
        speedDialView.setContentDescription(getString(R.string.menu_fab_description));
        speedDialView.addActionItem(
                new SpeedDialActionItem
                        .Builder(R.id.fab_justnow, R.drawable.ic_done_black_24dp)
                        .setFabBackgroundColor(getResources().getColor(R.color.colorAccent))
                        .setContentDescription(R.string.menu_justnow)
                        .setLabel(R.string.menu_justnow)
                        .create());
    java.lang.StackOverflowError: stack size 8192KB
        at com.leinardi.android.speeddial.SpeedDialView.setContentDescription(SpeedDialView.java:240)
        at com.leinardi.android.speeddial.SpeedDialView.setContentDescription(SpeedDialView.java:242)
        at com.leinardi.android.speeddial.SpeedDialView.setContentDescription(SpeedDialView.java:242)
        at com.leinardi.android.speeddial.SpeedDialView.setContentDescription(SpeedDialView.java:242)
        ...

Screenshot_20210523-231632

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
yourealwaysbecommented, Nov 21, 2021

Another workaround: set colorOnSecondary in styles.xml. E.g.

    <item name="colorOnSecondary">#ffffff</item>

Calling .setFabImageTintColor doesn’t seem to be possible if inflating the menu from a menu.xml.

1reaction
moisoni97commented, Jun 17, 2021

I have the same problem with fab icons go missing. I’ve tried to reproduce the problem but I can’t. I have implemented the exact same code from my project into the sample app and it just works.

One thing that I notice and for now is a workaround, setting an image tint color makes the image appear: .setFabImageTintColor(ContextCompat.getColor(mActivity, R.color.white))

Another thing is that, SpeedDialView now responds to system lightning (DarkMode and LightMode) and changes it’s behaviour accordingly:

-icons are tinted automatically in an unpleasant way so it’s better to ovrride this behaviour with .setFabImageTintColor(ContextCompat.getColor(mActivity, R.color.white))

-label background changes color automatically . Here we can use .setLabelBackgroundColor(ContextCompat.getColor(mActivity, R.color.white)) to stop changing color.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Help Center - Stack Overflow
Welcome to the Stack Overflow Help Center! If you are unable to find the answer you need here, you can also search for...
Read more >
Problems with Stack Overflow website
Recently as I have been doing my dev work on my Mac, I had noticed that the Stack Overflow website stopped working for...
Read more >
Introducing the Overflow Offline project
Unlocked Labs would not exist without Stack Overflow.” Many coders would say they rely on Stack Overflow to get work done, but Hicklin's ......
Read more >
Stack Overflow - Wikipedia
Stack Overflow is a question and answer website for professional and enthusiast programmers. It is the flagship site of the Stack Exchange Network....
Read more >
Stack Overflow NYC Office: Careers, Perks + Culture
Find jobs, benefits and insider info about Stack Overflow, an AdTech, ... Employees engage in a combination of remote and on-site work.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found