Search in sources :

Example 31 with Checkable

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);
}
Also used : Switch(org.holoeverywhere.widget.Switch) Checkable(android.widget.Checkable) ActionBarView(android.support.v7.internal.widget.ActionBarView) TextView(android.widget.TextView) View(android.view.View)

Example 32 with Checkable

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;
}
Also used : Checkable(android.widget.Checkable)

Example 33 with Checkable

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;
}
Also used : Checkable(android.widget.Checkable) View(android.view.View)

Example 34 with Checkable

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();
}
Also used : Checkable(android.widget.Checkable) View(android.view.View)

Example 35 with Checkable

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();
}
Also used : Checkable(android.widget.Checkable)

Aggregations

Checkable (android.widget.Checkable)80 View (android.view.View)47 TextView (android.widget.TextView)18 ViewGroup (android.view.ViewGroup)9 OnClickListener (android.view.View.OnClickListener)7 ImageView (android.widget.ImageView)7 Switch (android.widget.Switch)7 ResourceReference (com.android.ide.common.rendering.api.ResourceReference)6 Resources (android.content.res.Resources)5 Paint (android.graphics.Paint)5 Point (android.graphics.Point)4 SuppressLint (android.annotation.SuppressLint)3 AdapterView (android.widget.AdapterView)3 CheckBox (android.widget.CheckBox)3 ListView (android.widget.ListView)3 Spinner (android.widget.Spinner)3 Map (java.util.Map)3 Switch (org.holoeverywhere.widget.Switch)3 SimpleArrayMap (android.support.v4.util.SimpleArrayMap)2 AlertDialog (android.support.v7.app.AlertDialog)2