pull/4/head
210340082张国昊 2 years ago
parent 6666509e3e
commit 2747cab80b

@ -0,0 +1,37 @@
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);
}
}

@ -0,0 +1,50 @@
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();
}
}

@ -0,0 +1,135 @@
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();
}
}

@ -0,0 +1,41 @@
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);
}
}

@ -0,0 +1,95 @@
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));
}
});
}
}

@ -0,0 +1,55 @@
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();
}
});
}
}

@ -0,0 +1,7 @@
<?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.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

@ -0,0 +1,8 @@
<?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.

After

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

@ -0,0 +1,9 @@
<?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>

@ -0,0 +1,9 @@
<?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.

After

Width:  |  Height:  |  Size: 1018 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

@ -0,0 +1,12 @@
<?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>

@ -0,0 +1,9 @@
<?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>

@ -0,0 +1,5 @@
<?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>

@ -0,0 +1,9 @@
<?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,15 +2,19 @@
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
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">
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">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
@ -24,7 +28,7 @@
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
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>
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" />
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 828 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 711 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<size
android:width="150dp"
android:height="150dp"/>
<corners
android:radius="80dp"/>
<solid
android:color="@color/cyan"/>
</shape>

@ -2,169 +2,169 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillColor="#3DDC84"
android:fillColor="#26A69A"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1023 B

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="#88000042" />
<padding
android:bottom="5dp"
android:left="10dp"
android:right="10dp"
android:top="5dp" />
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@ -0,0 +1,100 @@
<!-- res/layout/activity_login.xml -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/background">
<RelativeLayout
android:id="@+id/layout_titlebar"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:background="#191970">
<Button
android:id="@+id/btn_AfterSleep"
android:layout_width="71dp"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:background="#191970"
android:drawableLeft="@drawable/arrow_back"
android:drawablePadding="6dp"
android:ellipsize="end"
android:gravity="center"
android:paddingLeft="5dp"
android:singleLine="true"
android:text="返回"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@color/colorWhite"
android:textSize="18sp" />
<TextView
android:id="@+id/text_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:ellipsize="marquee"
android:gravity="center_horizontal|center"
android:singleLine="true"
android:text="睡眠助手"
android:textAlignment="center"
android:textColor="#fff"
android:textSize="20dp" />
</RelativeLayout>
<EditText
android:padding="16dp"
android:layout_below="@id/layout_titlebar"
android:id="@+id/usernameEditText"
android:layout_width="match_parent"
android:textColorHint="@color/transparent_gray"
android:layout_height="wrap_content"
android:hint="Username"
android:textColor="#fff"
android:layout_marginTop="16dp"
android:layout_centerHorizontal="true"
android:textSize="18sp"/>
<EditText
android:padding="16dp"
android:id="@+id/passwordEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password"
android:textColor="#fff"
android:textColorHint="@color/transparent_gray"
android:layout_below="@+id/usernameEditText"
android:layout_marginTop="8dp"
android:layout_centerHorizontal="true"
android:inputType="textPassword"
android:textSize="18sp"/>
<Button
android:layout_margin="16dp"
android:id="@+id/loginButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="登陆"
android:layout_below="@+id/passwordEditText"
android:layout_marginTop="16dp"
android:textSize="18sp"/>
<Button
android:layout_margin="16dp"
android:id="@+id/registerButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="注册"
android:layout_below="@+id/loginButton"
android:layout_marginTop="16dp"
android:textSize="18sp"/>
</RelativeLayout>

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/background">
<RelativeLayout
android:id="@+id/layout_titlebar"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="#191970">
<Button
android:id="@+id/btn_AfterSleep"
android:layout_width="71dp"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:background="#191970"
android:drawableLeft="@drawable/arrow_back"
android:drawablePadding="6dp"
android:ellipsize="end"
android:gravity="center"
android:paddingLeft="5dp"
android:singleLine="true"
android:text="返回"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@color/colorWhite"
android:textSize="18sp" />
<TextView
android:id="@+id/text_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:ellipsize="marquee"
android:gravity="center_horizontal|center"
android:singleLine="true"
android:text="睡眠助手"
android:textAlignment="center"
android:textColor="#ffffffff"
android:textSize="20dp" />
</RelativeLayout>
<android.support.v4.view.ViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_below="@id/layout_titlebar"
android:layout_above="@+id/tabLayout" />
<android.support.design.widget.TabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" />
</RelativeLayout>

