Compare commits

..

No commits in common. 'master' and 'zzw_branch' have entirely different histories.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 451 KiB

@ -1,85 +0,0 @@
[{
"articleId": 211,
"articleTitle": "晚上喝茶会影响睡眠吗?",
"articleDesc": "晚上喝茶不一定会失眠,关键看你喝什么茶,以及怎么喝。",
"imgUrl": "http://fileserver1.clife.net:8080/group1/M00/66/B7/Cvtlp1rUOI6ACsLqAAJNhcvaAB0602.jpg",
"articleUrl": "https://cms.clife.cn/manages/series/clifeapp/page/view.html#type=2&id=211"
}, {
"articleId": 200,
"articleTitle": "什么?你游完泳居然失眠了",
"articleDesc": "运动把整个身体都撩起来了虽然你已经很想睡了但是你的身体还HIGH着呢",
"imgUrl": "http://fileserver1.clife.net:8080/group1/M00/56/46/Cvtlp1qwdjiAD5KnAAKWCh-hvgc718.jpg",
"articleUrl": "https://cms.clife.cn/manages/series/clifeapp/page/view.html#type=2&id=200"
}, {
"articleId": 199,
"articleTitle": "赖床睡不着容易产生垃圾睡眠",
"articleDesc": "垃圾睡眠大多是由于现代电子产品的泛滥和快节奏的生活压力所导致",
"imgUrl": "http://fileserver1.clife.net:8080/group1/M00/5E/5B/Cvtlhlqwb6SAGz3_AAC37QNGrsw952.jpg",
"articleUrl": "https://cms.clife.cn/manages/series/clifeapp/page/view.html#type=2&id=199"
}, {
"articleId": 192,
"articleTitle": "如何应对剧烈运动后的肌肉酸痛",
"articleDesc": "睡眠是修复损失最好的办法之一,大量的运动过后应该给自己足够的睡眠时间。",
"imgUrl": "http://fileserver1.clife.net:8080/group1/M00/58/2B/CvtlhlqfiLmABEktAAHuFkm3xKE419.jpg",
"articleUrl": "https://cms.clife.cn/manages/series/clifeapp/page/view.html#type=2&id=192"
}, {
"articleId": 186,
"articleTitle": "为什么喝茶容易失眠?如何喝茶才不会失眠?",
"articleDesc": "喝茶造成失眠的原因并不是绝对的,它与饮茶的时间、饮茶量、不同茶类、不同个体情况等均有关系。",
"imgUrl": "http://fileserver1.clife.net:8080/group1/M00/4C/BF/Cvtlp1qWSAWABiO4AAMxOXIyCNE762.jpg",
"articleUrl": "https://cms.clife.cn/manages/series/clifeapp/page/view.html#type=2&id=186"
}, {
"articleId": 182,
"articleTitle": "什么时间睡觉最有效?",
"articleDesc": "把握有效的睡眠时间最好晚上9点钟睡觉最晚不要超过10点半",
"imgUrl": "http://fileserver1.clife.net:8080/group1/M00/4F/41/Cvtlhlp4JWaAC2PnAAC37QNGrsw926.jpg",
"articleUrl": "https://cms.clife.cn/manages/series/clifeapp/page/view.html#type=2&id=182"
}, {
"articleId": 180,
"articleTitle": "睡觉超过8小时会早衰5个「睡眠习惯」让你越睡越不健康",
"articleDesc": "睡眠太多或太少,都会导致大脑早衰?",
"imgUrl": "http://fileserver1.clife.net:8080/group1/M00/4F/38/Cvtlhlp4Gr-Ac7hEAADQWHGflL0320.jpg",
"articleUrl": "https://cms.clife.cn/manages/series/clifeapp/page/view.html#type=2&id=180"
}, {
"articleId": 176,
"articleTitle": "什么时间做运动最好?",
"articleDesc": "一般人一天有24小时固定的生理时钟按照这个生理规律从事运动或身体活动会更有效果",
"imgUrl": "http://fileserver1.clife.net:8080/group1/M00/4B/C7/CvtlhlpwRiWAfu49AAHuFkm3xKE809.jpg",
"articleUrl": "https://cms.clife.cn/manages/series/clifeapp/page/view.html#type=2&id=176"
}, {
"articleId": 174,
"articleTitle": "冬季赖床5分钟 有利于健康",
"articleDesc": "冬季起床更是宜慢不宜快。尤其脑供血不足、颈椎病患者和心血管疾病患者等更是要注意。",
"imgUrl": "http://fileserver1.clife.net:8080/group1/M00/42/E3/Cvtlp1pu4gWAY8XoAACzPj4YCVw464.jpg",
"articleUrl": "https://cms.clife.cn/manages/series/clifeapp/page/view.html#type=2&id=174"
}, {
"articleId": 214,
"articleTitle": "我来告诉你为什么有人喝咖啡竟能帮助睡眠?",
"articleDesc": "咖啡能帮助睡眠,可能吗?",
"imgUrl": "http://fileserver1.clife.net:8080/group1/M00/68/FE/Cvtlp1rX83uADQYZAAJCnnZgH9o020.jpg",
"articleUrl": "https://cms.clife.cn/manages/series/clifeapp/page/view.html#type=2&id=214"
}, {
"articleId": 213,
"articleTitle": "叫醒一个正在梦游的人会发生什么?",
"articleDesc": "据说叫醒正在梦游中的人会变成白痴?是真的吗?",
"imgUrl": "http://fileserver1.clife.net:8080/group1/M00/70/8C/CvtlhlrWovmAKDJxAAJo-zlPQ3s775.jpg",
"articleUrl": "https://cms.clife.cn/manages/series/clifeapp/page/view.html#type=2&id=213"
}, {
"articleId": 212,
"articleTitle": "失眠,就一定要吃安眠药吗?",
"articleDesc": "如何科学的服用才能达到更好的助眠效果呢?",
"imgUrl": "http://fileserver1.clife.net:8080/group1/M00/70/01/CvtlhlrVhPWAWCcJAAIUEGxQJNA516.jpg",
"articleUrl": "https://cms.clife.cn/manages/series/clifeapp/page/view.html#type=2&id=212"
}, {
"articleId": 211,
"articleTitle": "晚上喝茶会影响睡眠吗?",
"articleDesc": "晚上喝茶不一定会失眠,关键看你喝什么茶,以及怎么喝。",
"imgUrl": "http://fileserver1.clife.net:8080/group1/M00/66/B7/Cvtlp1rUOI6ACsLqAAJNhcvaAB0602.jpg",
"articleUrl": "https://cms.clife.cn/manages/series/clifeapp/page/view.html#type=2&id=211"
}, {
"articleId": 210,
"articleTitle": "失眠了?不妨试试音乐疗法",
"articleDesc": "临床实验发现,通过音乐疗法,失眠者往往能够排除心中的杂念,进入音乐的意境中,消除烦恼忧愁,睡眠质量也就提高了。",
"imgUrl": "http://fileserver1.clife.net:8080/group1/M00/6D/4A/CvtlhlrQQHiAbsInAAG95hIe_yg603.jpg",
"articleUrl": "https://cms.clife.cn/manages/series/clifeapp/page/view.html#type=2&id=210"
}]

@ -1,37 +0,0 @@
package com.example;
//导入所需的类和接口
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import java.util.ArrayList;
import java.util.List;
public class ViewPagerAdapter extends FragmentPagerAdapter {
private List<Fragment> fragments = new ArrayList<>();
private List<String> fragmentTitles = new ArrayList<>();
//两个列表将会存储即将被加入到ViewPager中的 Fragment 和 页面标题。
public ViewPagerAdapter(FragmentManager fm) {
super(fm);
}
public void addFragment(Fragment fragment, String title) {
fragments.add(fragment);
fragmentTitles.add(title);
}//用于添加 Fragment 和对应的标题到 fragments 和 fragmentTitles 列表中。
//重写 getItem() 方法是为了返回 ViewPager 中要求位置的 Fragment 实例。
@Override
public Fragment getItem(int position) {
return fragments.get(position);
}
//getCount() 返回在适配器中的 Fragment 数量。
@Override
public int getCount() {
return fragments.size();
}
//getPageTitle() 方法返回在 ViewPager 中要求位置的页面标题。
@Override
public CharSequence getPageTitle(int position) {
return fragmentTitles.get(position);
}
}

