本文整理匯總了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());
}
});
}