Back to project page permission-explorer.
The source code is released under:
Copyright (C) 2012 Rui Gon?alves and Daniel Cibr?o Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),...
If you think the Android project permission-explorer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package pt.up.fe.ssin.pexplorer.utils.ui; // www . j av a2s. c o m import android.content.Context; import android.util.AttributeSet; import android.view.View; import android.widget.Checkable; import android.widget.RelativeLayout; public class CheckedRelativeLayout extends RelativeLayout implements Checkable { private Checkable checkable; public CheckedRelativeLayout(Context context) { super(context); } public CheckedRelativeLayout(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public CheckedRelativeLayout(Context context, AttributeSet attrs) { super(context, attrs); } @Override protected void onFinishInflate() { super.onFinishInflate(); for (int i = 0; i < getChildCount(); i++) { View v = getChildAt(i); if (v instanceof Checkable) { checkable = (Checkable) v; return; } } throw new ClassCastException( "No Checkable child view found in CheckedRelativeLayout."); } @Override public boolean isChecked() { return checkable.isChecked(); } @Override public void setChecked(boolean checked) { checkable.setChecked(checked); } @Override public void toggle() { checkable.toggle(); } }