@ -1,272 +0,0 @@
package com.example.sleep;
import android.app.Activity;
import android.content.ContentValues;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.KeyEvent;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.example.sleep.database.MyDataBaseHelper;
import com.github.mikephil.charting.charts.PieChart;
import com.example.sleep.database.GetRecord;
import com.example.sleep.database.RecordBean;
import com.example.sleep.drawChart.DrawPieChart;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Locale;
import java.util.Random;
import static com.example.sleep.database.GetRecord.getRecord;
import static java.lang.Math.pow;
/**
*
*/
// 这是一个Android活动用于显示睡眠分析的结果。
// 与这个活动关联的布局文件名为aftersleep。
public class AfterSleep extends Activity {
// 这些变量存储对布局文件中的UI元素的引用。
RelativeLayout background; // 屏幕的背景图像。
TextView mTime; // 显示总睡眠时间的文字视图。
TextView mStartTime; // 显示开始睡眠时间的文字视图。
TextView mStopTime; // 显示停止睡眠时间的文字视图。
PieChart mPieChart; // 饼状图用于显示深度、浅度和REM睡眠的时间比例。
TextView mDeep; // 显示深度睡眠时间的文字视图。
TextView mSwallow; // 显示浅度睡眠时间的文字视图。
TextView mDream; // 显示REM睡眠时间的文字视图。
DrawPieChart mDrawPieChart; // 用于绘制饼状图的对象。
private RecordBean mRecord; // 记录睡眠数据的对象。
private ImageView sleepReport;// 显示睡眠报告的图像视图。
private long timeusedinsec; // 睡眠持续的时间(以秒为单位)。
private String suggest; // 建议信息。
private int timeOfSleep; // 睡眠时间(小时)。
@Override // 覆写父类的onCreate方法在此方法中进行初始化工作。
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); // 调用父类的方法,加载默认的布局文件。
setContentView(R.layout.aftersleep); // 设置当前活动的布局文件为aftersleep。
// 初始化各个UI组件。
background = findViewById(R.id.aftersleep_background);
findViewById(R.id.btn_AfterSleep).setOnClickListener(v -> {
finish(); // 当点击“完成”按钮时,结束当前活动。
});
sleepReport = findViewById(R.id.report);
mPieChart = findViewById(R.id.mPiechart);
mTime = findViewById(R.id.sleepTime);
mStartTime = findViewById(R.id.startTime);
mStopTime = findViewById(R.id.stopTime);
mDeep = findViewById(R.id.deep);
mSwallow = findViewById(R.id.swallow);
mDream = findViewById(R.id.dream);
// 随机设置背景图片。
int[] array = {R.drawable.bg_1, R.drawable.bg_4, R.drawable.bg_5};
Random rnd = new Random();
int index = rnd.nextInt(3);
Resources resources = getBaseContext().getResources();
Drawable cur = resources.getDrawable(array[index]);
background.setBackground(cur);
// 获取最新的睡眠记录。
GetRecord mGetRecord = getRecord();
mRecord = mGetRecord.getLatestRecord();
initView(); // 初始化各个UI组件的内容。
saveData(); // 存储睡眠记录的数据。
}
private List<Integer> StringSplitAndConvert(String timeString) {
// String timeString = "15:24";
List<Integer> timeList = new ArrayList<>();
// 使用冒号 ":" 分割字符串
String[] timeParts = timeString.split(":");
if (timeParts.length == 2) {
try {
// 将分割后的字符串转换为整数
int hours = Integer.parseInt(timeParts[0]);
int minutes = Integer.parseInt(timeParts[1]);
timeList.add(hours);
timeList.add(minutes);
// 输出结果
System.out.println("Hours: " + hours);
System.out.println("Minutes: " + minutes);
} catch (NumberFormatException e) {
System.err.println("无法将字符串转换为整数。");
}
} else {
System.err.println("字符串格式不正确。");
}
return timeList;
}
private void saveData() {
// 获取最新的记录
GetRecord mGetRecord = getRecord();
mRecord = mGetRecord.getLatestRecord();
// 计算播放次数的评分
double grade_numberOfPlay = pow(1.01, -0);
// 获取记录的开始时间和结束时间
String startTime = mRecord.getStartTime();
String endTime = mRecord.getEndTime();
// 计算触摸次数的评分
double grade_numberOfTouch;
int numberOfTouch = 0;
if (numberOfTouch > 2000) {
grade_numberOfTouch = 0.89;
suggest += "最近是不是辗转难眠呢~睡眠质量不够高呢~";
} else {
grade_numberOfTouch = 1;
}
// 计算睡眠时长的评分
double sleepHour = (double) (timeusedinsec / 60 / 60) % 60;
double grade_sumOfSleep;
int nowHour = StringSplitAndConvert(endTime).get(0);
int nowMinute = StringSplitAndConvert(endTime).get(1);
int alarmHour = MySharedPreferences.getHours(App.mContext);
int alarmMinute = MySharedPreferences.getMinutes(App.mContext);
int subOfAlarm;
double alarmTime = alarmHour + alarmMinute / 60, nowTime = nowHour + nowMinute / 60;
if (nowTime > alarmTime) {
subOfAlarm = (nowHour - alarmHour) * 60 + nowMinute - alarmMinute;
} else if (nowTime == alarmTime) {
subOfAlarm = Math.abs(nowMinute - alarmMinute);
} else {
subOfAlarm = (alarmHour - nowHour) * 60 + nowMinute - alarmMinute;
}
double x1 = subOfAlarm / 20;
double grade_subOfAlarm;
if (x1 > 2) {
suggest += "最近睡眠不深,不知道怎么了?";
grade_subOfAlarm = 0.8;
} else if (x1 > -1) {
suggest += "您的生物钟很规律哦~希望您继续保持呢~";
grade_subOfAlarm = 0.99;
} else {
suggest += "最近有点赖床哦~";
grade_subOfAlarm = 0.9;
}
// 计算总睡眠评分
if (sleepHour > 9.3) {
suggest += "睡的时间太长了噢~该早就醒了~";
grade_sumOfSleep = 0.88;
} else if (sleepHour > 6) {
suggest += "睡觉时长很健康呐~";
grade_sumOfSleep = 0.96;
} else {
suggest += "最近睡眠缺乏~";
grade_sumOfSleep = 0.6;
}
// 计算睡眠时间的评分
double grade_timeOfSleep;
Calendar cl = Calendar.getInstance();
java.util.TimeZone timeZone = java.util.TimeZone.getTimeZone("GMT+8");
cl.setTimeZone(timeZone);
timeOfSleep = cl.get(Calendar.HOUR_OF_DAY);
if (timeOfSleep > 22 && timeOfSleep < 23) {
grade_timeOfSleep = 1;
} else if (timeOfSleep >= 23) {
grade_timeOfSleep = 0.95;
suggest += "另外,最近睡得有点迟啊~";
} else if (timeOfSleep > 0 && timeOfSleep < 2) {
grade_timeOfSleep = 0.75;
suggest += "另外,最近睡得有点迟啊~";
} else if (timeOfSleep > 11 && timeOfSleep < 15) {
grade_timeOfSleep = 1;
} else if (timeOfSleep > 2 && timeOfSleep < 6) {
grade_timeOfSleep = 0.65;
suggest += "最近在赶project吗这样对身体不好的...\n";
} else {
grade_timeOfSleep = 0.95;
}
// 计算总评分
double grade = 100 * grade_subOfAlarm * grade_sumOfSleep * grade_numberOfTouch * grade_timeOfSleep * pow(grade_numberOfPlay, 0.2);
grade = 10 * pow(grade, 0.5);
// 获取当前日期
Calendar calendar1 = Calendar.getInstance();
java.util.TimeZone timeZone1 = java.util.TimeZone.getTimeZone("GTM+8");
calendar1.setTimeZone(timeZone1);
int month = calendar1.get(Calendar.MONTH) + 1;
int day = calendar1.get(Calendar.DAY_OF_MONTH);
String x = month + "." + day;
// 保存评分和建议到SharedPreferences
SharedPreferences sharedpref = App.mContext.getSharedPreferences("info", MODE_PRIVATE);
float z = sharedpref.getFloat("grade", 100);
long grade1 = Math.round(grade);
z = (float) (0.2 * z + 0.8 * grade1);
SharedPreferences.Editor editor = sharedpref.edit();
editor.putFloat("grade", z);
editor.putString("suggestion", suggest);
editor.apply();
// 将评分和其他数据保存到数据库
MyDataBaseHelper dbHelp = new MyDataBaseHelper(this);
final SQLiteDatabase sqLiteDatabase = dbHelp.getWritableDatabase();
ContentValues cv = new ContentValues();
cv.put("time", x);
cv.put("grade", z);
cv.put("sumOfSleep", sleepHour);
cv.put("timeOfSleep", timeOfSleep);
sqLiteDatabase.insert("grade_table", null, cv);
}
//设置文本
protected void initView() {
if (mRecord != null) {
mStartTime.setText(String.format(getResources().getString(R.string.sleep_time), mRecord.getStartTime()));
mStopTime.setText(String.format(getResources().getString(R.string.get_up_time), mRecord.getEndTime()));
mTime.setText(String.format(Locale.getDefault(), "时长 %02d:%02d",
mRecord.getTotalTime() / 60, mRecord.getTotalTime() % 60));
mDeep.setText(String.format(Locale.getDefault(), "深度睡眠 %02d:%02d",
mRecord.getDeepTime() / 60, mRecord.getDeepTime() % 60));
mSwallow.setText(String.format(Locale.getDefault(), "浅层睡眠 %02d:%02d",
mRecord.getSwallowTime() / 60, mRecord.getSwallowTime() % 60));
mDream.setText(String.format(Locale.getDefault(), "醒/梦 %02d:%02d",
mRecord.getAwakeTime() / 60, mRecord.getAwakeTime() % 60));
mDrawPieChart = new DrawPieChart(mPieChart, mRecord, getResources());
} else {
Toast.makeText(this, "数据错误", Toast.LENGTH_SHORT).show();
}
}
//返回键效果
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
Intent i = new Intent().setClass(AfterSleep.this, MainScreen.class);
AfterSleep.this.startActivity(i);
AfterSleep.this.finish();
return true;
}
return super.onKeyDown(keyCode, event);
}
@Override
protected void onDestroy() {
super.onDestroy();
}
}

