use of android.widget.CompoundButton.OnCheckedChangeListener in project ignition by mttkay.
the class IgnitedHttpSampleActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ignited_http_sample);
statusText = (TextView) findViewById(R.id.ignitedhttp_status);
useCache = (CheckBox) findViewById(R.id.ignitedhttp_chk_use_cache);
useCache.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
enableCache(isChecked);
updateCacheStatus();
}
});
http = new IgnitedHttp(this);
enableCache(useCache.isChecked());
}
use of android.widget.CompoundButton.OnCheckedChangeListener in project KJFrameForAndroid by kymjs.
the class KJEmojiFragment method initWidget.
private void initWidget(View rootView) {
// title
mEmojiTitle = rootView.findViewById(R.id.emoji_title);
mEt = (EditText) mEmojiTitle.findViewById(R.id.emoji_titile_input);
mCBox = (CheckBox) mEmojiTitle.findViewById(R.id.emoji_title_menu);
mCBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
showEmojiKeyBoard();
hideSoftKeyboard();
} else {
hideEmojiKeyBoard();
showSoftKeyboard();
}
}
});
// bottom
mEmojiBottom = (RadioGroup) rootView.findViewById(R.id.emoji_bottom);
// 减一是因为有一个删除按钮
EMOJI_TAB_CONTENT = mEmojiBottom.getChildCount() - 1;
mEmojiTabs = new View[EMOJI_TAB_CONTENT];
if (EMOJI_TAB_CONTENT <= 1) {
// 只有一个分类的时候就不显示了
mEmojiBottom.setVisibility(View.GONE);
}
for (int i = 0; i < EMOJI_TAB_CONTENT; i++) {
mEmojiTabs[i] = mEmojiBottom.getChildAt(i);
mEmojiTabs[i].setOnClickListener(getBottomBarClickListener(i));
}
mEmojiBottom.findViewById(R.id.emoji_bottom_del).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
InputHelper.backspace(mEt);
}
});
// content必须放在bottom下面初始化
mEmojiContent = (LinearLayout) rootView.findViewById(R.id.emoji_content);
LayoutParams params = (LayoutParams) mEmojiContent.getLayoutParams();
params.height = EMOJI_TAB_CONTENT > 1 ? KJEmojiConfig.MORE_TYPE_HEIGHT : KJEmojiConfig.SINGLE_TYPE_HEIGHT;
mEmojiContent.setLayoutParams(params);
mEmojiPager = (ViewPager) mEmojiContent.findViewById(R.id.emoji_pager);
adapter = new EmojiPagerAdapter(getFragmentManager());
mEmojiPager.setAdapter(adapter);
mKeyboardHelper = new SoftKeyboardStateHelper(getActivity().getWindow().getDecorView());
mKeyboardHelper.addSoftKeyboardStateListener(this);
if (getActivity() instanceof OnSendClickListener) {
listener = (OnSendClickListener) getActivity();
mEmojiTitle.findViewById(R.id.emoji_title_send).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
listener.onClickSendButton(mEt.getText());
}
});
}
}
use of android.widget.CompoundButton.OnCheckedChangeListener in project KJFrameForAndroid by kymjs.
the class MineFragment method initWidget.
@Override
protected void initWidget(View parentView) {
super.initWidget(parentView);
mRlExit.setVisibility(View.GONE);
mTvVersion.setText("当前版本" + SystemTool.getAppVersionName(outsideAty));
mCbox.setChecked(PreferenceHelper.readBoolean(outsideAty, AppConfig.PUSH_SWITCH_FILE, AppConfig.PUSH_SWITCH_KEY));
mCbox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
PreferenceHelper.write(outsideAty, AppConfig.PUSH_SWITCH_FILE, AppConfig.PUSH_SWITCH_KEY, isChecked);
}
});
}
use of android.widget.CompoundButton.OnCheckedChangeListener in project mobile-android by photo.
the class SyncUploadFragment method init.
public void init(View v, Bundle savedInstanceState) {
final Button uploadBtn = (Button) v.findViewById(R.id.uploadBtn);
uploadBtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
TrackerUtils.trackButtonClickEvent("uploadBtn", SyncUploadFragment.this);
if (!UploadUiFragment.checkAlbumRequiredAndSpecified(albumsWrapper)) {
return;
}
v.setEnabled(false);
uploadSelectedFiles(true, true);
}
});
uploadBtn.setEnabled(false);
editTitle = (EditText) v.findViewById(R.id.edit_title);
editTags = (EditText) v.findViewById(R.id.edit_tags);
albumsText = ((EditText) v.findViewById(R.id.edit_albums));
albumsText.setVisibility(Preferences.isLimitedAccountAccessType() ? View.GONE : View.VISIBLE);
privateSwitch = (Switch) v.findViewById(R.id.private_switch);
twitterSwitch = (Switch) v.findViewById(R.id.twitter_switch);
facebookSwitch = (Switch) v.findViewById(R.id.facebook_switch);
albumsText.setOnClickListener(this);
if (Preferences.isLimitedAccountAccessType()) {
privateSwitch.setChecked(true);
privateSwitch.setEnabled(false);
}
privateSwitch.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
reinitShareSwitches(!isChecked);
}
});
reinitShareSwitches();
AccountLimitUtils2.tryToRefreshLimitInformationAndRunInContextAsync(new Runnable() {
@Override
public void run() {
if (!isAdded()) {
return;
}
UploadUiFragment.checkCanUpload(albumsText, uploadBtn, new RunnableWithParameter<StringMapParcelableWrapper>() {
@Override
public void run(StringMapParcelableWrapper parameter) {
SyncUploadFragment.this.albumsWrapper = parameter;
}
});
}
}, new Runnable() {
@Override
public void run() {
CommonUtils.debug(TAG, "Limit information refresh failed");
}
}, loadingControl);
}
use of android.widget.CompoundButton.OnCheckedChangeListener in project Conversations by siacs.
the class EditAccountActivity method onCreate.
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState != null) {
this.mSavedInstanceAccount = savedInstanceState.getString("account");
this.mSavedInstanceInit = savedInstanceState.getBoolean("initMode", false);
}
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_edit_account);
setSupportActionBar(binding.toolbar);
binding.accountJid.addTextChangedListener(this.mTextWatcher);
binding.accountJid.setOnFocusChangeListener(this.mEditTextFocusListener);
this.binding.accountPassword.addTextChangedListener(this.mTextWatcher);
this.binding.avater.setOnClickListener(this.mAvatarClickListener);
this.binding.hostname.addTextChangedListener(mTextWatcher);
this.binding.hostname.setOnFocusChangeListener(mEditTextFocusListener);
this.binding.clearDevices.setOnClickListener(v -> showWipePepDialog());
this.binding.port.setText(String.valueOf(Resolver.DEFAULT_PORT_XMPP));
this.binding.port.addTextChangedListener(mTextWatcher);
this.binding.saveButton.setOnClickListener(this.mSaveButtonClickListener);
this.binding.cancelButton.setOnClickListener(this.mCancelButtonClickListener);
if (savedInstanceState != null && savedInstanceState.getBoolean("showMoreTable")) {
changeMoreTableVisibility(true);
}
final OnCheckedChangeListener OnCheckedShowConfirmPassword = (buttonView, isChecked) -> updateSaveButton();
this.binding.accountRegisterNew.setOnCheckedChangeListener(OnCheckedShowConfirmPassword);
if (Config.DISALLOW_REGISTRATION_IN_UI) {
this.binding.accountRegisterNew.setVisibility(View.GONE);
}
this.binding.actionEditYourName.setOnClickListener(this::onEditYourNameClicked);
}
Aggregations