A vertical seekbar for Android
This is a vertical seekbar like in the IOS 11 control center with an image at the bottom
Add these to your app's build.gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.alpbak:BoxedVerticalSeekBar:1.1.1'
}
To create a new boxed vertical seekbar
<abak.tr.com.boxedverticalseekbar.BoxedVertical
android:id="@+id/boxed_vertical"
android:layout_width="60dp"
android:layout_height="250dp"
android:layout_gravity="center"
android:layout_marginBottom="30dp"
android:layout_marginTop="30dp"
android:layout_weight="1"
app:backgroundColor="@color/color_background"
app:progressColor="@color/color_progress"
app:textColor="#FF0000"
app:cornerRadius="20"
app:defaultValue="140"
app:imageEnabled="false"
app:textEnabled="true"
app:max="300"
app:step="5"
app:textBottomPadding="20"
app:textSize="12sp"
app:touchDisabled="true" />
To use the seekbar in your activity:
BoxedVertical bv = (BoxedVertical)findViewById(R.id.boxed_vertical);
bv.setOnBoxedPointsChangeListener(new BoxedVertical.OnValuesChangeListener() {
@Override
public void onPointsChanged(BoxedVertical boxedPoints, final int value) {
System.out.println(value);
}
@Override
public void onStartTrackingTouch(BoxedVertical boxedPoints) {
Toast.makeText(MainActivity.this, "onStartTrackingTouch", Toast.LENGTH_SHORT).show();
}
@Override
public void onStopTrackingTouch(BoxedVertical boxedPoints) {
Toast.makeText(MainActivity.this, "onStopTrackingTouch", Toast.LENGTH_SHORT).show();
}
});
app:imageEnabled="true"
app:defaultImage="@drawable/ic_volume_down_black_48dp"
app:maxImage="@drawable/ic_volume_up_black_48dp"
app:minImage="@drawable/ic_volume_off_black_48dp"
app:textEnabled="true"
app:textBottomPadding="20"
app:textColor="#FF0000"
app:textSize="12sp"
app:touchDisabled="false"
The library is a free software, you can use it, extended with no requirement to open source your changes. You can also make paid apps using it.
Pull requests are welcomed