@ -1,116 +0,0 @@
package com.example.sleep;
import static com.example.sleep.database.GetRecord.getRecord;
import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.KeyEvent;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.example.sleep.database.GetRecord;
import com.example.sleep.database.RecordBean;
import com.example.sleep.drawChart.DrawPieChart;
import com.github.mikephil.charting.charts.PieChart;
import java.util.Locale;
import java.util.Random;
/**
*
*/
public class AfterSleepReport extends Activity {
//这些变量存储对布局文件中的UI元素的引用
RelativeLayout background; //背景图片布局
TextView mTime; //显示总的睡眠时间的文字视图
TextView mStartTime; //显示开始睡眠时间的文字视图
TextView mStopTime; //显示结束睡眠时间的文字视图
PieChart mPieChart; //用于显示深度、浅度和REM睡眠时间的饼状图
TextView mDeep; //显示深度睡眠时间的文字视图
TextView mSwallow; //显示浅度睡眠时间的文字视图
TextView mDream; //显示睡眠时间的文字视图
DrawPieChart mDrawPieChart; //显示睡眠信息图
private RecordBean mRecord;
private ImageView sleepReport;
@Override
public void onCreate(Bundle savedInstanceState) {
//调用父类的方法,设置默认的布局文件
super.onCreate(savedInstanceState);
setContentView(R.layout.aftersleep);
//初始化各个UI组件
background = findViewById(R.id.aftersleep_background);
findViewById(R.id.btn_AfterSleep).setOnClickListener(v -> {
finish(); //当点击"完成"按钮时,结束当前活动
});
sleepReport = findViewById(R.id.report);
mPieChart = findViewById(R.id.mPiechart);
mTime = findViewById(R.id.sleepTime);
mStartTime = findViewById(R.id.startTime);
mStopTime = findViewById(R.id.stopTime);
mDeep = findViewById(R.id.deep);
mSwallow = findViewById(R.id.swallow);
mDream = findViewById(R.id.dream);
//随机背景
int[] array = {R.drawable.bg_1, R.drawable.bg_4, R.drawable.bg_5};
Random rnd = new Random();
int index = rnd.nextInt(3);
Resources resources = getBaseContext().getResources();
Drawable cur = resources.getDrawable(array[index]);
background.setBackground(cur);
//long recordId = this.getIntent().getLongExtra("recordId", 0);
//获取最新的睡眠记录
GetRecord mGetRecord = getRecord();
mRecord = mGetRecord.getLatestRecord();
initView();
}
//设置文本
protected void initView() {
if (mRecord != null) {
mStartTime.setText(String.format(getResources().getString(R.string.sleep_time), mRecord.getStartTime()));
mStopTime.setText(String.format(getResources().getString(R.string.get_up_time), mRecord.getEndTime()));
mTime.setText(String.format(Locale.getDefault(), "时长 %02d:%02d",
mRecord.getTotalTime() / 60, mRecord.getTotalTime() % 60));
mDeep.setText(String.format(Locale.getDefault(), "深度睡眠 %02d:%02d",
mRecord.getDeepTime() / 60, mRecord.getDeepTime() % 60));
mSwallow.setText(String.format(Locale.getDefault(), "浅层睡眠 %02d:%02d",
mRecord.getSwallowTime() / 60, mRecord.getSwallowTime() % 60));
mDream.setText(String.format(Locale.getDefault(), "醒/梦 %02d:%02d",
mRecord.getAwakeTime() / 60, mRecord.getAwakeTime() % 60));
mDrawPieChart = new DrawPieChart(mPieChart, mRecord, getResources());
} else {
Toast.makeText(this, "数据错误", Toast.LENGTH_SHORT).show();
}
}
//返回键效果
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
Intent i = new Intent().setClass(AfterSleepReport.this, MainScreen.class);
AfterSleepReport.this.startActivity(i);
AfterSleepReport.this.finish();
return true;
}
return super.onKeyDown(keyCode, event);
}
@Override
protected void onDestroy() {
super.onDestroy();
}
}

@ -1,38 +0,0 @@
package com.example.sleep;
import android.Manifest;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.media.Ringtone;
import android.media.RingtoneManager;
import android.net.Uri;
import android.support.v4.content.ContextCompat;
import android.util.Log;
public class AlarmReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
// 获取默认的闹钟铃声的URI
// Uri alarmTone = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM);
// Uri alarmTone = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
Uri alarmTone = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
Log.e("闹铃:","received: " +alarmTone.toString());
// 检查权限
if (ContextCompat.checkSelfPermission(context, Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
// 使用Ringtone来播放声音
Ringtone ringtone = RingtoneManager.getRingtone(App.mContext, alarmTone);
if (ringtone != null) {
Log.e("闹铃:","ringtone is playing");
ringtone.play();
} else {
Log.e("闹铃:","ringtone is null");
}
} else {
// 如果没有权限,可以选择播放内置的声音或其他方式提醒用户
Log.e("闹铃:","no premission");
}
}
}

@ -1,50 +0,0 @@
package com.example.sleep;
import android.app.Application;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
import com.example.sleep.database.dao.DaoMaster;
import com.example.sleep.database.dao.DaoSession;
import com.example.sleep.service.SensorService;
import com.example.sleep.utils.ApkHelper;
import com.shihoo.daemon.DaemonEnv;
import java.io.File;
public class App extends Application {
public static DaoSession mDaoSession;
public static Context mContext;
public void onCreate() {
/*
Daemon
*/
super.onCreate();
initGreenDao();
String processName = ApkHelper.getProcessName(this.getApplicationContext());
if ("com.sleephelper.howard.sleephelper".equals(processName)) {
Log.e("app", "启动主进程");
} else if ("com.sleephelper.howard.sleephelper:work".equals(processName)) {
Log.e("app", "启动了工作进程");
} else if ("com.sleephelper.howard.sleephelper:watch".equals(processName)) {
DaemonEnv.mWorkServiceClass = SensorService.class;
Log.e("app", "启动了守护进程");
}
mContext = this;
}
//数据库初始化
private void initGreenDao() {
DaoMaster.DevOpenHelper helper = new DaoMaster.DevOpenHelper
(this, this.getExternalFilesDir(null) + File.separator + "sleepRecord.db");
SQLiteDatabase db = helper.getWritableDatabase();
DaoMaster daoMaster = new DaoMaster(db);
mDaoSession = daoMaster.newSession();
}
}

