Java 类android.widget.CompoundButton.OnCheckedChangeListener 实例源码
项目:B4A_ViewsEx
文件:SwitchWrapper.java
@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);
}
});
}
}
项目:letv
文件:LoginActivity.java
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();
}
项目:AllHuaji
文件:MainActivity.java
@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);
}
});
}
项目:CustomAndroidOneSheeld
文件:ToggleButtonFragment.java
@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);
}
项目:boohee_v5.6
文件:AddCameraRecordActivity.java
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);
}
});
}
项目:boohee_v5.6
文件:DownloadManageActivity.java
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);
}
});
}
项目: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);
}
}
});
}
项目:Harmony-Music-Player
文件:EqualizerActivity.java
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;
}
}
项目:TAG
文件:NewGroupActivity.java
@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);
}
}
});
}
项目:GOpenSource_AppKit_Android_AS
文件:GosDeviceResetActivity.java
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);
}
}
});
}
项目:GOpenSource_AppKit_Android_AS
文件:GosAirlinkChooseDeviceWorkWiFiActivity.java
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());
}
});
}
项目:GOpenSource_AppKit_Android_AS
文件:GosCheckDeviceWorkWiFiActivity.java
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);
}
项目:GOpenSource_AppKit_Android_AS
文件:GosChooseDeviceWorkWiFiActivity.java
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());
}
});
}
项目:GOpenSource_AppKit_Android_AS
文件:GosAirlinkReadyActivity.java
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);
}
}
});
}
项目:GOpenSource_AppKit_Android_AS
文件:GosDeviceReadyActivity.java
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);
}
}
});
}
项目:GOpenSource_AppKit_Android_AS
文件:GosUserLoginActivity.java
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());
}
});
}
项目:Gourmet
文件:SubscriptionsAdapter.java
@Override
public void onBindViewHolder(final SubscriptionViewHolder holder, int position) {
final Subscription subscription = subscriptions.get(position);
if (!TextUtils.isEmpty(subscription.getRestaurant().getPhoto())) {
Picasso.with(context).load(subscription.getRestaurant().getPhoto()).into(holder.imageView);
}
holder.tvTitle.setText(subscription.getRestaurant().getName());
holder.subscribe.setChecked(subscription.isSubscribed());
holder.subscribe.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
subscription.setSubscribed(isChecked);
}
});
}
项目:GizOpenSource_AppKit_Android
文件:GosDeviceResetActivity.java
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);
}
}
});
}
项目:GizOpenSource_AppKit_Android
文件:GosAirlinkChooseDeviceWorkWiFiActivity.java
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());
}
});
}
项目:GizOpenSource_AppKit_Android
文件:GosCheckDeviceWorkWiFiActivity.java
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);
}
项目:GizOpenSource_AppKit_Android
文件:GosChooseDeviceWorkWiFiActivity.java
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());
}
});
}
项目:GizOpenSource_AppKit_Android
文件:GosAirlinkReadyActivity.java
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);
}
}
});
}
项目:GizOpenSource_AppKit_Android
文件:GosDeviceReadyActivity.java
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);
}
}
});
}
项目:GizOpenSource_AppKit_Android
文件:GosUserLoginActivity.java
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());
}
});
}
项目:EntboostIM
文件:HuaweiResolveErrorActivity.java
private void executeResolveError() {
Intent intent = getIntent();
//获取CheckBox实例
CheckBox cb = (CheckBox)this.findViewById(R.id.checkBox1);
//绑定监听器
cb.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton arg0, boolean checkedState) {
SharedPreferences preferences = getSharedPreferences("first", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
editor.putBoolean(ENABLE_SHOW_HUAWEI_RESOLVE_ERROR_VIEW, !checkedState);
editor.commit();
Log4jLog.d(LONG_TAG, "set enable_show_huawei_resolve_error_view:" + !checkedState);
}
});
int errorCode = intent.getIntExtra(INTENT_ERROR_CODE, -1);
HuaweiApiAvailability availability = HuaweiApiAvailability.getInstance();
if (availability.isUserResolvableError(errorCode)) {
availability.resolveError(this, errorCode, REQUEST_RESOLVE_ERROR, this);
}
}
项目:ChatDemoUI3.0
文件: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);
}
}
});
}
项目:ItHome
文件:LaPinShopCar.java
private void init() {
listView=(ListView) findViewById(R.id.shopcar_listview);
totalPrice=(TextView) findViewById(R.id.shopcar_allprice);
payall=(CheckBox) findViewById(R.id.shopcar_payall);
topay=(TextView) findViewById(R.id.shopcar_zhifu);
topay.setOnClickListener(this);
payall.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if(isChecked){
adapter.initCheckBox(true);
adapter.notifyDataSetChanged();
}
}
});
}
项目:intellij-ce-playground
文件:BooleanEditor.java
public Runnable bindEditor(View v, final EditableItem item, final Runnable afterChange) {
final ViewStub booleanEditorStub = (ViewStub) v.findViewById(R.id.boolean_editor_stub);
booleanEditorStub.setLayoutResource(R.layout.boolean_editor);
final Switch booleanEditor = (Switch) booleanEditorStub.inflate();
Runnable updateSwitch = new Runnable() {
public void run() {
booleanEditor.setChecked(item.hasValue() && item.getValueBool());
}};
booleanEditor.setVisibility(View.VISIBLE);
updateSwitch.run();
booleanEditor.setOnCheckedChangeListener(new OnCheckedChangeListener(){
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
item.setValue(isChecked);
afterChange.run();
}});
return updateSwitch;
}
项目:umeng_community_android
文件:PushSettingFragment.java
@Override
protected void initWidgets() {
int switchButtonResId = ResFinder.getId(
"umeng_common_switch_button");
mSwitchButton = (SwitchButton) mRootView
.findViewById(switchButtonResId);
mSwitchButton.setChecked(mSDKConfig.isPushEnable(getActivity()));
mSwitchButton.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// 保存配置
CommConfig.getConfig().setSDKPushable(getActivity(), isChecked);
}
});
}
项目:AndroidGeek
文件:PushSettingFragment.java
@Override
protected void initWidgets() {
int switchButtonResId = ResFinder.getId(
"umeng_common_switch_button");
mSwitchButton = (SwitchButton) mRootView
.findViewById(switchButtonResId);
mSwitchButton.setChecked(mSDKConfig.isPushEnable(getActivity()));
mSwitchButton.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// 保存配置
CommConfig.getConfig().setSDKPushable(getActivity(), isChecked);
}
});
}
项目:sdkdemoapp3.0_android
文件: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);
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);
}
}
});
}
项目:OSBuild
文件:MainActivity.java
/**
* Dialog: What's OSBuild?
* Show description about OSBuild.
*/
@TargetApi(11)
private void appDescDialog()
{
ViewGroup viewGroup = (ViewGroup) getLayoutInflater().inflate(R.layout.dialog_text_ask, null);
((MyTextView)viewGroup.findViewById(R.id.mtv_desc)).setText(R.string.dia_app_desc);
((CheckBox)viewGroup.findViewById(R.id.cb_not_show))
.setOnCheckedChangeListener(new OnCheckedChangeListener()
{
@Override
public void onCheckedChanged(CompoundButton p1, boolean p2)
{
sharedPreferences.edit()
.putBoolean("not_show_about", p2).commit();
}
});
AlertDialog alertDialog = (C.SDK >= 21 ? (new AlertDialog.Builder(this,
R.style.AlertDialogStyle)) : (new AlertDialog.Builder(this)))
.setTitle(R.string.dia_title_about)
.setView(viewGroup)
.setPositiveButton(R.string.dia_pos_ok, null)
.create();
alertDialog.show();
}
项目:Gizwits-SmartBuld_Android
文件:GosDeviceResetActivity.java
private void initEvent() {
btnNext.setOnClickListener(this);
tvSelect.setOnClickListener(this);
btnNext.setClickable(false);
btnNext.setBackgroundResource(R.drawable.button_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.button_shape_gray);
btnNext.setClickable(false);
}
}
});
}
项目:Gizwits-SmartBuld_Android
文件:GosAirlinkChooseDeviceWorkWiFiActivity.java
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());
}
});
}
项目:Gizwits-SmartBuld_Android
文件:GosCheckDeviceWorkWiFiActivity.java
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);
}
项目:Gizwits-SmartBuld_Android
文件:GosAirlinkReadyActivity.java
private void initEvent() {
btnNext.setOnClickListener(this);
tvSelect.setOnClickListener(this);
btnNext.setClickable(false);
btnNext.setBackgroundResource(R.drawable.button_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.button_shape_gray);
btnNext.setClickable(false);
}
}
});
}
项目:Gizwits-SmartBuld_Android
文件:GosDeviceReadyActivity.java
private void initEvent() {
tvNoRedLight.setOnClickListener(this);
tvSelect.setOnClickListener(this);
btnNext.setOnClickListener(this);
btnNext.setClickable(false);
btnNext.setBackgroundResource(R.drawable.button_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.button_shape_gray);
btnNext.setClickable(false);
}
}
});
}
项目:Gizwits-SmartBuld_Android
文件:GosUserLoginActivity.java
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());
}
});
}
项目:easyLight
文件:EasyLight.java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mTorch = (ToggleButton) findViewById(R.id.toggleLight);
mTorch.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked)
{
try{
if(isChecked){
mService.activateTorch();
}else{
mService.deactivateTorch();
}
}catch (Exception e) {
e.printStackTrace();
}
}
});
Toast.makeText(getApplicationContext(), R.string.hello_msg, Toast.LENGTH_SHORT).show();
}
项目:PdDroidPublisher
文件:MidiConfigDialog.java
private View createOutputWidget(MidiDevice midiDevice, final MidiOutput midiOutput) {
LinearLayout view = new LinearLayout(getContext());
TextView tv = new TextView(getContext());
tv.setText(new MidiPortAdapter(midiDevice, midiOutput).toString());
CheckBox cb = new CheckBox(getContext());
cb.setChecked(midiManager.isOpened(midiOutput));
cb.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
midiManager.open(midiOutput);
} else {
midiManager.close(midiOutput);
}
}
});
view.addView(cb);
view.addView(tv);
return view;
}