leinardi / leinardi/FloatingActionButtonSpeedDial

Main button click action

Open
#121 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Stale Type: Question
Dominant language
Java
Stars
1.5k
Forks
149
PR merge metrics
No merged PRs in 30d

Description

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: 2.0.1
  • Android version: 8.0
  • Support library version: 28
  • Device brand: ?
  • Device model: ?
Step 3: Describe the problem:
Steps to reproduce:

Here's is what I'm trying to do with the best explanation I can master:

  1. onMainActionSelected -> creates on-click action AFTER toogle is opened
  2. onToggleChanged -> creates action each time toogle is changed
  3. MY PROBLEM -> creates action ONLY the first time toogle is opened, but not after it's closed again

I'm using FAB for switching layers on the map ON/OFF. Upon main button click all layers switch off, user can click on different action items to switch on needed layers and then exit the FAB back to the map. However, currently after exiting the FAB 'onToogleChanged' runs again and clears all the layers, making the whole process pointless.

Relevant Code:

speedDialView.setOnChangeListener(new SpeedDialView.OnChangeListener() {
@Override
public boolean onMainActionSelected() {
//

              return false; // True to keep the Speed Dial open
            }

            @Override
            public void onToggleChanged(boolean isOpen) {
              Log.d(TAG, "Speed dial toggle state changed. Open = " + isOpen);

              Layer layerOne = mapboxMap.getStyle().getLayer("layer-id-One");
              if(layerOne != null){
                layerWestern.setProperties(visibility(Property.NONE));
              }

              Layer layerTwo = mapboxMap.getStyle().getLayer("layer-id-Two");
              if(layerTwo != null){
                layerVietnamese.setProperties(visibility(Property.NONE));
              }

}
});

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the OnChangeListener implementation used by speedDialView.setOnChangeListener and trace when onToggleChanged(boolean isOpen) is dispatched. Reproduce the open/close sequence described in the issue; done means the listener behavior supports switching layers without clearing them unexpectedly when the speed dial is exited.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.