implement SeekBar using GtkScale

This commit is contained in:
Julian Winkler
2024-03-10 17:33:37 +01:00
parent aef5d5ad23
commit 9509289ee5
5 changed files with 316 additions and 4 deletions

View File

@@ -9,8 +9,8 @@ import android.view.View;
public class ProgressBar extends View {
private int max = 100;
private int progress = 0;
protected int max = 100;
protected int progress = 0;
public ProgressBar(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
@@ -30,7 +30,7 @@ public class ProgressBar extends View {
@Override
protected native long native_constructor(Context context, AttributeSet attrs);
private native void native_setProgress(long widget, float fraction);
protected native void native_setProgress(long widget, float fraction);
public native void setIndeterminate(boolean indeterminate);

View File

@@ -13,7 +13,26 @@ public class SeekBar extends AbsSeekBar {
super(context, attributeSet);
}
public void setOnSeekBarChangeListener(OnSeekBarChangeListener l) {}
@Override
protected native long native_constructor(Context context, AttributeSet attrs);
@Override
protected native void native_setProgress(long widget, float fraction);
protected native void native_setMax(long widget, int max);
@Override
public void setMax(int max) {
this.max = max;
native_setMax(widget, max);
}
@Override
public void setProgress(int progress) {
this.progress = progress;
native_setProgress(widget, progress);
}
@Override
public void setIndeterminate(boolean indeterminate) {}
public native void setOnSeekBarChangeListener(final OnSeekBarChangeListener l);
public static interface OnSeekBarChangeListener {
}