@ -0,0 +1,102 @@
<!-- res/layout/activity_login.xml -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/background">
<RelativeLayout
android:id="@+id/layout_titlebar"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:background="#191970">
<Button
android:id="@+id/btn_AfterSleep"
android:layout_width="71dp"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:background="#191970"
android:drawableLeft="@drawable/arrow_back"
android:drawablePadding="6dp"
android:ellipsize="end"
android:gravity="center"
android:paddingLeft="5dp"
android:singleLine="true"
android:text="返回"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@color/colorWhite"
android:textSize="18sp" />
<TextView
android:id="@+id/text_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:ellipsize="marquee"
android:gravity="center_horizontal|center"
android:singleLine="true"
android:text="睡眠助手"
android:textAlignment="center"
android:textColor="#ffffffff"
android:textSize="20dp" />
</RelativeLayout>
<EditText
android:padding="16dp"
android:layout_below="@id/layout_titlebar"
android:id="@+id/usernameEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Username"
android:textColor="#fff"
android:textColorHint="@color/transparent_gray"
android:layout_marginTop="16dp"
android:layout_centerHorizontal="true"
android:textSize="18sp"/>
<EditText
android:padding="16dp"
android:textColorHint="@color/transparent_gray"
android:id="@+id/passwordEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password"
android:textColor="#fff"
android:layout_below="@+id/usernameEditText"
android:layout_marginTop="8dp"
android:layout_centerHorizontal="true"
android:inputType="textPassword"
android:textSize="18sp"/>
<Button
android:padding="16dp"
android:id="@+id/loginButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="登陆"
android:visibility="gone"
android:layout_below="@+id/passwordEditText"
android:layout_marginTop="16dp"
android:textSize="18sp"/>
<Button
android:layout_margin="16dp"
android:id="@+id/registerButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="注册"
android:layout_below="@+id/loginButton"
android:layout_marginTop="16dp"
android:textSize="18sp"/>
</RelativeLayout>

@ -0,0 +1,172 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/aftersleep_background"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/layout_titlebar"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:background="#191970">
<Button
android:id="@+id/btn_AfterSleep"
android:layout_width="71dp"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:background="#191970"
android:drawableLeft="@drawable/arrow_back"
android:drawablePadding="6dp"
android:ellipsize="end"
android:gravity="center"
android:paddingLeft="5dp"
android:singleLine="true"
android:text="返回"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@color/colorWhite"
android:textSize="18sp" />
<ImageView
android:id="@+id/report"
android:layout_width="48dp"
android:layout_height="32dp"
android:layout_alignParentEnd="true"
android:src="@drawable/record_0"
android:layout_centerInParent="true"
android:layout_marginRight="10dp"
/>
<TextView
android:id="@+id/text_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:ellipsize="marquee"
android:gravity="center_horizontal|center"
android:singleLine="true"
android:text="睡眠结果"
android:textAlignment="center"
android:textColor="#ffffffff"
android:textSize="20dp" />
</RelativeLayout>
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="515dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginTop="52dp">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:orientation="vertical">
<TextView
android:id="@+id/startTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/mPiechart"
android:layout_alignParentBottom="true"
android:layout_marginStart="16dp"
android:layout_marginTop="32dp"
android:text="睡觉 00:00"
android:textColor="@android:color/darker_gray"
android:textSize="18sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/mPiechart" />
<TextView
android:id="@+id/stopTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/startTime"
android:layout_alignEnd="@+id/mPiechart"
android:layout_marginTop="32dp"
android:layout_marginEnd="16dp"
android:text="起床 00:00"
android:textColor="@android:color/darker_gray"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/mPiechart" />
<TextView
android:id="@+id/sleepTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginStart="32dp"
android:layout_marginTop="24dp"
android:layout_toEndOf="@+id/deep"
android:text="时长00:00"
android:textColor="@color/colorWhite"
android:textSize="18sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/startTime" />
<TextView
android:id="@+id/deep"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:layout_marginEnd="28dp"
android:text="深度睡眠00:00"
android:textColor="@color/colorWhite"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/stopTime" />
<TextView
android:id="@+id/swallow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="浅层睡眠00:00"
android:textColor="@color/colorWhite"
android:textSize="18sp"
app:layout_constraintStart_toStartOf="@+id/sleepTime"
app:layout_constraintTop_toBottomOf="@+id/sleepTime" />
<TextView
android:id="@+id/dream"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="醒/梦00:00"
android:textColor="@color/colorWhite"
android:textSize="18sp"
app:layout_constraintStart_toStartOf="@+id/deep"
app:layout_constraintTop_toBottomOf="@+id/deep" />
<com.github.mikephil.charting.charts.PieChart
android:id="@+id/mPiechart"
android:layout_width="300dp"
android:layout_height="300dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_marginStart="8dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</ScrollView>
</RelativeLayout>

