DatePicker 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 DatePicker setEnabled method.

This code example shows how to use the following methods:setEnabled
 
		initialization(); 
	} 
	 
	private void setFieldsEnabled(boolean v) {
		_datePicker.setEnabled(v);
		_timePicker.setEnabled(v);
		_okButton.setEnabled(v);
		_cancelButton.setEnabled(v);
	} 
	 
	private void sendResult(String callback, Calendar result, byte[] opaque) {
		this.setFieldsEnabled(false);
		long res = result == null ? 0 : result.getTimeInMillis()/((long)1000);
		Logger.D(TAG, "Return result: " + res);
		DateTimePicker.callback(callback, res, opaque, result == null);
		finish(); 
	} 
	 
	@Override 
6
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, init, setEnabled
    /** 
     * Resets date to today. 
     */ 
    public void clearAnswer() { 
        final Calendar c = new GregorianCalendar();
        mDatePicker.init(c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH),
                mDateListener);
    } 
 
 
    public IAnswerData getAnswer() { 
        // clear focus first so the datewidget gets the value in the text box 
        mDatePicker.clearFocus();
        Date d =
                new Date(mDatePicker.getYear() - YEARSHIFT, mDatePicker.getMonth(), mDatePicker
                        .getDayOfMonth());
        return new DateData(d);
    } 
 
 

5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:init, setEnabled
		 
		if (data != null) 
		{ 
			if (!data.isUndefined()) 
			{ 
				datepicker.init(data.getYear(), data.getMonth() - 1, data.getDayOfMonth(), null);
				timepicker.setCurrentHour(data.getHour());
				timepicker.setCurrentMinute(data.getMinute());
			} 
		} 
		isForeverCheckBox.setChecked(checked);
		if (isForeverCheckBox.isChecked())
		{ 
			setEnabledComponents(false); 
		} 
		 
	} 
	 
 
	@Override 

5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:init, setEnabled
		initDateControls(); 
	} 
 
	private void disableControls() 
	{ 
		datePicker.setEnabled(false);
		timePicker.setEnabled(false);
		btnSetNow.setEnabled(false);
	} 
 
	private void initDateControls() 
	{ 
		datePicker.init(currentState.getInputDate().getYear(), currentState.getInputDate().getMonth(), currentState.getInputDate().getDay(), new DatePickerChangeListener());
		timePicker.setCurrentHour(currentState.getInputDate().getHour());
		timePicker.setCurrentMinute(currentState.getInputDate().getMinute());
		timePicker.setOnTimeChangedListener(new TimeChangedListener());
	} 
 
	void refreshDateControls() 
	{ 
5
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
		setResult(RESULT_CANCELED);
	} 
 
	@Override 
	public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
		expiry.setEnabled(isChecked);
	} 
 
	@Override 
	public void onClick(View v) {
		if (v == btnSave) {
			Intent i = getIntent();
			i.putExtra(Mosaic.EXTRA_TITLE, ((TextView) findViewById(R.id.title)).getText().toString());
			i.putExtra(Mosaic.EXTRA_BODY, ((TextView) findViewById(R.id.body)).getText().toString());
			i.putExtra(Mosaic.EXTRA_RADIUS, ((SeekBar) findViewById(R.id.radius)).getProgress());
			if (expires.isChecked()) {
				Calendar c = Calendar.getInstance();
				c.set(Calendar.DAY_OF_MONTH, expiry.getDayOfMonth());
				c.set(Calendar.MONTH, expiry.getMonth());
				c.set(Calendar.YEAR, expiry.getYear());
4
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
		deadlineTimeBtn.setOnClickListener(new View.OnClickListener() 
		{ 
			@Override 
			public void onClick(View v) 
			{ 
				deadlineDate.setEnabled(false);
				deadlineTime.setEnabled(true);
				deadlineDate.setVisibility(4);
				deadlineTime.setVisibility(0);
			} 
		}); 
		 
		//Dialog for setting the task deadline 
		final AlertDialog.Builder dead = new AlertDialog.Builder(this);
		dead.setView(getDeadlineInfoLayout);
		dead.setTitle("Set Deadline");
		dead.setPositiveButton("Set", new DialogInterface.OnClickListener() 
		{ 
			@Override 
			public void onClick(DialogInterface dialog, int which) 
4
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
    	} 
    } 
 
    @Override 
    public void setEnabled(boolean isEnabled) {
    	mDatePicker.setEnabled(isEnabled && !prompt.isReadOnly());
    } 
} 
4
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
		/* look if birthday should be added or not */ 
		dp.setEnabled(checkBox.isChecked());
		checkBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
			@Override 
			public void onCheckedChanged(CompoundButton button, boolean checked) {
				dp.setEnabled(checked);
			} 
		}); 
 
		AlertDialog.Builder builder = new AlertDialog.Builder(this);
		builder.setCancelable(false)
				.setView(layout)
				.setPositiveButton(getString(android.R.string.ok),
						new DialogInterface.OnClickListener() {
							public void onClick(DialogInterface dialog, int id) {
							} 
						}) 
				.setNegativeButton(getString(android.R.string.cancel),
						new DialogInterface.OnClickListener() {
							public void onClick(DialogInterface dialog, int id) {
4
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
    	if (!edit) {
    		 firstname.setEnabled(true);
             middlename.setEnabled(true);
             lastname.setEnabled(true);
             gender.setEnabled(true);
             dp.setEnabled(true);
             edit=true;
		} else { 
 
		} 
    	 
    } 
 
private class fetchdata extends AsyncTask<String , Integer, String>{
 
	protected String doInBackground(String... params) {
		// TODO Auto-generated method stub 
		 
		String res = "";
		String id=params[0];
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related DatePicker setEnabled Questions & Answers:

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