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


Java DatePickerDialog.setAccentColor方法代码示例

本文整理汇总了Java中com.wdullaer.materialdatetimepicker.date.DatePickerDialog.setAccentColor方法的典型用法代码示例。如果您正苦于以下问题:Java DatePickerDialog.setAccentColor方法的具体用法?Java DatePickerDialog.setAccentColor怎么用?Java DatePickerDialog.setAccentColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.wdullaer.materialdatetimepicker.date.DatePickerDialog的用法示例。


在下文中一共展示了DatePickerDialog.setAccentColor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showDateDialog

import com.wdullaer.materialdatetimepicker.date.DatePickerDialog; //导入方法依赖的package包/类
/**
 * 时间选择
 */
@OnClick(R.id.birthday_layout)
void showDateDialog() {
    Calendar now = Calendar.getInstance();
    Date time = now.getTime();
    time.setTime(time.getTime());
    DatePickerDialog dpd = DatePickerDialog.newInstance(
            this,
            now.get(Calendar.YEAR),
            now.get(Calendar.MONTH),
            now.get(Calendar.DAY_OF_MONTH)
    );
    now.setTime(time);
    dpd.setMaxDate(now);
    dpd.setAccentColor(accentColor);
    dpd.show(getActivity().getFragmentManager(), "Datepickerdialog");
}
 
开发者ID:tengbinlive,项目名称:aibao_demo,代码行数:20,代码来源:UserFragment.java

示例2: onClick

import com.wdullaer.materialdatetimepicker.date.DatePickerDialog; //导入方法依赖的package包/类
@OnClick({R.id.edit_remind_date_box, R.id.edit_remind_time, R.id.ll_remind_fr,
        R.id.tv_save, R.id.tv_cancel, R.id.tv_state})
public void onClick(View view) {
    mVicInput.stopRecord();
    switch (view.getId()) {
        case R.id.edit_remind_date_box:
            Date rDate = TimeUtils.parse(mEditRemindDate.getText().toString());
            Calendar now = Calendar.getInstance();
            now.setTime(rDate);
            //将当前日期传入日期选择器,并显示
            DatePickerDialog datePicker = DatePickerDialog.newInstance(
                    this,
                    now.get(Calendar.YEAR),
                    now.get(Calendar.MONTH),
                    now.get(Calendar.DAY_OF_MONTH)
            );
            datePicker.setAccentColor(getResources().getColor(R.color.base_blue));
            datePicker.show(getFragmentManager(), "DatePicker");
            break;
        case R.id.edit_remind_time:
            SimpleDate rTime = new SimpleDate(mEditRemindTime.getText().toString());
            TimePickerDialog timePicker = TimePickerDialog.newInstance(
                    this,
                    rTime.getHour(),
                    rTime.getMinute(),
                    true);
            timePicker.setAccentColor(getResources().getColor(R.color.base_blue));
            timePicker.show(getFragmentManager(), "TimePicker");
            break;
        case R.id.ll_remind_fr:
            final Remind rRemind = (Remind) ((TaskCard) mPresenter.getShowDatas().get(getAdapterPosition() - 1)).t;
            Calendar cl = Calendar.getInstance();
            if (rRemind.getRdate() != null)
                cl.setTime(rRemind.getRdate());
            RemindFrDialog frDialog = new RemindFrDialog(RemindActivity.this, rRemind.getFrequency(), cl, new RemindFrDialog.OnResultListener() {
                @Override
                public void onResult(int fr) {
                    remindFr = fr;
                    // rRemind.setFrequency(fr);
                    mEditRemindFr.setText(AssistUtils.translateRemindFrequency(fr));
                }
            });
            frDialog.show();
            break;
        case R.id.tv_save:
            saveHandle();
            break;
        case R.id.tv_cancel:
            cancelHandle();
            break;
        case R.id.tv_state:
            TaskCard<Remind> taskCard = mPresenter.getShowDatas().get(getAdapterPosition() - 1);
            if (taskCard.taskState == TaskCard.TaskState.REVOCABLE) {    //处于可撤销状态,点击撤销删除
                if (taskCard.t.getRdate().compareTo(TimeUtils.getTodayDate()) != -1 && taskCard.t.getRdate().before(TimeUtils.getTomorrow())) {
                    mPresenter.setTodayCount(mPresenter.getTodayCount() + 1);
                    notifyItemChanged(0);
                }
                taskCard.taskState = TaskCard.TaskState.ACTIVE;
                if (taskCard.t.getFrequency() == 0 && taskCard.t.getRdate().before(new Date())) {
                    taskCard.taskState = TaskCard.TaskState.INVALID;
                }
                taskCard.t.setSynced(false);
                mPresenter.operateData(IRemind.INSERT_TYPE, taskCard.t);
                mPresenter.switchRemind(taskCard.t, RemindService.ADD);
                notifyItemChanged(getAdapterPosition());
                //与服务器同步数据
                AssistEntityDao.create().sync(mRemindEntityDao);
            }
            break;
    }
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:72,代码来源:RemindActivity.java


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