zoukankan      html  css  js  c++  java
  • 结对项目:一寸时光APP(日程管理)三

    日程倒计时界面:主界面主要实现的是倒计时的功能,输入倒计时的时间后点击确定按钮,下方的方块即会显示倒计时时间,时间到后手机会震动及振铃。点击方块后取消提醒。

    图片:

    int hour = 0, minute = 0, second = 0;
    if (!TextUtils.isEmpty(etHour.getText().toString())) {
    hour = Integer.valueOf(etHour.getText().toString());
    }
    if (!TextUtils.isEmpty(etMinute.getText().toString())) {
    minute = Integer.valueOf(etMinute.getText().toString());
    }
    if (!TextUtils.isEmpty(etSecond.getText().toString())) {
    second = Integer.valueOf(etSecond.getText().toString());
    }
    int sum = hour * 1000 * 3600 + minute * 1000 * 60 + second * 1000;
    if (sum == 0) {
    Toast.makeText(getActivity(), "请输入倒计时时间!", Toast.LENGTH_SHORT).show();
    } else {
    mc = new MyCount(sum, 1000);
    mc.start();
    }
    etMinute.setText("");
    etHour.setText("");
    etSecond.setText("");

    通知栏提醒界面:主界面主要实现的是在日程提醒的状态下通知栏展示提醒的日程,点击该通知栏后可进入日程查看界面。

    图片:

    Notification.Builder builder = new Notification.Builder(this);
    notificationManager = (NotificationManager) this
    .getSystemService(NOTIFICATION_SERVICE);
    Intent clickIntent = new Intent(NotificationService.this, MyReceiver.class);
    clickIntent.putExtra("id", id);
    PendingIntent pendingIntent = PendingIntent.getBroadcast(NotificationService.this, 1, clickIntent, PendingIntent.FLAG_CANCEL_CURRENT);
    builder.setTicker("您有设定日程已到时间").setDefaults(Notification.DEFAULT_VIBRATE).setContentIntent(pendingIntent).setSmallIcon(R.mipmap.android).setContentTitle("日程提示")
    .setContentText("点击查看日程: " + title);
    Notification notification = builder.build();
    notificationManager.notify(1, notification);

  • 相关阅读:
    Spring事务管理(详解+实例)
    DRUID连接池的实用 配置详解
    spring配置c3p0
    Spring使用JdbcTemplate实现对数据库操作
    spring整合web 项目
    2018美团JAVA面试问题与总结
    Mybatis中的update动态SQL语句
    去除文件夹左下角的问号
    spring的aop实现原理
    Spring的bean管理注解和配置文件混合使用
  • 原文地址:https://www.cnblogs.com/feibingyu/p/7018702.html
Copyright © 2011-2022 走看看