@ -0,0 +1,196 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/background"
tools:context="com.example.sleep.CalendarPage">
<TextView
android:id="@+id/show_month_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="28dp"
android:textColor="@android:color/white"
android:textSize="22sp"
app:layout_constraintEnd_toStartOf="@+id/right"
app:layout_constraintHorizontal_bias="0.68"
app:layout_constraintStart_toEndOf="@+id/left"
app:layout_constraintTop_toBottomOf="@+id/layout_titlebar" />
<TextView
android:id="@+id/show_year_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="28dp"
android:layout_marginEnd="8dp"
android:textColor="@android:color/white"
android:textSize="22sp"
app:layout_constraintEnd_toStartOf="@+id/show_month_view"
app:layout_constraintTop_toBottomOf="@+id/layout_titlebar" />
<RelativeLayout
android:id="@+id/layout_titlebar"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="#191970"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/text_title"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:ellipsize="marquee"
android:gravity="center_horizontal|center"
android:singleLine="true"
android:text="睡眠记录"
android:textAlignment="center"
android:textColor="#ffffffff"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/btn_Remind"
android:layout_width="71dp"
android:layout_height="match_parent"
android:layout_alignEnd="@+id/text_title"
android:layout_alignParentTop="true"
android:layout_marginTop="0dp"
android:layout_marginEnd="0dp"
android:background="#191970"
android:drawablePadding="6dp"
android:ellipsize="end"
android:gravity="center"
android:onClick="onClickRemind"
android:singleLine="true"
android:text="提醒"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@color/colorWhite"
android:textSize="18sp" />
</RelativeLayout>
<Button
android:id="@+id/left"
android:layout_width="21dp"
android:layout_height="34dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="32dp"
android:layout_marginTop="80dp"
android:background="@drawable/arrows_left"
android:onClick="ClickLeft"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/right"
android:layout_width="21dp"
android:layout_height="34dp"
android:layout_alignTop="@+id/left"
android:layout_alignParentEnd="true"
android:layout_marginTop="80dp"
android:layout_marginEnd="32dp"
android:background="@drawable/arrows_right"
android:onClick="ClickRight"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<android.support.constraint.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="match_parent"
android:layout_height="52dp"
app:layout_constraintBottom_toBottomOf="parent"
tools:layout_editor_absoluteX="0dp">
<Button
android:id="@+id/text_home_1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:background="#191970"
android:drawableTop="@drawable/sleep_0"
android:drawablePadding="2dp"
android:ellipsize="end"
android:gravity="center"
android:onClick="ClickSleep"
android:paddingTop="5dp"
android:singleLine="true"
android:text="睡觉"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@color/colorWhite"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/text_record_1"
app:layout_constraintStart_toStartOf="parent" />
<Button
android:id="@+id/text_record_1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:background="#191970"
android:drawableTop="@drawable/record_1"
android:drawablePadding="2dp"
android:ellipsize="end"
android:gravity="center"
android:paddingTop="5dp"
android:singleLine="true"
android:text="记录"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@color/colorWhite"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/text_home_1" />
</android.support.constraint.ConstraintLayout>
<android.support.design.widget.CoordinatorLayout
android:id="@+id/content"
android:layout_width="wrap_content"
android:layout_height="300dp"
android:layout_marginStart="8dp"
android:layout_marginTop="36dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:layout_weight="1"
app:layout_constraintBottom_toTopOf="@+id/constraintLayout"
app:layout_constraintEnd_toStartOf="@+id/right"
app:layout_constraintStart_toEndOf="@+id/left"
app:layout_constraintTop_toBottomOf="@+id/layout_titlebar"
app:layout_constraintVertical_bias="0.419">
<com.ldf.calendar.view.MonthPager
android:id="@+id/calendar_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent" />
<android.support.v7.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="#c2c2c2"
app:layout_behavior="com.ldf.calendar.behavior.RecyclerViewBehavior" />
</android.support.design.widget.CoordinatorLayout>
</android.support.constraint.ConstraintLayout>

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
app:layout_constraintTop_toTopOf="parent">
<com.ldf.calendar.view.MonthPager
android:id="@+id/calendar_view"
android:layout_width="match_parent"
android:layout_height="300dp"
android:background="#fff"
app:layout_anchor="@+id/list"
app:layout_anchorGravity="top|center" />
<android.support.v7.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="#c2c2c2"
app:layout_behavior="com.ldf.calendar.behavior.RecyclerViewBehavior" />
</android.support.design.widget.CoordinatorLayout>
</android.support.constraint.ConstraintLayout>

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="120dp"
android:layout_height="120dp"
android:text="0"
android:textSize="60sp"
android:gravity="center"
android:background="@drawable/circlecyan"
android:layout_alignParentRight="true"
android:elevation="7dp"
android:shadowDy="1.0"
android:id="@+id/grade"/>
<LinearLayout
android:id="@+id/upper"
android:layout_width="match_parent"
android:layout_height="212dp"
android:layout_marginTop="30dp"
android:orientation="vertical"
android:background="@drawable/rect"
android:elevation="5dp">
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="您的近期睡眠综合评分:"
android:gravity="center_vertical"
android:textSize="18sp"
android:textColor="@color/white"
android:id="@+id/recentGrade"/>
<TextView
android:layout_marginTop="18dp"
android:layout_marginBottom="8dp"
android:padding="3dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="眠眠助手的建议:"
android:textSize="18sp"
android:textColor="@color/white"
android:id="@+id/suggest"/>
</LinearLayout>
</RelativeLayout>
<com.example.sleep.drawChart.SimpleLineChart
android:id="@+id/simpleLineChart"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginTop="40dp"
android:elevation="5dp"
android:layout_below="@+id/grade"
android:background="@drawable/rect"/>
</LinearLayout>

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="51.4dp"
android:layout_height="45dp"
android:orientation="vertical">
<View
android:id="@+id/today_background"
android:layout_width="33dp"
android:layout_height="33dp"
android:layout_centerInParent="true"
android:background="@drawable/today_background"
android:visibility="gone" />
<View
android:id="@+id/selected_background"
android:layout_width="33dp"
android:layout_height="33dp"
android:layout_centerInParent="true"
android:background="@drawable/selected_background"
android:visibility="gone" />
<TextView
android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="17"
android:textColor="#3666a2" />
<ImageView
android:id="@+id/maker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="8dp"
android:background="@drawable/view_syllabus_mark_background"
android:visibility="visible" />
</RelativeLayout>

