Search in sources :

Example 96 with OnCheckedChangeListener

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());
}
Also used : OnCheckedChangeListener(android.widget.CompoundButton.OnCheckedChangeListener) IgnitedHttp(com.github.ignition.support.http.IgnitedHttp) CompoundButton(android.widget.CompoundButton)

Example 97 with OnCheckedChangeListener

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());
            }
        });
    }
}
Also used : OnCheckedChangeListener(android.widget.CompoundButton.OnCheckedChangeListener) LayoutParams(android.widget.LinearLayout.LayoutParams) OnClickListener(android.view.View.OnClickListener) View(android.view.View) SoftKeyboardStateHelper(org.kymjs.emoji.helper.SoftKeyboardStateHelper) CompoundButton(android.widget.CompoundButton) EmojiPagerAdapter(org.kymjs.emoji.adapter.EmojiPagerAdapter)

Example 98 with OnCheckedChangeListener

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);
        }
    });
}
Also used : OnCheckedChangeListener(android.widget.CompoundButton.OnCheckedChangeListener) CompoundButton(android.widget.CompoundButton)

Example 99 with OnCheckedChangeListener

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);
}
Also used : EditText(android.widget.EditText) StringMapParcelableWrapper(com.trovebox.android.common.util.data.StringMapParcelableWrapper) OnCheckedChangeListener(android.widget.CompoundButton.OnCheckedChangeListener) Button(android.widget.Button) CompoundButton(android.widget.CompoundButton) OnClickListener(android.view.View.OnClickListener) RunnableWithParameter(com.trovebox.android.common.util.RunnableWithParameter) View(android.view.View) CompoundButton(android.widget.CompoundButton)

Example 100 with OnCheckedChangeListener

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);
}
Also used : PendingItem(eu.siacs.conversations.ui.util.PendingItem) Arrays(java.util.Arrays) OnCaptchaRequested(eu.siacs.conversations.services.XmppConnectionService.OnCaptchaRequested) Bundle(android.os.Bundle) KeyChain(android.security.KeyChain) SoftKeyboardUtils(eu.siacs.conversations.ui.util.SoftKeyboardUtils) NonNull(androidx.annotation.NonNull) Uri(android.net.Uri) ImageView(android.widget.ImageView) OnCheckedChangeListener(android.widget.CompoundButton.OnCheckedChangeListener) PendingIntent(android.app.PendingIntent) ActionBar(androidx.appcompat.app.ActionBar) MenuDoubleTabUtil(eu.siacs.conversations.ui.util.MenuDoubleTabUtil) CheckBox(android.widget.CheckBox) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Handler(android.os.Handler) SignupUtils(eu.siacs.conversations.utils.SignupUtils) View(android.view.View) PreferenceManager(android.preference.PreferenceManager) Resolver(eu.siacs.conversations.utils.Resolver) Log(android.util.Log) AvatarWorkerTask(eu.siacs.conversations.ui.util.AvatarWorkerTask) DataBindingUtil(androidx.databinding.DataBindingUtil) XmppConnection(eu.siacs.conversations.xmpp.XmppConnection) KeyChainAliasCallback(android.security.KeyChainAliasCallback) Set(java.util.Set) XmppAxolotlSession(eu.siacs.conversations.crypto.axolotl.XmppAxolotlSession) List(java.util.List) TextView(android.widget.TextView) ActivityNotFoundException(android.content.ActivityNotFoundException) OnUpdateBlocklist(eu.siacs.conversations.xmpp.OnUpdateBlocklist) HttpUrl(okhttp3.HttpUrl) TextWatcher(android.text.TextWatcher) Config(eu.siacs.conversations.Config) AlertDialog(androidx.appcompat.app.AlertDialog) PresenceTemplateAdapter(eu.siacs.conversations.ui.adapter.PresenceTemplateAdapter) Builder(androidx.appcompat.app.AlertDialog.Builder) TextInputLayout(com.google.android.material.textfield.TextInputLayout) DialogPresenceBinding(eu.siacs.conversations.databinding.DialogPresenceBinding) OnKeyStatusUpdated(eu.siacs.conversations.xmpp.OnKeyStatusUpdated) PresenceTemplate(eu.siacs.conversations.entities.PresenceTemplate) Features(eu.siacs.conversations.xmpp.XmppConnection.Features) Intent(android.content.Intent) Account(eu.siacs.conversations.entities.Account) Element(eu.siacs.conversations.xml.Element) Editable(android.text.Editable) MenuItem(android.view.MenuItem) ActivityEditAccountBinding(eu.siacs.conversations.databinding.ActivityEditAccountBinding) CryptoHelper(eu.siacs.conversations.utils.CryptoHelper) IntentSender(android.content.IntentSender) Presence(eu.siacs.conversations.entities.Presence) Toast(android.widget.Toast) Menu(android.view.Menu) UIHelper(eu.siacs.conversations.utils.UIHelper) Settings(android.provider.Settings) AxolotlService(eu.siacs.conversations.crypto.axolotl.AxolotlService) Build(android.os.Build) KnownHostsAdapter(eu.siacs.conversations.ui.adapter.KnownHostsAdapter) Avatar(eu.siacs.conversations.xmpp.pep.Avatar) R(eu.siacs.conversations.R) QuickConversationsService(eu.siacs.conversations.services.QuickConversationsService) CharMatcher(com.google.common.base.CharMatcher) TextUtils(android.text.TextUtils) Data(eu.siacs.conversations.xmpp.forms.Data) BarcodeProvider(eu.siacs.conversations.services.BarcodeProvider) XmppConnectionService(eu.siacs.conversations.services.XmppConnectionService) TorServiceUtils(eu.siacs.conversations.utils.TorServiceUtils) SharedPreferences(android.content.SharedPreferences) Bitmap(android.graphics.Bitmap) OnAccountUpdate(eu.siacs.conversations.services.XmppConnectionService.OnAccountUpdate) Activity(android.app.Activity) XmppUri(eu.siacs.conversations.utils.XmppUri) EditText(android.widget.EditText) Jid(eu.siacs.conversations.xmpp.Jid) OnClickListener(android.view.View.OnClickListener) OpenPgpUtils(org.openintents.openpgp.util.OpenPgpUtils) OnCheckedChangeListener(android.widget.CompoundButton.OnCheckedChangeListener)

Aggregations

OnCheckedChangeListener (android.widget.CompoundButton.OnCheckedChangeListener)101 CompoundButton (android.widget.CompoundButton)98 View (android.view.View)78 TextView (android.widget.TextView)66 ImageView (android.widget.ImageView)40 OnClickListener (android.view.View.OnClickListener)31 CheckBox (android.widget.CheckBox)30 DialogInterface (android.content.DialogInterface)27 AdapterView (android.widget.AdapterView)24 AlertDialog (android.app.AlertDialog)23 ListView (android.widget.ListView)20 Button (android.widget.Button)19 LayoutInflater (android.view.LayoutInflater)17 ArrayList (java.util.ArrayList)17 List (java.util.List)15 OnClickListener (android.content.DialogInterface.OnClickListener)12 SuppressLint (android.annotation.SuppressLint)11 Intent (android.content.Intent)11 ViewGroup (android.view.ViewGroup)10 Cursor (android.database.Cursor)9