本文整理汇总了Java中com.wdullaer.materialdatetimepicker.time.TimePickerDialog.setThemeDark方法的典型用法代码示例。如果您正苦于以下问题:Java TimePickerDialog.setThemeDark方法的具体用法?Java TimePickerDialog.setThemeDark怎么用?Java TimePickerDialog.setThemeDark使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.wdullaer.materialdatetimepicker.time.TimePickerDialog
的用法示例。
在下文中一共展示了TimePickerDialog.setThemeDark方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setTime
import com.wdullaer.materialdatetimepicker.time.TimePickerDialog; //导入方法依赖的package包/类
public void setTime(View v){
Calendar now = Calendar.getInstance();
TimePickerDialog tpd = TimePickerDialog.newInstance(
this,
now.get(Calendar.HOUR_OF_DAY),
now.get(Calendar.MINUTE),
false
);
tpd.setThemeDark(false);
tpd.show(getFragmentManager(), "Timepickerdialog");
}
示例2: onDateSet
import com.wdullaer.materialdatetimepicker.time.TimePickerDialog; //导入方法依赖的package包/类
@Override
public void onDateSet(DatePickerDialog view, int year, int monthOfYear, int dayOfMonth) {
String date = " " + year + "年\n" + (++monthOfYear) + "月" + dayOfMonth+"日";
if (left) {
naiveDateLeft = new NaiveDate(year, monthOfYear, dayOfMonth);
leftDate = date;
} else {
naiveDateRight = new NaiveDate(year, monthOfYear, dayOfMonth);
rightDate = date;
}
Calendar now = Calendar.getInstance();
TimePickerDialog tpd = TimePickerDialog.newInstance(
PublishNeedsActivity.this,
now.get(Calendar.HOUR_OF_DAY),
now.get(Calendar.MINUTE),
true
);
tpd.enableSeconds(false);
tpd.setThemeDark(false);
tpd.vibrate(true);
tpd.dismissOnPause(true);
tpd.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialogInterface) {
Log.d("TimePicker", "Dialog was cancelled");
}
});
tpd.show(getFragmentManager(), "Timepickerdialog");
}
示例3: sleeping
import com.wdullaer.materialdatetimepicker.time.TimePickerDialog; //导入方法依赖的package包/类
public void sleeping(){
if(IS_ALARM_CREATED){
AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.MyAlertDialogStyle);
builder.setTitle(getResources().getString(R.string.autocomplete));
builder.setMessage(getResources().getString(R.string.mess_to_stop_alarm));
builder.setNegativeButton(getResources().getString(R.string.cancel),null);
builder.setPositiveButton(getResources().getString(R.string.close_alarm),new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
alarm.cancel(startAlarmPI);
IS_ALARM_CREATED=false;
createToast(getResources().getString(R.string.mess_alarm_closed));
}
});
builder.setCancelable(false);
builder.show();
}else {
Calendar now = Calendar.getInstance();
TimePickerDialog tpd = TimePickerDialog.newInstance(this, now.get(Calendar.HOUR_OF_DAY), now.get(Calendar.MINUTE), true);
if(settings.getInt(5)==1) {
tpd.setThemeDark(true);
}else{
tpd.setThemeDark(false);
}
tpd.setTitle(getResources().getString(R.string.autocomplete));
tpd.setCancelText(getResources().getString(R.string.cancel));
tpd.setOkText(getResources().getString(R.string.alarm_ok));
tpd.show(getFragmentManager(), "TimePicker");
Log.d("State", "MainActivity: sleeping()");
}
}
示例4: onClick
import com.wdullaer.materialdatetimepicker.time.TimePickerDialog; //导入方法依赖的package包/类
@Override
public void onClick(View view) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(eventTime);
switch (view.getId()) {
case R.id.careportal_newnstreatment_eventdate:
DatePickerDialog dpd = DatePickerDialog.newInstance(
this,
calendar.get(Calendar.YEAR),
calendar.get(Calendar.MONTH),
calendar.get(Calendar.DAY_OF_MONTH)
);
dpd.setThemeDark(true);
dpd.dismissOnPause(true);
dpd.show(context.getFragmentManager(), "Datepickerdialog");
break;
case R.id.careportal_newnstreatment_eventtime:
TimePickerDialog tpd = TimePickerDialog.newInstance(
this,
calendar.get(Calendar.HOUR_OF_DAY),
calendar.get(Calendar.MINUTE),
DateFormat.is24HourFormat(context)
);
tpd.setThemeDark(true);
tpd.dismissOnPause(true);
tpd.show(context.getFragmentManager(), "Timepickerdialog");
break;
case R.id.ok:
createNSTreatment();
dismiss();
break;
case R.id.cancel:
dismiss();
break;
}
}