Search in sources :

Example 1 with DatePickerBuilder

use of com.codetroopers.betterpickers.datepicker.DatePickerBuilder in project android-betterpickers by code-troopers.

the class SampleDateThemeCustom method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.text_and_button);
    mResultTextView = (TextView) findViewById(R.id.text);
    Button button = (Button) findViewById(R.id.button);
    mResultTextView.setText(R.string.no_value);
    button.setText(R.string.date_picker_set);
    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            DatePickerBuilder dpb = new DatePickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.MyCustomBetterPickerTheme);
            dpb.show();
        }
    });
}
Also used : Button(android.widget.Button) DatePickerBuilder(com.codetroopers.betterpickers.datepicker.DatePickerBuilder) TextView(android.widget.TextView) View(android.view.View)

Example 2 with DatePickerBuilder

use of com.codetroopers.betterpickers.datepicker.DatePickerBuilder in project android-betterpickers by code-troopers.

the class SampleDateThemeLight method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.text_and_button);
    mResultTextView = (TextView) findViewById(R.id.text);
    Button button = (Button) findViewById(R.id.button);
    mResultTextView.setText(R.string.no_value);
    button.setText(R.string.date_picker_set);
    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            DatePickerBuilder dpb = new DatePickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment_Light);
            dpb.show();
        }
    });
}
Also used : Button(android.widget.Button) DatePickerBuilder(com.codetroopers.betterpickers.datepicker.DatePickerBuilder) TextView(android.widget.TextView) View(android.view.View)

Example 3 with DatePickerBuilder

use of com.codetroopers.betterpickers.datepicker.DatePickerBuilder in project android-betterpickers by code-troopers.

the class SampleDateYearOptional method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.text_and_button);
    mResultTextView = (TextView) findViewById(R.id.text);
    Button button = (Button) findViewById(R.id.button);
    mResultTextView.setText(R.string.no_value);
    button.setText(R.string.date_picker_set);
    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            DatePickerBuilder dpb = new DatePickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment).setYearOptional(true);
            dpb.show();
        }
    });
}
Also used : Button(android.widget.Button) DatePickerBuilder(com.codetroopers.betterpickers.datepicker.DatePickerBuilder) TextView(android.widget.TextView) View(android.view.View)

Example 4 with DatePickerBuilder

use of com.codetroopers.betterpickers.datepicker.DatePickerBuilder in project android-betterpickers by code-troopers.

the class SampleDateDismissListener method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.text_and_button);
    mResultTextView = (TextView) findViewById(R.id.text);
    Button button = (Button) findViewById(R.id.button);
    mResultTextView.setText(R.string.no_value);
    button.setText(R.string.date_picker_set);
    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            DatePickerBuilder dpb = new DatePickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment).setOnDismissListener(SampleDateDismissListener.this);
            dpb.show();
        }
    });
}
Also used : Button(android.widget.Button) DatePickerBuilder(com.codetroopers.betterpickers.datepicker.DatePickerBuilder) TextView(android.widget.TextView) View(android.view.View)

Example 5 with DatePickerBuilder

use of com.codetroopers.betterpickers.datepicker.DatePickerBuilder in project android-betterpickers by code-troopers.

the class SampleDateBasicUsage method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.text_and_button);
    mResultTextView = (TextView) findViewById(R.id.text);
    Button button = (Button) findViewById(R.id.button);
    mResultTextView.setText(R.string.no_value);
    button.setText(R.string.date_picker_set);
    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            DatePickerBuilder dpb = new DatePickerBuilder().setFragmentManager(getSupportFragmentManager()).setStyleResId(R.style.BetterPickersDialogFragment);
            dpb.show();
        }
    });
}
Also used : Button(android.widget.Button) DatePickerBuilder(com.codetroopers.betterpickers.datepicker.DatePickerBuilder) TextView(android.widget.TextView) View(android.view.View)

Aggregations

View (android.view.View)9 Button (android.widget.Button)9 TextView (android.widget.TextView)9 DatePickerBuilder (com.codetroopers.betterpickers.datepicker.DatePickerBuilder)9