use of android.widget.Checkable in project HoloEverywhere by Prototik.
the class SwitchScreenPreference method onBindView.
@Override
protected void onBindView(View view) {
super.onBindView(view);
View checkableView = view.findViewById(R.id.switchWidget);
if (checkableView != null && checkableView instanceof Checkable) {
((Checkable) checkableView).setChecked(mChecked);
sendAccessibilityEvent(checkableView);
if (checkableView instanceof Switch) {
final Switch switchView = (Switch) checkableView;
switchView.setTextOn(mSwitchOn);
switchView.setTextOff(mSwitchOff);
switchView.setOnCheckedChangeListener(mListener);
}
}
syncSummaryView(view);
}
use of android.widget.Checkable in project QuickAndroid by ImKarl.
the class BaseAdapterHelper method setChecked.
/**
* Sets the checked status of a checkable.
* @param viewId The view id.
* @param checked The checked status;
* @return The BaseAdapterHelper for chaining.
*/
@SuppressWarnings("unchecked")
public H setChecked(int viewId, boolean checked) {
Checkable view = (Checkable) retrieveView(viewId);
view.setChecked(checked);
return (H) this;
}
use of android.widget.Checkable in project ABPlayer by winkstu.
the class AdapterWrapper method getView.
@Override
public WrapperView getView(int position, View convertView, ViewGroup parent) {
WrapperView wv = (convertView == null) ? new WrapperView(mContext) : (WrapperView) convertView;
View item = mDelegate.getView(position, wv.mItem, wv);
View header = null;
if (previousPositionHasSameHeader(position)) {
recycleHeaderIfExists(wv);
} else {
header = configureHeader(wv, position);
}
if ((item instanceof Checkable) && !(wv instanceof CheckableWrapperView)) {
// Need to create Checkable subclass of WrapperView for ListView to work correctly
wv = new CheckableWrapperView(mContext);
} else if (!(item instanceof Checkable) && (wv instanceof CheckableWrapperView)) {
wv = new WrapperView(mContext);
}
wv.update(item, header, mDivider, mDividerHeight);
return wv;
}
use of android.widget.Checkable in project Signal-Android by WhisperSystems.
the class CheckedLinearLayout method toggle.
@Override
public void toggle() {
checked = !checked;
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
if (child instanceof Checkable) {
((Checkable) child).setChecked(checked);
}
}
refreshDrawableState();
}
use of android.widget.Checkable in project android-styled-dialogs by avast.
the class CheckableLinearLayout method setChecked.
@Override
public void setChecked(boolean checked) {
if (checked == this.mChecked) {
return;
}
this.mChecked = checked;
for (Checkable checkable : mCheckablesSet) {
checkable.setChecked(checked);
}
refreshDrawableState();
}
Aggregations