本文整理汇总了Java中android.widget.CompoundButton.OnCheckedChangeListener类的典型用法代码示例。如果您正苦于以下问题:Java OnCheckedChangeListener类的具体用法?Java OnCheckedChangeListener怎么用?Java OnCheckedChangeListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OnCheckedChangeListener类属于android.widget.CompoundButton包,在下文中一共展示了OnCheckedChangeListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: _initialize
import android.widget.CompoundButton.OnCheckedChangeListener; //导入依赖的package包/类
@Hide
@Override
public void _initialize(final BA ba, Object activityClass, String EventName) {
final Switch _switch = new Switch(ba.context);
final String eventName = EventName.toLowerCase(BA.cul);
setObject(_switch);
innerInitialize(ba, eventName, true);
if (ba.subExists(eventName + "_checkedchange")) {
getObject().setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
ba.raiseEventFromUI(_switch,eventName + "_checkedchange", isChecked);
}
});
}
}
示例2: beautyView
import android.widget.CompoundButton.OnCheckedChangeListener; //导入依赖的package包/类
private void beautyView() {
beautyEditText(this.mInputAccount, L10NString.getString("umgr_please_input_username"), this.mAccountTextWatcher);
beautyCleanButton(this.mClearInputAccount, this);
this.mInputAccountLayout.setOnClickListener(this);
beautyCleanButton(this.mClearInputPassword, this);
this.mInputPassword.setOnClickListener(this);
beautyEditText(this.mInputPassword, L10NString.getString("umgr_please_input_password"), this.mPasswordTextWatcher);
beautyColorTextView(this.mRegister, "#007dc4", false, L10NString.getString("umgr_whether_register_ornot"), this);
beautyColorTextView(this.mFindpwd, "#007dc4", false, L10NString.getString("umgr_whether_forget_password"), this);
beautyColorTextView(this.mSwitchAccount, "#007dc4", false, L10NString.getString("umgr_third_login_qihoo_tip"), this);
beautyButtonGreen(this.mLogin, L10NString.getString("umgr_login"), this);
beautyTextView(this.mAgreeClause1, L10NString.getString("umgr_login_agree_clause_1"));
beautyTextView(this.mAgreeClauseUser, L10NString.getString("umgr_agree_clause_2_user"));
beautyColorTextView(this.mAgreement, "#0099e5", true, L10NString.getString("umgr_agree_clause_2_agreement"), this);
beautyTextView(this.mAnd, L10NString.getString("umgr_agree_clause_2_and"));
beautyColorTextView(this.mPrivacy, "#0099e5", true, L10NString.getString("umgr_agree_clause_2_privacy"), this);
beautyCheckButton(this.mShowPwd, new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
LoginActivity.this.mInputPassword.setTransformationMethod(LoginActivity.this.mShowPwd.isChecked() ? HideReturnsTransformationMethod.getInstance() : PasswordTransformationMethod.getInstance());
}
});
loadPrivateConfig();
}
示例3: onCreate
import android.widget.CompoundButton.OnCheckedChangeListener; //导入依赖的package包/类
@SuppressLint("NewApi")
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_demo);
setting = new Settings(this);
s = (Switch) findViewById(R.id.switch1);
s.setChecked(setting.isStarted());
s.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// TODO 自动生成的方法存根
setting.setStarted(isChecked);
}
});
}
示例4: doOnViewCreated
import android.widget.CompoundButton.OnCheckedChangeListener; //导入依赖的package包/类
@Override
public void doOnViewCreated(View v, @Nullable Bundle savedInstanceState) {
toggleButtonButton = (OneSheeldToggleButton) v
.findViewById(R.id.toggle_button_shield_button_toggle_button);
if (getApplication().getRunningShields().get(
getControllerTag()) == null) {
getApplication().getRunningShields().put(getControllerTag(),
new ToggleButtonShield(activity, getControllerTag()));
}
toggleButtonButton
.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
// TODO Auto-generated method stub
((ToggleButtonShield) getApplication()
.getRunningShields().get(getControllerTag()))
.setButton(isChecked);
}
});
if (getApplication().getRunningShields().get(
getControllerTag()) != null)
toggleButtonButton.setEnabled(true);
}
示例5: addListener
import android.widget.CompoundButton.OnCheckedChangeListener; //导入依赖的package包/类
private void addListener() {
this.toggle_bingo.setOnCheckedChangeListener(new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
AddCameraRecordActivity.this.mInputCalory = AddCameraRecordActivity.this
.et_calory.getText().toString();
AddCameraRecordActivity.this.et_calory.getText().clear();
AddCameraRecordActivity.this.et_calory.setHint("请等待顾问为你估算");
AddCameraRecordActivity.this.et_calory.setEnabled(false);
return;
}
if (!TextUtils.isEmpty(AddCameraRecordActivity.this.mInputCalory)) {
AddCameraRecordActivity.this.et_calory.setText(AddCameraRecordActivity.this
.mInputCalory);
Selection.setSelection(AddCameraRecordActivity.this.et_calory.getText(),
AddCameraRecordActivity.this.et_calory.getText().length());
}
AddCameraRecordActivity.this.et_calory.setHint("所含的热量(可不填)");
AddCameraRecordActivity.this.et_calory.setEnabled(true);
}
});
}
示例6: initViews
import android.widget.CompoundButton.OnCheckedChangeListener; //导入依赖的package包/类
private void initViews() {
this.recyclerView.setLayoutManager(new LinearLayoutManager(this));
List<DownloadRecord> recordList = DownloadHelper.getInstance().getRecordsList();
this.mAdapter = new DownloadAdapter(this, recordList);
this.recyclerView.setAdapter(this.mAdapter);
if (recordList.size() == 0) {
showEmpty();
return;
}
this.tvDelete.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
DownloadManageActivity.this.showDeleteDialog();
}
});
this.cbSelectAll.setOnCheckedChangeListener(new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
DownloadManageActivity.this.mAdapter.selectAll();
} else if (!DownloadAdapter.CANCEL_SELECT_ALL.equals(buttonView.getTag())) {
DownloadManageActivity.this.mAdapter.selectNone();
}
buttonView.setTag(null);
}
});
}
示例7: onCreate
import android.widget.CompoundButton.OnCheckedChangeListener; //导入依赖的package包/类
@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);
}
}
});
}
示例8: bindSwitchToEqualizer
import android.widget.CompoundButton.OnCheckedChangeListener; //导入依赖的package包/类
private void bindSwitchToEqualizer() {
if (!mSwitchBound && mSwitchButton != null) {
mSwitchButton.setChecked(AudioEffects.areAudioEffectsEnabled());
mSwitchButton
.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
AudioEffects.setAudioEffectsEnabled(isChecked);
}
});
mSwitchBound = true;
}
}
示例9: onCreate
import android.widget.CompoundButton.OnCheckedChangeListener; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_new_group);
groupNameEditText = (EditText) findViewById(R.id.edit_group_name);
introductionEditText = (EditText) findViewById(R.id.edit_group_introduction);
checkBox = (CheckBox) findViewById(R.id.cb_public);
memberCheckbox = (CheckBox) findViewById(R.id.cb_member_inviter);
openInviteContainer = (LinearLayout) findViewById(R.id.ll_open_invite);
checkBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if(isChecked){
openInviteContainer.setVisibility(View.INVISIBLE);
}else{
openInviteContainer.setVisibility(View.VISIBLE);
}
}
});
}
示例10: initEvent
import android.widget.CompoundButton.OnCheckedChangeListener; //导入依赖的package包/类
private void initEvent() {
btnNext.setOnClickListener(this);
tvSelect.setOnClickListener(this);
btnNext.setClickable(false);
btnNext.setBackgroundResource(R.drawable.btn_next_shape_gray);
cbSelect.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
btnNext.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());
btnNext.setClickable(true);
} else {
btnNext.setBackgroundResource(R.drawable.btn_next_shape_gray);
btnNext.setClickable(false);
}
}
});
}
示例11: ininEvent
import android.widget.CompoundButton.OnCheckedChangeListener; //导入依赖的package包/类
private void ininEvent() {
btnNext.setOnClickListener(this);
imgWiFiList.setOnClickListener(this);
llChooseMode.setOnClickListener(this);
cbLaws.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
String psw = etPsw.getText().toString();
if (isChecked) {
etPsw.setInputType(0x90);
} else {
etPsw.setInputType(0x81);
}
etPsw.setSelection(psw.length());
}
});
}
开发者ID:gizwits,项目名称:GOpenSource_AppKit_Android_AS,代码行数:20,代码来源:GosAirlinkChooseDeviceWorkWiFiActivity.java
示例12: ininEvent
import android.widget.CompoundButton.OnCheckedChangeListener; //导入依赖的package包/类
private void ininEvent() {
btnNext.setOnClickListener(this);
imgWiFiList.setOnClickListener(this);
cbLaws.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
String psw = etPsw.getText().toString();
if (isChecked) {
etPsw.setInputType(0x90);
} else {
etPsw.setInputType(0x81);
}
etPsw.setSelection(psw.length());
}
});
cbLaws.setChecked(true);
}
示例13: ininEvent
import android.widget.CompoundButton.OnCheckedChangeListener; //导入依赖的package包/类
private void ininEvent() {
llNext.setOnClickListener(this);
imgWiFiList.setOnClickListener(this);
cbLaws.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
String psw = etPsw.getText().toString();
if (isChecked) {
etPsw.setInputType(0x90);
} else {
etPsw.setInputType(0x81);
}
etPsw.setSelection(psw.length());
}
});
}
示例14: initEvent
import android.widget.CompoundButton.OnCheckedChangeListener; //导入依赖的package包/类
private void initEvent() {
tvNoRedLight.setOnClickListener(this);
tvSelect.setOnClickListener(this);
btnNext.setOnClickListener(this);
btnNext.setClickable(false);
btnNext.setBackgroundResource(R.drawable.btn_next_shape_gray);
cbSelect.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
btnNext.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());;
btnNext.setClickable(true);
} else {
btnNext.setBackgroundResource(R.drawable.btn_next_shape_gray);
btnNext.setClickable(false);
}
}
});
}
示例15: initEvent
import android.widget.CompoundButton.OnCheckedChangeListener; //导入依赖的package包/类
private void initEvent() {
btnLogin.setOnClickListener(this);
tvRegister.setOnClickListener(this);
tvForget.setOnClickListener(this);
tvPass.setOnClickListener(this);
llQQ.setOnClickListener(this);
llWechat.setOnClickListener(this);
cbLaws.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
String psw = etPsw.getText().toString();
if (isChecked) {
etPsw.setInputType(0x90);
} else {
etPsw.setInputType(0x81);
}
etPsw.setSelection(psw.length());
}
});
}