@ -1,29 +0,0 @@
package com.example.sleep;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import com.example.sleep.service.GoSleepService;
public class GoSleepBroadcastReceiver extends BroadcastReceiver {
// 定义一个静态常量ACTION用于接收系统开机广播
static final String ACTION = "android.intent.action.BOOT_COMPLETED";
@Override
public void onReceive(Context context, Intent intent) {
// 当接收到系统广播时
if (ACTION.equals(intent.getAction())) {
// 创建一个意图启动GoSleepService服务
Intent ifSleepIntent = new Intent(context, GoSleepService.class);
// 根据Android版本选择启动前台服务或普通服务
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.startForegroundService(ifSleepIntent);
} else {
context.startService(ifSleepIntent);
}
}
}
}
//这段代码是一个广播接收器用于接收系统开机广播并在接收到广播时启动GoSleepService服务。根据Android版本的不同选择启动前台服务或普通服务。

@ -1,135 +0,0 @@
package com.example.sleep;
import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.FragmentActivity;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.ViewPager;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import com.example.ViewPagerAdapter;
import com.example.sleep.database.GetRecord;
import com.example.sleep.database.RecordBean;
import com.example.sleep.service.GoSleepService;
import static com.example.sleep.database.GetRecord.getRecord;
/**
*
*/
public class MainScreen extends FragmentActivity {
private static final int REQUEST_READ_EXTERNAL_STORAGE = 1;
private long exitTime = 0;
private ViewPager viewPager;
private TabLayout tabLayout;
private Button backRl;
//初始化
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
readLog();
/*initView();*/
startGoSleepService();
viewPager = findViewById(R.id.viewPager);
backRl = findViewById(R.id.btn_AfterSleep);
backRl.setOnClickListener(v -> finish());
tabLayout = findViewById(R.id.tabLayout);
ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());
adapter.addFragment(new SleepFragment(), "睡眠");
adapter.addFragment(new DreamAnalyszeScreen(), "解梦");
adapter.addFragment(new Share(), "分享");
adapter.addFragment(new SuggestScreen(), "报告");
viewPager.setAdapter(adapter);
tabLayout.setupWithViewPager(viewPager);
// 检查权限
if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
// 请求权限
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, REQUEST_READ_EXTERNAL_STORAGE);
}
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (requestCode == REQUEST_READ_EXTERNAL_STORAGE) {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
// 权限已获得
} else {
// 权限被拒绝
Toast.makeText(this, "Permission Denied!", Toast.LENGTH_SHORT).show();
}
}
}
//按钮
public void ClickRecord(View v) {
Intent i = new Intent();
i.setClass(MainScreen.this, CalendarPage.class);
MainScreen.this.startActivity(i);
MainScreen.this.finish();
}
//按下返回键的效果
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
if (System.currentTimeMillis() - exitTime > 2000) {
Toast.makeText(getApplicationContext(), "再按一次退出程序", Toast.LENGTH_SHORT).show();
exitTime = System.currentTimeMillis();
} else {
finish();
System.exit(0);
}
return true;
}
return super.onKeyDown(keyCode, event);
}
//读睡眠记录,判断是否异常退出
private void readLog() {
RecordBean mRecord;
GetRecord mGetRecord = getRecord();
mRecord = mGetRecord.getLatestRecord();
if (mRecord != null) {
if (!mRecord.getValid()) {
Intent i = new Intent();
i.setClass(MainScreen.this, SleepMonitoringScreen.class);
MainScreen.this.startActivity(i);
MainScreen.this.finish();
}
}
}
public void startGoSleepService() {
Intent ifSleepIntent = new Intent(this, GoSleepService.class);
this.startService(ifSleepIntent);
}
@Override
protected void onDestroy() {
super.onDestroy();
}
}

@ -1,128 +0,0 @@
package com.example.sleep;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.TimePickerDialog;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TimePicker;
import android.widget.Toast;
import java.util.Calendar;
import java.util.Random;
public class SleepFragment extends Fragment {
private Button startSleep;
private FragmentActivity activity;
private Button alarmTime;
private Calendar calendar;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// 在这里设置 SleepFragment 的布局,例如从 XML 文件中加载
View view = inflater.inflate(R.layout.fragment_sleep, container, false);
initView(view);
initListener();
return view;
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
// 在这里获取关联的Activity上下文
activity = getActivity();
}
private void initListener() {
startSleep.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(App.mContext, "开始记录!", Toast.LENGTH_SHORT).show();
Intent i = new Intent();
i.setClass(App.mContext, SleepMonitoringScreen.class);
activity.startActivity(i);
}
});
}
public void initView(View view) {
ImageView mImageText;
mImageText = view.findViewById(R.id.imageText);
startSleep = view.findViewById(R.id.btn_start);
alarmTime = view.findViewById(R.id.timeBtn);
alarmTime.setText("我将会在" + " 00:00 " + "醒来");
alarmTime.setOnClickListener(new Button.OnClickListener() {
@Override
public void onClick(View arg0) {
calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
new TimePickerDialog(getActivity(), new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker arg0, int h, int m) {
MySharedPreferences.saveTime(App.mContext,h,m);
//更新按钮上的时间
alarmTime.setText("我将会在 " + formatTime(h, m) + " " + "醒来");
//设置日历的时间,主要是让日历的年月日和当前同步
calendar.setTimeInMillis(System.currentTimeMillis());
//设置日历的小时和分钟
calendar.set(Calendar.HOUR_OF_DAY, h);
calendar.set(Calendar.MINUTE, m);
//将秒和毫秒设置为0
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
}
}, calendar.get(Calendar.HOUR_OF_DAY), calendar.get(Calendar.MINUTE), true).show();
}
});
//设置随机背景
int[] array = {R.drawable.main_bg_1, R.drawable.main_bg_2, R.drawable.main_bg_3,
R.drawable.main_bg_4, R.drawable.main_bg_5, R.drawable.main_bg_6};
Random rnd = new Random();
int index = rnd.nextInt(6);
Resources resources = getActivity().getResources();
Drawable cur = resources.getDrawable(array[index]);
mImageText.setBackground(cur);
}
public String formatTime(int h, int m) {
StringBuffer buf = new StringBuffer();
if (h < 10) {
buf.append("0" + h);
} else {
buf.append(h);
}
buf.append(" : ");
if (m < 10) {
buf.append("0" + m);
} else {
buf.append(m);
}
setAlarm(getActivity(),h,m);
return buf.toString();
}
public void setAlarm(Context context, int h, int m) {
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
Intent intent = new Intent(context, AlarmReceiver.class);
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent, 0);
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
calendar.set(Calendar.HOUR_OF_DAY, h);
calendar.set(Calendar.MINUTE, m);
alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pendingIntent);
}
}

