-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add feature: label show up on non user value changes. #12
Comments
Hi @someAndroidDeveloper |
Yes but I think 1.5s would be optimum for it, or its much better if you define a setter for that too.
These are the two which Im looking for, You may like to add |
@someAndroidDeveloper I've released new version 1.2.0, you can try now! |
@hearsilent I've got it running. -the duration is ok. FYI: currently it's on |
@someAndroidDeveloper Can you provide sample code to reproduce this? |
@hearsilent Sure, here is the simplest way. I tried to simulate the value change using a secondary slider: XML: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
tools:context=".MainActivity">
<hearsilent.discreteslider.DiscreteSlider
android:id="@+id/main_slider"
android:layout_width="wrap_content"
android:layout_height="470dp"
android:layout_gravity="center_vertical"
app:ds_inactiveTrackColor="#D3D3D3"
app:ds_orientation="vertical"
app:ds_thumbColor="@color/colorPrimary"
app:ds_thumbPressedColor="#1F089CF7"
app:ds_thumbRadius="9dp"
app:ds_trackColor="#D3D3D3"
app:ds_valueLabelDuration="2500"
app:ds_valueLabelMode="showOnProgressChange|showOnPressHold" />
<hearsilent.discreteslider.DiscreteSlider
android:id="@+id/test_slider"
android:layout_width="wrap_content"
android:layout_height="470dp"
android:layout_gravity="center_vertical|end"
app:ds_inactiveTrackColor="#D3D3D3"
app:ds_orientation="vertical"
app:ds_thumbColor="@color/colorPrimary"
app:ds_thumbPressedColor="#1F089CF7"
app:ds_thumbRadius="9dp"
app:ds_trackColor="#D3D3D3"
app:ds_valueLabelMode="none" />
</FrameLayout> and the Java: import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import hearsilent.discreteslider.DiscreteSlider;
public class MainActivity extends AppCompatActivity{
private DiscreteSlider mainSlider,testSlider;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mainSlider=findViewById(R.id.main_slider);
testSlider=findViewById(R.id.test_slider);
mainSlider.setCount(200);
testSlider.setCount(200);
mainSlider.setMinProgress(1);
testSlider.setMinProgress(1);
testSlider.setOnValueChangedListener(sliderListener);
}
private DiscreteSlider.OnValueChangedListener sliderListener=new DiscreteSlider.OnValueChangedListener(){
@Override
public void onValueChanged(int progress, boolean fromUser) {
super.onValueChanged(progress, fromUser);
mainSlider.setProgress(progress);
Log.d("slider change: ","value: "+progress);
}
};
} and again the result: The listener you have provided gets called once you release the thumb so make sure to drag it at least twice to see what I see. |
@someAndroidDeveloper I've fixed this issue, and release the version |
@hearsilent |
@someAndroidDeveloper You can call |
@hearsilent I called it before setting the listener as You mentioned in docs |
@someAndroidDeveloper It's must be called in right slider (Your touching slider) |
@hearsilent I understand it, and I did so. but the thing that I suspect is me explaining what I mean incorrectly. |
@someAndroidDeveloper Only can sync by step now. I'll try to implement method to provide sync immediately. |
@hearsilent so far so good. I'll be waiting |
Hi.
It will be very nice if You add modes for label such as showing up on setting values from code (like
when attaching it to scroll listeners) or showing up when pressed.
Let me know how are Your thoughts on this.
The text was updated successfully, but these errors were encountered: