Java 类android.widget.CheckBox 实例源码

项目:RepWifiApp    文件:NetworkDetailsActivity.java   
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_network_details);

    CheckBox c = (CheckBox) findViewById(R.id.chk_show_pass_details);
    c.setOnCheckedChangeListener(this);

    Intent intent = getIntent();
    if (!intent.hasExtra(ActivityLauncher.EXTRA_APINFO)) {
        this.setResult(RESULT_CANCELED);
        this.finish();
        return;
    }

    this.currentNetwork = (AccessPointInfo) intent.getExtras().getSerializable(
                    ActivityLauncher.EXTRA_APINFO);
    if (this.currentNetwork == null) {
        this.setResult(RESULT_CANCELED);
        this.finish();
        return;
    }

    loadNetwork(false);

}
项目:GCSApp    文件:NewGroupActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.em_activity_new_group);
    groupNameEditText = (EditText) findViewById(R.id.edit_group_name);
    introductionEditText = (EditText) findViewById(R.id.edit_group_introduction);
    publibCheckBox = (CheckBox) findViewById(R.id.cb_public);
    memberCheckbox = (CheckBox) findViewById(R.id.cb_member_inviter);
    secondTextView = (TextView) findViewById(R.id.second_desc);

    publibCheckBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if (isChecked) {
                secondTextView.setText(R.string.join_need_owner_approval);
            } else {
                secondTextView.setText(R.string.Open_group_members_invited);
            }
        }
    });
}
项目:financisto1-holo    文件:QifExportActivity.java   
protected void savePreferences() {
    SharedPreferences.Editor editor = getPreferences(MODE_PRIVATE).edit();

       currencyPreferences.savePreferences(this, editor);

       long[] selectedIds = getSelectedAccountsIds();
       if (selectedIds.length > 0) {
           editor.putString(QIF_EXPORT_SELECTED_ACCOUNTS, joinSelectedAccounts(selectedIds));
       }

       Spinner dateFormats = (Spinner)findViewById(R.id.spinnerDateFormats);
    editor.putInt(QIF_EXPORT_DATE_FORMAT, dateFormats.getSelectedItemPosition());
       CheckBox uploadToDropbox = (CheckBox)findViewById(R.id.checkboxUploadToDropbox);
       editor.putBoolean(QIF_EXPORT_UPLOAD_TO_DROPBOX, uploadToDropbox.isChecked());

    editor.commit();
}
项目:LittleLight    文件:ItemAdapter.java   
public ItemViewHolder(View itemView) {
    super(itemView);
    tile = itemView;
    imageView = (ImageView) itemView.findViewById(R.id.ivIcon);
    tvAmount = (TextView) itemView.findViewById(R.id.tvAmount);
    tvFirstLine = (TextView) itemView.findViewById(R.id.tvItemTileFirstLine);
    tvSecondLine = (TextView) itemView.findViewById(R.id.tvItemTileSecondLine);
    checkBox = (CheckBox) itemView.findViewById(R.id.cbCheck);
}
项目:GitHub    文件:ImagePreviewActivity.java   
public void initView() {
    images = (List<LocalMedia>) getIntent().getSerializableExtra(EXTRA_PREVIEW_LIST);
    selectImages = (List<LocalMedia>) getIntent().getSerializableExtra(EXTRA_PREVIEW_SELECT_LIST);
    maxSelectNum = getIntent().getIntExtra(EXTRA_MAX_SELECT_NUM, 9);
    position = getIntent().getIntExtra(EXTRA_POSITION, 1);

    barLayout = (LinearLayout) findViewById(R.id.bar_layout);
    selectBarLayout = (RelativeLayout) findViewById(R.id.select_bar_layout);

    toolbar = (Toolbar) findViewById(R.id.toolbar);
    toolbar.setTitle((position + 1) + "/" + images.size());
    setSupportActionBar(toolbar);
    toolbar.setNavigationIcon(R.mipmap.ic_back);


    doneText = (TextView) findViewById(R.id.done_text);
    onSelectNumChange();

    checkboxSelect = (CheckBox) findViewById(R.id.checkbox_select);
    onImageSwitch(position);


    viewPager = (PreviewViewPager) findViewById(R.id.preview_pager);
    viewPager.setAdapter(new SimpleFragmentAdapter(getSupportFragmentManager()));
    viewPager.setCurrentItem(position);
}
项目:bluewatcher    文件:SettingsActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getActionBar().setDisplayHomeAsUpEnabled(true);
    setContentView(R.layout.activity_settings);
    pm = getPackageManager();

    startAtBoot = (CheckBox) findViewById(R.id.startup_at_boot);

    showReconnectMessage = (CheckBox) findViewById(R.id.show_reconnect_message);
    sendControlMode = (CheckBox) findViewById(R.id.send_control_mode);
    gba400CleanNotification = (CheckBox) findViewById(R.id.gba400_clean_notification);
    disableServer = (CheckBox) findViewById(R.id.disableServerOption);
    startCameraButton = (Button)findViewById(R.id.start_camera);
    startCameraButton.setOnClickListener(new StartCameraButtonListener(this));

    notificationsAccessButton = (Button)findViewById(R.id.notifications_config_button);
    notificationsAccessButton.setOnClickListener(new NotificationsConfigButtonListener(this));

    try {
        loadConfiguration();
    } catch(JSONException e) {
        ConfigurationManager.showConfigurationError(getApplicationContext());
        finish();
    }
}
项目:Adblocker-for-Android    文件:MainActivity.java   
private void readPrefs()
{
    SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
    ((CheckBox)findViewById(R.id.rbStevenBlack)).setChecked(settings.getBoolean("StevenBlacks", false));
    ((CheckBox)findViewById(R.id.cbPorn)).setChecked(settings.getBoolean("StevenBlacksPorn", false));
    ((CheckBox)findViewById(R.id.cbSocial)).setChecked(settings.getBoolean("StevenBlacksSocial", false));
    ((CheckBox)findViewById(R.id.cbFakeNews)).setChecked(settings.getBoolean("StevenBlacksFakeNews", false));
    ((CheckBox)findViewById(R.id.cbGambling)).setChecked(settings.getBoolean("StevenBlacksGambling", false));
    ((CheckBox)findViewById(R.id.rbHostsFileNet)).setChecked(settings.getBoolean("HostsFileNet", true));

    if(settings.getBoolean("StevenBlacks", false))
    {
        ((CheckBox)findViewById(R.id.cbSocial)).setTextColor(Color.BLACK);
        ((CheckBox)findViewById(R.id.cbSocial)).setEnabled(true);

        ((CheckBox)findViewById(R.id.cbFakeNews)).setTextColor(Color.BLACK);
        ((CheckBox)findViewById(R.id.cbFakeNews)).setEnabled(true);

        ((CheckBox)findViewById(R.id.cbGambling)).setTextColor(Color.BLACK);
        ((CheckBox)findViewById(R.id.cbGambling)).setEnabled(true);

        ((CheckBox)findViewById(R.id.cbPorn)).setTextColor(Color.BLACK);
        ((CheckBox)findViewById(R.id.cbPorn)).setEnabled(true);
    }
}
项目:AndroidApp-Deploy    文件:Mandarini.java   
public void check1(View view) {

        //checkbox 1
        CheckBox mandarino_uno = (CheckBox) findViewById(R.id.vota1);
        //checkbox 2
        CheckBox mandarino_due = (CheckBox) findViewById(R.id.vota2);
        //checkbox 3
        CheckBox mandarino_tre = (CheckBox) findViewById(R.id.vota3);

        mandarino_uno_checked=mandarino_uno.isChecked();

        if(mandarino_uno_checked) {
            orange = 1;
            mandarino_due.setChecked(false);
            mandarino_tre.setChecked(false);

        }else{
            orange=0;
        }
    }