@ -1,293 +0,0 @@
package com.example.sleep;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.IBinder;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.example.sleep.service.DaemonService;
import com.example.sleep.service.GoSleepService;
import com.example.sleep.service.GrayService;
import com.example.sleep.service.MediaService;
import com.example.sleep.service.PlayerMusicService;
import com.example.sleep.service.SensorService;
import com.shihoo.daemon.DaemonEnv;
import com.shihoo.daemon.WatchProcessPrefHelper;
import java.util.Calendar;
import java.util.Locale;
import java.util.Random;
import java.util.Timer;
import java.util.TimerTask;
import static android.content.ContentValues.TAG;
/**
*
*/
public class SleepMonitoringScreen extends Activity {
TextView clock;
TextView musicTitle;
RelativeLayout background;
private Button playButton;
private int runningTime;
private Timer mRunTimer;
private boolean playing;
//private JobSchedulerManager mJobManager;
private MediaService.MyBinder mMyBinder;
// 连接音乐服务
private ServiceConnection mServiceConnection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
mMyBinder = (MediaService.MyBinder) service;
mMyBinder.getMusicTitle(musicTitle);
Log.e(TAG, "Service与Activity已连接");
}
@Override
public void onServiceDisconnected(ComponentName name) {
}
};
private BroadcastReceiver mScreenOReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action != null && action.equals("android.intent.action.SCREEN_ON")) {
stopRunTimer();
startRunTimer();
}
}
};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.sleep);
//mJobManager = JobSchedulerManager.getJobSchedulerInstance(this);
//mJobManager.startJobScheduler();
stopGoSleepService();
initView();
initMedia();
initData();
IntentFilter mScreenOnFilter = new IntentFilter("android.intent.action.SCREEN_ON");
this.registerReceiver(mScreenOReceiver, mScreenOnFilter);
}
//开始记录数据
public void initData() {
runningTime = 0;
startRunTimer();
//startPlayMusicService();
//stopGosleepService();
startDaemonService();
WatchProcessPrefHelper.setIsStartSDaemon(this, true);
DaemonEnv.startServiceSafely(this, SensorService.class, false);
}
public void initMedia() {
playing = false;
Intent MediaServiceIntent = new Intent(this, MediaService.class);
bindService(MediaServiceIntent, mServiceConnection, BIND_AUTO_CREATE);
}
//界面初始化
public void initView() {
Typeface typeface = Typeface.createFromAsset(getAssets(), "clock_font.ttf");
clock = findViewById(R.id.mRunTime);
clock.setTypeface(typeface);
musicTitle = findViewById(R.id.musicName);
playButton = findViewById(R.id.play);
//设置随机背景
background = findViewById(R.id.sleep_background);
int[] array = {R.drawable.bg_2, R.drawable.bg_3, R.drawable.bg_6, R.drawable.bg_7};
Random rnd = new Random();
int index = rnd.nextInt(4);
Resources resources = getBaseContext().getResources();
Drawable cur = resources.getDrawable(array[index]);
background.setBackground(cur);
}
// 音乐播放按钮
public void onClickMedia(View v) {
runningTime = 0;
switch (v.getId()) {
case R.id.play:
if (!playing) {
mMyBinder.playMusic();
Log.e(TAG, "Play music.");
playButton.setBackground(getResources().getDrawable(R.drawable.ic_play_btn_pause));
} else {
mMyBinder.pauseMusic();
Log.e(TAG, "Pause music.");
playButton.setBackground(getResources().getDrawable(R.drawable.ic_play_btn_play));
}
playing = !playing;
break;
case R.id.next:
mMyBinder.nextMusic();
break;
case R.id.previous:
mMyBinder.previousMusic();
break;
}
}
// 停止记录按钮
public void onRunningClick2(View v) {
Toast.makeText(this, "停止记录!", Toast.LENGTH_SHORT).show();
WatchProcessPrefHelper.setIsStartSDaemon(this, false);
DaemonEnv.stopAllServices(this);
stopRunTimer();
stopDaemonService();
//stopPlayMusicService();
//stopGrayService();
Intent i = new Intent();
i.setClass(SleepMonitoringScreen.this, AfterSleep.class);
SleepMonitoringScreen.this.startActivity(i);
SleepMonitoringScreen.this.finish();
}
//返回键效果
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
Toast.makeText(SleepMonitoringScreen.this, "正在睡觉", Toast.LENGTH_SHORT).show();
return true;
}
return super.onKeyDown(keyCode, event);
}
//计时器
public void startRunTimer() {
TimerTask mTask = new TimerTask() {
Calendar calendar = Calendar.getInstance();
int hour = calendar.get(Calendar.HOUR_OF_DAY);
int minute = calendar.get(Calendar.MINUTE);
@Override
public void run() {
if (playing) {
++runningTime;
if (runningTime > 15) {
mMyBinder.closeMedia();
}
}
++minute;
if (minute == 60) {
minute = 0;
hour++;
}
if (hour == 24) {
minute = 0;
hour = 0;
}
// 更新UI有bug需要重写
runOnUiThread(new Runnable() {
@Override
public void run() {
clock.setText(String.format(Locale.getDefault(), "%02d:%02d", hour, minute));
}
});
}
};
Calendar calendar = Calendar.getInstance();
clock.setText(String.format(Locale.getDefault(), "%02d:%02d",
calendar.get(Calendar.HOUR_OF_DAY), calendar.get(Calendar.MINUTE)));
mRunTimer = new Timer();
mRunTimer.schedule(mTask, 60000 - calendar.get(Calendar.SECOND) * 1000
- calendar.get(Calendar.MILLISECOND), 60000);
}
//停止计时器
private void stopRunTimer() {
if (mRunTimer != null) {
mRunTimer.cancel();
mRunTimer = null;
}
}
//下面各种的保活策略部分在sdk=25时有效于是暂时去掉了
private void startPlayMusicService() {
Intent intent = new Intent(SleepMonitoringScreen.this, PlayerMusicService.class);
startService(intent);
}
private void stopPlayMusicService() {
Intent intent = new Intent(SleepMonitoringScreen.this, PlayerMusicService.class);
stopService(intent);
}
private void startGoSleepService() {
Intent intent = new Intent(SleepMonitoringScreen.this, GoSleepService.class);
startService(intent);
}
private void stopGoSleepService() {
Intent intent = new Intent(SleepMonitoringScreen.this, GoSleepService.class);
stopService(intent);
}
private void startDaemonService() {
Intent intent = new Intent(SleepMonitoringScreen.this, DaemonService.class);
startService(intent);
}
private void stopDaemonService() {
Intent intent = new Intent(SleepMonitoringScreen.this, DaemonService.class);
stopService(intent);
}
private void startGrayService() {
Intent intent = new Intent(SleepMonitoringScreen.this, GrayService.class);
startService(intent);
}
private void stopGrayService() {
Intent intent = new Intent(SleepMonitoringScreen.this, GrayService.class);
stopService(intent);
}
@Override
protected void onDestroy() {
super.onDestroy();
this.unregisterReceiver(mScreenOReceiver);
if (mMyBinder != null && playing) {
mMyBinder.closeMedia();
}
unbindService(mServiceConnection);
WatchProcessPrefHelper.setIsStartSDaemon(this, false);
DaemonEnv.stopAllServices(this);
stopRunTimer();
// stopPlayMusicService();
stopDaemonService();
//startGosleepService();
//mJobManager.stopJobScheduler();
}
}

@ -1,41 +0,0 @@
package com.example.sleep;
import android.Manifest;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import com.example.sleep.activity.LoginActivity;
//整个程序的入口splash界面
public class SplashActivity extends Activity {
private static final int DELAY_TIME = 1500;
private static final int REQUEST_EXTERNAL_STORAGE = 1;
private static String[] PERMISSIONS_STORAGE = {
Manifest.permission.WRITE_EXTERNAL_STORAGE
};
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
// myPermission();
// 利用消息处理器实现延迟跳转到登录窗口
new Handler().postDelayed(() -> {
Intent intent = new Intent(SplashActivity.this, LoginActivity.class);
// 启动登录窗口
startActivity(intent);
// 关闭启动画面
finish();
}, DELAY_TIME);
}
}

