Search in sources :

Example 6 with Button

use of android.widget.Button in project android-betterpickers by code-troopers.

the class SampleDateMultipleReferences method onDialogDateSet.

@Override
public void onDialogDateSet(int reference, int year, int monthOfYear, int dayOfMonth) {
    Button buttonToSet;
    switch(reference) {
        case BUTTON_ONE_REFERENCE:
            buttonToSet = buttonOne;
            break;
        case BUTTON_TWO_REFERENCE:
            buttonToSet = buttonTwo;
            break;
        case BUTTON_THREE_REFERENCE:
            buttonToSet = buttonThree;
            break;
        case BUTTON_FOUR_REFERENCE:
            buttonToSet = buttonFour;
            break;
        default:
            buttonToSet = buttonOne;
    }
    buttonToSet.setText(getString(R.string.date_picker_result_value, year, monthOfYear, dayOfMonth));
}
Also used : Button(android.widget.Button)

Example 7 with Button

use of android.widget.Button 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 8 with Button

use of android.widget.Button 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 9 with Button

use of android.widget.Button 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 10 with Button

use of android.widget.Button in project android-betterpickers by code-troopers.

the class SampleExpirationDismissListener 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.expiration_picker_set);
    button.setOnClickListener(new View.OnClickListener() {

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

Aggregations

Button (android.widget.Button)1427 View (android.view.View)872 TextView (android.widget.TextView)585 OnClickListener (android.view.View.OnClickListener)272 Intent (android.content.Intent)189 LinearLayout (android.widget.LinearLayout)186 ImageView (android.widget.ImageView)141 EditText (android.widget.EditText)120 ListView (android.widget.ListView)112 AdapterView (android.widget.AdapterView)74 ViewGroup (android.view.ViewGroup)62 ScrollView (android.widget.ScrollView)51 Test (org.junit.Test)51 CompoundButton (android.widget.CompoundButton)49 FrameLayout (android.widget.FrameLayout)47 Bundle (android.os.Bundle)44 CheckBox (android.widget.CheckBox)43 ImageButton (android.widget.ImageButton)43 LargeTest (android.test.suitebuilder.annotation.LargeTest)41 DialogInterface (android.content.DialogInterface)39