项目:HueNotifier    文件:LightSettings.java   
LightSettings(List<CheckBox> checkBoxes) {
    String lights = null;
    String colors = null;
    for (CheckBox cb : checkBoxes) {
        if (cb.isChecked()) {
            if (lights == null) {
                lights = String
                        .valueOf(((int[]) cb.getTag())[0]);
                colors = String
                        .valueOf(((int[]) cb.getTag())[1]);
            } else {
                lights += "," + ((int[]) cb.getTag())[0];
                colors += "," + ((int[]) cb.getTag())[1];
            }
        }
    }
    this.lights = Util.toIntArray(lights);
    this.colors = Util.toIntArray(colors);
}
项目:Options    文件:CheckOption.java   
@Override
protected View createView(ViewGroup parent) {
    View view = LayoutInflater.from(parent.getContext())
            .inflate(R.layout.check_option, parent, false);

    TextView titleText = (TextView) view.findViewById(R.id.preference_check_title);
    final TextView detailText = (TextView) view.findViewById(R.id.preference_check_body);
    final CheckBox toggle = (CheckBox) view.findViewById(R.id.preference_check_toggle);

    titleText.setText(getTitle());
    detailText.setText(getDescription(isToggled()));
    toggle.setChecked(isToggled());

    view.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            toggle.setChecked(!isToggled());
        }
    });

    toggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            onSwitchToggle(isChecked);
            detailText.setText(getDescription(isChecked));
        }
    });

    return view;
}
项目:letv    文件:LoginActivity.java   
private void initView() {
    this.mInputAccountLayout = (RelativeLayout) this.mRootView.findViewWithTag("umgr_login_layout_input_username");
    this.mInputAccount = (EditText) this.mRootView.findViewWithTag("umgr_login_input_username");
    this.mClearInputAccount = (Button) this.mRootView.findViewWithTag("umgr_login_clear_input_username");
    this.mInputPassword = (EditText) this.mRootView.findViewWithTag("umgr_login_input_password");
    this.mClearInputPassword = (Button) this.mRootView.findViewWithTag("umgr_login_clear_input_password");
    this.mRegister = (TextView) this.mRootView.findViewWithTag("umgr_login_register");
    this.mFindpwd = (TextView) this.mRootView.findViewWithTag("umgr_login_findpwd");
    this.mErrorPrompt = (TextView) this.mRootView.findViewWithTag("umgr_login_error_prompt");
    this.mLogin = (Button) this.mRootView.findViewWithTag("umgr_login_submit");
    this.mAgreeClause1 = (TextView) this.mRootView.findViewWithTag("umgr_agree_clause_1");
    this.mAgreeClauseUser = (TextView) this.mRootView.findViewWithTag("umgr_agree_clause_2_user");
    this.mAgreement = (TextView) this.mRootView.findViewWithTag("umgr_agree_clause_2_agreement");
    this.mAnd = (TextView) this.mRootView.findViewWithTag("umgr_agree_clause_2_and");
    this.mPrivacy = (TextView) this.mRootView.findViewWithTag("umgr_agree_clause_2_privacy");
    this.mShowPwd = (CheckBox) this.mRootView.findViewWithTag("umgr_login_show_password");
    this.mSwitchAccount = (TextView) this.mRootView.findViewWithTag("umgr_login_switch");
}
项目:All-about-water    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    //Initiate layout elements
    radioGroup_q1 = (RadioGroup) findViewById(R.id.radioGroup_q1);
    radioGroup_q2 = (RadioGroup) findViewById(R.id.radioGroup_q2);
    radioGroup_q3 = (RadioGroup) findViewById(R.id.radioGroup_q3);
    radioGroup_q4 = (RadioGroup) findViewById(R.id.radioGroup_q4);
    radioGroup_q5 = (RadioGroup) findViewById(R.id.radioGroup_q5);
    radioGroup_q6 = (RadioGroup) findViewById(R.id.radioGroup_q6);
    checkBox_7a = (CheckBox) findViewById(R.id.checkBox_7a);
    checkBox_7b = (CheckBox) findViewById(R.id.checkBox_7b);
    checkBox_7c = (CheckBox) findViewById(R.id.checkBox_7c);
    editText_name = (EditText) findViewById(R.id.editText_name);
}
项目:AssistantBySDK    文件:RemindEditAheadDialog.java   
@Override
protected void initTaskView(LinearLayout llTaskContainer) {
    View taskView = View.inflate(context, R.layout.remind_edit_ahead_dialog, null);
    taskView.findViewById(R.id.read_cancel).setOnClickListener(this);
    taskView.findViewById(R.id.read_confirm).setOnClickListener(this);
    cbs[0]=(CheckBox)taskView.findViewById(R.id.read_fr7);
    cbs[0].setTag("7");
    cbs[1]=(CheckBox)taskView.findViewById(R.id.read_fr5);
    cbs[1].setTag("5");
    cbs[2]=(CheckBox)taskView.findViewById(R.id.read_fr3);
    cbs[2].setTag("3");
    cbs[3]=(CheckBox)taskView.findViewById(R.id.read_fr1);
    cbs[3].setTag("1");

    llTaskContainer.addView(taskView);
}
项目:HueNotifier    文件:MainActivity.java   
private void showColorPickerDialog(final CheckBox cb, final TextView tv, final int[] tag) {
    ColorPickerDialog dialog = new ColorPickerDialog(
            MainActivity.this,
            tag[1]);
    dialog.setOnColorChangedListener(
            new ColorPickerDialog.OnColorChangedListener() {
                @Override
                public void onColorChanged(int color) {
                    tv.setTextColor(color);
                    tag[1] = color;
                    cb.setTag(tag);
                    startService(new Intent(MainActivity.this,
                            ColorFlashService.class)
                            .putExtra("lights", new int[]{tag[0]})
                            .putExtra("colors", new int[]{color})
                            .putExtra("flashOnlyIfLightsOn", false));
                }
            });
    dialog.show();
}
项目:MBEStyle    文件:RequestFragment.java   
private void deselectAll() {
    mCheckedPositions.clear();
    handleFabShow();

    // 取消所有 Bean 内记录的选中状态
    for (RequestBean bean : mApps) {
        bean.isCheck = false;
    }

    // 当前可见的所有 Item 取消选择
    for (int i = 0; i < rvApp.getChildCount(); i++) {
        View childAt = rvApp.getChildAt(i);
        CheckBox cbCheck = (CheckBox) childAt.findViewById(R.id.cb_check);
        cbCheck.setChecked(false);
    }
}
项目:LiveWallPaper    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mCbVoice = (CheckBox) findViewById(R.id.id_cb_voice);

    mCbVoice.setOnCheckedChangeListener(
            new CompoundButton.OnCheckedChangeListener() {
                @Override
                public void onCheckedChanged(
                        CompoundButton buttonView, boolean isChecked) {

                    if (isChecked) {
                        // 静音
                        VideoLiveWallpaper.voiceSilence(getApplicationContext());
                    } else {
                        VideoLiveWallpaper.voiceNormal(getApplicationContext());
                    }
                }
            });
}
项目:Linphone4Android    文件:ChatFragment.java   
public ViewHolder(View view) {
    id = view.getId();
    bubbleLayout = (RelativeLayout) view.findViewById(R.id.bubble);
    delete = (CheckBox) view.findViewById(R.id.delete_message);
    background = (LinearLayout) view.findViewById(R.id.background);
    contactPicture = (ImageView) view.findViewById(R.id.contact_picture);
    contactName = (TextView) view.findViewById(R.id.contact_header);
    messageText = (TextView) view.findViewById(R.id.message);
    messageImage = (ImageView) view.findViewById(R.id.image);
    fileTransferLayout = (RelativeLayout) view.findViewById(R.id.file_transfer_layout);
    fileTransferProgressBar = (ProgressBar) view.findViewById(R.id.progress_bar);
    fileTransferAction = (Button) view.findViewById(R.id.file_transfer_action);
    messageStatus = (ImageView) view.findViewById(R.id.status);
    messageSendingInProgress = (ProgressBar) view.findViewById(R.id.inprogress);
    contactPictureMask = (ImageView) view.findViewById(R.id.mask);
}
项目:GravityBox    文件:IncreasingRingPreference.java   
@Override
protected void onBindDialogView(View view) {
    super.onBindDialogView(view);

    mEnabledCheckbox = (CheckBox) view.findViewById(R.id.increasing_ring);
    mEnabledCheckbox.setOnCheckedChangeListener(this);

    mMinVolumeTitle = (TextView) view.findViewById(R.id.increasing_ring_min_volume_title);

    mMinVolumeSeekBar = (SeekBar) view.findViewById(R.id.seekbar);
    AudioManager am = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE);
    mMinVolumeSeekBar.setSecondaryProgress(am.getStreamVolume(AudioManager.STREAM_RING));

    mRingVolumeNotice = (TextView) view.findViewById(R.id.increasing_ring_volume_notice);

    mIntervalTitle = (TextView) view.findViewById(R.id.increasing_ring_ramp_up_duration_title);
    mInterval = (Spinner) view.findViewById(R.id.increasing_ring_ramp_up_duration);
    mIntervalValues = getContext().getResources().getIntArray(R.array.increasing_ring_ramp_up_duration_values);

    getConfig();
    updateVolumeNoticeVisibility(mMinVolumeSeekBar.getProgress());
    updateEnabledStates();
}
项目:androdns    文件:DNSFormActivity.java   
public void doLookup() {
    setStatusText("initializing");
    Session thisQuestion = new Session();

    //build the question object
    String qname = gettxtQNAMEContent();
    thisQuestion.qname = qname;
    thisQuestion.qtype = gettxtQTYPEContent();
    thisQuestion.flag_RD = ((CheckBox) findViewById(R.id.cbRD)).isChecked();
    thisQuestion.flag_CD = ((CheckBox) findViewById(R.id.cbCD)).isChecked();
    thisQuestion.flag_DO = ((CheckBox) findViewById(R.id.cbDO)).isChecked();
    thisQuestion.qclass = (((Spinner) findViewById(R.id.spinnerCLASS))).getSelectedItem().toString();
    thisQuestion.server = gettxtResolverContent().trim();
    thisQuestion.TCP = ((CheckBox) findViewById(R.id.cbTCP)).isChecked();
    doLookup(thisQuestion);
}
项目:Shush    文件:MainActivity.java   
@Override
protected void onResume() {
    super.onResume();
    //initialise location permissions checkbox
    CheckBox locationPermissionsCheckBox = (CheckBox) findViewById(R.id.location_permission_checkbox);
    if (ActivityCompat.checkSelfPermission(MainActivity.this, Manifest.permission.ACCESS_FINE_LOCATION)!= PackageManager.PERMISSION_GRANTED){
        locationPermissionsCheckBox.setChecked(false);
    }
    else {
        locationPermissionsCheckBox.setChecked(true);
        locationPermissionsCheckBox.setEnabled(false);
    }

    NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
    if (Build.VERSION.SDK_INT>=24 && !notificationManager.isNotificationPolicyAccessGranted()){
        mRingerPermissionCheckBox.setChecked(false);
    }
    else {
        mRingerPermissionCheckBox.setChecked(true);
        mRingerPermissionCheckBox.setEnabled(false);
    }
}
项目:permitlog-android    文件:CustomDriveDialog.java   
@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    // Save the current data
    outState.putLong("startTime", startingTime.getTimeInMillis());
    outState.putLong("endTime", endingTime.getTimeInMillis());
    // If the user has no drivers, save the driver ID as null:
    if (spinnerData.driverIds.isEmpty()) outState.putString("driverId", null);
    //Otherwise, just save the driver ID from the spinner:
    else outState.putString("driverId", spinnerData.driverIds.get(driversSpinner.getSelectedItemPosition()));
    outState.putBoolean("showNotice", ddNotice.getParent() == ddNoticeContainer);
    outState.putBoolean("night", ((CheckBox)findViewById(R.id.night_checkbox)).isChecked());
    outState.putBoolean("weather", ((CheckBox) findViewById(R.id.weather_checkbox)).isChecked());
    outState.putBoolean("adverse", ((CheckBox) findViewById(R.id.adverse_checkbox)).isChecked());
}
项目:permitlog-android    文件:CustomDriveDialog.java   
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
    //Set startingTime and endingTime using the data from the database:
    startingTime.setTimeInMillis((long)dataSnapshot.child("start").getValue());
    endingTime.setTimeInMillis((long)dataSnapshot.child("end").getValue());
    //Set the data and times according to the above:
    updateDateAndTime();
    //Set the night checkbox to whatever the log says:
    ((CheckBox)findViewById(R.id.night_checkbox)).setChecked(
            dataSnapshot.hasChild("night") && (boolean)dataSnapshot.child("night").getValue()
    );
    //Not all users have "weather" and "adverse", so make sure to use .hasChild() to check if they do:
    ((CheckBox)findViewById(R.id.weather_checkbox)).setChecked(
            dataSnapshot.hasChild("weather") && (boolean)dataSnapshot.child("weather").getValue()
    );
    ((CheckBox)findViewById(R.id.adverse_checkbox)).setChecked(
            dataSnapshot.hasChild("adverse") && (boolean)dataSnapshot.child("adverse").getValue()
    );

    //Adjust the spinner according to the driver:
    selectDriver(dataSnapshot.child("driver_id").getValue().toString());
}
项目:chat-sdk-android-push-firebase    文件:ChatSDKAbstractUsersListAdapter.java   
protected View rowForType(ViewHolder holder, final int position){
    View row =  ( (LayoutInflater) mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE) ).inflate(userItems.get(position).getResourceID(), null);

    holder.textView = (TextView) row.findViewById(R.id.chat_sdk_txt);

    if (getItemViewType(position) == TYPE_USER)
    {
        holder.profilePicture = (CircleImageView) row.findViewById(R.id.img_profile_picture);
        if (isMultiSelect)
        {
            holder.checkBox = (CheckBox) row.findViewById(R.id.checkbox);
            holder.checkBox.setVisibility(View.VISIBLE);
            holder.checkBox.setChecked(selectedUsersPositions.get(position));
            holder.checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                @Override
                public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                    setViewSelected(position, isChecked);
                }
            });
        }
    }

    row.setTag(holder);

    return row;
}
项目:Allshare    文件:MainActivity.java   
@Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    momentCheckBox = (CheckBox) findViewById(R.id.shareToMomentCheckBox);
    qzoneCheckBox = (CheckBox) findViewById(R.id.shareToQzoneCheckBox);

    icon = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
    if (!ICON_FILE.exists()) {
        try {
            FileOutputStream fileOutputStream = new FileOutputStream(ICON_FILE);
            icon.compress(Bitmap.CompressFormat.PNG, 100, fileOutputStream);
            fileOutputStream.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
项目:AndroidBackendlessChat    文件:ChatSDKAbstractUsersListAdapter.java   
protected View rowForType(ViewHolder holder, final int position){
    View row =  ( (LayoutInflater) mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE) ).inflate(userItems.get(position).getResourceID(), null);

    holder.textView = (TextView) row.findViewById(R.id.chat_sdk_txt);

    if (getItemViewType(position) == TYPE_USER)
    {
        holder.profilePicture = (CircleImageView) row.findViewById(R.id.img_profile_picture);
        if (isMultiSelect)
        {
            holder.checkBox = (CheckBox) row.findViewById(R.id.checkbox);
            holder.checkBox.setVisibility(View.VISIBLE);
            holder.checkBox.setChecked(selectedUsersPositions.get(position));
            holder.checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                @Override
                public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                    setViewSelected(position, isChecked);
                }
            });
        }
    }

    row.setTag(holder);

    return row;
}
项目:okwallet    文件:ReportIssueDialogBuilder.java   
public ReportIssueDialogBuilder(final Activity activity, final int titleResId, final int messageResId) {
    super(activity);

    this.activity = activity;

    final LayoutInflater inflater = LayoutInflater.from(activity);
    final View view = inflater.inflate(R.layout.report_issue_dialog, null);

    ((TextView) view.findViewById(R.id.report_issue_dialog_message)).setText(messageResId);

    viewDescription = (EditText) view.findViewById(R.id.report_issue_dialog_description);

    viewCollectDeviceInfo = (CheckBox) view.findViewById(R.id.report_issue_dialog_collect_device_info);
    viewCollectInstalledPackages = (CheckBox) view
            .findViewById(R.id.report_issue_dialog_collect_installed_packages);
    viewCollectApplicationLog = (CheckBox) view.findViewById(R.id.report_issue_dialog_collect_application_log);
    viewCollectWalletDump = (CheckBox) view.findViewById(R.id.report_issue_dialog_collect_wallet_dump);

    setTitle(titleResId);
    setView(view);
    setPositiveButton(R.string.report_issue_dialog_report, this);
    setNegativeButton(R.string.button_cancel, null);
}
项目:ucar-weex-core    文件:WXDebugActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.wx_debug_activity);
    textBack = (TextView) findViewById(R.id.text_back);
    textScan = (ImageView) findViewById(R.id.text_scan);
    editHost = (EditText) findViewById(R.id.edit_host);
    editPort = (EditText) findViewById(R.id.edit_port);
    editOpen = (EditText) findViewById(R.id.edit_open);
    cbLocal = (CheckBox) findViewById(R.id.cb_local);
    cbDebugChrome = (CheckBox) findViewById(R.id.cb_debug_chrome);
    cbSRemote = (CheckBox) findViewById(R.id.cb_sRemoteDebugMode);
    btnSave = (Button) findViewById(R.id.btn_save);
    btnReset = (Button) findViewById(R.id.btn_save_reset);
    btnOpen = (Button) findViewById(R.id.btn_open);
    spinner = (Spinner) findViewById(R.id.spinner_log_level);

    textBack.setOnClickListener(this);
    textScan.setOnClickListener(this);
    btnSave.setOnClickListener(this);
    btnReset.setOnClickListener(this);
    btnOpen.setOnClickListener(this);
    setData();
    hideSoftInput();
}
项目:boohee_v5.6    文件:HomeTimelineAdapter.java   
public Holder(View view) {
    this.lightProgress = (ProgressBar) view.findViewById(R.id.pb_light);
    this.avatarImage = (ImageView) view.findViewById(R.id.avatar);
    this.officialImage = (ImageView) view.findViewById(R.id.iv_official);
    this.markImage = (ImageView) view.findViewById(R.id.iv_mark);
    this.nickName = (TextView) view.findViewById(R.id.nickname);
    this.postTime = (TextView) view.findViewById(R.id.post_time);
    this.body = (TextView) view.findViewById(R.id.body);
    this.repostUser = (TextView) view.findViewById(R.id.tv_reposted_user);
    this.tv_comment = (TextView) view.findViewById(R.id.tv_comment);
    this.nineGridLayout = (NineGridLayout) view.findViewById(R.id.iv_post_grid);
    this.cb_praise = (CheckBox) view.findViewById(R.id.cb_praise);
    this.tv_praise_plus = (TextView) view.findViewById(R.id.tv_praise_plus);
    this.rl_praise = view.findViewById(R.id.rl_praise);
    this.ll_comment = view.findViewById(R.id.ll_comment);
    this.ll_menu = view.findViewById(R.id.ll_menu);
    this.ll_bottom = view.findViewById(R.id.ll_bottom);
    this.attachmentLayout = (LinearLayout) view.findViewById(R.id.attachment_layout);
    this.ivAttachment = (ImageView) view.findViewById(R.id.iv_attachment);
    this.tvAttachment = (TextView) view.findViewById(R.id.tv_attachment);
    this.video = (ExVideoView) view.findViewById(R.id.video);
}
项目:gst-android-camera    文件:CameraActivity.java   
public void onCheckboxClicked(View view) {
    boolean checked = ((CheckBox) view).isChecked();

    switch(view.getId()) {
        case R.id.autofocus:
                gstAhc.setAutoFocus(checked);
            break;
        default:
            break;
    }
}
项目:FileDownloader-master    文件:MultitaskTestActivity.java   
private void assignViews() {
    taskCountSb = (SeekBar) findViewById(R.id.task_count_sb);
    taskCountTv = (TextView) findViewById(R.id.task_count_tv);
    timeConsumeTv = (TextView) findViewById(R.id.time_consume_tv);
    wayRgp = (RadioGroup) findViewById(R.id.way_rgp);
    serialRbtn = (RadioButton) findViewById(R.id.serial_rbtn);
    parallelRbtn = (RadioButton) findViewById(R.id.parallel_rbtn);
    avoidMissFrameCb = (CheckBox) findViewById(R.id.avoid_miss_frame_cb);
    overTaskPb = (ProgressBar) findViewById(R.id.over_task_pb);
    actionBtn = (Button) findViewById(R.id.action_btn);
    pendingTv = (TextView) findViewById(R.id.pending_tv);
    pendingInfoTv = (TextView) findViewById(R.id.pending_info_tv);
    pendingPb = (ProgressBar) findViewById(R.id.pending_pb);
    connectedTv = (TextView) findViewById(R.id.connected_tv);
    connectedInfoTv = (TextView) findViewById(R.id.connected_info_tv);
    connectedPb = (ProgressBar) findViewById(R.id.connected_pb);
    progressTv = (TextView) findViewById(R.id.progress_tv);
    progressInfoTv = (TextView) findViewById(R.id.progress_info_tv);
    progressPb = (ProgressBar) findViewById(R.id.progress_pb);
    retryTv = (TextView) findViewById(R.id.retry_tv);
    retryInfoTv = (TextView) findViewById(R.id.retry_info_tv);
    retryPb = (ProgressBar) findViewById(R.id.retry_pb);
    errorTv = (TextView) findViewById(R.id.error_tv);
    errorInfoTv = (TextView) findViewById(R.id.error_info_tv);
    errorPb = (ProgressBar) findViewById(R.id.error_pb);
    pausedTv = (TextView) findViewById(R.id.paused_tv);
    pausedInfoTv = (TextView) findViewById(R.id.paused_info_tv);
    pausedPb = (ProgressBar) findViewById(R.id.paused_pb);
    completedReusedTv = (TextView) findViewById(R.id.completed_with_old_tv);
    completedReusedInfoTv = (TextView) findViewById(R.id.completed_with_old_info_tv);
    completedReusedPb = (ProgressBar) findViewById(R.id.completed_with_old_pb);
    completedDownloadingTv = (TextView) findViewById(R.id.completed_tv);
    completedDownloadingInfoTv = (TextView) findViewById(R.id.completed_info_tv);
    completedDownloadingPb = (ProgressBar) findViewById(R.id.completed_pb);
    warnTv = (TextView) findViewById(R.id.warn_tv);
    warnInfoTv = (TextView) findViewById(R.id.warn_info_tv);
    warnPb = (ProgressBar) findViewById(R.id.warn_pb);
    deleteAllFileBtn = (Button) findViewById(R.id.delete_all_file_btn);
}
项目:q-mail    文件:AccountSetupBasics.java   
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.account_setup_basics);
    mEmailView = (EditText)findViewById(R.id.account_email);
    mPasswordView = (EditText)findViewById(R.id.account_password);
    mClientCertificateCheckBox = (CheckBox)findViewById(R.id.account_client_certificate);
    mClientCertificateSpinner = (ClientCertificateSpinner)findViewById(R.id.account_client_certificate_spinner);
    mNextButton = (Button)findViewById(R.id.next);
    mManualSetupButton = (Button)findViewById(R.id.manual_setup);
    mShowPasswordCheckBox = (CheckBox) findViewById(R.id.show_password);
    mNextButton.setOnClickListener(this);
    mManualSetupButton.setOnClickListener(this);
}
项目:GitHub    文件:TestSetupActivity.java   
public void startClick(View v) {
    TestParams params = new TestParams();
    Spinner spinnerThread = (Spinner) findViewById(R.id.spinnerThread);
    String threadModeStr = spinnerThread.getSelectedItem().toString();
    ThreadMode threadMode = ThreadMode.valueOf(threadModeStr);
    params.setThreadMode(threadMode);

    params.setEventInheritance(((CheckBox) findViewById(R.id.checkBoxEventBusEventHierarchy)).isChecked());
    params.setIgnoreGeneratedIndex(((CheckBox) findViewById(R.id.checkBoxEventBusIgnoreGeneratedIndex)).isChecked());

    EditText editTextEvent = (EditText) findViewById(R.id.editTextEvent);
    params.setEventCount(Integer.parseInt(editTextEvent.getText().toString()));

    EditText editTextSubscriber = (EditText) findViewById(R.id.editTextSubscribe);
    params.setSubscriberCount(Integer.parseInt(editTextSubscriber.getText().toString()));

    Spinner spinnerTestToRun = (Spinner) findViewById(R.id.spinnerTestToRun);
    int testPos = spinnerTestToRun.getSelectedItemPosition();
    params.setTestNumber(testPos + 1);
    ArrayList<Class<? extends Test>> testClasses = initTestClasses(testPos);
    params.setTestClasses(testClasses);

    Intent intent = new Intent();
    intent.setClass(this, TestRunnerActivity.class);
    intent.putExtra("params", params);
    startActivity(intent);
}
项目:GestureLockView    文件:StandardGestureLockActivity.java   
private void initView() {
    mGestureLockView = (GestureLockView) findViewById(R.id.glv);
    mPassword = (TextView) findViewById(R.id.tv_current_passord);
    mGuidesCheckBox = (CheckBox) findViewById(R.id.cb_guide);
    mColorCheckBox = (CheckBox) findViewById(R.id.cb_color);
    mAnimCheckBox = (CheckBox) findViewById(R.id.cb_anim);
    mAnimDurationSeekbar = (SeekBar) findViewById(R.id.sb_anim_duration);
    mAnimScaleModeRadioGroup = (RadioGroup) findViewById(R.id.rg);
    mAnimScaleRateSeekbar = (SeekBar) findViewById(R.id.sb_anim_rate);
    mVibrateCheckBox = (CheckBox) findViewById(R.id.cb_vibrate);
    mVibrateDurationSeekbar = (SeekBar) findViewById(R.id.sb_vibrate_duration);
    mRadiusSeekbar = (SeekBar) findViewById(R.id.sb_radius);
    mLineThicknesSeekbar = (SeekBar) findViewById(R.id.sb_line_thickness);
}
项目:Camera-Roll-Android-App    文件:ExcludePathsActivity.java   
@Override
public void setFile(File_POJO file) {
    super.setFile(file);
    CheckBox checkBox = itemView.findViewById(R.id.checkbox);
    checkBox.setTag(file.getPath());
    setOnCheckedChangeListener(null);
    checkBox.setChecked(file.excluded);
    ArrayList<String> excludedPaths = Provider.getExcludedPaths();
    boolean enabled = !Provider.isDirExcludedBecauseParentDirIsExcluded(
            file.getPath(), excludedPaths);
    checkBox.setEnabled(enabled);
}
项目:Remember    文件:NoteAdapter.java   
public ViewHolder(View v){
    super(v);
    cardView = (CardView)v.findViewById(R.id.cardview);
    contentView = (TextView)v.findViewById(R.id.content);
    dateView = (TextView)v.findViewById(R.id.date);
    checkBox = (CheckBox)v.findViewById(R.id.checkbox);

}
项目:GCSApp    文件:PayAdapter.java   
public MyViewHolder(final View itemView) {
    super(itemView);
    rl_cb_item = (RelativeLayout) itemView.findViewById(R.id.rl_cb_item);
    cb_item = (CheckBox) itemView.findViewById(R.id.cb_item);

    iv_item_goods = (ImageView) itemView.findViewById(R.id.iv_item_goods);
    iv_item_plus = (ImageView) itemView.findViewById(R.id.iv_item_plus);
    iv_item_reduce = (ImageView) itemView.findViewById(R.id.iv_item_reduce);

    tv_item_name = (TextView) itemView.findViewById(R.id.tv_item_name);
    tv_item_price_one = (TextView) itemView.findViewById(R.id.tv_item_price_one);
    tv_item_type = (TextView) itemView.findViewById(R.id.tv_item_type);
    tv_item_price_add = (TextView) itemView.findViewById(R.id.tv_item_price_add);
    tv_item_num = (TextView) itemView.findViewById(R.id.tv_item_num);
}
项目:SimpleDialogFragments    文件:CheckViewHolder.java   
@Override
protected void setUpView(View view, Context context, Bundle savedInstanceState,
                         final SimpleFormDialog.DialogActions actions,
                         boolean isLastElement, boolean isOnlyElement) {

    checkBox = (CheckBox) view.findViewById(R.id.checkBox);

    // Label
    checkBox.setText(field.getText(context));

    // Check preset
    if (savedInstanceState != null) {
        checkBox.setChecked(savedInstanceState.getBoolean(SAVED_CHECK_STATE));
    } else {
        checkBox.setChecked(field.getInitialState(context));
    }

    // Positive button state for single element forms
    if (isOnlyElement) {
        checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                actions.updatePosButtonState();
            }
        });
    }

}
项目:sctalk    文件:CheckboxConfigHelper.java   
private void configCheckBox(CheckBox checkBox,String key,ConfigurationSp.CfgDimension dimension) {

        if (configMgr == null) {
            logger.e("config#configMgr is null");
            return;
        }

        boolean shouldCheck = configMgr.getCfg(key,dimension);
        logger.d("config#%s is set %s", dimension, shouldCheck);
        checkBox.setChecked(shouldCheck);
    }
