コード例 #1
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.text_and_button);

    text = (TextView) findViewById(R.id.text);
    button = (Button) findViewById(R.id.button);

    text.setText("--");
    button.setText("Set Time");
    button.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            FragmentManager fm = getSupportFragmentManager();
            DateTime now = DateTime.now();
            RadialTimePickerDialog timePickerDialog =
                RadialTimePickerDialog.newInstance(
                    SampleRadialTimeCustom.this,
                    now.getHourOfDay(),
                    now.getMinuteOfHour(),
                    DateFormat.is24HourFormat(SampleRadialTimeCustom.this));
            timePickerDialog.setThemeCustom(R.style.MyCustomBetterPickersRadialTimePickerDialog);
            timePickerDialog.show(fm, FRAG_TAG_TIME_PICKER);
          }
        });
  }
コード例 #2
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.text_and_button);

    text = (TextView) findViewById(R.id.text);
    button = (Button) findViewById(R.id.button);

    text.setText("--");
    button.setText("Set Date");
    button.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            DatePickerBuilder dpb =
                new DatePickerBuilder()
                    .setFragmentManager(getFragmentManager())
                    .setStyleResId(R.style.MyCustomBetterPickerTheme);
            dpb.show();
          }
        });
  }