AnderWeb / discreteSeekBar

Apache License 2.0
2.11k stars 400 forks source link

Add alwaysShowIndicator attr support #33

Open almozavr opened 9 years ago

almozavr commented 9 years ago

With alwaysShowIndicator="true" floating marker should stay on screen and don't dismiss until unset programatically. Possible solution by @AnderWeb as discussed here:

The "proper" solution would be making DiscreteSeekBar extend from ViewGroup. Then, if the alwaysShowIndicator flag is enabled, it would create and add the Floater to itself taking care of measuring/layout/positioning. Else, it would behave as usual, creating the Popup with the Floater inside.

skywalkerlw commented 8 years ago

+1

kevin1404 commented 8 years ago

That would be great!

andreibalmos commented 8 years ago

Hey guys, is there any progress being made? This would be an awesome feature.

sendtion commented 7 years ago

that is great.

jonasmedeiros commented 7 years ago

@AnderWeb Why dont you merge? I need this feature.

jonasmedeiros commented 7 years ago

Hi my only problem with this solutions is that the indicator stays above the keyboard

vinkeSch commented 6 years ago

@AnderWeb This feature is not done, right?

G00fY2 commented 6 years ago

A quick workaround I am using is to force the pressed state. This causes the ripple circle (you can change its color) to show too but I can live with that solution:

public class PressedDiscreteSeekBar extends DiscreteSeekBar {

  public PressedDiscreteSeekBar(Context context) {
    super(context);
    drawableStateChanged();
  }

  public PressedDiscreteSeekBar(Context context, AttributeSet attrs) {
    super(context, attrs);
    drawableStateChanged();
  }

  public PressedDiscreteSeekBar(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    drawableStateChanged();
  }

  protected void drawableStateChanged() {
    super.setPressed(true);
    super.drawableStateChanged();
  }
}