@ -1,95 +0,0 @@
package com.example.sleep.activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.example.sleep.App;
import com.example.sleep.MainScreen;
import com.example.sleep.R;
import com.example.sleep.database.UserBean;
import com.example.sleep.database.dao.DaoSession;
import com.example.sleep.database.dao.UserBeanDao;
import java.util.List;
// LoginActivity.java
//定义了一个名为LoginActivity的类。这个类在Android应用中处理用户的登录操作。
public class LoginActivity extends AppCompatActivity {
private EditText usernameEditText;
private EditText passwordEditText;
private Button loginButton;
private Button registerButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
//初始化LoginActivity的各种资源以及为一些控件设置事件监听器。
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
usernameEditText = findViewById(R.id.usernameEditText);
passwordEditText = findViewById(R.id.passwordEditText);
loginButton = findViewById(R.id.loginButton);
registerButton = findViewById(R.id.registerButton);
findViewById(R.id.btn_AfterSleep).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
loginButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// 处理登录逻辑
String username = usernameEditText.getText().toString();
String password = passwordEditText.getText().toString();
// 1. 获取SharedPreferences实例
SharedPreferences sharedPreferences = LoginActivity.this.getSharedPreferences("MyPreferences", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString("UserNameKey", username);
editor.apply();
// 验证用户名和密码从GreenDAO数据库中检查
// 如果匹配成功,执行登录操作
// 否则,显示错误消息
// 获取 GreenDAO 的 DAOSession
DaoSession mDaoSession = App.mDaoSession;
UserBeanDao userBeanDao = mDaoSession.getUserBeanDao();
// 查询数据库以验证用户名和密码
List<UserBean> matchingUsers = userBeanDao.queryBuilder()
.where(UserBeanDao.Properties.Username.eq(username), UserBeanDao.Properties.Password.eq(password))
.list();
if (matchingUsers != null && !matchingUsers.isEmpty()) {
Intent intent = new Intent();
intent.setClass(LoginActivity.this, MainScreen.class);
startActivity(intent);
finish();
} else {
Toast.makeText(LoginActivity.this, "用户名或密码不正确", Toast.LENGTH_SHORT).show();
}
}
});
registerButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// 跳转到注册页面
startActivity(new Intent(LoginActivity.this, RegisterActivity.class));
}
});
}
}

@ -1,55 +0,0 @@
package com.example.sleep.activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.example.sleep.App;
import com.example.sleep.R;
import com.example.sleep.database.UserBean;
import com.example.sleep.database.dao.DaoSession;
import com.example.sleep.database.dao.UserBeanDao;
//处理用户的注册操作
public class RegisterActivity extends AppCompatActivity {
private EditText registerUsernameEditText;//用户名
private EditText registerPasswordEditText;//密码
private Button registerButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
//设置一些基本的视图元素,并为其中视图元素设置一个简单的事件处理程序。
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
registerUsernameEditText = findViewById(R.id.usernameEditText);
registerPasswordEditText = findViewById(R.id.passwordEditText);
registerButton = findViewById(R.id.registerButton);
findViewById(R.id.btn_AfterSleep).setOnClickListener(v -> finish());
registerButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// 处理注册逻辑
String newUsername = registerUsernameEditText.getText().toString();
String newPassword = registerPasswordEditText.getText().toString();
// 将新用户的用户名和密码保存到GreenDAO数据库中
// 执行注册操作
// 创建一个新的 User 对象并设置用户名和密码
UserBean newUser = new UserBean();
newUser.setUsername(newUsername);
newUser.setPassword(newPassword);
// 获取 GreenDAO 的 DAOSession
DaoSession mDaoSession = App.mDaoSession;
UserBeanDao userBeanDao = mDaoSession.getUserBeanDao();
long id = userBeanDao.insert(newUser);
System.out.println("userDao: " + id);
if (id != -1) Toast.makeText(RegisterActivity.this,"注册成功",Toast.LENGTH_SHORT).show();
finish();
}
});
}
}

@ -1,139 +0,0 @@
package com.example.sleep.drawChart;
import android.content.res.Resources;
import android.graphics.Color;
import com.github.mikephil.charting.charts.LineChart;
import com.github.mikephil.charting.components.AxisBase;
import com.github.mikephil.charting.components.Legend;
import com.github.mikephil.charting.components.LimitLine;
import com.github.mikephil.charting.components.XAxis;
import com.github.mikephil.charting.components.YAxis;
import com.github.mikephil.charting.data.Entry;
import com.github.mikephil.charting.data.LineData;
import com.github.mikephil.charting.data.LineDataSet;
import com.github.mikephil.charting.formatter.IAxisValueFormatter;
import com.example.sleep.R;
import com.example.sleep.database.RecordBean;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
public class DrawLineChart {
private LineChart mLineChart;
private RecordBean mRecord;
private Resources mResources;
private ArrayList<Integer> times;
private ArrayList<Float> sleepDetails;
private List<Entry> entries = new ArrayList<>();
/**
* 线
*
* @param lineChart 线
* @param mRecord
* @param mResources
*/
public DrawLineChart(LineChart lineChart, RecordBean mRecord, Resources mResources) {
mLineChart = lineChart;
mLineChart.setDrawBorders(false);
mLineChart.setNoDataText("睡眠时间太短啦!没有足够数据!");
mLineChart.setNoDataTextColor(Color.WHITE);
mLineChart.setDrawGridBackground(true);
mLineChart.setGridBackgroundColor(mResources.getColor(R.color.transparent_gray));
mLineChart.setDragEnabled(true);
mLineChart.animateX(1000);
mLineChart.setScaleEnabled(true);
mLineChart.setPinchZoom(true);
mLineChart.getDescription().setEnabled(false);
//画折线图
if (mRecord.getDrawChart()) {
this.mResources = mResources;
this.mRecord = mRecord;
readRecordDetails();
drawChart();
} else {
mLineChart.clear();
}
}
public void setRecord(RecordBean mRecord) {
this.mRecord = mRecord;
if (mRecord.getDrawChart()) {
readRecordDetails();
drawChart();
} else {
mLineChart.clear();
}
}
private void readRecordDetails() {
String[] arr = mRecord.getSleepDetail().split(" ");
String[] buf;
for (String e : arr) {
buf = e.split(",");
entries.add(new Entry(Integer.parseInt(buf[0]), Float.parseFloat(buf[1])));
}
}
private void drawChart() {
// 创建线性数据集并设置属性
LineDataSet lineDataSet = new LineDataSet(entries, "");
lineDataSet.setColor(mResources.getColor(R.color.Pie_Yellow));
lineDataSet.setLineWidth(1.6f);
lineDataSet.setDrawCircles(false);
lineDataSet.setMode(LineDataSet.Mode.HORIZONTAL_BEZIER);
// 设置线性图数据并绘制
LineData data = new LineData(lineDataSet);
data.setDrawValues(false);
// 设置X轴属性
XAxis xAxis = mLineChart.getXAxis();
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
xAxis.setGranularity(1f);
xAxis.setLabelCount(8, false);
xAxis.setTextColor(Color.WHITE);
xAxis.setDrawGridLines(false);
xAxis.setLabelRotationAngle(0);
xAxis.setValueFormatter(new IAxisValueFormatter() {
@Override
public String getFormattedValue(float value, AxisBase axis) {
int IValue = (int) value;
return String.format(Locale.getDefault(), "%02d:%02d", IValue % 1440 / 60, IValue % 60);
}
});
// 设置左侧Y轴属性
YAxis leftYAxis = mLineChart.getAxisLeft();
leftYAxis.setEnabled(true);
leftYAxis.setDrawGridLines(false);
leftYAxis.setAxisMinimum(0);
leftYAxis.setValueFormatter(new IAxisValueFormatter() {
@Override
public String getFormattedValue(float value, AxisBase axis) {
return "";
}
});
// 设置限制线并添加到左侧Y轴
LimitLine limitLine = new LimitLine(0.37f, "深度睡眠");
limitLine.setLineColor(mResources.getColor(R.color.Pie_Green));
limitLine.setTextColor(mResources.getColor(R.color.Pie_Green));
leftYAxis.addLimitLine(limitLine);
LimitLine limitLine1 = new LimitLine(0.8f, "浅层睡眠");
limitLine1.setLineColor(mResources.getColor(R.color.Pie_Blue));
limitLine1.setTextColor(mResources.getColor(R.color.Pie_Blue));
leftYAxis.addLimitLine(limitLine1);
// 设置图例并绘制线性图
Legend legend = mLineChart.getLegend();
legend.setEnabled(false);
mLineChart.setData(data);
mLineChart.invalidate();
}
}

