Merge branch 'master' of https://github.com/wangtianrui/OldPeopleHome
7
android/OldPeopleHome/.idea/kotlinc.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="KotlinCommonCompilerArguments">
|
||||
<option name="apiVersion" value="1.2" />
|
||||
<option name="languageVersion" value="1.2" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -49,4 +49,12 @@ dependencies {
|
||||
|
||||
//indicator
|
||||
implementation 'com.ryanjeffreybrooks:indefinitepagerindicator:1.0.10'
|
||||
|
||||
//drawer
|
||||
implementation 'com.mxn.soul:flowingdrawer-core:2.1.0'
|
||||
implementation 'com.nineoldandroids:library:2.4.0'
|
||||
|
||||
//SDK
|
||||
implementation(name: 'android-smartband-sdk-sxrblejy2library-release', ext: 'aar')
|
||||
implementation(name: 'android-smartband-sdk-sxrblejy2aidl-release', ext: 'aar')
|
||||
}
|
||||
|
||||
@@ -2,12 +2,43 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.scorpiomiku.oldpeoplehome">
|
||||
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_PRIVILEGED" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_SMS" />
|
||||
<uses-permission android:name="android.permission.READ_SMS" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
|
||||
<!-- 调用相机权限 -->
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
|
||||
<uses-feature android:name="android.hardware.camera" />
|
||||
<uses-feature android:name="android.hardware.camera.autofocus" />
|
||||
<uses-feature android:name="android.hardware.microphone" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CALL_LOG" />
|
||||
|
||||
<!-- 获取运营商信息,用于支持提供运营商信息相关的接口 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<!-- 这个权限用于获取wifi的获取权限,wifi信息会用来进行网络定位 -->
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
|
||||
<!-- 用于读取手机当前的状态 -->
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<!-- 写入扩展存储,向扩展卡写入数据,用于写入离线定位数据 -->
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<!-- 访问网络,网络定位需要上网 -->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<!-- SD卡读取权限,用户写入离线定位数据 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.bluetooth_le"
|
||||
android:required="true" />
|
||||
|
||||
<application
|
||||
android:name=".OldPeopleHome"
|
||||
android:allowBackup="true"
|
||||
@@ -16,6 +47,15 @@
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<service
|
||||
android:name="com.scorpiomiku.oldpeoplehome.service.SampleBleService"
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
android:process="com.scorpiomiku.oldpeoplehome.service.SampleBleService">
|
||||
<intent-filter>
|
||||
<action android:name="com.sxr.sdk.ble.BluetoothLeService.SampleBleService" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<activity android:name=".modules.loginregister.LoginActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
@@ -24,6 +64,7 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name=".modules.oldpeople.activity.OldPeopleMainActivity" />
|
||||
<activity android:name=".modules.children.activity.ChildMainActivity" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
6
android/OldPeopleHome/app/src/main/assets/JySDK.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sdk>
|
||||
<vid>000001001101</vid>
|
||||
<appid>HUNEPX60P3KIDYH</appid>
|
||||
<secret>b8FXJMzfELLOTM6BgGsFXmieePgqx1Ya50gPEUur</secret>
|
||||
</sdk>
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.scorpiomiku.oldpeoplehome.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.scorpiomiku.oldpeoplehome.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by ScorpioMiku on 2019/8/21.
|
||||
*/
|
||||
|
||||
public class PeopleSpinnerAdapter extends BaseAdapter {
|
||||
private Context context;
|
||||
private List<String> people;
|
||||
|
||||
public PeopleSpinnerAdapter(Context context, List<String> people) {
|
||||
this.context = context;
|
||||
this.people = people;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return people.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int i) {
|
||||
return people.get(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
@SuppressLint("ViewHolder")
|
||||
@Override
|
||||
public View getView(int i, View view, ViewGroup viewGroup) {
|
||||
view = LayoutInflater.from(context).inflate(R.layout.child_main_spinner_item, null);
|
||||
if (view != null) {
|
||||
ImageView avatar = view.findViewById(R.id.spinner_avatar);
|
||||
TextView name = view.findViewById(R.id.spinner_name);
|
||||
name.setText(people.get(i));
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -10,6 +10,8 @@ import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
|
||||
|
||||
import com.scorpiomiku.oldpeoplehome.modules.loginregister.LoginActivity;
|
||||
|
||||
import butterknife.ButterKnife;
|
||||
|
||||
/**
|
||||
@@ -52,7 +54,8 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.CALL_PHONE,
|
||||
Manifest.permission.CAMERA,
|
||||
Manifest.permission.SEND_SMS
|
||||
Manifest.permission.SEND_SMS,
|
||||
Manifest.permission.ACCESS_COARSE_LOCATION
|
||||
},
|
||||
1);
|
||||
}
|
||||
|
||||
@@ -48,5 +48,9 @@ public abstract class BaseFragment extends Fragment {
|
||||
return myView;
|
||||
}
|
||||
|
||||
public void refreshUi() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.scorpiomiku.oldpeoplehome.bean;
|
||||
|
||||
public class BleDeviceItem {
|
||||
private String bleDeviceName;
|
||||
private String bleDeviceAddress;
|
||||
private String nickname;
|
||||
private String bindedDate;
|
||||
private int rssi;
|
||||
private String type;
|
||||
|
||||
public BleDeviceItem() {
|
||||
}
|
||||
|
||||
public BleDeviceItem(String deviceName, String deviceAddress, String nickname, String bindedDate, int rssi, String type) {
|
||||
setBleDeviceName(deviceName);
|
||||
setBleDeviceAddress(deviceAddress);
|
||||
setNickname(nickname);
|
||||
setBindedDate(bindedDate);
|
||||
setRssi(rssi);
|
||||
setType(type);
|
||||
}
|
||||
|
||||
public String getBleDeviceName() {
|
||||
return bleDeviceName;
|
||||
}
|
||||
|
||||
public void setBleDeviceName(String bleDeviceName) {
|
||||
this.bleDeviceName = bleDeviceName;
|
||||
}
|
||||
|
||||
public String getBleDeviceAddress() {
|
||||
return bleDeviceAddress;
|
||||
}
|
||||
|
||||
public void setBleDeviceAddress(String bleDeviceAddress) {
|
||||
this.bleDeviceAddress = bleDeviceAddress;
|
||||
}
|
||||
|
||||
public int getRssi() {
|
||||
return rssi;
|
||||
}
|
||||
|
||||
public void setRssi(int rssi) {
|
||||
this.rssi = rssi;
|
||||
}
|
||||
|
||||
public String getNickname() {
|
||||
return nickname;
|
||||
}
|
||||
|
||||
public void setNickname(String nickname) {
|
||||
this.nickname = nickname;
|
||||
}
|
||||
|
||||
public String getBindedDate() {
|
||||
return bindedDate;
|
||||
}
|
||||
|
||||
public void setBindedDate(String bindedDate) {
|
||||
this.bindedDate = bindedDate;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BleDeviceItem{" +
|
||||
"bleDeviceName='" + bleDeviceName + '\'' +
|
||||
", bleDeviceAddress='" + bleDeviceAddress + '\'' +
|
||||
", nickname='" + nickname + '\'' +
|
||||
", bindedDate='" + bindedDate + '\'' +
|
||||
", rssi=" + rssi +
|
||||
", type='" + type + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.scorpiomiku.oldpeoplehome.bean;
|
||||
|
||||
/**
|
||||
* Created by ScorpioMiku on 2019/8/23.
|
||||
*/
|
||||
|
||||
public class SportData {
|
||||
|
||||
private String oldPeopleId;
|
||||
private int type;
|
||||
private String time;
|
||||
private int step;
|
||||
private int distance;
|
||||
private int cal;
|
||||
private int cursleeptime;
|
||||
private int totalrunningtime;
|
||||
private int steptime;
|
||||
|
||||
public SportData(int type, String time, int step, int distance, int cal, int cursleeptime,
|
||||
int totalrunningtime, int steptime, String oldPeopleId) {
|
||||
this.type = type;
|
||||
this.time = time;
|
||||
this.step = step;
|
||||
this.distance = distance;
|
||||
this.cal = cal;
|
||||
this.cursleeptime = cursleeptime;
|
||||
this.totalrunningtime = totalrunningtime;
|
||||
this.steptime = steptime;
|
||||
this.oldPeopleId = oldPeopleId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SportData{" +
|
||||
"oldPeopleId='" + oldPeopleId + '\'' +
|
||||
", type=" + type +
|
||||
", time='" + time + '\'' +
|
||||
", step=" + step +
|
||||
", distance=" + distance +
|
||||
", cal=" + cal +
|
||||
", cursleeptime=" + cursleeptime +
|
||||
", totalrunningtime=" + totalrunningtime +
|
||||
", steptime=" + steptime +
|
||||
'}';
|
||||
}
|
||||
|
||||
public String getOldPeopleId() {
|
||||
return oldPeopleId;
|
||||
}
|
||||
|
||||
public void setOldPeopleId(String oldPeopleId) {
|
||||
this.oldPeopleId = oldPeopleId;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(String time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public int getStep() {
|
||||
return step;
|
||||
}
|
||||
|
||||
public void setStep(int step) {
|
||||
this.step = step;
|
||||
}
|
||||
|
||||
public int getDistance() {
|
||||
return distance;
|
||||
}
|
||||
|
||||
public void setDistance(int distance) {
|
||||
this.distance = distance;
|
||||
}
|
||||
|
||||
public int getCal() {
|
||||
return cal;
|
||||
}
|
||||
|
||||
public void setCal(int cal) {
|
||||
this.cal = cal;
|
||||
}
|
||||
|
||||
public int getCursleeptime() {
|
||||
return cursleeptime;
|
||||
}
|
||||
|
||||
public void setCursleeptime(int cursleeptime) {
|
||||
this.cursleeptime = cursleeptime;
|
||||
}
|
||||
|
||||
public int getTotalrunningtime() {
|
||||
return totalrunningtime;
|
||||
}
|
||||
|
||||
public void setTotalrunningtime(int totalrunningtime) {
|
||||
this.totalrunningtime = totalrunningtime;
|
||||
}
|
||||
|
||||
public int getSteptime() {
|
||||
return steptime;
|
||||
}
|
||||
|
||||
public void setSteptime(int steptime) {
|
||||
this.steptime = steptime;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,193 @@
|
||||
package com.scorpiomiku.oldpeoplehome.modules.children.activity;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.design.widget.BottomNavigationView;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.Spinner;
|
||||
|
||||
import com.mxn.soul.flowingdrawer_core.FlowingDrawer;
|
||||
import com.mxn.soul.flowingdrawer_core.FlowingMenuLayout;
|
||||
import com.scorpiomiku.oldpeoplehome.R;
|
||||
import com.scorpiomiku.oldpeoplehome.adapter.PeopleSpinnerAdapter;
|
||||
import com.scorpiomiku.oldpeoplehome.base.BaseActivity;
|
||||
import com.scorpiomiku.oldpeoplehome.base.BaseFragment;
|
||||
import com.scorpiomiku.oldpeoplehome.modules.children.fragment.EnvironmentFragment;
|
||||
import com.scorpiomiku.oldpeoplehome.modules.children.fragment.HeartRateFragment;
|
||||
import com.scorpiomiku.oldpeoplehome.modules.children.fragment.MapFragment;
|
||||
import com.scorpiomiku.oldpeoplehome.modules.children.fragment.SleepFragment;
|
||||
import com.scorpiomiku.oldpeoplehome.modules.children.fragment.StepFragment;
|
||||
import com.scorpiomiku.oldpeoplehome.utils.StatusBarUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.OnClick;
|
||||
|
||||
/**
|
||||
* Created by ScorpioMiku on 2019/8/21.
|
||||
*/
|
||||
|
||||
public class ChildMainActivity extends BaseActivity {
|
||||
@BindView(R.id.spinner)
|
||||
Spinner spinner;
|
||||
@BindView(R.id.container)
|
||||
RelativeLayout container;
|
||||
@BindView(R.id.navigation)
|
||||
BottomNavigationView navigation;
|
||||
@BindView(R.id.tool_bar)
|
||||
LinearLayout toolBar;
|
||||
@BindView(R.id.avatar)
|
||||
ImageView avatar;
|
||||
@BindView(R.id.menu_layout)
|
||||
FlowingMenuLayout menuLayout;
|
||||
@BindView(R.id.drawerlayout)
|
||||
FlowingDrawer drawerlayout;
|
||||
private BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener;
|
||||
private FragmentManager fragmentManager;
|
||||
private BaseFragment[] fragments = {
|
||||
new StepFragment(),
|
||||
new SleepFragment(),
|
||||
new HeartRateFragment(),
|
||||
new EnvironmentFragment(),
|
||||
new MapFragment()
|
||||
};
|
||||
private int[] barColors = {
|
||||
R.color.step_bg,
|
||||
R.color.sleep_bg,
|
||||
R.color.heart_rate_bg,
|
||||
R.color.environment_bg,
|
||||
R.color.informaiton_bg
|
||||
};
|
||||
private int[] toolBarColors = {
|
||||
Color.rgb(236, 128, 96),
|
||||
Color.rgb(61, 78, 202),
|
||||
Color.rgb(214, 63, 156),
|
||||
Color.rgb(47, 182, 137),
|
||||
Color.rgb(63, 81, 181),
|
||||
};
|
||||
|
||||
@Override
|
||||
protected Handler initHandle() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void iniview() {
|
||||
fragmentManager = getSupportFragmentManager();
|
||||
mOnNavigationItemSelectedListener = new BottomNavigationView.OnNavigationItemSelectedListener() {
|
||||
|
||||
@Override
|
||||
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.navigation_step:
|
||||
changeFragment(0);
|
||||
return true;
|
||||
case R.id.navigation_sleep:
|
||||
changeFragment(1);
|
||||
return true;
|
||||
case R.id.navigation_heart_rate:
|
||||
changeFragment(2);
|
||||
return true;
|
||||
case R.id.navigation_environmental:
|
||||
changeFragment(3);
|
||||
return true;
|
||||
case R.id.navigation_map:
|
||||
changeFragment(4);
|
||||
return true;
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
navigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);
|
||||
initFragmentManager();
|
||||
initToolbar();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.activity_child_main;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refreshData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
// TODO: add setContentView(...) invocation
|
||||
ButterKnife.bind(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化fragment管理器
|
||||
*/
|
||||
private void initFragmentManager() {
|
||||
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
|
||||
fragmentTransaction.add(R.id.container, fragments[0]);
|
||||
fragmentTransaction.add(R.id.container, fragments[1]);
|
||||
fragmentTransaction.add(R.id.container, fragments[2]);
|
||||
fragmentTransaction.add(R.id.container, fragments[3]);
|
||||
fragmentTransaction.add(R.id.container, fragments[4]);
|
||||
|
||||
fragmentTransaction.hide(fragments[1]);
|
||||
fragmentTransaction.hide(fragments[2]);
|
||||
fragmentTransaction.hide(fragments[3]);
|
||||
fragmentTransaction.hide(fragments[4]);
|
||||
fragmentTransaction.commit();
|
||||
StatusBarUtils.setWindowStatusBarColor(this, barColors[0]);
|
||||
spinner.setBackgroundColor(toolBarColors[0]);
|
||||
toolBar.setBackgroundColor(toolBarColors[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改fragment
|
||||
*
|
||||
* @param index
|
||||
*/
|
||||
private void changeFragment(int index) {
|
||||
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
|
||||
for (int i = 0; i < fragments.length; i++) {
|
||||
if (i == index) {
|
||||
fragmentTransaction.show(fragments[i]);
|
||||
StatusBarUtils.setWindowStatusBarColor(this, barColors[i]);
|
||||
spinner.setBackgroundColor(toolBarColors[i]);
|
||||
toolBar.setBackgroundColor(toolBarColors[i]);
|
||||
} else {
|
||||
fragmentTransaction.hide(fragments[i]);
|
||||
}
|
||||
}
|
||||
fragmentTransaction.commit();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 初始化Toolbar
|
||||
*/
|
||||
private void initToolbar() {
|
||||
ArrayList<String> oldPeopleList = new ArrayList<>();
|
||||
oldPeopleList.add("Joy");
|
||||
oldPeopleList.add("Tom");
|
||||
oldPeopleList.add("Jony");
|
||||
oldPeopleList.add("Wang");
|
||||
PeopleSpinnerAdapter adapter
|
||||
= new PeopleSpinnerAdapter(getApplication(), oldPeopleList);
|
||||
spinner.setAdapter(adapter);
|
||||
}
|
||||
|
||||
@OnClick(R.id.avatar)
|
||||
public void onViewClicked() {
|
||||
drawerlayout.openMenu();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.scorpiomiku.oldpeoplehome.modules.children.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.github.mikephil.charting.charts.LineChart;
|
||||
import com.github.mikephil.charting.data.Entry;
|
||||
import com.scorpiomiku.oldpeoplehome.R;
|
||||
import com.scorpiomiku.oldpeoplehome.base.BaseFragment;
|
||||
import com.scorpiomiku.oldpeoplehome.utils.ChartUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
|
||||
/**
|
||||
* Created by ScorpioMiku on 2019/8/18.
|
||||
*/
|
||||
|
||||
public class EnvironmentFragment extends BaseFragment {
|
||||
@BindView(R.id.temperature_text)
|
||||
TextView temperatureText;
|
||||
@BindView(R.id.humidity_text)
|
||||
TextView humidityText;
|
||||
@BindView(R.id.temperature_chart)
|
||||
LineChart temperatureChart;
|
||||
@BindView(R.id.humidity_chart)
|
||||
LineChart humidityChart;
|
||||
Unbinder unbinder;
|
||||
|
||||
@Override
|
||||
protected Handler initHandle() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_child_environment;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void refreshData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
initChart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
// TODO: inflate a fragment view
|
||||
View rootView = super.onCreateView(inflater, container, savedInstanceState);
|
||||
unbinder = ButterKnife.bind(this, rootView);
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
unbinder.unbind();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化Chart
|
||||
*/
|
||||
private void initChart() {
|
||||
ArrayList<Entry> temperatureValues = new ArrayList<>();
|
||||
float[] temperature = {20f, 90f, 60f, 88f};
|
||||
temperatureValues.add(new Entry(0, 0));
|
||||
for (int i = 0; i < temperature.length; i++) {
|
||||
temperatureValues.add(new Entry(i + 1, temperature[i]));
|
||||
}
|
||||
ChartUtils.initSingleLineChart(temperatureChart, temperatureValues, "近15天平均温度", 0xFF01B67A);
|
||||
|
||||
|
||||
ArrayList<Entry> humidityValues = new ArrayList<>();
|
||||
float[] levels = {20f, 90f, 60f, 88f};
|
||||
humidityValues.add(new Entry(0, 0));
|
||||
for (int i = 0; i < levels.length; i++) {
|
||||
humidityValues.add(new Entry(i + 1, levels[i]));
|
||||
}
|
||||
ChartUtils.initSingleLineChart(humidityChart, humidityValues, "近15天平均湿度", 0xFF01B67A);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.scorpiomiku.oldpeoplehome.modules.children.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.github.mikephil.charting.charts.LineChart;
|
||||
import com.github.mikephil.charting.data.Entry;
|
||||
import com.scorpiomiku.oldpeoplehome.R;
|
||||
import com.scorpiomiku.oldpeoplehome.base.BaseFragment;
|
||||
import com.scorpiomiku.oldpeoplehome.utils.ChartUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import me.itangqi.waveloadingview.WaveLoadingView;
|
||||
|
||||
/**
|
||||
* Created by ScorpioMiku on 2019/8/18.
|
||||
*/
|
||||
|
||||
public class HeartRateFragment extends BaseFragment {
|
||||
@BindView(R.id.waveLoadingView)
|
||||
WaveLoadingView waveLoadingView;
|
||||
@BindView(R.id.heart_rate_text)
|
||||
TextView heartRateText;
|
||||
@BindView(R.id.begin)
|
||||
TextView begin;
|
||||
@BindView(R.id.chart)
|
||||
LineChart chart;
|
||||
Unbinder unbinder;
|
||||
|
||||
@Override
|
||||
protected Handler initHandle() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_child_heart_rate;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void refreshData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
initChart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
// TODO: inflate a fragment view
|
||||
View rootView = super.onCreateView(inflater, container, savedInstanceState);
|
||||
unbinder = ButterKnife.bind(this, rootView);
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
unbinder.unbind();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化折线图
|
||||
*/
|
||||
private void initChart() {
|
||||
ArrayList<Entry> pointValues = new ArrayList<>();
|
||||
int i;
|
||||
float[] levels = {20f, 90f, 60f, 88f, 100f};
|
||||
pointValues.add(new Entry(0, 0));
|
||||
for (i = 0; i < levels.length; i++) {
|
||||
pointValues.add(new Entry(i + 1, levels[i]));
|
||||
}
|
||||
ChartUtils.initSingleLineChart(chart, pointValues, "近15天平均心率", 0xFFF56EC0);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.scorpiomiku.oldpeoplehome.modules.children.fragment;
|
||||
|
||||
import android.os.Handler;
|
||||
|
||||
import com.scorpiomiku.oldpeoplehome.R;
|
||||
import com.scorpiomiku.oldpeoplehome.base.BaseFragment;
|
||||
|
||||
/**
|
||||
* Created by ScorpioMiku on 2019/8/21.
|
||||
*/
|
||||
|
||||
public class MapFragment extends BaseFragment {
|
||||
@Override
|
||||
protected Handler initHandle() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_child_map;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void refreshData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.scorpiomiku.oldpeoplehome.modules.children.fragment;
|
||||
|
||||
import android.os.Handler;
|
||||
|
||||
import com.scorpiomiku.oldpeoplehome.R;
|
||||
import com.scorpiomiku.oldpeoplehome.base.BaseFragment;
|
||||
|
||||
/**
|
||||
* Created by ScorpioMiku on 2019/8/18.
|
||||
*/
|
||||
|
||||
public class MyInformationFragment extends BaseFragment {
|
||||
@Override
|
||||
protected Handler initHandle() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_child_my;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void refreshData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
package com.scorpiomiku.oldpeoplehome.modules.children.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentPagerAdapter;
|
||||
import android.support.v4.view.ViewPager;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.rbrooks.indefinitepagerindicator.IndefinitePagerIndicator;
|
||||
import com.scorpiomiku.oldpeoplehome.R;
|
||||
import com.scorpiomiku.oldpeoplehome.base.BaseFragment;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import me.itangqi.waveloadingview.WaveLoadingView;
|
||||
|
||||
/**
|
||||
* Created by ScorpioMiku on 2019/8/18.
|
||||
*/
|
||||
|
||||
public class SleepFragment extends BaseFragment {
|
||||
@BindView(R.id.waveLoadingView)
|
||||
WaveLoadingView waveLoadingView;
|
||||
@BindView(R.id.sleep_text)
|
||||
TextView sleepText;
|
||||
|
||||
Unbinder unbinder;
|
||||
@BindView(R.id.viewpager_pager_indicator)
|
||||
IndefinitePagerIndicator viewpagerPagerIndicator;
|
||||
@BindView(R.id.view_pager)
|
||||
ViewPager viewPager;
|
||||
|
||||
@Override
|
||||
protected Handler initHandle() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_child_sleep;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void refreshData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
// initPie();
|
||||
initViewPager();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
// TODO: inflate a fragment view
|
||||
View rootView = super.onCreateView(inflater, container, savedInstanceState);
|
||||
unbinder = ButterKnife.bind(this, rootView);
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
unbinder.unbind();
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制饼图
|
||||
*/
|
||||
// private void initPie() {
|
||||
// List<PieEntry> strings = new ArrayList<>();
|
||||
// strings.add(new PieEntry(30f, "深度睡眠"));
|
||||
// strings.add(new PieEntry(70f, "浅度睡眠"));
|
||||
//
|
||||
// PieDataSet dataSet = new PieDataSet(strings, "");
|
||||
//
|
||||
// ArrayList<Integer> colors = new ArrayList<Integer>();
|
||||
// colors.add(getResources().getColor(R.color.sleep_deep));
|
||||
// colors.add(getResources().getColor(R.color.sleep_shallow));
|
||||
// dataSet.setColors(colors);
|
||||
// dataSet.setValueTextSize(16f);
|
||||
// PieData pieData = new PieData(dataSet);
|
||||
// pieData.setDrawValues(true);
|
||||
// pieData.setValueFormatter(new PercentFormatter());
|
||||
// pieData.setValueTextSize(16f);
|
||||
// pieData.setValueTextColor(getResources().getColor(R.color.place_holder));
|
||||
//
|
||||
//
|
||||
// sleepPie.setData(pieData);
|
||||
// sleepPie.invalidate();
|
||||
//
|
||||
// Description description = new Description();
|
||||
// description.setText("");
|
||||
// sleepPie.setDescription(description);
|
||||
// sleepPie.setHoleRadius(0f);
|
||||
// sleepPie.setTransparentCircleRadius(0f);
|
||||
// Legend legend = sleepPie.getLegend();
|
||||
// legend.setEnabled(false);
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* 初始化Viewpager
|
||||
*/
|
||||
private void initViewPager() {
|
||||
FragmentManager fragmentManager = getFragmentManager();
|
||||
viewPager.setAdapter(new FragmentPagerAdapter(fragmentManager) {
|
||||
@Override
|
||||
public Fragment getItem(int i) {
|
||||
return new SleepViewPagerItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return 10;
|
||||
}
|
||||
});
|
||||
viewpagerPagerIndicator.attachToViewPager(viewPager);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.scorpiomiku.oldpeoplehome.modules.children.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.github.mikephil.charting.charts.PieChart;
|
||||
import com.github.mikephil.charting.components.Description;
|
||||
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.scorpiomiku.oldpeoplehome.R;
|
||||
import com.scorpiomiku.oldpeoplehome.base.BaseFragment;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
|
||||
/**
|
||||
* Created by ScorpioMiku on 2019/8/20.
|
||||
*/
|
||||
|
||||
public class SleepViewPagerItem extends BaseFragment {
|
||||
@BindView(R.id.pie_chart)
|
||||
PieChart sleepPie;
|
||||
Unbinder unbinder;
|
||||
|
||||
@Override
|
||||
protected Handler initHandle() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_sleep_item;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void refreshData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
initPie();
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
// TODO: inflate a fragment view
|
||||
View rootView = super.onCreateView(inflater, container, savedInstanceState);
|
||||
unbinder = ButterKnife.bind(this, rootView);
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
unbinder.unbind();
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制饼图
|
||||
*/
|
||||
private void initPie() {
|
||||
List<PieEntry> strings = new ArrayList<>();
|
||||
strings.add(new PieEntry(30f, "深度睡眠"));
|
||||
strings.add(new PieEntry(70f, "浅度睡眠"));
|
||||
|
||||
PieDataSet dataSet = new PieDataSet(strings, "");
|
||||
|
||||
ArrayList<Integer> colors = new ArrayList<Integer>();
|
||||
colors.add(getResources().getColor(R.color.sleep_deep));
|
||||
colors.add(getResources().getColor(R.color.sleep_shallow));
|
||||
dataSet.setColors(colors);
|
||||
dataSet.setValueTextSize(12f);
|
||||
PieData pieData = new PieData(dataSet);
|
||||
pieData.setDrawValues(true);
|
||||
pieData.setValueFormatter(new PercentFormatter());
|
||||
pieData.setValueTextSize(12f);
|
||||
pieData.setValueTextColor(getResources().getColor(R.color.place_holder));
|
||||
|
||||
|
||||
sleepPie.setData(pieData);
|
||||
sleepPie.invalidate();
|
||||
|
||||
Description description = new Description();
|
||||
description.setText("");
|
||||
sleepPie.setDescription(description);
|
||||
sleepPie.setHoleRadius(0f);
|
||||
sleepPie.setTransparentCircleRadius(0f);
|
||||
Legend legend = sleepPie.getLegend();
|
||||
legend.setEnabled(false);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.scorpiomiku.oldpeoplehome.modules.children.fragment;
|
||||
|
||||
import android.os.Handler;
|
||||
|
||||
import com.scorpiomiku.oldpeoplehome.R;
|
||||
import com.scorpiomiku.oldpeoplehome.base.BaseFragment;
|
||||
|
||||
/**
|
||||
* Created by ScorpioMiku on 2019/8/18.
|
||||
*/
|
||||
|
||||
public class StepFragment extends BaseFragment {
|
||||
@Override
|
||||
protected Handler initHandle() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_child_step;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void refreshData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.scorpiomiku.oldpeoplehome.modules.loginregister;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.v4.app.ActivityCompat;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
@@ -11,6 +15,7 @@ import android.widget.TextView;
|
||||
|
||||
import com.scorpiomiku.oldpeoplehome.R;
|
||||
import com.scorpiomiku.oldpeoplehome.base.BaseActivity;
|
||||
import com.scorpiomiku.oldpeoplehome.modules.children.activity.ChildMainActivity;
|
||||
import com.scorpiomiku.oldpeoplehome.modules.oldpeople.activity.OldPeopleMainActivity;
|
||||
|
||||
import butterknife.BindView;
|
||||
@@ -38,7 +43,7 @@ public class LoginActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void iniview() {
|
||||
|
||||
checkPermission();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -70,4 +75,6 @@ public class LoginActivity extends BaseActivity {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,30 +1,48 @@
|
||||
package com.scorpiomiku.oldpeoplehome.modules.oldpeople.activity;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.design.widget.BottomNavigationView;
|
||||
import android.support.v4.app.ActivityCompat;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import com.scorpiomiku.oldpeoplehome.R;
|
||||
import com.scorpiomiku.oldpeoplehome.base.BaseActivity;
|
||||
import com.scorpiomiku.oldpeoplehome.base.BaseFragment;
|
||||
import com.scorpiomiku.oldpeoplehome.bean.BleDeviceItem;
|
||||
import com.scorpiomiku.oldpeoplehome.bean.SportData;
|
||||
import com.scorpiomiku.oldpeoplehome.modules.oldpeople.fragmemt.EnvironmentFragment;
|
||||
import com.scorpiomiku.oldpeoplehome.modules.oldpeople.fragmemt.HeartRateFragment;
|
||||
import com.scorpiomiku.oldpeoplehome.modules.oldpeople.fragmemt.MyInformationFragment;
|
||||
import com.scorpiomiku.oldpeoplehome.modules.oldpeople.fragmemt.SleepFragment;
|
||||
import com.scorpiomiku.oldpeoplehome.modules.oldpeople.fragmemt.StepFragment;
|
||||
import com.scorpiomiku.oldpeoplehome.service.SampleBleService;
|
||||
import com.scorpiomiku.oldpeoplehome.utils.ComparatorBleDeviceItem;
|
||||
import com.scorpiomiku.oldpeoplehome.utils.LogUtils;
|
||||
import com.scorpiomiku.oldpeoplehome.utils.StatusBarUtils;
|
||||
import com.sxr.sdk.ble.keepfit.aidl.IRemoteService;
|
||||
import com.sxr.sdk.ble.keepfit.aidl.IServiceCallback;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.Locale;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.OnClick;
|
||||
|
||||
/**
|
||||
* Created by ScorpioMiku on 2019/8/18.
|
||||
@@ -35,7 +53,8 @@ public class OldPeopleMainActivity extends BaseActivity {
|
||||
RelativeLayout container;
|
||||
@BindView(R.id.navigation)
|
||||
BottomNavigationView navigation;
|
||||
|
||||
@BindView(R.id.floating_button)
|
||||
FloatingActionButton floatingButton;
|
||||
private BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener;
|
||||
private FragmentManager fragmentManager;
|
||||
private BaseFragment[] fragments = {
|
||||
@@ -50,7 +69,7 @@ public class OldPeopleMainActivity extends BaseActivity {
|
||||
R.color.sleep_bg,
|
||||
R.color.heart_rate_bg,
|
||||
R.color.environment_bg,
|
||||
R.color.colorPrimaryDark
|
||||
R.color.informaiton_bg
|
||||
};
|
||||
|
||||
@Override
|
||||
@@ -87,7 +106,7 @@ public class OldPeopleMainActivity extends BaseActivity {
|
||||
};
|
||||
navigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);
|
||||
initFragmentManager();
|
||||
checkPermission();
|
||||
initBlueSDK();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -133,6 +152,11 @@ public class OldPeopleMainActivity extends BaseActivity {
|
||||
*/
|
||||
private void changeFragment(int index) {
|
||||
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
|
||||
if (index == 4) {
|
||||
floatingButton.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
floatingButton.setVisibility(View.VISIBLE);
|
||||
}
|
||||
for (int i = 0; i < fragments.length; i++) {
|
||||
if (i == index) {
|
||||
fragmentTransaction.show(fragments[i]);
|
||||
@@ -145,4 +169,418 @@ public class OldPeopleMainActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
|
||||
//-------------blue
|
||||
private IRemoteService mService;
|
||||
private ArrayList<BleDeviceItem> nearbyItemList = new ArrayList<>();
|
||||
private ServiceConnection mServiceConnection;
|
||||
private String mac;
|
||||
private boolean bStart = false;
|
||||
private String pathLog = "/jyClient/log/";
|
||||
private boolean bSave = true;
|
||||
private IServiceCallback mServiceCallback = new IServiceCallback.Stub() {
|
||||
@Override
|
||||
public void onAuthSdkResult(int i) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScanCallback(String deviceName, String deviceMacAddress, int rssi) throws RemoteException {
|
||||
// LogUtils.logd("扫描ing");
|
||||
Iterator<BleDeviceItem> iter = nearbyItemList.iterator();
|
||||
BleDeviceItem item = null;
|
||||
boolean bExist = false;
|
||||
while (iter.hasNext()) {
|
||||
item = iter.next();
|
||||
if (item.getBleDeviceAddress().equalsIgnoreCase(deviceMacAddress)) {
|
||||
bExist = true;
|
||||
item.setRssi(rssi);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!bExist) {
|
||||
item = new BleDeviceItem(deviceName, deviceMacAddress, "", "", rssi, "");
|
||||
nearbyItemList.add(item);
|
||||
Collections.sort(nearbyItemList, new ComparatorBleDeviceItem());
|
||||
LogUtils.logList(nearbyItemList);
|
||||
if (item.getBleDeviceName().equals("Y1-4389")) {
|
||||
callRemoteDisconnect();
|
||||
mac = item.getBleDeviceAddress();
|
||||
callRemoteConnect(item.getBleDeviceName(), item.getBleDeviceAddress());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectStateChanged(int state) throws RemoteException {
|
||||
if (state == 2) {
|
||||
LogUtils.logd("连接手环成功");
|
||||
getNewHandData();
|
||||
} else {
|
||||
LogUtils.loge("断开连接:" + state);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAuthDeviceResult(int i) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetDeviceTime(int i, String s) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetDeviceTime(int i) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetUserInfo(int i) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetCurSportData(int type, long timestamp, int step, int distance,
|
||||
int cal, int cursleeptime, int totalrunningtime, int steptime) throws RemoteException {
|
||||
Date date = new Date(timestamp * 1000);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
|
||||
String time = sdf.format(date);
|
||||
SportData sportData =
|
||||
new SportData(type, time, step, distance, cal, cursleeptime, totalrunningtime, steptime, "123");
|
||||
LogUtils.logd("获得新运动数据:" + sportData.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSendVibrationSignal(int i) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetPhontMode(int i) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetIdleTime(int i) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetSleepTime(int i) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetDeviceBatery(int i, int i1) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetDeviceInfo(int i, String s, String s1, String s2, int i1) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetAlarm(int i) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetDeviceMode(int i) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetNotify(int i) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetSenserData(int i, long l, int i1, int i2) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAutoHeartMode(int i) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetDeviceInfo(int i) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetHourFormat(int i) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetDataByDay(int i, long l, int i1, int i2) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetDataByDayEnd(int i, long l) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetDeviceAction(int i) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetBandFunction(int i, boolean[] booleans) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetLanguage(int i) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSendWeather(int i) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetAntiLost(int i) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetBloodPressureMode(int i) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceiveSensorData(int i, int i1, int i2, int i3, int i4) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetMultipleSportData(int i, String s, int i1, int i2) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetGoalStep(int i) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetDeviceHeartRateArea(int i) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSensorStateChange(int i, int i1) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReadCurrentSportData(int i, String s, int i1, int i2) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetOtaInfo(boolean b, String s, String s1) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetOtaUpdate(int i, int i1) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetDeviceCode(int i) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetDeviceCode(byte[] bytes) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCharacteristicChanged(String s, byte[] bytes) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCharacteristicWrite(String s, byte[] bytes, int i) throws RemoteException {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* SDK的绑定、扫描、蓝牙的选择
|
||||
*/
|
||||
private void initBlueSDK() {
|
||||
Intent gattServiceIntent = new Intent(this,
|
||||
SampleBleService.class);
|
||||
gattServiceIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startService(gattServiceIntent);
|
||||
mServiceConnection = new ServiceConnection() {
|
||||
@Override
|
||||
public void onServiceConnected(ComponentName componentName, IBinder service) {
|
||||
LogUtils.shortToast("Service connected");
|
||||
|
||||
mService = IRemoteService.Stub.asInterface(service);
|
||||
try {
|
||||
mService.registerCallback(mServiceCallback);
|
||||
mService.openSDKLog(bSave, pathLog, "blue.log");
|
||||
boolean isConnected = callRemoteIsConnected();
|
||||
|
||||
callRemoteScanDevice();
|
||||
if (!isConnected) {
|
||||
|
||||
} else {
|
||||
|
||||
int authrize = callRemoteIsAuthrize();
|
||||
LogUtils.logd("authrize:" + authrize);
|
||||
}
|
||||
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServiceDisconnected(ComponentName componentName) {
|
||||
LogUtils.loge("Service disconnected");
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 自动绑定服务
|
||||
*/
|
||||
Intent intent = new Intent(IRemoteService.class.getName());
|
||||
intent.setClassName("com.scorpiomiku.oldpeoplehome",
|
||||
"com.scorpiomiku.oldpeoplehome.service.SampleBleService");
|
||||
bindService(intent, mServiceConnection, BIND_AUTO_CREATE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否连接SDK成功
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean callRemoteIsConnected() {
|
||||
boolean isConnected = false;
|
||||
if (mService != null) {
|
||||
try {
|
||||
isConnected = mService.isConnectBt();
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
LogUtils.shortToast("Remote call error!");
|
||||
}
|
||||
} else {
|
||||
LogUtils.shortToast("Service is not available yet!");
|
||||
}
|
||||
|
||||
return isConnected;
|
||||
}
|
||||
|
||||
/**
|
||||
* 确定权限
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private int callRemoteIsAuthrize() {
|
||||
int isAuthrize = 0;
|
||||
if (mService != null) {
|
||||
try {
|
||||
isAuthrize = mService.isAuthrize();
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
LogUtils.shortToast("Remote call error!");
|
||||
}
|
||||
} else {
|
||||
LogUtils.shortToast("Service is not available yet!");
|
||||
}
|
||||
|
||||
return isAuthrize;
|
||||
}
|
||||
|
||||
/**
|
||||
* 扫描蓝牙设备,自动进入回调 onScanCallback
|
||||
*/
|
||||
private void callRemoteScanDevice() {
|
||||
// LogUtils.logd("开始扫描");
|
||||
if (nearbyItemList != null)
|
||||
nearbyItemList.clear();
|
||||
|
||||
if (mService != null) {
|
||||
try {
|
||||
bStart = !bStart;
|
||||
mService.scanDevice(bStart);
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
LogUtils.shortToast("Remote call error!");
|
||||
}
|
||||
} else {
|
||||
LogUtils.loge("scan:Service is not available yet!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除当前连接的设备
|
||||
*/
|
||||
private void callRemoteDisconnect() {
|
||||
|
||||
if (mService != null) {
|
||||
try {
|
||||
mService.disconnectBt(true);
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
LogUtils.logd("callRemoteDisconnect: Remote call error!");
|
||||
}
|
||||
} else {
|
||||
LogUtils.logd("callRemoteDisconnect: Service is not available yet!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 连接设备
|
||||
*
|
||||
* @param name
|
||||
* @param mac
|
||||
*/
|
||||
private void callRemoteConnect(String name, String mac) {
|
||||
if (mac == null || mac.length() == 0) {
|
||||
LogUtils.logd("callRemoteConnect: ble device mac address is not correctly!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (mService != null) {
|
||||
try {
|
||||
mService.connectBt(name, mac);
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
LogUtils.loge("callRemoteConnect: Remote call error!");
|
||||
}
|
||||
} else {
|
||||
LogUtils.loge("callRemoteConnect: Service is not available yet!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 主动获取数据函数
|
||||
*/
|
||||
private void getNewHandData() {
|
||||
try {
|
||||
mService.getCurSportData();
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@OnClick(R.id.floating_button)
|
||||
public void onViewClicked() {
|
||||
getNewHandData();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,39 @@
|
||||
package com.scorpiomiku.oldpeoplehome.modules.oldpeople.fragmemt;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.github.mikephil.charting.charts.LineChart;
|
||||
import com.github.mikephil.charting.data.Entry;
|
||||
import com.scorpiomiku.oldpeoplehome.R;
|
||||
import com.scorpiomiku.oldpeoplehome.base.BaseFragment;
|
||||
import com.scorpiomiku.oldpeoplehome.utils.ChartUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
|
||||
/**
|
||||
* Created by ScorpioMiku on 2019/8/18.
|
||||
*/
|
||||
|
||||
public class EnvironmentFragment extends BaseFragment {
|
||||
@BindView(R.id.temperature_text)
|
||||
TextView temperatureText;
|
||||
@BindView(R.id.humidity_text)
|
||||
TextView humidityText;
|
||||
@BindView(R.id.temperature_chart)
|
||||
LineChart temperatureChart;
|
||||
@BindView(R.id.humidity_chart)
|
||||
LineChart humidityChart;
|
||||
Unbinder unbinder;
|
||||
|
||||
@Override
|
||||
protected Handler initHandle() {
|
||||
return null;
|
||||
@@ -27,6 +51,42 @@ public class EnvironmentFragment extends BaseFragment {
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
initChart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
// TODO: inflate a fragment view
|
||||
View rootView = super.onCreateView(inflater, container, savedInstanceState);
|
||||
unbinder = ButterKnife.bind(this, rootView);
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
unbinder.unbind();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化Chart
|
||||
*/
|
||||
private void initChart() {
|
||||
ArrayList<Entry> temperatureValues = new ArrayList<>();
|
||||
float[] temperature = {20f, 90f, 60f, 88f};
|
||||
temperatureValues.add(new Entry(0, 0));
|
||||
for (int i = 0; i < temperature.length; i++) {
|
||||
temperatureValues.add(new Entry(i + 1, temperature[i]));
|
||||
}
|
||||
ChartUtils.initSingleLineChart(temperatureChart, temperatureValues, "近15天平均温度", 0xFF01B67A);
|
||||
|
||||
|
||||
ArrayList<Entry> humidityValues = new ArrayList<>();
|
||||
float[] levels = {20f, 90f, 60f, 88f};
|
||||
humidityValues.add(new Entry(0, 0));
|
||||
for (int i = 0; i < levels.length; i++) {
|
||||
humidityValues.add(new Entry(i + 1, levels[i]));
|
||||
}
|
||||
ChartUtils.initSingleLineChart(humidityChart, humidityValues, "近15天平均湿度", 0xFF01B67A);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,16 +75,13 @@ public class HeartRateFragment extends BaseFragment {
|
||||
*/
|
||||
private void initChart() {
|
||||
ArrayList<Entry> pointValues = new ArrayList<>();
|
||||
pointValues.add(new Entry(0, 100));
|
||||
ArrayList<Float> data = new ArrayList<>();
|
||||
int i;
|
||||
float[] levels = {2f, 90f, 60f, 88f};
|
||||
for (i = 1; i <= levels.length - 1; i++) {
|
||||
pointValues.add(new Entry(i, Float.valueOf(levels[i])));
|
||||
data.add(Float.valueOf(levels[i]));
|
||||
float[] levels = {20f, 90f, 60f, 88f, 100f};
|
||||
pointValues.add(new Entry(0, 0));
|
||||
for (i = 0; i < levels.length; i++) {
|
||||
pointValues.add(new Entry(i + 1, levels[i]));
|
||||
}
|
||||
pointValues.add(new Entry(i, 0));
|
||||
ChartUtils.initSingleLineChart(chart, pointValues, "心率统计图");
|
||||
ChartUtils.initSingleLineChart(chart, pointValues, "近15天平均心率", 0xFFF56EC0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,15 +1,54 @@
|
||||
package com.scorpiomiku.oldpeoplehome.modules.oldpeople.fragmemt;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.scorpiomiku.oldpeoplehome.R;
|
||||
import com.scorpiomiku.oldpeoplehome.base.BaseFragment;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import me.itangqi.waveloadingview.WaveLoadingView;
|
||||
import me.zhouzhuo.zzhorizontalprogressbar.ZzHorizontalProgressBar;
|
||||
|
||||
/**
|
||||
* Created by ScorpioMiku on 2019/8/18.
|
||||
*/
|
||||
|
||||
public class StepFragment extends BaseFragment {
|
||||
@BindView(R.id.waveLoadingView)
|
||||
WaveLoadingView waveLoadingView;
|
||||
@BindView(R.id.now_step)
|
||||
TextView nowStep;
|
||||
@BindView(R.id.target_step)
|
||||
TextView targetStep;
|
||||
@BindView(R.id.finish_percent)
|
||||
TextView finishPercent;
|
||||
@BindView(R.id.calorie_holder)
|
||||
TextView calorieHolder;
|
||||
@BindView(R.id.calorie_text)
|
||||
TextView calorieText;
|
||||
@BindView(R.id.calorie_pb)
|
||||
ZzHorizontalProgressBar caloriePb;
|
||||
@BindView(R.id.distance_holder)
|
||||
TextView distanceHolder;
|
||||
@BindView(R.id.distance_text)
|
||||
TextView distanceText;
|
||||
@BindView(R.id.distance_pb)
|
||||
ZzHorizontalProgressBar distancePb;
|
||||
@BindView(R.id.time_holder)
|
||||
TextView timeHolder;
|
||||
@BindView(R.id.time_text)
|
||||
TextView timeText;
|
||||
@BindView(R.id.time_pb)
|
||||
ZzHorizontalProgressBar timePb;
|
||||
Unbinder unbinder;
|
||||
|
||||
@Override
|
||||
protected Handler initHandle() {
|
||||
return null;
|
||||
@@ -29,4 +68,33 @@ public class StepFragment extends BaseFragment {
|
||||
protected void initView() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
// TODO: inflate a fragment view
|
||||
View rootView = super.onCreateView(inflater, container, savedInstanceState);
|
||||
unbinder = ButterKnife.bind(this, rootView);
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
unbinder.unbind();
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新数据
|
||||
*
|
||||
* @param step
|
||||
* @param percent
|
||||
* @param cal
|
||||
* @param distance
|
||||
*/
|
||||
public void refreshUi(String step, String percent, String cal, String distance) {
|
||||
nowStep.setText(step);
|
||||
calorieText.setText(cal);
|
||||
distanceText.setText(distance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.scorpiomiku.oldpeoplehome.service;
|
||||
|
||||
|
||||
import com.sxr.sdk.ble.keepfit.service.BluetoothLeService;
|
||||
|
||||
public class SampleBleService extends BluetoothLeService {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
}
|
||||
}
|
||||
@@ -33,13 +33,13 @@ public class ChartUtils {
|
||||
* @param linename
|
||||
* @return
|
||||
*/
|
||||
public static void initSingleLineChart(LineChart mLineChart, List<Entry> list, String linename) {
|
||||
public static void initSingleLineChart(LineChart mLineChart, List<Entry> list, String linename,int fillColor) {
|
||||
|
||||
LineDataSet dataSet = new LineDataSet(list, "Label"); // add entries to dataset
|
||||
dataSet.setColor(Color.parseColor("#d63f9c"));//线条颜色
|
||||
dataSet.setColor(fillColor);//线条颜色
|
||||
dataSet.setCircleColor(Color.parseColor("#7d7d7d"));//圆点颜色
|
||||
dataSet.setDrawFilled(true);
|
||||
dataSet.setFillColor(0xFFF56EC0);
|
||||
dataSet.setFillColor(fillColor);
|
||||
dataSet.setLineWidth(1f);//线条宽度
|
||||
|
||||
//设置样式
|
||||
@@ -73,7 +73,7 @@ public class ChartUtils {
|
||||
|
||||
//隐藏x轴描述
|
||||
Description description = new Description();
|
||||
description.setText("近15天平均心率");
|
||||
description.setText(linename);
|
||||
description.setTextSize(12f);
|
||||
// description.setTextColor(0x000);
|
||||
description.setTextColor(Color.WHITE);
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.scorpiomiku.oldpeoplehome.utils;
|
||||
|
||||
import com.scorpiomiku.oldpeoplehome.bean.BleDeviceItem;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
public class ComparatorBleDeviceItem implements Comparator<BleDeviceItem> {
|
||||
|
||||
@Override
|
||||
public int compare(BleDeviceItem arg0, BleDeviceItem arg1) {
|
||||
int rssi0 = arg0.getRssi();
|
||||
int rssi1 = arg1.getRssi();
|
||||
int result = 0;
|
||||
if(rssi0 < rssi1)
|
||||
{
|
||||
result=1;
|
||||
}
|
||||
if(rssi0 > rssi1)
|
||||
{
|
||||
result=-1;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,8 @@ import android.widget.Toast;
|
||||
|
||||
import com.scorpiomiku.oldpeoplehome.OldPeopleHome;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by ScorpioMiku on 2019/8/18.
|
||||
*/
|
||||
@@ -19,4 +21,18 @@ public class LogUtils {
|
||||
public static void shortToast(String message) {
|
||||
Toast.makeText(OldPeopleHome.mInstance, message, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
public static void loge(String message) {
|
||||
Log.e(TAG, message);
|
||||
}
|
||||
|
||||
public static void logList(List list) {
|
||||
String log = "[\n";
|
||||
for (Object item :
|
||||
list) {
|
||||
log += item.toString() + ";\n";
|
||||
}
|
||||
log += "]";
|
||||
Log.d(TAG, log);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<vector android:height="24dp" android:viewportHeight="1024.0"
|
||||
android:viewportWidth="1024.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#666666" android:pathData="M791.5,183.5h-537.6a51.2,51.2 0,0 0,-51.2 51.2v537.6a51.2,51.2 0,0 0,51.2 51.2h537.6a51.2,51.2 0,0 0,51.2 -51.2L842.7,234.7a51.2,51.2 0,0 0,-51.2 -51.2zM804.3,759.5a25.6,25.6 0,0 1,-25.6 25.6h-512a25.6,25.6 0,0 1,-25.6 -25.6L241.1,247.5a25.6,25.6 0,0 1,25.6 -25.6h512a25.6,25.6 0,0 1,25.6 25.6v512z"/>
|
||||
<path android:fillColor="#666666" android:pathData="M714.7,484.3h-384v0.2c-0.5,-0 -1,-0.2 -1.6,-0.2a19.2,19.2 0,0 0,0 38.4c0.5,0 1.1,-0.1 1.6,-0.2v0.2h384a19.2,19.2 0,0 0,0 -38.4z"/>
|
||||
<path android:fillColor="#666666" android:pathData="M502.7,310.7v384h0.2c-0,0.5 -0.2,1 -0.2,1.6a19.2,19.2 0,0 0,38.4 0c0,-0.5 -0.1,-1.1 -0.2,-1.6h0.2v-384a19.2,19.2 0,0 0,-38.4 0z"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,8 @@
|
||||
<vector android:height="24dp" android:viewportHeight="1024.0"
|
||||
android:viewportWidth="1024.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#080808" android:pathData="M512,0C260,0 51.1,182.1 8.4,421.8c-1.8,11.7 -0.8,4.4 -0.8,4.4l-1,7.3C2.7,459.1 0,485.1 0,511.9c0,282.8 229.2,512 512,512s512,-229.2 512,-511.9S794.8,0 512,0zM648.6,76.2c-89.6,16.2 -165.5,44.6 -229.5,80.7a54.4,54.4 0,0 0,-68.1 3.4c-39,-14.4 -70.7,-23.6 -90.9,-29a456.2,456.2 0,0 1,388.5 -55.1zM221.9,159.4a1152.2,1152.2 0,0 1,111.3 31.6,55.1 55.1,0 0,0 -1,10.3 54.3,54.3 0,0 0,1.8 13.4c-94.3,75.1 -155.4,166.8 -194.7,250.2a54.8,54.8 0,0 0,-44.8 23.3,861 861,0 0,1 -36.4,-25.9 455.8,455.8 0,0 1,163.7 -302.8zM78.1,653.9a455.1,455.1 0,0 1,-22.7 -141.9c0,-4.4 0.5,-8.6 0.7,-12.9q14,11.2 28.5,21.9a54.6,54.6 0,0 0,17.7 39.1,798.6 798.6,0 0,0 -24.1,93.9zM148.4,787.4a456.6,456.6 0,0 1,-41.7 -65.6,925.9 925.9,0 0,1 32.6,-147.2 54.7,54.7 0,0 0,20.5 -4q35.1,20.9 71.9,38.8a64.3,64.3 0,0 0,-2.2 16.5,68.3 68.3,0 0,0 3.6,21.5 645,645 0,0 0,-84.8 140zM182.1,827.1a577.6,577.6 0,0 1,76.8 -144.9,68.8 68.8,0 0,0 98.9,-21.5 996.1,996.1 0,0 0,193.1 43,780.8 780.8,0 0,0 20.1,160.3 37,37 0,1 0,18.6 69.3c2.7,8.9 5.6,17.8 8.6,26.8l0.1,0.1a454.9,454.9 0,0 1,-416.2 -133.1zM747.9,902.4a453.2,453.2 0,0 1,-115.8 49.7c-3.9,-12.7 -6.9,-15.4 -10.2,-27.8 0,0 17.8,-15.6 13.2,-37.5s-29,-30.9 -30.4,-29.5c-12,-56.8 -12.7,-101.3 -13.6,-149.7a1028.3,1028.3 0,0 0,126.4 2.2,68.9 68.9,0 0,0 49.3,53 700,700 0,0 1,-18.9 139.6zM789.1,874.3a709.9,709.9 0,0 0,18.7 -112.9,68.8 68.8,0 0,0 46.4,-64.9l-0.1,-1.2c27.1,-4.7 54.9,-10.7 83,-17.6a457.2,457.2 0,0 1,-148 196.5zM844.2,661.4a68.8,68.8 0,0 0,-40 -30.7,485.2 485.2,0 0,0 -53.4,-159 134.1,134.1 0,0 1,-34.2 30,534.6 534.6,0 0,1 41.1,131.6 69.1,69.1 0,0 0,-37.1 39.5,1023.9 1023.9,0 0,1 -129.2,-4.2 595,595 0,0 1,24.4 -150.2,135 135,0 0,1 -36.1,-14 607.9,607.9 0,0 0,-28.2 159.6,1039.3 1039.3,0 0,1 -184.2,-42.6 68.9,68.9 0,0 0,-14.9 -38.5,714.8 714.8,0 0,1 187.8,-112.3 135.1,135.1 0,0 1,-22.6 -42.1,744.2 744.2,0 0,0 -202.1,130.6 67.2,67.2 0,0 0,-16.8 -2.4,68.7 68.7,0 0,0 -47.5,19.2q-33.6,-15.5 -63,-31.4a53.8,53.8 0,0 0,-12.4 -65.8c47.3,-103.6 110.9,-179.2 178,-234.3a54.3,54.3 0,0 0,79.4 -13.3,706.6 706.6,0 0,1 112.2,66.3 136.6,136.6 0,0 1,25.6 -22.5,876.4 876.4,0 0,0 -129.2,-76.1 53.7,53.7 0,0 0,-2.5 -13.8c113,-65.5 220,-83.5 262.1,-88.2a456.9,456.9 0,0 1,126.1 85.5,617.2 617.2,0 0,0 -109.2,91.1 135.6,135.6 0,0 1,29.5 25.5,516.7 516.7,0 0,1 110.8,-83.7 455.6,455.6 0,0 1,81.6 139.2,1151.6 1151.6,0 0,0 -162,6.4 128.8,128.8 0,0 1,1.2 45.3,1173.8 1173.8,0 0,1 173,-13.4 448.6,448.6 0,0 1,-2 246.6c-36,9.3 -71.6,16.8 -106.2,22.2zM854.1,695.4v-0.1,0.1z"/>
|
||||
<path android:fillColor="#080808" android:pathData="M549.3,385.5a95.8,95.8 0,1 1,95.8 95.8,95.8 95.8,0 0,1 -95.8,-95.8z"/>
|
||||
<path android:fillColor="#080808" android:pathData="M582.9,385.5a62.3,62.3 0,1 0,62.3 -60.2,62.3 62.3,0 0,0 -62.3,60.2z"/>
|
||||
<path android:fillColor="#080808" android:pathData="M645.2,381.1m-31,0a31,31 0,1 0,62 0,31 31,0 1,0 -62,0Z"/>
|
||||
<path android:fillColor="#080808" android:pathData="M648.5,387.5m-102.4,0a102.4,102.4 0,1 0,204.8 0,102.4 102.4,0 1,0 -204.8,0Z"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:viewportHeight="1024.0"
|
||||
android:viewportWidth="1024.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#ffffff" android:pathData="M512.2,964.5c-105.1,0 -207.1,-55.2 -266.2,-144.1 -56.4,-84.8 -65.8,-188.2 -25.9,-284.1 41,-75.5 86.4,-144.1 130.4,-210.4 34.1,-51.5 69.3,-104.7 102.2,-160.6 12,-20.3 23.4,-42.9 34.4,-64.6 7.7,-15.2 15.5,-30.7 23.5,-45.4l54.7,108.1 0.3,0.4c32.2,54.9 69,107.5 104.5,158.3 51,73 99.1,141.9 132.6,214.1 40.9,88.9 32.7,193.8 -21.9,280.6 -57.1,90.7 -155.4,145.9 -263,147.7 -1.8,0 -3.6,0 -5.3,0zM552.3,233.3c-21.2,-29.6 -65,-30 -86.8,-0.9 -65.6,87.5 -148.8,213.1 -184.7,281.4 -39.5,78.6 -40,178 9.1,259.8 48.3,80.4 135.8,136 228.4,138.2l1,-0c88.6,-3.4 180.6,-65.9 224.2,-146.3 46.5,-85.8 33.9,-185.8 -23.3,-281.5l-0.5,-0.7c-18.6,-27.5 -44.7,-68.6 -72.3,-112 -24.9,-39.1 -64.8,-95.6 -95.1,-137.9z"/>
|
||||
<path android:fillColor="#ffffff" android:pathData="M743.7,589.7c-51.6,-11.9 -144.6,-20.2 -245.5,33.7 -90.9,48.6 -179.6,20.8 -226.3,-1.4 -2.3,50.4 10.7,102.8 38.5,149.2 45.1,75.1 120.7,119.4 207.3,121.4l1,-0c71.6,-2.7 140.9,-41 184.7,-99.9 10.8,-16.9 20.6,-34.3 29.3,-51.5 20,-47.7 23.6,-99.3 11,-151.5z"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:viewportHeight="1024.0"
|
||||
android:viewportWidth="1024.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#d81e06" android:pathData="M313.7,153.5a41,41 0,0 1,39.7 71.7A327.5,327.5 0,0 0,184.3 512c0,181 146.7,327.7 327.7,327.7s327.7,-146.7 327.7,-327.7c0,-116.7 -61.4,-222.7 -159.8,-281.5a41,41 0,1 1,42 -70.3A409.4,409.4 0,0 1,921.6 512c0,226.2 -183.4,409.6 -409.6,409.6S102.4,738.2 102.4,512A409.4,409.4 0,0 1,313.7 153.5z"/>
|
||||
<path android:fillColor="#d81e06" android:pathData="M471,102.4m41,0l0,0q41,0 41,41l0,409.6q0,41 -41,41l0,0q-41,0 -41,-41l0,-409.6q0,-41 41,-41Z"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,4 @@
|
||||
<vector android:height="24dp" android:viewportHeight="1024.0"
|
||||
android:viewportWidth="1024.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#707070" android:pathData="M812.8,551.2c56,-72.4 99,-133.8 99,-203.3 0,-112.9 -94.8,-204.4 -212,-204.4s-212,91.5 -212,204.4c0,62.4 36.9,122 85.1,186.4l-58,18.6L402.6,517.3C416.4,494.1 425.3,471.6 425.3,447.3c0,-64.1 -51.8,-116 -115.7,-116 -63.9,0 -115.7,51.9 -115.7,116 0,26.8 11.7,52.7 28.7,79.5L222.1,526.8 64,880.5l238.8,-90.1 217.3,90.1 204,-90.1L960,880.5 812.8,551.2zM699.9,248.6c56.8,0 102.9,44.4 102.9,99.3s-46.1,99.3 -102.9,99.3c-56.9,0 -102.9,-44.5 -102.9,-99.3S643,248.6 699.9,248.6zM309.7,391c31,0 56.2,25.2 56.2,56.3 0,31 -25.2,56.3 -56.2,56.3 -31,0 -56.2,-25.3 -56.2,-56.3C253.5,416.2 278.7,391 309.7,391zM720.1,736.8l-200.1,86.7 -213.2,-86.7 -159,72.4 91.1,-235.1 14.8,-2.8c18.1,24.2 37.9,49.7 55.9,78.1C332.2,613.5 355.8,583.7 375.9,556.3L515.1,601l87.1,-28.4c31.9,40.9 66.2,84 97.7,131.6 29.5,-45.3 60,-84.9 88.6,-121.5l91.9,229.5L720.1,736.8z"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,6 @@
|
||||
<vector android:height="24dp" android:viewportHeight="1024.0"
|
||||
android:viewportWidth="1024.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#53d6d6" android:pathData="M512,512m-512,0a512,512 0,1 0,1024 0,512 512,0 1,0 -1024,0Z"/>
|
||||
<path android:fillColor="#ffff" android:pathData="M512,795.3c-75.1,0 -143.4,-27.3 -198,-78.5 -13.7,-10.2 -13.7,-30.7 0,-44.4 10.2,-13.7 30.7,-13.7 44.4,0 41,41 95.6,61.4 153.6,61.4 122.9,0 221.9,-99 221.9,-221.9v-17.1c0,-17.1 10.2,-30.7 27.3,-34.1 17.1,0 30.7,10.2 34.1,27.3v20.5c0,160.4 -126.3,286.7 -283.3,286.7zM259.4,563.2c-17.1,0 -30.7,-13.7 -30.7,-27.3v-20.5c0,-157 126.3,-283.3 283.3,-283.3 75.1,0 143.4,27.3 198,81.9 13.7,10.2 13.7,30.7 0,44.4 -10.2,13.7 -30.7,13.7 -44.4,0 -41,-41 -95.6,-61.4 -153.6,-61.4 -122.9,0 -221.9,99 -221.9,221.9v17.1c0,10.2 -10.2,23.9 -30.7,27.3 3.4,-3.4 0,0 0,0z"/>
|
||||
<path android:fillColor="#ffff" android:pathData="M331.1,532.5l-71.7,75.1 -71.7,-75.1zM689.5,491.5l71.7,-75.1 71.7,75.1z"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#464646"
|
||||
android:pathData="M10,6L8.59,7.41 13.17,12l-4.58,4.59L10,18l6,-6z"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,4 @@
|
||||
<vector android:height="24dp" android:viewportHeight="1024.0"
|
||||
android:viewportWidth="1024.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#ffffff" android:pathData="M514.8,83.3c20,0.2 40,1.5 59.8,4.4 39.2,5.8 77.7,17.1 113.8,33.5a429.7,429.7 0,0 1,117.5 78.7,431.6 431.6,0 0,1 85.5,112.3 426.5,426.5 0,0 1,41.6 118.6c8.7,45.6 10,92.5 3.9,138.4a425.2,425.2 0,0 1,-37.4 126.1,430.6 430.6,0 0,1 -88.1,123.2 429.8,429.8 0,0 1,-132.6 88.4,429.7 429.7,0 0,1 -328.8,1.9 428.9,428.9 0,0 1,-116.5 -71.2c-39.8,-34.1 -73.3,-75.4 -98.4,-121.5a425.4,425.4 0,0 1,-40.8 -107.5,430.8 430.8,0 0,1 -8.8,-140.5c4.4,-43.2 15.4,-85.7 32.5,-125.4a427.6,427.6 0,0 1,83.7 -126.5,431.3 431.3,0 0,1 129.2,-93c35.1,-16.4 72.4,-27.8 110.6,-34.1 20.6,-3.4 41.4,-5.3 62.2,-5.8 3.7,0 7.4,-0.2 11.1,0zM509.5,117.4c-18.4,0 -36.8,1.4 -55.1,4.1 -36.1,5.3 -71.4,15.7 -104.7,30.7 -36.9,16.7 -71.1,39.1 -101.2,66a397.2,397.2 0,0 0,-86.8 112,392.9 392.9,0 0,0 -37.2,107c-8.2,42.7 -9.3,86.7 -3.2,129.9 5.6,40.1 17.5,79.2 35.1,115.7a395.9,395.9 0,0 0,81.7 113c35.4,34.1 77.1,61.6 122.6,80.6a396.6,396.6 0,0 0,151.3 30c51.8,0 103.5,-10.2 151.3,-30a397.3,397.3 0,0 0,122.6 -80.6,395.7 395.7,0 0,0 81.7,-113 392.1,392.1 0,0 0,35.1 -115.7c6,-43.2 4.9,-87.2 -3.2,-129.9a393,393 0,0 0,-37.2 -107,396.8 396.8,0 0,0 -86.8,-112 399.2,399.2 0,0 0,-101.2 -66,393 393,0 0,0 -104.7,-30.7 372,372 0,0 0,-55.1 -4.1c-2.6,-0.2 -2.6,-0.2 -5.1,0zM591.7,351.6a85.2,85.2 0,0 1,85.4 85.3c0,9.6 -7.6,17.1 -17.1,17.1 -9.5,0 -17.1,-7.5 -17.1,-17.1v0.2c0,-28.3 -22.9,-51.4 -51.2,-51.4h-34.1a51.2,51.2 0,0 0,-51.2 51.4v170.3c0,28.5 22.9,51.4 51.2,51.4h34.1a51.1,51.1 0,0 0,51.2 -51.4v0.2a17.1,17.1 0,0 1,34.1 0v0.2c0,47.1 -38.2,85.2 -85.4,85.2h-34.1a85.1,85.1 0,0 1,-85.4 -85.2L472.3,436.9c0,-47.1 38.2,-85.3 85.4,-85.3h34.1zM369.9,351.6a68.3,68.3 0,1 0,0 136.5,68.3 68.3,0 0,0 0,-136.5zM369.9,454c-18.8,0 -34.1,-15.2 -34.1,-34.1 0,-18.8 15.3,-34.1 34.1,-34.1s34.1,15.4 34.1,34.1c0,18.9 -15.3,34.1 -34.1,34.1z"/>
|
||||
</vector>
|
||||
BIN
android/OldPeopleHome/app/src/main/res/drawable/test_avatar.jpg
Normal file
|
After Width: | Height: | Size: 64 KiB |
@@ -0,0 +1,296 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mxn.soul.flowingdrawer_core.FlowingDrawer 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:id="@+id/drawerlayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
app:edMenuBackground="#FFF"
|
||||
app:edMenuSize="230dp"
|
||||
app:edPosition="1"
|
||||
tools:context="com.scorpiomiku.oldpeoplehome.modules.oldpeople.activity.OldPeopleMainActivity">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
app:contentInsetStart="0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/tool_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
tools:background="@color/colorPrimary">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="10dp"
|
||||
app:cardCornerRadius="15dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/test_avatar" />
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="2019-8-21"
|
||||
android:textColor="@color/white_text"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="220dp"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:padding="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:gravity="center"
|
||||
android:text="选择老人:"
|
||||
android:textColor="@color/white_text"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/spinner"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v7.widget.Toolbar>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<android.support.design.widget.BottomNavigationView
|
||||
android:id="@+id/navigation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="55dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:layout_marginStart="0dp"
|
||||
android:background="?android:attr/windowBackground"
|
||||
app:menu="@menu/childmain" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<com.mxn.soul.flowingdrawer_core.FlowingMenuLayout
|
||||
android:id="@+id/menu_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="150dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="150dp"
|
||||
android:background="@color/drawer_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.7">
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
app:cardCornerRadius="30dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/test_avatar" />
|
||||
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="20dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Mr.Jiang"
|
||||
android:textColor="@color/white_text"
|
||||
android:textSize="18sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="15dp"
|
||||
android:alpha="0.06"
|
||||
android:src="@drawable/ic_drawer_bg" />
|
||||
</RelativeLayout>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="5dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="手机号:"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="13688434001"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="10dp"
|
||||
android:alpha="0.8"
|
||||
android:src="@drawable/ic_right_row" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@color/place_holder" />
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="15dp"
|
||||
android:text="已绑定的亲人"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/people_recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
</android.support.v7.widget.RecyclerView>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="10dp"
|
||||
android:src="@drawable/ic_add" />
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:layout_margin="20dp"
|
||||
app:cardCornerRadius="8dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:src="@drawable/ic_log_out" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="退出登录" />
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
</com.mxn.soul.flowingdrawer_core.FlowingMenuLayout>
|
||||
|
||||
</com.mxn.soul.flowingdrawer_core.FlowingDrawer>
|
||||
@@ -8,25 +8,25 @@
|
||||
tools:context="com.scorpiomiku.oldpeoplehome.modules.oldpeople.activity.OldPeopleMainActivity">
|
||||
|
||||
<!--<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"-->
|
||||
<!--android:layout_width="match_parent"-->
|
||||
<!--android:layout_height="?attr/actionBarSize"-->
|
||||
<!--android:background="@color/colorPrimary"-->
|
||||
<!--app:contentInsetStart="0dp">-->
|
||||
<!--android:layout_width="match_parent"-->
|
||||
<!--android:layout_height="?attr/actionBarSize"-->
|
||||
<!--android:background="@color/colorPrimary"-->
|
||||
<!--app:contentInsetStart="0dp">-->
|
||||
|
||||
<!--<LinearLayout-->
|
||||
<!--android:layout_width="match_parent"-->
|
||||
<!--android:layout_height="match_parent"-->
|
||||
<!--android:gravity="center"-->
|
||||
<!--android:orientation="horizontal">-->
|
||||
<!--<LinearLayout-->
|
||||
<!--android:layout_width="match_parent"-->
|
||||
<!--android:layout_height="match_parent"-->
|
||||
<!--android:gravity="center"-->
|
||||
<!--android:orientation="horizontal">-->
|
||||
|
||||
<!--<TextView-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:layout_gravity="center"-->
|
||||
<!--android:text="@string/app_name"-->
|
||||
<!--android:textColor="#FFF"-->
|
||||
<!--android:textSize="20sp" />-->
|
||||
<!--</LinearLayout>-->
|
||||
<!--<TextView-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:layout_gravity="center"-->
|
||||
<!--android:text="@string/app_name"-->
|
||||
<!--android:textColor="#FFF"-->
|
||||
<!--android:textSize="20sp" />-->
|
||||
<!--</LinearLayout>-->
|
||||
|
||||
<!--</android.support.v7.widget.Toolbar>-->
|
||||
|
||||
@@ -36,6 +36,19 @@
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/floating_button"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_margin="16dp"
|
||||
android:alpha="0.6"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_refresh"
|
||||
app:backgroundTint="#53d6d6"
|
||||
app:borderWidth="0dp"
|
||||
app:fabSize="normal"/>
|
||||
|
||||
</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="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="5dp"
|
||||
android:background="#00000000"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/spinner_avatar"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/test_avatar" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/spinner_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/text_gray" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,206 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="0.2"
|
||||
android:background="@color/environment_bg"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="采集数据时间:"
|
||||
android:textColor="@color/white_text"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="2019-8-20 15:58"
|
||||
android:textColor="@color/white_text"
|
||||
android:textSize="18sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/environment_bg"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<me.itangqi.waveloadingview.WaveLoadingView
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_gravity="center"
|
||||
app:wlv_borderColor="#71d7b6"
|
||||
app:wlv_borderWidth="8dp"
|
||||
app:wlv_progressValue="0"
|
||||
app:wlv_round_rectangle="true"
|
||||
app:wlv_shapeType="circle"
|
||||
app:wlv_titleCenter=""
|
||||
app:wlv_titleCenterColor="@android:color/white"
|
||||
app:wlv_titleCenterSize="15sp"
|
||||
app:wlv_titleCenterStrokeColor="#2fb689"
|
||||
app:wlv_titleCenterStrokeWidth="3dp"
|
||||
app:wlv_triangle_direction="north"
|
||||
app:wlv_waveAmplitude="70"
|
||||
app:wlv_waveColor="#2fb689" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="28dp"
|
||||
android:src="@drawable/ic_temperature" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/temperature_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="26.4"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="℃"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="20sp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<me.itangqi.waveloadingview.WaveLoadingView
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_gravity="center"
|
||||
app:wlv_borderColor="#71d7b6"
|
||||
app:wlv_borderWidth="8dp"
|
||||
app:wlv_progressValue="0"
|
||||
app:wlv_round_rectangle="true"
|
||||
app:wlv_shapeType="circle"
|
||||
app:wlv_titleCenter=""
|
||||
app:wlv_titleCenterColor="@android:color/white"
|
||||
app:wlv_titleCenterSize="15sp"
|
||||
app:wlv_titleCenterStrokeColor="#2fb689"
|
||||
app:wlv_titleCenterStrokeWidth="3dp"
|
||||
app:wlv_triangle_direction="north"
|
||||
app:wlv_waveAmplitude="70"
|
||||
app:wlv_waveColor="#2fb689" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:src="@drawable/ic_humidity" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/humidity_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="78"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="%"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="20sp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.2"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
<com.github.mikephil.charting.charts.LineChart
|
||||
android:id="@+id/temperature_chart"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
</com.github.mikephil.charting.charts.LineChart>
|
||||
|
||||
<com.github.mikephil.charting.charts.LineChart
|
||||
android:id="@+id/humidity_chart"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
</com.github.mikephil.charting.charts.LineChart>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,288 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/heart_rate_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<me.itangqi.waveloadingview.WaveLoadingView
|
||||
android:id="@+id/waveLoadingView"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_gravity="center"
|
||||
app:wlv_borderColor="#e155ab"
|
||||
app:wlv_borderWidth="8dp"
|
||||
app:wlv_progressValue="0"
|
||||
app:wlv_round_rectangle="true"
|
||||
app:wlv_shapeType="circle"
|
||||
app:wlv_titleCenter=""
|
||||
app:wlv_titleCenterColor="@android:color/white"
|
||||
app:wlv_titleCenterSize="15sp"
|
||||
app:wlv_titleCenterStrokeColor="#d4409b"
|
||||
app:wlv_titleCenterStrokeWidth="3dp"
|
||||
app:wlv_triangle_direction="north"
|
||||
app:wlv_waveAmplitude="70"
|
||||
app:wlv_waveColor="#ba2983" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="140dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:src="@drawable/ic_heart" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/heart_rate_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="00:00"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="30sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="BPM"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginTop="10dp"
|
||||
app:cardCornerRadius="12.5dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white_text"
|
||||
android:orientation="vertical"
|
||||
android:padding="1dp">
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:cardCornerRadius="12dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/begin"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/heart_rate_bg"
|
||||
android:gravity="center"
|
||||
android:text="开始"
|
||||
android:textColor="@color/white_text"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.2"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_margin="10dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:src="@drawable/ic_heart_log" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="最小心率"
|
||||
android:textColor="@color/heart_rate_bg"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
android:textColor="#c42e8a"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:gravity="center"
|
||||
android:text="BPM"
|
||||
android:textColor="@color/heart_rate_bg"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_margin="10dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:src="@drawable/ic_heart_log" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="平均心率"
|
||||
android:textColor="@color/heart_rate_bg"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
android:textColor="#c42e8a"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:gravity="center"
|
||||
android:text="BPM"
|
||||
android:textColor="@color/heart_rate_bg"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_margin="10dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:src="@drawable/ic_heart_log" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="最大心率"
|
||||
android:textColor="@color/heart_rate_bg"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
android:textColor="#c42e8a"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:gravity="center"
|
||||
android:text="BPM"
|
||||
android:textColor="@color/heart_rate_bg"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.2"
|
||||
android:orientation="horizontal">
|
||||
<com.github.mikephil.charting.charts.LineChart
|
||||
android:id="@+id/chart"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
</com.github.mikephil.charting.charts.LineChart>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?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.constraint.ConstraintLayout>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?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.constraint.ConstraintLayout>
|
||||
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/sleep_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<me.itangqi.waveloadingview.WaveLoadingView
|
||||
android:id="@+id/waveLoadingView"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_gravity="center"
|
||||
app:wlv_borderColor="#4e60e9"
|
||||
app:wlv_borderWidth="8dp"
|
||||
app:wlv_progressValue="5"
|
||||
app:wlv_round_rectangle="true"
|
||||
app:wlv_shapeType="circle"
|
||||
app:wlv_titleCenter=""
|
||||
app:wlv_titleCenterColor="@android:color/white"
|
||||
app:wlv_titleCenterSize="15sp"
|
||||
app:wlv_titleCenterStrokeColor="#4355d9"
|
||||
app:wlv_titleCenterStrokeWidth="3dp"
|
||||
app:wlv_triangle_direction="north"
|
||||
app:wlv_waveAmplitude="70"
|
||||
app:wlv_waveColor="#293dcf" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:src="@drawable/ic_moon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sleep_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="00:00"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="30sp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.2"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.rbrooks.indefinitepagerindicator.IndefinitePagerIndicator
|
||||
android:id="@+id/viewpager_pager_indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="5dp"
|
||||
app:dotColor="#a1a8da"
|
||||
app:dotCount="3"
|
||||
app:dotRadius="8dp"
|
||||
app:dotSeparation="16dp"
|
||||
app:selectedDotColor="#3d4ec9"
|
||||
app:selectedDotRadius="6dp" />
|
||||
|
||||
<android.support.v4.view.ViewPager
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</android.support.v4.view.ViewPager>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,348 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView 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="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/step_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<me.itangqi.waveloadingview.WaveLoadingView
|
||||
android:id="@+id/waveLoadingView"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_gravity="center"
|
||||
app:wlv_borderColor="#ef906b"
|
||||
app:wlv_borderWidth="8dp"
|
||||
app:wlv_progressValue="40"
|
||||
app:wlv_round_rectangle="true"
|
||||
app:wlv_shapeType="circle"
|
||||
app:wlv_titleCenter=""
|
||||
app:wlv_titleCenterColor="@android:color/white"
|
||||
app:wlv_titleCenterSize="15sp"
|
||||
app:wlv_titleCenterStrokeColor="#ec5353"
|
||||
app:wlv_titleCenterStrokeWidth="3dp"
|
||||
app:wlv_triangle_direction="north"
|
||||
app:wlv_waveAmplitude="70"
|
||||
app:wlv_waveColor="#f15d5a" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:src="@drawable/ic_step" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="0"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="30sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="目标 4000 步"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="完成 0%"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.2"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="90dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@drawable/ic_calorie" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="5"
|
||||
android:orientation="vertical"
|
||||
android:paddingRight="10dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:text="消耗"
|
||||
android:textColor="@color/step_bg"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/calorie_holder"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:text="千卡"
|
||||
android:textColor="@color/step_bg"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/calorie_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_toLeftOf="@+id/calorie_holder"
|
||||
android:text="0"
|
||||
android:textColor="#e77554"
|
||||
android:textSize="20sp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<me.zhouzhuo.zzhorizontalprogressbar.ZzHorizontalProgressBar
|
||||
android:id="@+id/calorie_pb"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginTop="10dp"
|
||||
app:zpb_bg_color="@color/place_holder"
|
||||
app:zpb_max="100"
|
||||
app:zpb_padding="0dp"
|
||||
app:zpb_pb_color="@color/step_bg"
|
||||
app:zpb_progress="30" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@color/place_holder" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="90dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@drawable/ic_distance" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="5"
|
||||
android:orientation="vertical"
|
||||
android:paddingRight="10dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:text="距离"
|
||||
android:textColor="@color/step_bg"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/distance_holder"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:text="公里"
|
||||
android:textColor="@color/step_bg"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/distance_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_toLeftOf="@+id/distance_holder"
|
||||
android:text="0.0"
|
||||
android:textColor="#e77554"
|
||||
android:textSize="20sp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<me.zhouzhuo.zzhorizontalprogressbar.ZzHorizontalProgressBar
|
||||
android:id="@+id/distance_pb"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginTop="10dp"
|
||||
app:zpb_bg_color="@color/place_holder"
|
||||
app:zpb_max="100"
|
||||
app:zpb_padding="0dp"
|
||||
app:zpb_pb_color="@color/step_bg"
|
||||
app:zpb_progress="30" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@color/place_holder" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="90dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@drawable/ic_time" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="5"
|
||||
android:orientation="vertical"
|
||||
android:paddingRight="10dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:text="时长"
|
||||
android:textColor="@color/step_bg"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/time_holder"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:text=""
|
||||
android:textColor="@color/step_bg"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/time_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_toLeftOf="@+id/time_holder"
|
||||
android:text="00:00"
|
||||
android:textColor="#e77554"
|
||||
android:textSize="20sp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<me.zhouzhuo.zzhorizontalprogressbar.ZzHorizontalProgressBar
|
||||
android:id="@+id/time_pb"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginTop="10dp"
|
||||
app:zpb_bg_color="@color/place_holder"
|
||||
app:zpb_max="100"
|
||||
app:zpb_padding="0dp"
|
||||
app:zpb_pb_color="@color/step_bg"
|
||||
app:zpb_progress="30" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@color/place_holder" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
@@ -1,12 +1,222 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="环境" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="@color/environment_bg"
|
||||
app:contentInsetStart="0dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="2019-8-18"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</android.support.v7.widget.Toolbar>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="0.2"
|
||||
android:background="@color/environment_bg"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="采集数据时间:"
|
||||
android:textColor="@color/white_text"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="2019-8-20 15:58"
|
||||
android:textColor="@color/white_text"
|
||||
android:textSize="18sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/environment_bg"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<me.itangqi.waveloadingview.WaveLoadingView
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_gravity="center"
|
||||
app:wlv_borderColor="#71d7b6"
|
||||
app:wlv_borderWidth="8dp"
|
||||
app:wlv_progressValue="0"
|
||||
app:wlv_round_rectangle="true"
|
||||
app:wlv_shapeType="circle"
|
||||
app:wlv_titleCenter=""
|
||||
app:wlv_titleCenterColor="@android:color/white"
|
||||
app:wlv_titleCenterSize="15sp"
|
||||
app:wlv_titleCenterStrokeColor="#2fb689"
|
||||
app:wlv_titleCenterStrokeWidth="3dp"
|
||||
app:wlv_triangle_direction="north"
|
||||
app:wlv_waveAmplitude="70"
|
||||
app:wlv_waveColor="#2fb689" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="28dp"
|
||||
android:src="@drawable/ic_temperature" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/temperature_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="26.4"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="℃"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="20sp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<me.itangqi.waveloadingview.WaveLoadingView
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_gravity="center"
|
||||
app:wlv_borderColor="#71d7b6"
|
||||
app:wlv_borderWidth="8dp"
|
||||
app:wlv_progressValue="0"
|
||||
app:wlv_round_rectangle="true"
|
||||
app:wlv_shapeType="circle"
|
||||
app:wlv_titleCenter=""
|
||||
app:wlv_titleCenterColor="@android:color/white"
|
||||
app:wlv_titleCenterSize="15sp"
|
||||
app:wlv_titleCenterStrokeColor="#2fb689"
|
||||
app:wlv_titleCenterStrokeWidth="3dp"
|
||||
app:wlv_triangle_direction="north"
|
||||
app:wlv_waveAmplitude="70"
|
||||
app:wlv_waveColor="#2fb689" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:src="@drawable/ic_humidity" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/humidity_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="78"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="%"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="20sp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.2"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
<com.github.mikephil.charting.charts.LineChart
|
||||
android:id="@+id/temperature_chart"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
</com.github.mikephil.charting.charts.LineChart>
|
||||
|
||||
<com.github.mikephil.charting.charts.LineChart
|
||||
android:id="@+id/humidity_chart"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
</com.github.mikephil.charting.charts.LineChart>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,12 +1,259 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="我的" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="@color/informaiton_bg"
|
||||
app:contentInsetStart="0dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="个人信息"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</android.support.v7.widget.Toolbar>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.3dp"
|
||||
android:layout_weight="0"
|
||||
android:background="@color/white_text" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/informaiton_bg"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
app:cardCornerRadius="50dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white_text"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/test_avatar" />
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:gravity="center"
|
||||
android:text="赵励志"
|
||||
android:textColor="@color/white_text"
|
||||
android:textSize="18sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.5"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="10dp"
|
||||
android:text="房间号:"
|
||||
android:textColor="@color/white_text"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="11302"
|
||||
android:textColor="@color/white_text"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="10dp"
|
||||
android:text="性别:"
|
||||
android:textColor="@color/white_text"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="男"
|
||||
android:textColor="@color/white_text"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="10dp"
|
||||
android:text="身高:"
|
||||
android:textColor="@color/white_text"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="110"
|
||||
android:textColor="@color/white_text"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="cm"
|
||||
android:textColor="@color/white_text"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="10dp"
|
||||
android:text="体重:"
|
||||
android:textColor="@color/white_text"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="120"
|
||||
android:textColor="@color/white_text"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="g"
|
||||
android:textColor="@color/white_text"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="10dp"
|
||||
android:text="电话号:"
|
||||
android:textColor="@color/white_text"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="18935134236"
|
||||
android:textColor="@color/white_text"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1.2"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:gravity="center"
|
||||
android:text="关联的亲人"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_toLeftOf="@id/connected_people_row"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@color/place_holder" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/connected_people_row"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="10dp"
|
||||
android:src="@drawable/ic_right_row" />
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -69,6 +69,7 @@
|
||||
android:src="@drawable/ic_step" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/now_step"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
@@ -76,21 +77,71 @@
|
||||
android:textColor="#FFF"
|
||||
android:textSize="30sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="目标 4000 步"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="14sp" />
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="目标 "
|
||||
android:textColor="#FFF"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/target_step"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="4000"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text=" 步"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="14sp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="完成 0%"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="14sp" />
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="完成 "
|
||||
android:textColor="#FFF"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/finish_percent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="10"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=" %"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="14sp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
29
android/OldPeopleHome/app/src/main/res/menu/childmain.xml
Normal file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:id="@+id/navigation_step"
|
||||
android:icon="@drawable/ic_step_unchoose"
|
||||
android:title="步行" />
|
||||
|
||||
<item
|
||||
android:id="@+id/navigation_sleep"
|
||||
android:icon="@drawable/ic_sleep_unchoose"
|
||||
android:title="睡眠" />
|
||||
|
||||
<item
|
||||
android:id="@+id/navigation_heart_rate"
|
||||
android:icon="@drawable/ic_heart_rate_unchoose"
|
||||
android:title="心率" />
|
||||
|
||||
<item
|
||||
android:id="@+id/navigation_environmental"
|
||||
android:icon="@drawable/ic_environment_unchoose"
|
||||
android:title="温湿度" />
|
||||
|
||||
<item
|
||||
android:id="@+id/navigation_map"
|
||||
android:icon="@drawable/ic_map"
|
||||
android:title="路径" />
|
||||
|
||||
</menu>
|
||||
@@ -8,7 +8,8 @@
|
||||
<color name="step_string">#e66d4a</color>
|
||||
<color name="sleep_bg">#3d4eca</color>
|
||||
<color name="heart_rate_bg">#d63f9c</color>
|
||||
<color name="environment_bg">#5adeb2</color>
|
||||
<color name="environment_bg">#2fb689</color>
|
||||
<color name="informaiton_bg">#3F51B5</color>
|
||||
|
||||
<color name="place_holder">#dfdede</color>
|
||||
|
||||
@@ -16,4 +17,7 @@
|
||||
<color name="sleep_shallow">#4766e4</color>
|
||||
<color name="sleep_no">#7096cc</color>
|
||||
<color name="white_text">#FFF</color>
|
||||
|
||||
<color name="text_gray">#999494</color>
|
||||
<color name="drawer_bg">#279ae2</color>
|
||||
</resources>
|
||||
|
||||
@@ -8,4 +8,10 @@
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="SpinnerStyle">
|
||||
<item name="colorAccent">#2f2a94</item>
|
||||
<item name="colorControlNormal">#ddf16565</item> <!--改变了spinner的颜色 -->
|
||||
</style>
|
||||
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -25,6 +25,7 @@ allprojects {
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
maven { url "https://jitpack.io" }
|
||||
flatDir { dirs 'libs' }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
55
android/handcircle/JYOU PRO SDK/android-sdk-jy/android-smartband-sdk-sxrblejy2/.gitignore
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
# Built application files
|
||||
*.apk
|
||||
*.ap_
|
||||
|
||||
# Files for the ART/Dalvik VM
|
||||
*.dex
|
||||
|
||||
# Java class files
|
||||
*.class
|
||||
|
||||
# Generated files
|
||||
bin/
|
||||
gen/
|
||||
out/
|
||||
|
||||
# Gradle files
|
||||
.gradle/
|
||||
build/
|
||||
|
||||
# Local configuration file (sdk path, etc)
|
||||
local.properties
|
||||
|
||||
# Proguard folder generated by Eclipse
|
||||
proguard/
|
||||
|
||||
# Log Files
|
||||
*.log
|
||||
|
||||
# Android Studio Navigation editor temp files
|
||||
.navigation/
|
||||
|
||||
# Android Studio captures folder
|
||||
captures/
|
||||
|
||||
# Intellij
|
||||
*.iml
|
||||
.idea/workspace.xml
|
||||
.idea/tasks.xml
|
||||
.idea/gradle.xml
|
||||
.idea/dictionaries
|
||||
.idea/libraries
|
||||
|
||||
# Keystore files
|
||||
*.jks
|
||||
|
||||
# External native build folder generated in Android Studio 2.2 and later
|
||||
.externalNativeBuild
|
||||
|
||||
# Google Services (e.g. APIs or Firebase)
|
||||
google-services.json
|
||||
|
||||
# Freeline
|
||||
freeline.py
|
||||
freeline/
|
||||
freeline_project_description.json
|
||||
@@ -0,0 +1,29 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<Objective-C-extensions>
|
||||
<file>
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
|
||||
</file>
|
||||
<class>
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
|
||||
</class>
|
||||
<extensions>
|
||||
<pair source="cpp" header="h" fileNamingConvention="NONE" />
|
||||
<pair source="c" header="h" fileNamingConvention="NONE" />
|
||||
</extensions>
|
||||
</Objective-C-extensions>
|
||||
</code_scheme>
|
||||
</component>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" native2AsciiForPropertiesFiles="true" defaultCharsetForPropertiesFiles="UTF-8">
|
||||
<file url="PROJECT" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
||||
33
android/handcircle/JYOU PRO SDK/android-sdk-jy/android-smartband-sdk-sxrblejy2/.idea/misc.xml
generated
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="NullableNotNullManager">
|
||||
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
|
||||
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
|
||||
<option name="myNullables">
|
||||
<value>
|
||||
<list size="4">
|
||||
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
|
||||
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
|
||||
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
|
||||
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
<option name="myNotNulls">
|
||||
<value>
|
||||
<list size="4">
|
||||
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
|
||||
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
|
||||
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
|
||||
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
||||
9
android/handcircle/JYOU PRO SDK/android-sdk-jy/android-smartband-sdk-sxrblejy2/.idea/modules.xml
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/android-smartband-sdk-sxrblejy2.iml" filepath="$PROJECT_DIR$/android-smartband-sdk-sxrblejy2.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/android-smartband-sdk-sxrblejy2client/android-smartband-sdk-sxrblejy2client.iml" filepath="$PROJECT_DIR$/android-smartband-sdk-sxrblejy2client/android-smartband-sdk-sxrblejy2client.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="gen"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
||||
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
||||
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
|
||||
<classpathentry kind="output" path="bin/classes"/>
|
||||
</classpath>
|
||||
@@ -0,0 +1,55 @@
|
||||
# Built application files
|
||||
*.apk
|
||||
*.ap_
|
||||
|
||||
# Files for the ART/Dalvik VM
|
||||
*.dex
|
||||
|
||||
# Java class files
|
||||
*.class
|
||||
|
||||
# Generated files
|
||||
bin/
|
||||
gen/
|
||||
out/
|
||||
|
||||
# Gradle files
|
||||
.gradle/
|
||||
build/
|
||||
|
||||
# Local configuration file (sdk path, etc)
|
||||
local.properties
|
||||
|
||||
# Proguard folder generated by Eclipse
|
||||
proguard/
|
||||
|
||||
# Log Files
|
||||
*.log
|
||||
|
||||
# Android Studio Navigation editor temp files
|
||||
.navigation/
|
||||
|
||||
# Android Studio captures folder
|
||||
captures/
|
||||
|
||||
# Intellij
|
||||
*.iml
|
||||
.idea/workspace.xml
|
||||
.idea/tasks.xml
|
||||
.idea/gradle.xml
|
||||
.idea/dictionaries
|
||||
.idea/libraries
|
||||
|
||||
# Keystore files
|
||||
*.jks
|
||||
|
||||
# External native build folder generated in Android Studio 2.2 and later
|
||||
.externalNativeBuild
|
||||
|
||||
# Google Services (e.g. APIs or Firebase)
|
||||
google-services.json
|
||||
|
||||
# Freeline
|
||||
freeline.py
|
||||
freeline/
|
||||
freeline_project_description.json
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>SXRBleKeepFitAIDLClient</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,3 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding//src/com/sxr/sdk/ble/keepfit/client/MainActivity.java=UTF-8
|
||||
encoding/<project>=UTF-8
|
||||
@@ -0,0 +1,12 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.7
|
||||
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.sxr.sdk.ble.keepfit.client"
|
||||
android:versionCode="3"
|
||||
android:versionName="1.0.2">
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="18"
|
||||
android:targetSdkVersion="22" />
|
||||
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_SMS" />
|
||||
<uses-permission android:name="android.permission.READ_SMS" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
|
||||
<!-- 调用相机权限 -->
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
|
||||
<uses-feature android:name="android.hardware.camera" />
|
||||
<uses-feature android:name="android.hardware.camera.autofocus" />
|
||||
<uses-feature android:name="android.hardware.microphone" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CALL_LOG"/>
|
||||
|
||||
<!-- 获取运营商信息,用于支持提供运营商信息相关的接口-->
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<!-- 这个权限用于获取wifi的获取权限,wifi信息会用来进行网络定位-->
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
|
||||
<!-- 用于读取手机当前的状态-->
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<!-- 写入扩展存储,向扩展卡写入数据,用于写入离线定位数据-->
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<!-- 访问网络,网络定位需要上网-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<!-- SD卡读取权限,用户写入离线定位数据-->
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.bluetooth_le"
|
||||
android:required="true" />
|
||||
|
||||
<application
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme" >
|
||||
|
||||
<service
|
||||
android:name="com.sxr.sdk.ble.keepfit.client.SampleBleService"
|
||||
android:enabled="true"
|
||||
android:process="com.sxr.sdk.ble.keepfit.client.SampleBleService"
|
||||
android:exported="true" >
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="com.sxr.sdk.ble.BluetoothLeService.SampleBleService" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<activity
|
||||
android:name="com.sxr.sdk.ble.keepfit.client.MainActivity"
|
||||
android:label="@string/app_name" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sdk>
|
||||
<vid>000001001101</vid>
|
||||
<appid>HUNEPX60P3KIDYH</appid>
|
||||
<secret>b8FXJMzfELLOTM6BgGsFXmieePgqx1Ya50gPEUur</secret>
|
||||
</sdk>
|
||||
@@ -0,0 +1,41 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: '*.jar')
|
||||
implementation(name: 'android-smartband-sdk-sxrblejy2library-release', ext: 'aar')
|
||||
implementation(name: 'android-smartband-sdk-sxrblejy2aidl-release', ext: 'aar')
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 21
|
||||
buildToolsVersion '27.0.3'
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_7
|
||||
targetCompatibility JavaVersion.VERSION_1_7
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
manifest.srcFile 'AndroidManifest.xml'
|
||||
java.srcDirs = ['src']
|
||||
resources.srcDirs = ['src']
|
||||
aidl.srcDirs = ['src']
|
||||
renderscript.srcDirs = ['src']
|
||||
res.srcDirs = ['res']
|
||||
assets.srcDirs = ['assets']
|
||||
}
|
||||
|
||||
// Move the tests to tests/java, tests/res, etc...
|
||||
androidTest.setRoot('tests')
|
||||
|
||||
// Move the build types to build-types/<type>
|
||||
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
|
||||
// This moves them out of them default location under src/<type>/... which would
|
||||
// conflict with src/ being used by the main source set.
|
||||
// Adding new build types or product flavors should be accompanied
|
||||
// by a similar customization.
|
||||
debug.setRoot('build-types/debug')
|
||||
release.setRoot('build-types/release')
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
# This file is automatically generated by Android Tools.
|
||||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
|
||||
#
|
||||
# This file must be checked in Version Control Systems.
|
||||
#
|
||||
# To customize properties used by the Ant build system edit
|
||||
# "ant.properties", and override values to adapt the script to your
|
||||
# project structure.
|
||||
#
|
||||
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
|
||||
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
|
||||
|
||||
# Project target.
|
||||
target=android-21
|
||||
android.library.reference.1=../android-smartband-sdk-sxrblejy2aidl
|
||||
android.library.reference.2=../android-smartband-sdk-sxrblejy2library
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="false">
|
||||
<shape>
|
||||
<solid android:color="@android:color/holo_blue_light" />
|
||||
<corners android:radius="8dp" />
|
||||
<stroke android:color="@android:color/transparent" android:width="8dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<solid android:color="@android:color/holo_blue_dark" />
|
||||
<corners android:radius="8dp" />
|
||||
<stroke android:color="@android:color/transparent" android:width="8dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,468 @@
|
||||
<?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:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/data_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=""
|
||||
android:textColor="@android:color/holo_green_dark" />
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/svLog"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSync"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="visible" />
|
||||
</ScrollView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/bind"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/bind" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/unbind"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:enabled="false"
|
||||
android:text="@string/unbind" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/scan"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:enabled="false"
|
||||
android:text="@string/scan" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/connect"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:enabled="false"
|
||||
android:text="@string/connect"
|
||||
android:visibility="gone" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/disconnect"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:enabled="false"
|
||||
android:text="@string/disconnect" />
|
||||
</LinearLayout>
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/svDevice"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="visible">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llConnect"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/set_time"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/set_time" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/getcursportdata"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/sync_time" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/set_userinfo"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/set_userinfo" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/set_vir"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/set_vir" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/set_photo"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/set_photo" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/set_idletime"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/set_idletime" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/set_sleep"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/set_sleep" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/read_batery"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/read_batery" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/read_fw"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/read_deviceinfo" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/set_alarm"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/set_alarm" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/openheart"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/openheart" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/closeheart"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/closeheart" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/send_msg"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/send_msg" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/set_autoheart"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/set_autoheart" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/set_fuzhu"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/set_fuzhu" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/set_showmode"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/set_showmode" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_getdata"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:inputType="number"
|
||||
android:text="1" />
|
||||
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_getday"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:inputType="number"
|
||||
android:text="0" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/getdata"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2"
|
||||
android:text="@string/getdata" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt_setHeartRateArea"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/set_heart_range" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/set_parameters"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/set_parameters" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="visible">
|
||||
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:hint="name"
|
||||
android:text="name" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:hint="content"
|
||||
android:text="content" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="visible">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etType"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:hint="type"
|
||||
android:inputType="number"
|
||||
android:text="3" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bNotify"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/send_call_notificatioin" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/setLanguage"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="设置系统语言" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/send_weather"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="发送天气信息" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt_open_blood"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="打开血压" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt_close_blood"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="关闭血压" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt_getmutipleSportData"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="同步多运动数据" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt_setgoalstep"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="设置目标步数" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/bSetDeviceCode"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/set_device_code" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bGetDeviceCode"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/get_device_code" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/bGetBandFunction"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/get_band_function" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bSetUuid"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/set_uuid" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/MyListItem"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:id="@+id/ItemRssi"
|
||||
android:textSize="14sp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white" >
|
||||
</TextView>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="10dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical" >
|
||||
<TextView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:id="@+id/ItemTitle"
|
||||
android:textSize="20sp"
|
||||
android:gravity="left"
|
||||
android:textColor="@color/white" >
|
||||
</TextView>
|
||||
|
||||
<TextView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:id="@+id/ItemDate"
|
||||
android:textSize="14sp"
|
||||
android:gravity="left"
|
||||
android:textColor="@color/white" >
|
||||
</TextView>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?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:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@color/pop_window_bg"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<ListView
|
||||
android:id="@+id/nearby_device_listView"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:padding="8dip"
|
||||
android:divider="#ffffff"
|
||||
android:dividerHeight="4dp" >
|
||||
</ListView>
|
||||
|
||||
</LinearLayout>
|
||||
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<color name="white">#ffffff</color>
|
||||
<color name="pop_window_bg">#a0000000</color>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<!-- Default screen margins, per the Android Design guidelines. -->
|
||||
</resources>
|
||||
@@ -0,0 +1,34 @@
|
||||
<resources>
|
||||
<string name="app_name">JYSDK</string>
|
||||
|
||||
<string name="bind">绑定服务</string>
|
||||
<string name="unbind">解绑服务</string>
|
||||
<string name="scan">扫描</string>
|
||||
<string name="connect">连接</string>
|
||||
<string name="disconnect">断连</string>
|
||||
<string name="send_call_notificatioin">发送提醒</string>
|
||||
<string name="sync_time">获取当前运动数据</string>
|
||||
<string name="set_time">设置设备时间</string>
|
||||
<string name="set_parameters">设置设备参数</string>
|
||||
<string name="set_userinfo">设置个人信息</string>
|
||||
<string name="set_vir">手环振动</string>
|
||||
<string name="set_photo">拍照模式</string>
|
||||
<string name="set_idletime">久坐提醒时间</string>
|
||||
<string name="set_sleep">设置睡眠时间段</string>
|
||||
<string name="read_batery">读取设备电量</string>
|
||||
<string name="read_deviceinfo">读取手环信息</string>
|
||||
<string name="set_alarm">设置闹钟</string>
|
||||
<string name="send_msg">固件升级</string>
|
||||
<string name="openheart">开启测试心率</string>
|
||||
<string name="closeheart">关闭测试心率</string>
|
||||
<string name="set_autoheart">自动测试心率</string>
|
||||
<string name="set_fuzhu">特殊模式</string>
|
||||
<string name="set_showmode">设置显示模式</string>
|
||||
<string name="getdata">获取历史数据</string>
|
||||
<string name="set_device_code">设置机器串码</string>
|
||||
<string name="get_device_code">获取机器串码</string>
|
||||
|
||||
<string name="set_heart_range">设置心率区间</string>
|
||||
<string name="get_band_function">获取手环功能</string>
|
||||
<string name="set_uuid">切换默认处理</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,27 @@
|
||||
<resources>
|
||||
|
||||
<!--
|
||||
Base application theme, dependent on API level. This theme is replaced
|
||||
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
|
||||
-->
|
||||
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.NoActionBar">
|
||||
<!--
|
||||
Theme customizations available in newer API levels can go in
|
||||
res/values-vXX/styles.xml, while customizations related to
|
||||
backward-compatibility can go here.
|
||||
-->
|
||||
</style>
|
||||
|
||||
<!-- Application theme. -->
|
||||
<style name="AppTheme" parent="AppBaseTheme">
|
||||
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
|
||||
<item name="android:textSize">14sp</item>
|
||||
<item name="android:buttonStyle">@style/buttonStyle</item>
|
||||
</style>
|
||||
|
||||
<style name="buttonStyle">
|
||||
<item name="android:background">@drawable/button</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:padding">16dp</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.sxr.sdk.ble.keepfit.client;
|
||||
|
||||
public class BleDeviceItem {
|
||||
private String bleDeviceName;
|
||||
private String bleDeviceAddress;
|
||||
private String nickname;
|
||||
private String bindedDate;
|
||||
private int rssi;
|
||||
private String type;
|
||||
|
||||
public BleDeviceItem() {
|
||||
}
|
||||
|
||||
public BleDeviceItem(String deviceName, String deviceAddress, String nickname, String bindedDate, int rssi, String type) {
|
||||
setBleDeviceName(deviceName);
|
||||
setBleDeviceAddress(deviceAddress);
|
||||
setNickname(nickname);
|
||||
setBindedDate(bindedDate);
|
||||
setRssi(rssi);
|
||||
setType(type);
|
||||
}
|
||||
|
||||
public String getBleDeviceName() {
|
||||
return bleDeviceName;
|
||||
}
|
||||
public void setBleDeviceName(String bleDeviceName) {
|
||||
this.bleDeviceName = bleDeviceName;
|
||||
}
|
||||
|
||||
public String getBleDeviceAddress() {
|
||||
return bleDeviceAddress;
|
||||
}
|
||||
|
||||
public void setBleDeviceAddress(String bleDeviceAddress) {
|
||||
this.bleDeviceAddress = bleDeviceAddress;
|
||||
}
|
||||
|
||||
public int getRssi() {
|
||||
return rssi;
|
||||
}
|
||||
|
||||
public void setRssi(int rssi) {
|
||||
this.rssi = rssi;
|
||||
}
|
||||
|
||||
public String getNickname() {
|
||||
return nickname;
|
||||
}
|
||||
|
||||
public void setNickname(String nickname) {
|
||||
this.nickname = nickname;
|
||||
}
|
||||
|
||||
public String getBindedDate() {
|
||||
return bindedDate;
|
||||
}
|
||||
|
||||
public void setBindedDate(String bindedDate) {
|
||||
this.bindedDate = bindedDate;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.sxr.sdk.ble.keepfit.client;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
public class ComparatorBleDeviceItem implements Comparator<BleDeviceItem>{
|
||||
|
||||
@Override
|
||||
public int compare(BleDeviceItem arg0, BleDeviceItem arg1) {
|
||||
int rssi0 = arg0.getRssi();
|
||||
int rssi1 = arg1.getRssi();
|
||||
int result = 0;
|
||||
if(rssi0 < rssi1)
|
||||
{
|
||||
result=1;
|
||||
}
|
||||
if(rssi0 > rssi1)
|
||||
{
|
||||
result=-1;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.sxr.sdk.ble.keepfit.client;
|
||||
|
||||
import com.sxr.sdk.ble.keepfit.service.BluetoothLeService;
|
||||
public class SampleBleService extends BluetoothLeService {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
|
||||
super.onCreate();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.sxr.sdk.ble.keepfit.client;
|
||||
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.PackageManager.NameNotFoundException;
|
||||
import android.os.Build;
|
||||
import android.os.Environment;
|
||||
import android.util.Log;
|
||||
|
||||
import org.apache.http.util.EncodingUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.RandomAccessFile;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.security.MessageDigest;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
public class SysUtils {
|
||||
|
||||
// 将字符串写入到文本文件中
|
||||
public static void writeTxtToFile(String strcontent, String filePath, String fileName) {
|
||||
//生成文件夹之后,再生成文件,不然会出错
|
||||
File sdcardDir = Environment.getExternalStorageDirectory();
|
||||
String path = sdcardDir.getPath() + filePath;
|
||||
Calendar today = Calendar.getInstance();
|
||||
fileName = today.get(Calendar.YEAR) + "-" + (today.get(Calendar.MONTH) + 1) + "-" + today.get(Calendar.DAY_OF_MONTH) + "-" + fileName;
|
||||
makeFilePath(path, fileName);
|
||||
|
||||
String strFilePath = path + fileName;
|
||||
// 每次写入时,都换行写
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String now = sdf.format(new Date());
|
||||
String strContent = now + ":" + strcontent + "\r\n";
|
||||
try {
|
||||
File file = new File(strFilePath);
|
||||
if (!file.exists()) {
|
||||
Log.d("TestFile", "Create the file:" + strFilePath);
|
||||
file.getParentFile().mkdirs();
|
||||
file.createNewFile();
|
||||
}
|
||||
RandomAccessFile raf = new RandomAccessFile(file, "rwd");
|
||||
raf.seek(file.length());
|
||||
raf.write(strContent.getBytes());
|
||||
raf.close();
|
||||
} catch (Exception e) {
|
||||
Log.e("TestFile", "Error on write File:" + e);
|
||||
}
|
||||
}
|
||||
|
||||
// 生成文件
|
||||
public static File makeFilePath(String filePath, String fileName) {
|
||||
File file = null;
|
||||
makeRootDirectory(filePath);
|
||||
try {
|
||||
file = new File(filePath + fileName);
|
||||
if (!file.exists()) {
|
||||
file.createNewFile();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return file;
|
||||
}
|
||||
|
||||
// 生成文件夹
|
||||
public static void makeRootDirectory(String filePath) {
|
||||
File file = null;
|
||||
try {
|
||||
file = new File(filePath);
|
||||
if (!file.exists()) {
|
||||
file.mkdir();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.i("error:", e+"");
|
||||
}
|
||||
}
|
||||
|
||||
public static String printHexString( byte[] b) {
|
||||
if(b == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
String hexString = "";
|
||||
for (int i = 0; i < b.length; i++) {
|
||||
String hex = Integer.toHexString(b[i] & 0xFF);
|
||||
if (hex.length() == 1) {
|
||||
hex = '0' + hex;
|
||||
}
|
||||
hexString += hex.toUpperCase() + " ";
|
||||
}
|
||||
|
||||
return hexString;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.0.1'
|
||||
}
|
||||
}
|
||||
allprojects {
|
||||
repositories {
|
||||
jcenter()
|
||||
google()
|
||||
flatDir { dirs 'libs' }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
#Tue Jul 10 10:37:45 CST 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
|
||||
164
android/handcircle/JYOU PRO SDK/android-sdk-jy/android-smartband-sdk-sxrblejy2/gradlew
vendored
Normal file
@@ -0,0 +1,164 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
esac
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
||||
if $cygwin ; then
|
||||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
fi
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >&-
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >&-
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||
function splitJvmOpts() {
|
||||
JVM_OPTS=("$@")
|
||||
}
|
||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||
|
||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||
90
android/handcircle/JYOU PRO SDK/android-sdk-jy/android-smartband-sdk-sxrblejy2/gradlew.bat
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windowz variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
goto execute
|
||||
|
||||
:4NT_args
|
||||
@rem Get arguments from the 4NT Shell from JP Software
|
||||
set CMD_LINE_ARGS=%$
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@@ -0,0 +1,3 @@
|
||||
//include ':android-smartband-sdk-sxrblejy2aidl'
|
||||
include ':android-smartband-sdk-sxrblejy2client'
|
||||
//include ':android-smartband-sdk-sxrblejy2library'
|
||||
BIN
android/handcircle/JYOU PRO SDK中文(1).zip
Normal file
1
android/图标/关机.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1566379915976" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4704" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M313.67168 153.53856a40.96 40.96 0 0 1 39.7312 71.65952A327.53664 327.53664 0 0 0 184.32 512c0 180.98176 146.69824 327.68 327.68 327.68s327.68-146.69824 327.68-327.68c0-116.67456-61.44-222.65856-159.78496-281.45664a40.96 40.96 0 1 1 42.04544-70.30784A409.35424 409.35424 0 0 1 921.6 512c0 226.22208-183.37792 409.6-409.6 409.6S102.4 738.22208 102.4 512A409.43616 409.43616 0 0 1 313.67168 153.53856z" fill="#d81e06" p-id="4705"></path><path d="M471.04 102.4m40.96 0l0 0q40.96 0 40.96 40.96l0 409.6q0 40.96-40.96 40.96l0 0q-40.96 0-40.96-40.96l0-409.6q0-40.96 40.96-40.96Z" fill="#d81e06" p-id="4706"></path></svg>
|
||||
|
After Width: | Height: | Size: 990 B |
1
android/图标/刷新.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1566551240437" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2235" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#FFFFFF" p-id="2236"></path><path d="M512 795.306667c-75.093333 0-143.36-27.306667-197.973333-78.506667-13.653333-10.24-13.653333-30.72 0-44.373333 10.24-13.653333 30.72-13.653333 44.373333 0 40.96 40.96 95.573333 61.44 153.6 61.44 122.88 0 221.866667-98.986667 221.866667-221.866667v-17.066667c0-17.066667 10.24-30.72 27.306666-34.133333 17.066667 0 30.72 10.24 34.133334 27.306667v20.48c0 160.426667-126.293333 286.72-283.306667 286.72zM259.413333 563.2c-17.066667 0-30.72-13.653333-30.72-27.306667v-20.48c0-157.013333 126.293333-283.306667 283.306667-283.306666 75.093333 0 143.36 27.306667 197.973333 81.92 13.653333 10.24 13.653333 30.72 0 44.373333-10.24 13.653333-30.72 13.653333-44.373333 0-40.96-40.96-95.573333-61.44-153.6-61.44-122.88 0-221.866667 98.986667-221.866667 221.866667v17.066666c0 10.24-10.24 23.893333-30.72 27.306667 3.413333-3.413333 0 0 0 0z" fill="#333333" p-id="2237"></path><path d="M331.093333 532.48l-71.68 75.093333-71.68-75.093333zM689.493333 491.52l71.68-75.093333 71.68 75.093333z" fill="#333333" p-id="2238"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
1
android/图标/地图 (1).svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1566374199019" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2172" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M812.8 551.232c56-72.384 99.008-133.824 99.008-203.328 0-112.896-94.848-204.352-211.968-204.352s-211.968 91.52-211.968 204.352c0 62.4 36.864 121.984 85.056 186.368l-57.984 18.56L402.56 517.312C416.448 494.08 425.344 471.552 425.344 447.296c0-64.064-51.84-115.968-115.712-115.968-63.936 0-115.712 51.904-115.712 115.968 0 26.752 11.712 52.672 28.672 79.488L222.08 526.848 64 880.512l238.848-90.112 217.344 90.112 204.032-90.112L960 880.512 812.8 551.232zM699.904 248.64c56.832 0 102.912 44.416 102.912 99.264s-46.144 99.328-102.912 99.328c-56.896 0-102.912-44.48-102.912-99.328S643.008 248.64 699.904 248.64zM309.696 390.976c30.976 0 56.192 25.216 56.192 56.32 0 31.04-25.216 56.32-56.192 56.32-31.04 0-56.192-25.28-56.192-56.32C253.504 416.192 278.656 390.976 309.696 390.976zM720.128 736.832l-200.064 86.656-213.248-86.656-159.04 72.448 91.136-235.136 14.848-2.816c18.112 24.192 37.888 49.728 55.936 78.08C332.16 613.504 355.776 583.68 375.936 556.288L515.072 600.96l87.104-28.352c31.872 40.896 66.176 84.032 97.664 131.584 29.504-45.312 60.032-84.864 88.64-121.536l91.904 229.504L720.128 736.832z" p-id="2173"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
1
android/图标/地图.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1566374098445" class="icon" viewBox="0 0 1638 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2038" xmlns:xlink="http://www.w3.org/1999/xlink" width="319.921875" height="200"><defs><style type="text/css"></style></defs><path d="M961.024 24.32c-105.344 0-190.336 84.992-190.336 189.824s190.336 342.4 190.336 342.4S1150.72 319.488 1150.72 214.144C1151.232 109.312 1066.368 24.32 961.024 24.32z m5.76 277.376c-51.328 0-92.8-41.472-92.8-92.8s41.472-92.8 92.8-92.8 92.8 41.472 92.8 92.8-41.984 92.8-92.8 92.8zM730.24 110.848H465.024c-50.304 0-91.264 40.832-91.264 91.264v297.856l218.112 102.272 129.024-340.224c-5.76-19.968-9.472-38.272-9.472-54.528 0-34.304 6.784-66.816 18.816-96.64z m0 0" p-id="2039"></path><path d="M1196.416 114.56c11.52 28.8 17.792 60.288 17.792 93.312 0 138.88-251.648 452.992-251.648 452.992s-109.056-136.32-183.552-268.928l-96 253.696L1262.464 917.76c0-3.2 0.512-5.76 0.512-8.448V202.112c0-41.472-28.288-76.544-66.56-87.552zM373.76 610.944v297.216c0 42.496 29.312 78.592 68.736 88.576L556.288 696.32 373.76 610.944z m797.952 389.12c8.448 0 16.256-1.024 24.064-3.2L647.424 739.456l-98.56 260.608h622.848z m0 0" p-id="2040"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
1
android/图标/添加.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1566379690348" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3896" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M791.46666666 183.46666667h-537.6a51.2 51.2 0 0 0-51.2 51.2v537.6a51.2 51.2 0 0 0 51.2 51.2h537.6a51.2 51.2 0 0 0 51.2-51.2V234.66666667a51.2 51.2 0 0 0-51.2-51.2z m12.8 576a25.6 25.6 0 0 1-25.6 25.6h-512a25.6 25.6 0 0 1-25.6-25.6V247.46666667a25.6 25.6 0 0 1 25.6-25.6h512a25.6 25.6 0 0 1 25.6 25.6v512z" fill="#666666" p-id="3897"></path><path d="M714.66666666 484.26666667h-384v0.1664c-0.5376-0.0384-1.0496-0.1664-1.6-0.1664a19.2 19.2 0 0 0 0 38.4c0.5376 0 1.0624-0.1152 1.6-0.1792v0.1792h384a19.2 19.2 0 0 0 0-38.4z" fill="#666666" p-id="3898"></path><path d="M502.67306666 310.67306667v384h0.1664c-0.0384 0.5376-0.1664 1.0496-0.1664 1.6a19.2 19.2 0 0 0 38.4 0c0-0.5376-0.1152-1.0624-0.1792-1.6h0.1792v-384a19.2 19.2 0 0 0-38.4 0z" fill="#666666" p-id="3899"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |