You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
implement CompoundButton using GtkSwitch
This commit is contained in:
@@ -3,10 +3,8 @@ package android.widget;
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
public abstract class CompoundButton extends Button {
|
||||
public abstract class CompoundButton extends Button implements Checkable {
|
||||
|
||||
private boolean checked;
|
||||
|
||||
public CompoundButton(Context context) {
|
||||
super(context);
|
||||
}
|
||||
@@ -15,15 +13,24 @@ public abstract class CompoundButton extends Button {
|
||||
super(context, attributeSet);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected native long native_constructor(Context context, AttributeSet attrs);
|
||||
|
||||
public static interface OnCheckedChangeListener {}
|
||||
|
||||
public void setOnCheckedChangeListener(OnCheckedChangeListener listener) {}
|
||||
public native void setOnCheckedChangeListener(OnCheckedChangeListener listener);
|
||||
|
||||
public void setChecked(boolean checked) {
|
||||
this.checked = checked;
|
||||
}
|
||||
public native void setChecked(boolean checked);
|
||||
|
||||
public boolean isChecked() {
|
||||
return checked;
|
||||
}
|
||||
public native boolean isChecked();
|
||||
|
||||
// following methods are overridden to prevent calling incompatible methods from superclasses
|
||||
@Override
|
||||
public void setOnClickListener(final OnClickListener l) {}
|
||||
@Override
|
||||
public void setText(CharSequence text) {}
|
||||
@Override
|
||||
public void setTextColor(int color) {}
|
||||
@Override
|
||||
public void setTextSize(float size) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user