@ -0,0 +1,17 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:gravity="center"
app:layout_goneMarginBottom="15dp"
android:orientation="vertical">
<TextView
android:id="@+id/tab_text"
android:textColor="#000"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:text="Person"/>
</LinearLayout>

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/background">
<RelativeLayout
android:visibility="gone"
android:id="@+id/layout_titlebar"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="#191970">
<Button
android:id="@+id/btn_AfterSleep"
android:layout_width="71dp"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:background="#191970"
android:drawableLeft="@drawable/arrow_back"
android:drawablePadding="6dp"
android:ellipsize="end"
android:gravity="center"
android:paddingLeft="5dp"
android:singleLine="true"
android:text="返回"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@color/colorWhite"
android:textSize="18sp" />
<TextView
android:id="@+id/text_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:ellipsize="marquee"
android:gravity="center_horizontal|center"
android:singleLine="true"
android:text="睡眠助手"
android:textAlignment="center"
android:textColor="#ffffffff"
android:textSize="20dp" />
</RelativeLayout>
<TextView
android:layout_below="@id/layout_titlebar"
android:id="@+id/text2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_marginTop="20dp"
android:ellipsize="marquee"
android:gravity="center_horizontal|center"
android:singleLine="true"
android:text="请上传图片发表动态"
android:textAlignment="center"
android:textColor="#ffffffff"
android:textSize="20dp" />
<ImageView
android:layout_marginRight="10dp"
android:layout_alignParentRight="true"
android:layout_below="@id/layout_titlebar"
android:id="@+id/event_image"
android:layout_width="wrap_content"
android:layout_marginTop="20dp"
android:layout_height="wrap_content"
android:src="@mipmap/default_image_up" />
<android.support.v7.widget.RecyclerView
android:id="@+id/rl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/event_image"
android:layout_marginTop="30dp"/>
</RelativeLayout>

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/background">
<RelativeLayout
android:visibility="visible"
android:id="@+id/layout_titlebar"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="#191970">
<Button
android:id="@+id/btn_AfterSleep"
android:layout_width="71dp"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:background="#191970"
android:drawableLeft="@drawable/arrow_back"
android:drawablePadding="6dp"
android:ellipsize="end"
android:gravity="center"
android:paddingLeft="5dp"
android:singleLine="true"
android:text="返回"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@color/colorWhite"
android:textSize="18sp" />
<TextView
android:id="@+id/text_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:ellipsize="marquee"
android:gravity="center_horizontal|center"
android:singleLine="true"
android:text="睡眠助手"
android:textAlignment="center"
android:textColor="#ffffffff"
android:textSize="20dp" />
</RelativeLayout>
<ImageView
android:layout_marginRight="10dp"
android:layout_alignParentRight="true"
android:layout_below="@id/layout_titlebar"
android:id="@+id/event_image"
android:layout_width="match_parent"
android:layout_marginTop="20dp"
android:layout_height="200dp"
android:src="@mipmap/default_image_upload" />
<LinearLayout
android:visibility="visible"
android:id="@+id/edit_content_ll"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_alignParentBottom="true"
android:orientation="vertical">
<EditText
android:id="@+id/event_content"
android:textSize="15sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<ImageView
android:layout_gravity="right"
android:src="@drawable/post_bar"
android:id="@+id/event_content_post"
android:layout_width="48dp"
android:layout_height="48dp" />
</LinearLayout>
</RelativeLayout>

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- 文章标题 -->
<TextView
android:id="@+id/textViewTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="18sp"
android:textStyle="bold"
android:padding="8dp"
android:textColor="@android:color/white"/>
<!-- 文章图片 -->
<ImageView
android:id="@+id/imageViewArticleImage"
android:layout_width="match_parent"
android:layout_height="250dp"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:layout_margin="8dp"/>
</LinearLayout>

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/article_rl"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</android.support.constraint.ConstraintLayout>

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<Button
android:id="@+id/btn_take_photo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="拍摄"
android:layout_marginBottom="8dp" />
<Button
android:id="@+id/btn_choose_from_gallery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="从相册中选择"
android:layout_marginBottom="8dp" />
<Button
android:id="@+id/btn_cancel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="取消" />
</LinearLayout>

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/background">
<Button
android:id="@+id/btn_start"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="@drawable/start"
android:fontFamily="sans-serif"
android:text="开始解梦"
android:textColor="@color/colorWhite"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
/>
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"/>
<ImageView
android:id="@+id/image_dream"
android:layout_width="wrap_content"
android:layout_marginTop="15dp"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:src="@drawable/dream"/>
<EditText
app:layout_constraintTop_toBottomOf="@id/image_dream"
android:padding="16dp"
android:id="@+id/dream_title"
android:layout_width="match_parent"
android:textColorHint="@color/transparent_gray"
android:layout_height="wrap_content"
android:hint="输入梦境"
android:textColor="#fff"
android:layout_marginTop="16dp"
android:layout_centerHorizontal="true"
android:textSize="18sp"/>
<TextView
app:layout_constraintTop_toBottomOf="@id/dream_title"
android:padding="16dp"
android:id="@+id/dream_des"
android:layout_width="match_parent"
android:textColorHint="@color/transparent_gray"
android:layout_height="wrap_content"
android:textColor="#fff"
android:layout_marginTop="16dp"
android:textSize="12sp"/>
</android.support.constraint.ConstraintLayout>

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/background">
<Button
android:id="@+id/btn_start"
android:layout_width="180dp"
android:layout_height="180dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="48dp"
android:background="@drawable/start"
android:fontFamily="sans-serif"
android:text="开始记录"
android:textColor="@color/colorWhite"
android:textSize="24sp"
app:layout_constraintBottom_toTopOf="@+id/constraintLayout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.497"
app:layout_constraintStart_toStartOf="parent" />
<Button
android:layout_marginTop="20dp"
android:id="@+id/timeBtn"
android:layout_width="fill_parent"
android:layout_height="50dp"
app:layout_constraintTop_toBottomOf="@id/imageText"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:text="0000"
android:textColor="#ffffff"
android:background="@drawable/bg"
android:textSize="26sp" />
<ImageView
android:id="@+id/imageText"
android:layout_width="240dp"
android:layout_height="240dp"
android:layout_above="@+id/btn_start"
android:layout_centerHorizontal="true"
android:layout_marginTop="32dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<android.support.constraint.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="match_parent"
android:layout_height="52dp"
app:layout_constraintBottom_toBottomOf="parent">
</android.support.constraint.ConstraintLayout>
</android.support.constraint.ConstraintLayout>

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/cv_item"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#e7e7e7">
<TextView
android:id="@+id/text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
<View
android:layout_width="match_parent"
android:layout_height="0.67dp"
android:layout_alignParentBottom="true"
android:background="@android:color/white" />
</RelativeLayout>

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_marginEnd="16dp"
android:src="@mipmap/ic_launcher" />
<TextView
android:layout_marginTop="15dp"
android:id="@+id/textView"
android:textSize="25sp"
android:textColor="#fff"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sample Text" />
</LinearLayout>

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<RelativeLayout
android:id="@+id/rlTimeline"
android:layout_width="65dp"
android:layout_height="match_parent">
<TextView
android:id="@+id/TopLine"
android:layout_width="2dp"
android:layout_height="30dp"
android:layout_centerHorizontal="true"
android:background="#999" />
<ImageView
android:id="@+id/Dot"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_below="@id/TopLine"
android:layout_centerHorizontal="true"
android:background="@drawable/timeline_dot" />
<TextView
android:layout_width="2dp"
android:layout_height="match_parent"
android:layout_below="@id/Dot"
android:layout_centerHorizontal="true"
android:background="#999" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rlCenter"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="6dp"
android:paddingRight="10dp"
android:paddingBottom="6dp">
<TextView
android:id="@+id/Date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginTop="12dp"
android:text="2014/06/24 20:55:28"
android:textColor="@color/silver"
android:textSize="18sp" />
<TextView
android:id="@+id/Time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/Date"
android:layout_marginTop="5dp"
android:text="时间"
android:textColor="@color/colorWhite"
android:textSize="18sp" />
</RelativeLayout>
</LinearLayout>