@ -1,106 +0,0 @@
package com.example.sleep.drawChart;
import android.content.res.Resources;
import android.graphics.Color;
import com.github.mikephil.charting.animation.Easing;
import com.github.mikephil.charting.charts.PieChart;
import com.github.mikephil.charting.components.Legend;
import com.github.mikephil.charting.data.PieData;
import com.github.mikephil.charting.data.PieDataSet;
import com.github.mikephil.charting.data.PieEntry;
import com.github.mikephil.charting.formatter.PercentFormatter;
import com.example.sleep.R;
import com.example.sleep.database.RecordBean;
import java.util.ArrayList;
public class DrawPieChart {
private PieChart mPieChart;
private RecordBean mRecord;
private Resources mResources;
// 构造函数,设置饼状图的一些属性
/**
*
* @param pieChart
* @param mRecord
* @param mResources
*/
public DrawPieChart(PieChart pieChart, RecordBean mRecord, Resources mResources) {
mPieChart = pieChart;
mPieChart.setNoDataText("睡眠时间太短啦!没有足够数据!");
mPieChart.setNoDataTextColor(Color.WHITE);
//画空心饼状图
if (mRecord.getDrawChart()) {
this.mResources = mResources;
this.mRecord = mRecord;
drawChart();
} else {
mPieChart.clear();
}
}
// 设置睡眠记录
public void setRecord(RecordBean mRecord) {
this.mRecord = mRecord;
if (mRecord.getDrawChart()) {
drawChart();
} else {
mPieChart.clear();
}
}
// 绘制饼状图
private void drawChart() {
mPieChart.setCenterText("您的睡眠状态");
mPieChart.setCenterTextColor(Color.WHITE);
mPieChart.setUsePercentValues(true);
mPieChart.getDescription().setEnabled(false);
mPieChart.setExtraOffsets(10, 10, 10, 5);
mPieChart.setDrawCenterText(true);
mPieChart.setDrawHoleEnabled(true);
mPieChart.setTransparentCircleColor(Color.WHITE);
mPieChart.setTransparentCircleAlpha(110);
mPieChart.setHoleRadius(58f);
mPieChart.setHoleColor(Color.TRANSPARENT);
mPieChart.setTransparentCircleRadius(61f);
mPieChart.setRotationAngle(0);
mPieChart.setRotationEnabled(true);
mPieChart.setHighlightPerTapEnabled(false);
// 创建包含睡眠状态数据的 PieEntry 对象列表
ArrayList<PieEntry> entries = new ArrayList<>();
entries.add(new PieEntry(mRecord.getDeepTime(), "深度睡眠"));
entries.add(new PieEntry(mRecord.getSwallowTime(), "浅层睡眠"));
entries.add(new PieEntry(mRecord.getAwakeTime(), "醒/梦"));
// 设置饼状图数据集
PieDataSet dataSet = new PieDataSet(entries, "");
dataSet.setSliceSpace(3f);
dataSet.setSelectionShift(5f);
// 设置图例
mPieChart.setEntryLabelColor(Color.WHITE);
mPieChart.setEntryLabelTextSize(12f);
Legend l = mPieChart.getLegend();
l.setVerticalAlignment(Legend.LegendVerticalAlignment.TOP);
l.setHorizontalAlignment(Legend.LegendHorizontalAlignment.RIGHT);
l.setOrientation(Legend.LegendOrientation.VERTICAL);
l.setDrawInside(false);
l.setXEntrySpace(7f);
l.setYEntrySpace(0f);
l.setYOffset(0f);
l.setTextColor(Color.WHITE);
// 设置颜色
ArrayList<Integer> colors = new ArrayList<>();
colors.add(mResources.getColor(R.color.Pie_Green));
colors.add(mResources.getColor(R.color.Pie_Blue));
colors.add(mResources.getColor(R.color.Pie_Yellow));
dataSet.setColors(colors);
// 设置饼状图数据并进行动画效果的设置
PieData data = new PieData(dataSet);
data.setValueFormatter(new PercentFormatter());
data.setValueTextSize(11f);
data.setValueTextColor(Color.WHITE);
mPieChart.setData(data);
mPieChart.highlightValues(null);
mPieChart.animateY(1400, Easing.EasingOption.EaseInOutQuad);
mPieChart.invalidate();
}
}

