Search in sources :

Example 51 with Checkable

use of android.widget.Checkable in project YhLibraryForAndroid by android-coco.

the class YHRecyclerViewHolder method setChecked.

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

Example 52 with Checkable

use of android.widget.Checkable in project AndrOBD by fr3ts0n.

the class CheckableRelativeLayout method findCheckableChildren.

/**
 * Add to our checkable list all the children of the view that implement the
 * interface Checkable
 */
private void findCheckableChildren(View v) {
    if (v instanceof Checkable) {
        this.checkableViews.add((Checkable) v);
    }
    if (v instanceof ViewGroup) {
        final ViewGroup vg = (ViewGroup) v;
        final int childCount = vg.getChildCount();
        for (int i = 0; i < childCount; ++i) {
            findCheckableChildren(vg.getChildAt(i));
        }
    }
}
Also used : ViewGroup(android.view.ViewGroup) Checkable(android.widget.Checkable)

Example 53 with Checkable

use of android.widget.Checkable in project AndroidNews by zhjohow.

the class ViewHolderHelper method setChecked.

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

Example 54 with Checkable

use of android.widget.Checkable in project android_packages_apps_Settings by omnirom.

the class UsbModeChooserActivity method inflateOption.

private void inflateOption(final int mode, boolean selected, LinearLayout container, final boolean disallowedByAdmin) {
    View v = mLayoutInflater.inflate(R.layout.restricted_radio_with_summary, container, false);
    TextView titleView = (TextView) v.findViewById(android.R.id.title);
    titleView.setText(getTitle(mode));
    TextView summaryView = (TextView) v.findViewById(android.R.id.summary);
    updateSummary(summaryView, mode);
    if (disallowedByAdmin) {
        if (mEnforcedAdmin != null) {
            setDisabledByAdmin(v, titleView, summaryView);
        } else {
            return;
        }
    }
    v.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            if (disallowedByAdmin && mEnforcedAdmin != null) {
                RestrictedLockUtils.sendShowAdminSupportDetailsIntent(UsbModeChooserActivity.this, mEnforcedAdmin);
                return;
            }
            if (!ActivityManager.isUserAMonkey()) {
                mBackend.setMode(mode);
            }
            mDialog.dismiss();
            finish();
        }
    });
    ((Checkable) v).setChecked(selected);
    container.addView(v);
}
Also used : OnClickListener(android.view.View.OnClickListener) TextView(android.widget.TextView) Checkable(android.widget.Checkable) View(android.view.View) TextView(android.widget.TextView)

Example 55 with Checkable

use of android.widget.Checkable in project android_packages_apps_Settings by omnirom.

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)

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