@ -0,0 +1,218 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/background">
<RelativeLayout
android:id="@+id/layout_titlebar"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:background="#191970">
<TextView
android:id="@+id/text_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginTop="0dp"
android:ellipsize="marquee"
android:gravity="center_horizontal|center"
android:singleLine="true"
android:text="详细记录"
android:textAlignment="center"
android:textColor="#ffffffff"
android:textSize="20dp" />
<Button
android:id="@+id/btn_RecordDetails"
android:layout_width="71dp"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:background="#191970"
android:drawableLeft="@drawable/arrow_back"
android:drawablePadding="6dp"
android:ellipsize="end"
android:gravity="center"
android:onClick="ClickBackDetails"
android:paddingLeft="5dp"
android:singleLine="true"
android:text="返回"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@color/colorWhite"
android:textSize="18sp" />
</RelativeLayout>
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginTop="52dp">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:orientation="vertical">
<TextView
android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:text="1月1日"
android:textColor="@color/colorWhite"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/left"
android:layout_width="21dp"
android:layout_height="34dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="28dp"
android:layout_marginTop="12dp"
android:background="@drawable/arrows_left"
android:onClick="ClickLeft"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/right"
android:layout_width="21dp"
android:layout_height="34dp"
android:layout_alignTop="@+id/left"
android:layout_alignParentEnd="true"
android:layout_marginTop="12dp"
android:layout_marginEnd="28dp"
android:background="@drawable/arrows_right"
android:onClick="ClickRight"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/startTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/mPiechart"
android:layout_alignParentBottom="true"
android:layout_marginStart="16dp"
android:layout_marginTop="32dp"
android:text="睡觉 00:00"
android:textColor="@android:color/darker_gray"
android:textSize="18sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/lineChart" />
<TextView
android:id="@+id/stopTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/startTime"
android:layout_alignEnd="@+id/mPiechart"
android:layout_marginTop="32dp"
android:layout_marginEnd="16dp"
android:text="起床 00:00"
android:textColor="@android:color/darker_gray"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/lineChart" />
<TextView
android:id="@+id/sleepTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginStart="32dp"
android:layout_marginTop="24dp"
android:layout_toEndOf="@+id/deep"
android:text="时长00:00"
android:textColor="@color/colorWhite"
android:textSize="18sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/startTime" />
<TextView
android:id="@+id/deep"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:layout_marginEnd="32dp"
android:text="深度睡眠00:00"
android:textColor="@color/colorWhite"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/stopTime" />
<TextView
android:id="@+id/swallow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="浅层睡眠00:00"
android:textColor="@color/colorWhite"
android:textSize="18sp"
app:layout_constraintStart_toStartOf="@+id/sleepTime"
app:layout_constraintTop_toBottomOf="@+id/sleepTime" />
<TextView
android:id="@+id/dream"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="醒/梦00:00"
android:textColor="@color/colorWhite"
android:textSize="18sp"
app:layout_constraintStart_toStartOf="@+id/deep"
app:layout_constraintTop_toBottomOf="@+id/deep" />
<com.github.mikephil.charting.charts.LineChart
android:id="@+id/lineChart"
android:layout_width="327dp"
android:layout_height="222dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_marginStart="8dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/date" />
<com.github.mikephil.charting.charts.PieChart
android:id="@+id/mPiechart"
android:layout_width="300dp"
android:layout_height="300dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_marginStart="8dp"
android:layout_marginTop="180dp"
android:layout_marginEnd="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/lineChart" />
</android.support.constraint.ConstraintLayout>
</ScrollView>
</RelativeLayout>

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/background"
tools:context="com.example.sleep.Record">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/layout_titlebar"
app:layout_constraintVertical_bias="0.0">
<android.support.v7.widget.RecyclerView
android:id="@+id/timelList"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/layout_titlebar"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="#191970"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Button
android:id="@+id/btn_Records"
android:layout_width="71dp"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:background="#191970"
android:drawableLeft="@drawable/arrow_back"
android:drawablePadding="6dp"
android:ellipsize="end"
android:gravity="center"
android:onClick="ClickBack"
android:paddingLeft="5dp"
android:singleLine="true"
android:text="返回"
android:textAlignment="center"
android:textAllCaps="false"
android:textColor="@color/colorWhite"
android:textSize="18sp" />
<TextView
android:id="@+id/text_title"
android:layout_width="match_parent"
android:layout_height="52dp"
android:gravity="center_horizontal|center"
android:text="睡眠记录"
android:textColor="#ffffffff"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</RelativeLayout>
</android.support.constraint.ConstraintLayout>