@ -1,193 +0,0 @@
package com.example.sleep.drawChart;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;
import java.util.HashMap;
public class SimpleLineChart extends View {
//View 的宽和高
private int mWidth, mHeight;
private int yInterval;
//Y轴字体的大小
private float mYAxisFontSize = 24;
//线的颜色
private int mLineColor = Color.parseColor("#00BCD4");
//线条的宽度
private float mStrokeWidth = 8.0f;
//点的集合
private HashMap<Integer, Double> mPointMap;
//点的半径
private float mPointRadius = 10;
//没有数据的时候的内容
private String mNoDataMsg = "no data";
//X轴的文字
private String[] mXAxis = {"aa"};
//Y轴的文字
private String[] mYAxis = {"bb"};
public SimpleLineChart(Context context) {
this(context, null);
}
public SimpleLineChart(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public SimpleLineChart(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int widthMode = MeasureSpec.getMode(widthMeasureSpec);
int heightMode = MeasureSpec.getMode(heightMeasureSpec);
int widthSize = MeasureSpec.getSize(widthMeasureSpec);
int heightSize = MeasureSpec.getSize(heightMeasureSpec);
if (widthMode == MeasureSpec.EXACTLY) {
mWidth = widthSize;
}else if(widthMode == MeasureSpec.AT_MOST){
throw new IllegalArgumentException("width must be EXACTLY,you should set like android:width=\"200dp\"");
}
if (heightMode == MeasureSpec.EXACTLY) {
mHeight = heightSize;
}else if(widthMeasureSpec == MeasureSpec.AT_MOST){
throw new IllegalArgumentException("height must be EXACTLY,you should set like android:height=\"200dp\"");
}
setMeasuredDimension(mWidth, mHeight);
}
@Override
protected void onDraw(Canvas canvas) {
if(mXAxis.length==0||mYAxis.length==0){
throw new IllegalArgumentException("X or Y items is null");
}
//画坐标线的轴
Paint axisPaint = new Paint();
axisPaint.setTextSize(mYAxisFontSize);
axisPaint.setColor(Color.parseColor("#3F51B5"));
if (mPointMap == null || mPointMap.size() == 0) {
int textLength = (int) axisPaint.measureText(mNoDataMsg);
canvas.drawText(mNoDataMsg, mWidth/2 - textLength/2, mHeight/2, axisPaint);
} else {
//画 Y 轴
//存放每个Y轴的坐标
double[] yPoints = new double[mYAxis.length];
//计算Y轴 每个刻度的间距
yInterval = (int) ((mHeight - mYAxisFontSize - 2) / (mYAxis.length));
//测量Y轴文字的高度 用来画第一个数
Paint.FontMetrics fm = axisPaint.getFontMetrics();
int yItemHeight = (int) Math.ceil(fm.descent - fm.ascent);
for (int i = 0; i < mYAxis.length; i++) {
canvas.drawText(mYAxis[i], 0, mYAxisFontSize + i * yInterval, axisPaint);
yPoints[i] = (int) (mYAxisFontSize + i * yInterval);
}
//画 X 轴
//x轴的刻度集合
int[] xPoints = new int[mXAxis.length];
//计算Y轴开始的原点坐标
int xItemX = (int) axisPaint.measureText(mYAxis[1]);
//X轴偏移量
int xOffset = 50;
//计算x轴 刻度间距
int xInterval = (int) ((mWidth - xOffset) / (mXAxis.length));
//获取X轴刻度Y坐标
int xItemY = (int) (mYAxisFontSize + mYAxis.length * yInterval);
for (int i = 0; i < mXAxis.length; i++) {
canvas.drawText(mXAxis[i], i * xInterval + xItemX + xOffset, xItemY, axisPaint);
xPoints[i] = (int) (i * xInterval + xItemX + axisPaint.measureText(mXAxis[i]) / 2 + xOffset + 10);
// Log.e("wing", xPoints[i] + "");
}
//画点
Paint pointPaint = new Paint();
pointPaint.setColor(mLineColor);
Paint linePaint = new Paint();
linePaint.setColor(mLineColor);
linePaint.setAntiAlias(true);
//设置线条宽度
linePaint.setStrokeWidth(mStrokeWidth);
pointPaint.setStyle(Paint.Style.FILL);
for (int i = 0; i < mXAxis.length; i++) {
if (mPointMap.get(i) == null) {
throw new IllegalArgumentException("PointMap has incomplete data!");
}
//画点
canvas.drawCircle(xPoints[i], (float)(yPoints[5]+(yPoints[0]-yPoints[5])*mPointMap.get(i)), mPointRadius, pointPaint);
if (i > 0) {
canvas.drawLine(xPoints[i - 1], (float)(yPoints[5]+(yPoints[0]-yPoints[5])*mPointMap.get(i - 1)), xPoints[i], (float)(yPoints[5]+(yPoints[0]-yPoints[5])*mPointMap.get(i)), linePaint);
}
}
}
}
/**
* map
* @param data
*/
public void setData(HashMap<Integer,Double> data){
mPointMap = data;
invalidate();
}
/**
* Y
* @param yItem
*/
public void setYItem(String[] yItem){
mYAxis = yItem;
}
/**
* X
* @param xItem
*/
public void setXItem(String[] xItem){
mXAxis = xItem;
}
public void setLineColor(int color){
mLineColor = color;
invalidate();
}
}

@ -1,181 +0,0 @@
package com.example.sleep.service;
import android.app.Service;
import android.content.Intent;
import android.content.res.AssetFileDescriptor;
import android.content.res.AssetManager;
import android.media.MediaPlayer;
import android.os.Binder;
import android.os.IBinder;
import android.widget.TextView;
import android.widget.Toast;
import java.io.IOException;
import java.util.ArrayList;
public class MediaService extends Service implements MediaPlayer.OnPreparedListener {
private static final String TAG = "MediaService";
//初始化MediaPlayer
private MediaPlayer mMediaPlayer;
private MyBinder mBinder = new MyBinder();
//标记当前歌曲的序号
private int currentPosition = 0;
//歌曲路径
private String[] musicPath;
// 用于显示歌曲标题的TextView
private TextView title;
@Override
public void onCreate() {
super.onCreate();
// 初始化音乐路径信息
musicPath = getMusic();
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
// 在服务因异常终止而重新创建时系统将会重新启动该服务并且保留其传递给onStartCommand的最后一个Intent
return START_STICKY;
}
/**
*
*
* @return String[]
*/
public String[] getMusic() {
AssetManager assetManager = getAssets();
String[] tmp_files = null;
try {
tmp_files = assetManager.list("");
} catch (IOException e) {
e.printStackTrace();
}
ArrayList<String> files_array = new ArrayList<>();
if (tmp_files != null) {
for (String str : tmp_files) {
if (str.endsWith(".mp3")) {
// 将以".mp3"结尾的文件名添加到列表中
files_array.add(str);
}
}
}
// 将ArrayList转换为String[]
return files_array.toArray(new String[0]);
}
/**
*
*/
private void changeMusic() {
if (currentPosition < 0) {
currentPosition = musicPath.length - 1;
} else if (currentPosition > musicPath.length - 1) {
currentPosition = 0;
}
if (mMediaPlayer == null) {
mMediaPlayer = new MediaPlayer();
mMediaPlayer.setOnCompletionListener(new CompletionListener());
}
try {
AssetFileDescriptor fd = getAssets().openFd(musicPath[currentPosition]);
// 更新界面显示的歌曲标题
title.setText(musicPath[currentPosition].replace(".mp3", ""));
// 切歌之前先重置,释放掉之前的资源
mMediaPlayer.reset();
// 设置播放源
mMediaPlayer.setDataSource(fd.getFileDescriptor(), fd.getStartOffset(), fd.getLength());
// 开始播放前的准备工作,加载多媒体资源,获取相关信息
mMediaPlayer.prepare();
//开始播放
mMediaPlayer.start();
} catch (IOException e) {
e.printStackTrace();
}
}
private final class CompletionListener implements MediaPlayer.OnCompletionListener {
@Override
public void onCompletion(MediaPlayer mp) {
// 播放完成后自动切换到下一首音乐
++currentPosition;
changeMusic();
}
}
@Override
public IBinder onBind(Intent intent) {
// 返回用于和Activity通信的Binder对象
return mBinder;
}
@Override
public boolean onUnbind(Intent intent) {
return super.onUnbind(intent);
}
@Override
public void onPrepared(MediaPlayer mp) {
try {
// 开始播放
mp.start();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* ActivityBinder
*/
public class MyBinder extends Binder {
// 播放音乐
public void playMusic() {
changeMusic();
}
// 暂停
public void pauseMusic() {
if (mMediaPlayer.isPlaying()) {
mMediaPlayer.pause();
}
}
// 下一首
public void nextMusic() {
if (mMediaPlayer != null && musicPath.length != 0) {
currentPosition += 1;
changeMusic();
} else {
Toast.makeText(getApplicationContext(), "未找到音乐", Toast.LENGTH_SHORT).show();
}
}
// 上一首
public void previousMusic() {
if (mMediaPlayer != null && musicPath.length != 0) {
currentPosition -= 1;
changeMusic();
} else {
Toast.makeText(getApplicationContext(), "未找到音乐", Toast.LENGTH_SHORT).show();
}
}
// 关闭播放器
public void closeMedia() {
if (mMediaPlayer != null) {
mMediaPlayer.stop();
mMediaPlayer.release();
}
}
public void getMusicTitle(TextView musicTitle) {
// 获取用于显示歌曲标题的TextView
title = musicTitle;
}
}
@Override
public void onDestroy() {
super.onDestroy();
}
}

@ -1,66 +0,0 @@
package com.example.sleep.service;
import android.app.Service;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.IBinder;
import android.support.annotation.Nullable;
import com.example.sleep.R;
/**
*
*/
public class PlayerMusicService extends Service {
// 媒体播放器对象
private MediaPlayer mMediaPlayer;
@Nullable
@Override
public IBinder onBind(Intent intent) {
// 返回空,表示不支持绑定操作
return null;
}
@Override
public void onCreate() {
super.onCreate();
// 创建媒体播放器并加载指定音频文件
mMediaPlayer = MediaPlayer.create(getApplicationContext(), R.raw.silent);
// 设置音乐循环播放
mMediaPlayer.setLooping(true);
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
new Thread(new Runnable() {
@Override
public void run() {
// 在新线程中启动音乐播放
startPlayMusic();
}
}).start();
// 当服务被异常杀死后会自动重启并且在重启后会保留传递的Intent
return START_STICKY;
}
private void startPlayMusic() {
if (mMediaPlayer != null) {
// 开始播放音乐
mMediaPlayer.start();
}
}
private void stopPlayMusic() {
if (mMediaPlayer != null) {
// 停止播放音乐
mMediaPlayer.stop();
}
}
@Override
public void onDestroy() {
super.onDestroy();
stopPlayMusic();
}
}

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="3dp"></corners>
<solid android:color="#42000000" />
<solid android:color="#fff"></solid>
</shape>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@android:color/transparent"></solid>
<corners android:radius="25dip"></corners>
<stroke
android:width="1px"
android:color="#ff9c0e"></stroke>
</shape>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"
android:useLevel="false">
<solid android:color="@color/white" />
<size
android:width="20dp"
android:height="20dp" />
</shape>

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"
android:useLevel="false">
<solid android:color="@color/colorPrimary" />
<size
android:width="20dp"
android:height="20dp" />
</shape>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1018 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 908 B

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"
android:useLevel="false">
<solid android:color="@android:color/transparent" />
<stroke
android:width="1dp"
android:color="@color/colorPrimary" />
<size
android:width="20dp"
android:height="20dp" />
</shape>

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"
android:useLevel="false">
<solid android:color="#ffff9c0e" />
<size
android:width="4dp"
android:height="4dp" />
</shape>

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/view_syllabus_active_mark_background" android:state_enabled="true"></item>
<item android:drawable="@drawable/view_syllabus_unactive_mark_background" android:state_enabled="false"></item>
</selector>

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"
android:useLevel="false">
<solid android:color="#cccccc" />
<size
android:width="4dp"
android:height="4dp" />
</shape>

@ -2,19 +2,15 @@
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeColor="#00000000"
android:strokeWidth="1">
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
@ -28,7 +24,7 @@
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeColor="#00000000"
android:strokeWidth="1" />
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 573 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save