Search in sources :

Example 66 with Checkable

use of android.widget.Checkable in project FreeFlow by Comcast.

the class FreeFlowContainer method updateOnScreenCheckedViews.

/**
 * Perform a quick, in-place update of the checked or activated state on all
 * visible item views. This should only be called when a valid choice mode
 * is active.
 */
private void updateOnScreenCheckedViews() {
    Iterator<?> it = frames.entrySet().iterator();
    View child = null;
    while (it.hasNext()) {
        Map.Entry<?, FreeFlowItem> pairs = (Map.Entry<?, FreeFlowItem>) it.next();
        child = pairs.getValue().view;
        boolean isChecked = isChecked(pairs.getValue().itemSection, pairs.getValue().itemIndex);
        if (child instanceof Checkable) {
            ((Checkable) child).setChecked(isChecked);
        } else {
            child.setActivated(isChecked);
        }
    }
}
Also used : Checkable(android.widget.Checkable) View(android.view.View) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) SimpleArrayMap(android.support.v4.util.SimpleArrayMap)

Example 67 with Checkable

use of android.widget.Checkable in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class CellDataPreference method onBindViewHolder.

@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
    super.onBindViewHolder(holder);
    View switchView = holder.findViewById(android.R.id.switch_widget);
    switchView.setClickable(false);
    ((Checkable) switchView).setChecked(mChecked);
}
Also used : Checkable(android.widget.Checkable) View(android.view.View)

Example 68 with Checkable

use of android.widget.Checkable in project androidannotations by androidannotations.

the class CheckedChangeHandledActivityTest method testCheckedStatePassedToAnnotatedMethod.

@Test
public void testCheckedStatePassedToAnnotatedMethod() {
    assertThat(activity.checked).isFalse();
    Checkable button = (Checkable) activity.findViewById(R.id.conventionButton);
    button.setChecked(true);
    assertThat(activity.checked).isTrue();
}
Also used : Checkable(android.widget.Checkable) Test(org.junit.Test)

Example 69 with Checkable

use of android.widget.Checkable in project androidannotations by androidannotations.

the class CheckedChangeHandledActivityTest method testHandlingWithConvention.

@Test
public void testHandlingWithConvention() {
    assertThat(activity.conventionButtonEventHandled).isFalse();
    Checkable button = (Checkable) activity.findViewById(R.id.conventionButton);
    button.setChecked(true);
    assertThat(activity.conventionButtonEventHandled).isTrue();
}
Also used : Checkable(android.widget.Checkable) Test(org.junit.Test)

Example 70 with Checkable

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

the class EasyRVHolder method setChecked.

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

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