@ -0,0 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/sleep_background"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/mRunTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="80dp"
android:fontFamily="sans-serif"
android:text=""
android:textColor="@android:color/darker_gray"
android:textSize="70sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<Button
android:id="@+id/btn_stop"
android:layout_width="180dp"
android:layout_height="180dp"
android:layout_below="@+id/textView"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp"
android:background="@drawable/stop"
android:onClick="onRunningClick2"
android:text="@string/stop_record"
android:textColor="@color/colorWhite"
android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/mRunTime"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp"
android:text="@string/recording"
android:textColor="@color/rightRight"
android:textSize="20sp"
app:layout_constraintBottom_toTopOf="@+id/btn_stop"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/mRunTime" />
<TextView
android:id="@+id/musicName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/play"
android:layout_centerHorizontal="true"
android:layout_marginBottom="24dp"
android:text=""
android:textColor="@color/rightRight"
android:textSize="20sp" />
<Button
android:id="@+id/play"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="60dp"
android:background="@drawable/ic_play_btn_play"
android:onClick="onClickMedia"
android:text=""
android:textAlignment="viewStart" />
<Button
android:id="@+id/next"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_alignTop="@+id/play"
android:layout_marginStart="36dp"
android:layout_marginTop="0dp"
android:layout_toEndOf="@+id/play"
android:background="@drawable/ic_play_btn_next"
android:onClick="onClickMedia"
android:text="" />
<Button
android:id="@+id/previous"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_alignTop="@+id/play"
android:layout_marginTop="0dp"
android:layout_marginEnd="36dp"
android:layout_toStartOf="@+id/play"
android:background="@drawable/ic_play_btn_prev"
android:onClick="onClickMedia"
android:text="" />
</RelativeLayout>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/splash"
android:orientation="vertical">
</LinearLayout>

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

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

Loading…
Cancel
Save