实用的Android DialogFragments选择器:android-betterpickers

jopen 10年前

android-betterpickers是一个非常棒的Android选择器类库,用于选择日期,时间、数字等。

用法

For a working implementation of this project see the sample/ folder.

  1. Implement the appropriate Handler callbacks:

    public class MyActivity extends Activity implements DatePickerDialogFragment.DatePickerDialogHandler {      @Override    public void onCreate(Bundle savedInstanceState) {      // ...    }      @Override    public void onDialogDateSet(int year, int monthOfYear, int dayOfMonth) {      // Do something with your date!    }  }  
  2. Use one of the Builder classes to create a PickerDialog with a theme:

    DatePickerBuilder dpb = new DatePickerBuilder()      .setFragmentManager(getSupportFragmentManager())      .setStyleResId(R.style.BetterPickersDialogFragment);  dpb.show();
实用的Android DialogFragments选择器:android-betterpickers

项目主页:http://www.open-open.com/lib/view/home/1413863843872