TextView setEnabled - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for TextView setEnabled method.

This code example shows how to use the following methods:setChecked, setEnabled
    } 
 
    @Override 
    public void onCheckedChanged(CompoundButton buttonView, boolean desiredState) {
        boolean success = false;
        mActionBarSwitch.setEnabled(false);
        if (desiredState) {
            success = mNfcAdapter.enableNdefPush();
        } else { 
            success = mNfcAdapter.disableNdefPush();
        } 
        if (success) {
            mActionBarSwitch.setChecked(desiredState);
        } 
        mActionBarSwitch.setEnabled(true);
    } 
} 
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setVisibility, setEnabled
    private void updateVolumeNoticeVisibility(int value) {
        boolean visible = value > mMinVolumeSeekBar.getSecondaryProgress();
        if (!mEnabledCheckbox.isChecked()) {
            visible = false;
        } 
        mRingVolumeNotice.setVisibility(visible ? View.VISIBLE : View.GONE);
    } 
 
    private void updateEnabledStates() { 
        boolean enable = mEnabledCheckbox.isChecked();
        mMinVolumeTitle.setEnabled(enable);
        mMinVolumeSeekBar.setEnabled(enable);
        mRingVolumeNotice.setEnabled(enable);
        mIntervalTitle.setEnabled(enable);
        mInterval.setEnabled(enable);
    } 
 
    @Override 
    protected Parcelable onSaveInstanceState() {
        final Parcelable superState = super.onSaveInstanceState();
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:isChecked, setOnCheckedChangeListener, setChecked, setEnabled
            case BluetoothAdapter.STATE_TURNING_OFF:
                mSwitch.setEnabled(false);
                break; 
            case BluetoothAdapter.STATE_OFF:
                setChecked(false); 
                mSwitch.setEnabled(true);
                break; 
            default: 
                setChecked(false); 
                mSwitch.setEnabled(true);
        } 
    } 
 
    private void setChecked(boolean isChecked) {
        if (isChecked != mSwitch.isChecked()) {
            // set listener to null, so onCheckedChanged won't be called 
            // if the checked status on Switch isn't changed by user click 
            if (mValidListener) {
                mSwitch.setOnCheckedChangeListener(null);
            } 

8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setEnabled
        mValidateButton.setOnClickListener(mClickListener);
    } 
 
    View.OnClickListener mClickListener = new View.OnClickListener() {
        public void onClick(View v) { 
            mValidateButton.setEnabled(false); 
            mValidateThread = new Validator(); 
            mValidateThread.execute(LargeAssetTest.this.getAssets()); 
        } 
    }; 
 
    /** 
     * Validation happens in a separate thread 
     */ 
    class Validator extends AsyncTask<AssetManager, Integer, Boolean> {
        static final String TAG = "Validator";
 
        @Override 
        protected Boolean doInBackground(AssetManager... params) {
            AssetManager am = params[0];
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setEnabled
    public void onBackPressed() { 
    } 
 
    @Override 
    public void onCheckedChanged(CompoundButton button, boolean checked) {
        mButton.setEnabled(checked);
    } 
 
    @Override 
    public void onClick(DialogInterface dialog, int which) {
        try { 
            if (which == DialogInterface.BUTTON_POSITIVE && mService.prepareVpn(null, mPackage)) {
                setResult(RESULT_OK); 
            } 
        } catch (Exception e) {
            Log.e(TAG, "onClick", e);
        } 
    } 
} 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setEnabled
  protected void onActivityResult(int requestCode, int resultCode,
                                    Intent data) {
    if (requestCode==PICK_REQUEST) {
      if (resultCode==RESULT_OK) {
        contact=data.getData();
        viewButton.setEnabled(true);
      } 
    } 
  } 
 
  public void pickContact(View v) {
    Intent i=new Intent(Intent.ACTION_PICK,
                        Contacts.CONTENT_URI);
   
    startActivityForResult(i, PICK_REQUEST);
  } 
   
  public void viewContact(View v) {
    startActivity(new Intent(Intent.ACTION_VIEW, contact));
  } 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setOnClickListener, setEnabled
 
	public void setPositiveClickListener(OnClickListener positiveClickListener) {
		if (positiveClickListener == null) {
			btnPositive.setEnabled(false);
		} else { 
		    btnPositive.setEnabled(true);
		} 
		btnPositive.setOnClickListener(positiveClickListener);
	} 
 
	public void setPositiveBtnText(int resId) {
		btnPositive.setText(resId);
	} 
 
	public void setNegativeClickListener(OnClickListener negativeClickListener) {
		btnNegative.setOnClickListener(negativeClickListener);
	} 
	 
	public void setDialogTitle(int resId) {
		tvDialogTitle.setText(resId);
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setFocusable, setEnabled
        } 
    } 
 
    private void updateSendButton() { 
        if (null != mSendButton) {
            mSendButton.setEnabled(mCanSend);
            mSendButton.setFocusable(mCanSend);
        } 
    } 
 
    public void hideView() { 
        if (mView != null) {
            ((View)mView).setVisibility(View.GONE);
        } 
    } 
 
    private View getStubView(int stubId, int viewId) {
        View view = findViewById(viewId);
        if (view == null) {
            ViewStub stub = (ViewStub) findViewById(stubId);
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setChecked, setEnabled
    } 
 
    @Override 
    public void onCheckedChanged(CompoundButton buttonView, boolean desiredState) {
        boolean success = false;
        mActionBarSwitch.setEnabled(false);
        if (desiredState) {
            success = mNfcAdapter.enableNdefPush();
        } else { 
            success = mNfcAdapter.disableNdefPush();
        } 
        if (success) {
            mActionBarSwitch.setChecked(desiredState);
        } 
        mActionBarSwitch.setEnabled(true);
    } 
} 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:isChecked, setOnCheckedChangeListener, setChecked, setEnabled
 
        // Bluetooth state is not sticky, so set it manually 
        handleStateChanged(mLocalAdapter.getBluetoothState());
 
        mContext.registerReceiver(mReceiver, mIntentFilter);
        mSwitch.setOnCheckedChangeListener(this);
        mValidListener = true;
    } 
 
    public void pause() { 
        if (mLocalAdapter == null) {
            return; 
        } 
 
        mContext.unregisterReceiver(mReceiver);
        mSwitch.setOnCheckedChangeListener(null);
        mValidListener = false;
    } 
 
    public void setSwitch(Switch switch_) {

8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related TextView setEnabled Questions & Answers:

Other TextView setEnabled Examples

61:					Log.e("TTS", "This Language is not supported");
62:				} else {
63:					btnSpeak.setEnabled(true);
64:					speakOut();
65:				}

Read More

setEnabled Method Overview
Set the enabled state of this view.
See Code Examples for other Android TextView Methods: