Search in sources :

Example 71 with Checkable

use of android.widget.Checkable in project BookReader by JustWayward.

the class EasyLVHolder method setChecked.

@Override
public EasyLVHolder setChecked(int viewId, boolean checked) {
    Checkable view = getView(viewId);
    view.setChecked(checked);
    return this;
}
Also used : Checkable(android.widget.Checkable)

Example 72 with Checkable

use of android.widget.Checkable in project little-bear-dictionary by daimajia.

the class CheckBoxPreference method onBindView.

@Override
protected void onBindView(View view) {
    super.onBindView(view);
    View checkboxView = view.findViewById(R.id.checkbox);
    if (checkboxView != null && checkboxView instanceof Checkable) {
        ((Checkable) checkboxView).setChecked(mChecked);
        sendAccessibilityEvent(checkboxView);
    }
    syncSummaryView(view);
}
Also used : Checkable(android.widget.Checkable) View(android.view.View)

Example 73 with Checkable

use of android.widget.Checkable in project little-bear-dictionary by daimajia.

the class SwitchPreference 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) View(android.view.View)

Example 74 with Checkable

use of android.widget.Checkable in project little-bear-dictionary by daimajia.

the class ListView method updateOnScreenCheckedViews.

@SuppressLint("NewApi")
private void updateOnScreenCheckedViews() {
    final int firstPos = getFirstVisiblePosition();
    final int count = getChildCount();
    for (int i = 0; i < count; i++) {
        final View child = getChildAt(i);
        final int position = firstPos + i;
        boolean state = getCheckedItemPositions().get(position);
        if (child instanceof Checkable) {
            ((Checkable) child).setChecked(state);
        } else if (VERSION.SDK_INT >= 11) {
            child.setActivated(state);
        }
    }
}
Also used : Checkable(android.widget.Checkable) AbsListView(android.widget.AbsListView) View(android.view.View) AdapterView(android.widget.AdapterView) SuppressLint(android.annotation.SuppressLint) SuppressLint(android.annotation.SuppressLint)

Example 75 with Checkable

use of android.widget.Checkable in project HoloEverywhere by Prototik.

the class CheckBoxPreference method onBindView.

@Override
protected void onBindView(View view) {
    super.onBindView(view);
    View checkboxView = view.findViewById(R.id.checkbox);
    if (checkboxView != null && checkboxView instanceof Checkable) {
        ((Checkable) checkboxView).setChecked(mChecked);
        sendAccessibilityEvent(checkboxView);
    }
    syncSummaryView(view);
}
Also used : Checkable(android.widget.Checkable) View(android.view.View)

Aggregations

Checkable (android.widget.Checkable)79 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