当前位置: 首页>>代码示例>>Java>>正文


Java TimePickerDialog.setThemeDark方法代码示例

本文整理汇总了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");
}
 
开发者ID:attiqrehman1991,项目名称:Task-Reminder,代码行数:12,代码来源:ReminderEditActivity.java

示例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");
}
 
开发者ID:Luodian,项目名称:Shared-Route,代码行数:32,代码来源:PublishNeedsActivity.java

示例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()");
    }
}
 
开发者ID:romanvey,项目名称:LvivSoundGit,代码行数:32,代码来源:MainActivity.java

示例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;
    }
}
 
开发者ID:MilosKozak,项目名称:AndroidAPS,代码行数:37,代码来源:NewNSTreatmentDialog.java


注:本文中的com.wdullaer.materialdatetimepicker.time.TimePickerDialog.setThemeDark方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。