项目:sctalk    文件:CheckboxConfigHelper.java   
private void handleCheckBoxChanged(final CheckBox checkBox,final String key,final ConfigurationSp.CfgDimension dimension) {
    if (checkBox == null || configMgr == null) {
        return;
    }

    checkBox.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            configMgr.setCfg(key,dimension,checkBox.isChecked());
        }
    });
}
项目:Musicoco    文件:SheetSongListController.java   
public void initViews() {
    random = (ImageView) activity.findViewById(R.id.sheet_detail_songs_icon);
    playAllRandom = (TextView) activity.findViewById(R.id.sheet_detail_songs_play_random);
    line = activity.findViewById(R.id.sheet_detail_songs_line);
    songList = (RecyclerView) activity.findViewById(R.id.sheet_detail_songs_list);
    randomContainer = activity.findViewById(R.id.sheet_detail_random_container);

    checkContainer = activity.findViewById(R.id.sheet_detail_check_container);
    checkAll = (CheckBox) activity.findViewById(R.id.sheet_detail_check_all);
    checkCount = (TextView) activity.findViewById(R.id.sheet_detail_check_count);
    checkAll.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            boolean isChecked = checkAll.isChecked();
            if (isChecked) {
                songAdapter.checkAll();
            } else {
                songAdapter.clearAllCheck();
            }
        }
    });

    randomContainer.setOnClickListener(this);
    FloatingActionButton fabPlayAll = (FloatingActionButton) activity.findViewById(R.id.sheet_detail_play_all);
    fabPlayAll.setOnClickListener(this);

    songList.post(new Runnable() {
        @Override
        public void run() {
            calculateRecycleViewHeight();
        }
    });
}