1 package com.moiseum.wolnelektury.components;
3 import android.content.Context;
4 import android.util.AttributeSet;
5 import android.widget.Checkable;
6 import android.widget.RelativeLayout;
9 * Relative layout for handling checking/selecting action.
11 public class CheckableRelativeLayout extends RelativeLayout implements Checkable {
13 public CheckableRelativeLayout(Context context) {
17 public CheckableRelativeLayout(Context context, AttributeSet attrs) {
18 super(context, attrs);
21 public CheckableRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr) {
22 super(context, attrs, defStyleAttr);
26 public void setChecked(boolean checked) {
27 super.setSelected(checked);
31 public boolean isChecked() {
32 return super.isSelected();
36 public void toggle() {
37 super.setSelected(!isSelected());