mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-12 18:11:57 +01:00
e1f2e0c830
I left the non-preference related dslv code untouched and took it from here https://github.com/sbolotovms/drag-sort-listview (This is one of many forks, which had migrated android to androidx) The base for the code in DragSortListPreferenceFragment.java and DragSortListPreference.java comes from: https://github.com/kd7uiy/drag-sort-listview I heavily modiefied it moved it to androidx
39 lines
871 B
Java
39 lines
871 B
Java
package com.mobeta.android.dslv;
|
|
|
|
import android.content.Context;
|
|
import android.util.AttributeSet;
|
|
import android.widget.Checkable;
|
|
import android.widget.LinearLayout;
|
|
|
|
public class CheckableLinearLayout extends LinearLayout implements Checkable {
|
|
|
|
private static final int CHECKABLE_CHILD_INDEX = 1;
|
|
private Checkable child;
|
|
|
|
public CheckableLinearLayout(Context context, AttributeSet attrs) {
|
|
super(context, attrs);
|
|
}
|
|
|
|
@Override
|
|
protected void onFinishInflate() {
|
|
super.onFinishInflate();
|
|
child = (Checkable) getChildAt(CHECKABLE_CHILD_INDEX);
|
|
}
|
|
|
|
@Override
|
|
public boolean isChecked() {
|
|
return child.isChecked();
|
|
}
|
|
|
|
@Override
|
|
public void setChecked(boolean checked) {
|
|
child.setChecked(checked);
|
|
}
|
|
|
|
@Override
|
|
public void toggle() {
|
|
child.toggle();
|
|
}
|
|
|
|
}
|