Compare commits
1 Commits
master
...
wwh_branch
Author | SHA1 | Date |
---|---|---|
|
30ab4fd094 | 3 years ago |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 116 KiB |
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 175 KiB |
Before Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 9.5 KiB |
@ -0,0 +1,76 @@
|
|||||||
|
package com.tanshui.timeuse;
|
||||||
|
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import android.app.AppOpsManager;
|
||||||
|
import android.app.usage.UsageStats;
|
||||||
|
import android.app.usage.UsageStatsManager;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.pm.ApplicationInfo;
|
||||||
|
import android.content.pm.PackageInfo;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.content.pm.ResolveInfo;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.provider.Settings;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.ListView;
|
||||||
|
import android.widget.SimpleAdapter;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
|
||||||
|
private Button app_use;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_main);
|
||||||
|
app_use = findViewById(R.id.app_use);
|
||||||
|
|
||||||
|
//如没有开启应用权限,则开启
|
||||||
|
if (!isStatAccessPermissionSet()) {
|
||||||
|
Intent intent = new Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS);
|
||||||
|
this.startActivity(intent);
|
||||||
|
}
|
||||||
|
app_use.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
Intent intent=new Intent(MainActivity.this,appTimeUse.class);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 开启应用访问权限
|
||||||
|
public boolean isStatAccessPermissionSet() {
|
||||||
|
try {
|
||||||
|
PackageManager packageManager = this.getPackageManager();
|
||||||
|
ApplicationInfo info = packageManager.getApplicationInfo(this.getPackageName(), 0);
|
||||||
|
AppOpsManager appOpsManager = (AppOpsManager) this.getSystemService(APP_OPS_SERVICE);
|
||||||
|
return appOpsManager.checkOpNoThrow(AppOpsManager.OPSTR_GET_USAGE_STATS, info.uid, info.packageName) == AppOpsManager.MODE_ALLOWED;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,66 +0,0 @@
|
|||||||
package com.tanshui.timeuse;
|
|
||||||
|
|
||||||
public class PieInfo {
|
|
||||||
|
|
||||||
private float startAngle; // 开始绘制的角度
|
|
||||||
|
|
||||||
private float sweepAngle; // 扫过的角度
|
|
||||||
|
|
||||||
private int color; // 显示的颜色
|
|
||||||
|
|
||||||
private float percent; // 所占百分比
|
|
||||||
|
|
||||||
public float getStartAngle() {
|
|
||||||
return startAngle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStartAngle(float startAngle) {
|
|
||||||
this.startAngle = startAngle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public float getSweepAngle() {
|
|
||||||
return sweepAngle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSweepAngle(float sweepAngle) {
|
|
||||||
this.sweepAngle = sweepAngle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getColor() {
|
|
||||||
return color;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setColor(int color) {
|
|
||||||
this.color = color;
|
|
||||||
}
|
|
||||||
|
|
||||||
public float getPercent() {
|
|
||||||
return percent;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPercent(float percent) {
|
|
||||||
this.percent = percent;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSelected() {
|
|
||||||
return selected;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSelected(boolean selected) {
|
|
||||||
this.selected = selected;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean selected; // true为选中
|
|
||||||
|
|
||||||
public PieInfo(int color, float percent) {
|
|
||||||
this.color = color;
|
|
||||||
this.percent = percent;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PieInfo(int color, float percent, boolean selected) {
|
|
||||||
this.color = color;
|
|
||||||
this.percent = percent;
|
|
||||||
this.selected = selected;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -0,0 +1,28 @@
|
|||||||
|
package com.tanshui.timeuse;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import com.tanshui.timeuse.database.timeUseDBHelper;
|
||||||
|
|
||||||
|
public class add_task extends AppCompatActivity {
|
||||||
|
private timeUseDBHelper dbHelper;
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_add_task);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
dbHelper = timeUseDBHelper.getInstance(this);
|
||||||
|
dbHelper.openReadLink();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onStop() {
|
||||||
|
super.onStop();
|
||||||
|
dbHelper.closeLink();
|
||||||
|
}
|
||||||
|
}
|
@ -1,252 +0,0 @@
|
|||||||
package com.tanshui.timeuse;
|
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
|
|
||||||
import android.app.ProgressDialog;
|
|
||||||
import android.app.usage.UsageStats;
|
|
||||||
import android.app.usage.UsageStatsManager;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.pm.ApplicationInfo;
|
|
||||||
import android.content.pm.PackageInfo;
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.graphics.drawable.Drawable;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.ListView;
|
|
||||||
import android.widget.SimpleAdapter;
|
|
||||||
|
|
||||||
import com.tanshui.timeuse.database.timeUseDBHelper;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class appTime extends AppCompatActivity {
|
|
||||||
|
|
||||||
private ProgressDialog progressDialog;
|
|
||||||
private String date;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
setContentView(R.layout.activity_app_time);
|
|
||||||
ArrayList<AppInfo> mApplicationInfos;
|
|
||||||
timeUseDBHelper dbHelper;
|
|
||||||
List<AppInfo> appInfoList;
|
|
||||||
SimpleAdapter simpleAdapter;
|
|
||||||
dbHelper = timeUseDBHelper.getInstance(this);
|
|
||||||
dbHelper.openWriteLink();
|
|
||||||
dbHelper.openReadLink();
|
|
||||||
appInfoList=dbHelper.queryAllClassifyInfo();
|
|
||||||
showProgressDialog("1","11");
|
|
||||||
ListView lv_app = findViewById(R.id.lv_app1);
|
|
||||||
Button list = findViewById(R.id.jump_app_list1);
|
|
||||||
Button report = findViewById(R.id.jump_app_report1);
|
|
||||||
Button appClassify =findViewById(R.id.jump_app_appClassify1);
|
|
||||||
// 接受传的date
|
|
||||||
Intent intent1=getIntent();
|
|
||||||
date = intent1.getStringExtra("date");
|
|
||||||
|
|
||||||
list.setOnClickListener(v -> {
|
|
||||||
Intent intent=new Intent(appTime.this,task_show.class);
|
|
||||||
startActivity(intent);
|
|
||||||
});
|
|
||||||
report.setOnClickListener(v -> {
|
|
||||||
Intent intent=new Intent();
|
|
||||||
intent.setClass(appTime.this, report.class);
|
|
||||||
intent.putExtra("date",date);
|
|
||||||
showProgressDialog("","正在加载");
|
|
||||||
startActivity(intent);
|
|
||||||
|
|
||||||
});
|
|
||||||
appClassify.setOnClickListener(v -> {
|
|
||||||
Intent intent=new Intent();
|
|
||||||
intent.setClass(appTime.this, software_classification.class);
|
|
||||||
intent.putExtra("date",date);
|
|
||||||
startActivity(intent);
|
|
||||||
});
|
|
||||||
|
|
||||||
mApplicationInfos=getAllAppInfo(this);
|
|
||||||
|
|
||||||
// 从早上8点开始监听
|
|
||||||
Calendar setBeginCal=Calendar.getInstance();
|
|
||||||
|
|
||||||
|
|
||||||
Calendar setEndCal=Calendar.getInstance();
|
|
||||||
|
|
||||||
|
|
||||||
Calendar beginCal = Calendar.getInstance();
|
|
||||||
int hour = beginCal.get(Calendar.HOUR_OF_DAY);
|
|
||||||
int minute = beginCal.get(Calendar.MINUTE);
|
|
||||||
int second = beginCal.get(Calendar.SECOND);
|
|
||||||
|
|
||||||
setBeginCal.add(Calendar.SECOND, -1 * second);
|
|
||||||
setBeginCal.add(Calendar.MINUTE, -1 * minute);
|
|
||||||
setBeginCal.add(Calendar.HOUR, -1 * hour+8);
|
|
||||||
|
|
||||||
setEndCal.add(Calendar.SECOND, -1 * second);
|
|
||||||
setEndCal.add(Calendar.MINUTE, -1 * minute);
|
|
||||||
setEndCal.add(Calendar.HOUR, -1 * hour+10);
|
|
||||||
|
|
||||||
beginCal.add(Calendar.SECOND, -1 * second);
|
|
||||||
beginCal.add(Calendar.MINUTE, -1 * minute);
|
|
||||||
beginCal.add(Calendar.HOUR, -1 * hour+8);
|
|
||||||
|
|
||||||
Calendar endCal = Calendar.getInstance();
|
|
||||||
|
|
||||||
UsageStatsManager manager=(UsageStatsManager)getApplicationContext().getSystemService(USAGE_STATS_SERVICE);
|
|
||||||
List<UsageStats> stats=manager.queryUsageStats(UsageStatsManager.INTERVAL_DAILY,beginCal.getTimeInMillis(),endCal.getTimeInMillis());
|
|
||||||
Map<String, UsageStats> statsMap = manager.queryAndAggregateUsageStats(setBeginCal.getTimeInMillis(), setEndCal.getTimeInMillis());
|
|
||||||
|
|
||||||
ArrayList<HashMap<String, Object>> listItem = new ArrayList<>();
|
|
||||||
|
|
||||||
List<String> name = new ArrayList<>();
|
|
||||||
List<Drawable> icons = new ArrayList<>();
|
|
||||||
|
|
||||||
for(UsageStats us:stats){
|
|
||||||
try {
|
|
||||||
PackageManager pm=getApplicationContext().getPackageManager();
|
|
||||||
ApplicationInfo applicationInfo=pm.getApplicationInfo(us.getPackageName(),PackageManager.GET_META_DATA);
|
|
||||||
// Toast.makeText(this, appInfo.package_name, Toast.LENGTH_SHORT).show();
|
|
||||||
PackageInfo packageInfo = pm.getPackageInfo(applicationInfo.packageName, PackageManager.GET_CONFIGURATIONS);
|
|
||||||
int flags = packageInfo.applicationInfo.flags;
|
|
||||||
// SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss");
|
|
||||||
//
|
|
||||||
// String t=format.format(new Date(us.getLastTimeUsed()));
|
|
||||||
// long t1=us.getLastTimeStamp();
|
|
||||||
// String t2=format.format(new Date(us.getLastTimeUsed()));
|
|
||||||
String appName = "";
|
|
||||||
Drawable icon=null;
|
|
||||||
|
|
||||||
for(AppInfo app:mApplicationInfos){
|
|
||||||
if(applicationInfo.packageName.equals(app.getPackage_name())){
|
|
||||||
appName=app.getLabel();
|
|
||||||
name.add(appName);
|
|
||||||
icon=app.getIcon();
|
|
||||||
icons.add(icon);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(getTimeFromInt(us.getTotalTimeInForeground())!="已结束"){
|
|
||||||
UsageStats usageStats=statsMap.get(applicationInfo.packageName);
|
|
||||||
// 判断是否为系统应用系统
|
|
||||||
if((flags & ApplicationInfo.FLAG_SYSTEM) == 0){
|
|
||||||
AppInfo appInfo=new AppInfo();
|
|
||||||
HashMap<String,Object> map = new HashMap<>();
|
|
||||||
//加入图片
|
|
||||||
map.put("ItemImage", icon);
|
|
||||||
// 添加app名称
|
|
||||||
|
|
||||||
map.put("ItemLabel", appName);
|
|
||||||
appInfo.setLabel(appName);
|
|
||||||
// 添加app使用时间
|
|
||||||
map.put("ItemTime","今天使用时间:"+getTimeFromInt(usageStats.getTotalTimeInForeground()));
|
|
||||||
appInfo.setTimeString(getTimeFromInt(usageStats.getTotalTimeInForeground()));
|
|
||||||
appInfo.setTimeLong(usageStats.getTotalTimeInForeground());
|
|
||||||
appInfo.setPackage_name(applicationInfo.packageName);
|
|
||||||
|
|
||||||
// dbHelper=timeUseDBHelper.getInstance(this);
|
|
||||||
if(dbHelper.searchPacketName(appInfo.getPackage_name(),"appList")){
|
|
||||||
// 修改时间
|
|
||||||
dbHelper.updateAppUseTime(appInfo,date);
|
|
||||||
|
|
||||||
}else{
|
|
||||||
for(AppInfo app:appInfoList){
|
|
||||||
if(app.getPackage_name().equals(appInfo.getPackage_name()))
|
|
||||||
appInfo.setClassify(app.getClassify());
|
|
||||||
}
|
|
||||||
dbHelper.insertAppInfos(appInfo,date);
|
|
||||||
}
|
|
||||||
listItem.add(map);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
simpleAdapter = new SimpleAdapter(this,
|
|
||||||
//绑定的数据
|
|
||||||
listItem,
|
|
||||||
//每一行的布局
|
|
||||||
R.layout.appitem,
|
|
||||||
//动态数组中的数据源的键映射到布局文件对应的控件中
|
|
||||||
new String[] {"ItemImage", "ItemLabel","ItemTime"},
|
|
||||||
new int[] {R.id.iv_appIcon, R.id.label,R.id.times});
|
|
||||||
lv_app.setAdapter(simpleAdapter);
|
|
||||||
|
|
||||||
// 显示app图标
|
|
||||||
simpleAdapter.setViewBinder((view, o, s) -> {
|
|
||||||
if(view instanceof ImageView && o instanceof Drawable){
|
|
||||||
|
|
||||||
ImageView iv=(ImageView)view;
|
|
||||||
iv.setImageDrawable((Drawable)o);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else return false;
|
|
||||||
});
|
|
||||||
hideProgressDialog();
|
|
||||||
}
|
|
||||||
// 弹出正在加载弹窗
|
|
||||||
public void showProgressDialog(String title, String message) {
|
|
||||||
if (progressDialog == null) {
|
|
||||||
|
|
||||||
progressDialog = ProgressDialog.show(appTime.this,
|
|
||||||
title, message, true, false);
|
|
||||||
} else if (progressDialog.isShowing()) {
|
|
||||||
progressDialog.setTitle(title);
|
|
||||||
progressDialog.setMessage(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
progressDialog.show();
|
|
||||||
|
|
||||||
}
|
|
||||||
public ArrayList<AppInfo> getAllAppInfo(Context ctx) {
|
|
||||||
ArrayList<AppInfo> appBeanList = new ArrayList<>();
|
|
||||||
AppInfo bean = null;
|
|
||||||
PackageManager packageManager = ctx.getPackageManager();
|
|
||||||
List<PackageInfo> list = packageManager.getInstalledPackages(0);
|
|
||||||
for (PackageInfo p : list) {
|
|
||||||
bean = new AppInfo();
|
|
||||||
|
|
||||||
bean.setIcon(p.applicationInfo.loadIcon(packageManager));
|
|
||||||
bean.setLabel(packageManager.getApplicationLabel(p.applicationInfo).toString());
|
|
||||||
bean.setPackage_name(p.applicationInfo.packageName);
|
|
||||||
|
|
||||||
int flags = p.applicationInfo.flags;
|
|
||||||
// 判断是否是属于系统的apk
|
|
||||||
if ((flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
|
|
||||||
// bean.setSystem(true);
|
|
||||||
} else {
|
|
||||||
appBeanList.add(bean);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return appBeanList;
|
|
||||||
}
|
|
||||||
// 隐藏提示加载弹窗
|
|
||||||
public void hideProgressDialog() {
|
|
||||||
|
|
||||||
if (progressDialog != null && progressDialog.isShowing()) {
|
|
||||||
progressDialog.dismiss();
|
|
||||||
}
|
|
||||||
progressDialog=null;
|
|
||||||
}
|
|
||||||
public static String getTimeFromInt(long time) {
|
|
||||||
|
|
||||||
if (time <= 0) { return "已结束"; }
|
|
||||||
// long day = time / (1 * 60 * 60 * 24);
|
|
||||||
String hour = time / (1000*60*60) % 60 +"";
|
|
||||||
String minute = time / (1000*60) % 60<10?"0"+time / (1000*60) % 60:""+time / (1000*60) % 60;
|
|
||||||
String second = time /1000 % 60<10?"0"+time / 1000 % 60:""+time / 1000 % 60;
|
|
||||||
|
|
||||||
return hour+"小时"+minute+"分钟"+second+"秒";
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.tanshui.timeuse.login;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import com.tanshui.timeuse.R;
|
||||||
|
|
||||||
|
public class login extends AppCompatActivity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_login);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.tanshui.timeuse.login;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import com.tanshui.timeuse.R;
|
||||||
|
|
||||||
|
public class registered extends AppCompatActivity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_registered);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,94 @@
|
|||||||
|
package com.tanshui.timeuse;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import android.app.DatePickerDialog;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.DatePicker;
|
||||||
|
import android.widget.ListView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.tanshui.timeuse.database.timeUseDBHelper;
|
||||||
|
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class show_task extends AppCompatActivity {
|
||||||
|
private TextView textView;
|
||||||
|
private Button changeDate;
|
||||||
|
private Button addTask;
|
||||||
|
private String decs;
|
||||||
|
private DatePicker picker;
|
||||||
|
private DatePickerDialog.OnDateSetListener listener;
|
||||||
|
private int nowYear;
|
||||||
|
private int nowMonth;
|
||||||
|
private int nowDay;
|
||||||
|
private timeUseDBHelper dbHelper;
|
||||||
|
private List<taskInfo> task;
|
||||||
|
private ListView lv_task;
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_show_task);
|
||||||
|
textView = findViewById(R.id.tv);
|
||||||
|
lv_task=findViewById(R.id.lv_task);
|
||||||
|
changeDate = findViewById(R.id.changeDate);
|
||||||
|
addTask=findViewById(R.id.addTask);
|
||||||
|
// 获取当前日期
|
||||||
|
Calendar now=Calendar.getInstance();
|
||||||
|
nowYear=now.get(Calendar.YEAR);
|
||||||
|
nowMonth=now.get(Calendar.MONTH);//实际月份需要加1
|
||||||
|
nowDay=now.get(Calendar.DATE);
|
||||||
|
decs=String.format("%s-%s-%s", nowYear, nowMonth, nowDay);
|
||||||
|
textView.setText(decs);
|
||||||
|
// List<taskInfo> list=dbHelper.queryAllTaskInfo();
|
||||||
|
// 点击按钮更改日期
|
||||||
|
changeDate.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
DatePickerDialog dateDialog = new DatePickerDialog(show_task.this,
|
||||||
|
new DatePickerDialog.OnDateSetListener() {
|
||||||
|
@Override
|
||||||
|
public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
|
||||||
|
|
||||||
|
decs = String.format("%s-%s-%s", year, month, dayOfMonth);
|
||||||
|
textView.setText(decs);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
calendar.get(Calendar.YEAR),
|
||||||
|
calendar.get(Calendar.MONTH),
|
||||||
|
calendar.get(Calendar.DAY_OF_MONTH));
|
||||||
|
|
||||||
|
dateDialog.show();
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 点击按钮添加任务
|
||||||
|
addTask.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
Intent intent=new Intent();
|
||||||
|
intent.setClass(show_task.this, task_add.class);
|
||||||
|
intent.putExtra("date",decs);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
dbHelper = timeUseDBHelper.getInstance(this);
|
||||||
|
dbHelper.openReadLink();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onStop() {
|
||||||
|
super.onStop();
|
||||||
|
dbHelper.closeLink();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package com.tanshui.timeuse;
|
||||||
|
|
||||||
|
public class taskManager {
|
||||||
|
public void addTask(){
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -1,60 +0,0 @@
|
|||||||
package com.tanshui.timeuse.util;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import android.graphics.Color;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by 54966 on 2018/3/8.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class ColorRandom {
|
|
||||||
|
|
||||||
private ArrayList<Integer> colorArrays;
|
|
||||||
|
|
||||||
private int count;
|
|
||||||
|
|
||||||
public ColorRandom(int count) {
|
|
||||||
colorArrays = new ArrayList<>(count);
|
|
||||||
this.count = count;
|
|
||||||
setColor();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setColor() {
|
|
||||||
for (int i = 0; i < count; i++) {
|
|
||||||
int color = getColor();
|
|
||||||
colorArrays.add(color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Integer getColor() {
|
|
||||||
int color = Color.parseColor("#FFA500");
|
|
||||||
while (colorArrays.contains(color) || "#FFFFFF".equals(color)) {
|
|
||||||
color = getRandColorCode();
|
|
||||||
if (!colorArrays.contains(color)) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return color;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArrayList getColors() {
|
|
||||||
return colorArrays;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Integer getRandColorCode() {
|
|
||||||
String r, g, b;
|
|
||||||
Random random = new Random();
|
|
||||||
r = Integer.toHexString(random.nextInt(256)).toUpperCase();
|
|
||||||
g = Integer.toHexString(random.nextInt(256)).toUpperCase();
|
|
||||||
b = Integer.toHexString(random.nextInt(256)).toUpperCase();
|
|
||||||
|
|
||||||
r = r.length() == 1 ? "0" + r : r;
|
|
||||||
g = g.length() == 1 ? "0" + g : g;
|
|
||||||
b = b.length() == 1 ? "0" + b : b;
|
|
||||||
|
|
||||||
return Color.parseColor("#" + r + g + b);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,47 +0,0 @@
|
|||||||
package com.tanshui.timeuse.util;
|
|
||||||
|
|
||||||
public class dateList {
|
|
||||||
private String date;
|
|
||||||
private int num;
|
|
||||||
private int finishedNum;
|
|
||||||
|
|
||||||
public int getFinishedNum() {
|
|
||||||
return finishedNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFinishedNum(int finishedNum) {
|
|
||||||
this.finishedNum = finishedNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
private float dates;
|
|
||||||
public float getDates() {
|
|
||||||
return dates;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDates(float dates) {
|
|
||||||
this.dates = dates;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public dateList(String date, int num) {
|
|
||||||
this.date = date;
|
|
||||||
this.num = num;
|
|
||||||
}
|
|
||||||
public dateList(){}
|
|
||||||
public String getDate() {
|
|
||||||
return date;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDate(String date) {
|
|
||||||
this.date = date;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getNum() {
|
|
||||||
return num;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNum(int num) {
|
|
||||||
this.num = num;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
package com.tanshui.timeuse.util;
|
|
||||||
|
|
||||||
public class getApp {
|
|
||||||
|
|
||||||
}
|
|
@ -1,5 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:drawable="@drawable/btn_color_enter" android:state_pressed="true" ></item>
|
<item android:drawable="@drawable/btn_color_enter" android:state_pressed="true"></item>
|
||||||
|
|
||||||
</selector>
|
</selector>
|
@ -1,13 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:shape="rectangle">
|
android:shape="rectangle">
|
||||||
<solid android:color="#625B57" />
|
<solid android:color="#b1b1b1" />
|
||||||
<!-- 设置圆角 -->
|
<!-- 设置圆角 -->
|
||||||
<corners android:radius="10dp" />
|
<corners android:radius="10dp" />
|
||||||
<!-- 设置边框 -->
|
<!-- 设置边框 -->
|
||||||
<stroke
|
<stroke
|
||||||
android:width="1px"
|
android:width="1px"
|
||||||
android:color="#625B57" />
|
android:color="#efefef" />
|
||||||
<!--left to right-->
|
<!--left to right-->
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context=".add_task">
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -1,57 +0,0 @@
|
|||||||
<?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"
|
|
||||||
tools:context=".appTimeUse">
|
|
||||||
<ListView
|
|
||||||
android:id="@+id/lv_app1"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
></ListView>
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="45dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:background="@color/tabColor"
|
|
||||||
android:layout_marginTop="10dp">
|
|
||||||
<Button
|
|
||||||
android:layout_width="120dp"
|
|
||||||
android:layout_height="45dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@drawable/btn_basic"
|
|
||||||
android:id="@+id/jump_app_list1"
|
|
||||||
android:text="任务清单">
|
|
||||||
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
android:layout_width="120dp"
|
|
||||||
android:layout_height="45dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@color/btnColor"
|
|
||||||
android:id="@+id/jump_app_appUse1"
|
|
||||||
android:text="应用使用情况">
|
|
||||||
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
android:layout_width="120dp"
|
|
||||||
android:layout_height="45dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@drawable/btn_basic"
|
|
||||||
android:id="@+id/jump_app_report1"
|
|
||||||
android:text="分析报告">
|
|
||||||
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
android:layout_width="120dp"
|
|
||||||
android:layout_height="45dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@drawable/btn_basic"
|
|
||||||
android:id="@+id/jump_app_appClassify1"
|
|
||||||
android:text="应用分类">
|
|
||||||
</Button>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
@ -0,0 +1,47 @@
|
|||||||
|
<?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"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context=".show_task"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<TextView
|
||||||
|
android:gravity="center"
|
||||||
|
android:id="@+id/tv"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
/>
|
||||||
|
<ListView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:id="@+id/lv_task">
|
||||||
|
</ListView>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<Button
|
||||||
|
android:id="@+id/changeDate"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/changeDate"
|
||||||
|
android:layout_weight="1"
|
||||||
|
/>
|
||||||
|
<Button
|
||||||
|
android:id="@+id/addTask"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/addTask"
|
||||||
|
android:layout_weight="1"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="45dp"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:gravity="center"/>
|
|
@ -1,6 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:context=".appTimeUse">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="123123">
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</TextView>
|
||||||
|
</LinearLayout>
|
@ -1,6 +1,44 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
tools:context=".report"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_marginLeft="10dp">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/title"
|
||||||
|
android:text="查看分析报告"
|
||||||
|
android:textSize="20dp">
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</TextView>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="任务数量:"
|
||||||
|
android:textSize="20dp">
|
||||||
|
|
||||||
|
</TextView>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="任务完成率:"
|
||||||
|
android:textSize="20dp">
|
||||||
|
|
||||||
|
</TextView>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="任务量趋势:"
|
||||||
|
android:textSize="20dp">
|
||||||
|
|
||||||
|
</TextView>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -1,107 +0,0 @@
|
|||||||
<?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">
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:orientation="vertical">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/taskNumber"
|
|
||||||
android:textSize="20dp">
|
|
||||||
|
|
||||||
</TextView>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/finishRate"
|
|
||||||
android:textSize="20dp">
|
|
||||||
|
|
||||||
</TextView>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/taskNumRate"
|
|
||||||
android:textSize="20dp">
|
|
||||||
</TextView>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/top_five"
|
|
||||||
android:textSize="20dp">
|
|
||||||
|
|
||||||
</TextView>
|
|
||||||
</LinearLayout>
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical">
|
|
||||||
<com.tanshui.timeuse.util.PieChart
|
|
||||||
android:id="@+id/pie_chart1"
|
|
||||||
android:layout_width="220dp"
|
|
||||||
android:layout_height="220dp"
|
|
||||||
android:layout_gravity="center"/>
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="180dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_marginLeft="30dp">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="16dp"
|
|
||||||
android:id="@+id/pie_btn1"/>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="16dp"
|
|
||||||
android:id="@+id/pie_btn2" />
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="16dp"
|
|
||||||
android:id="@+id/pie_btn3" />
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="16dp"
|
|
||||||
android:id="@+id/pie_btn4" />
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="16dp"
|
|
||||||
android:id="@+id/pie_btn5" />
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="16dp"
|
|
||||||
android:id="@+id/pie_btn6" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- <com.tanshui.timeuse.util.PieChart-->
|
|
||||||
<!-- android:id="@+id/pie_chart"-->
|
|
||||||
<!-- android:layout_width="200dp"-->
|
|
||||||
<!-- android:layout_height="200dp"-->
|
|
||||||
<!-- android:background="@color/endColor"-->
|
|
||||||
<!-- />-->
|
|
||||||
</LinearLayout>
|
|
@ -1,173 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical">
|
|
||||||
<ScrollView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1">
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:orientation="vertical">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/week_taskNumber"
|
|
||||||
android:text="任务最多的天数,完成率最高的天数"
|
|
||||||
android:textSize="20dp">
|
|
||||||
|
|
||||||
</TextView>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/week_finishRate"
|
|
||||||
android:layout_marginBottom="20dp"
|
|
||||||
android:textSize="20dp">
|
|
||||||
|
|
||||||
</TextView>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/week_topTaskNumber"
|
|
||||||
android:layout_marginBottom="20dp"
|
|
||||||
android:textSize="20dp">
|
|
||||||
|
|
||||||
</TextView>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/week_topFinishRate"
|
|
||||||
android:layout_marginBottom="20dp"
|
|
||||||
android:textSize="20dp">
|
|
||||||
|
|
||||||
</TextView>
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
<com.tanshui.timeuse.util.PieChart
|
|
||||||
android:id="@+id/week_pie_chart1"
|
|
||||||
android:layout_width="200dp"
|
|
||||||
android:layout_height="200dp" />
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="180dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:orientation="vertical">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="15dp"
|
|
||||||
android:id="@+id/week_pie_btn1"/>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="15dp"
|
|
||||||
android:id="@+id/week_pie_btn2" />
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="15dp"
|
|
||||||
android:id="@+id/week_pie_btn3" />
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="15dp"
|
|
||||||
android:id="@+id/week_pie_btn4" />
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="15dp"
|
|
||||||
android:id="@+id/week_pie_btn5" />
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="15dp"
|
|
||||||
android:id="@+id/week_pie_btn6" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
<com.tanshui.timeuse.util.PieChart
|
|
||||||
android:id="@+id/week_pie_chart2"
|
|
||||||
android:layout_width="200dp"
|
|
||||||
android:layout_height="200dp" />
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="180dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:orientation="vertical">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="15dp"
|
|
||||||
android:id="@+id/week_pie_btn21"/>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="15dp"
|
|
||||||
android:id="@+id/week_pie_btn22" />
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="15dp"
|
|
||||||
android:id="@+id/week_pie_btn23" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="有关任务的折线图"
|
|
||||||
android:layout_marginBottom="20dp"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:textSize="20dp"/>
|
|
||||||
<com.github.mikephil.charting.charts.LineChart
|
|
||||||
android:id="@+id/line"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="300dp"
|
|
||||||
android:layout_marginBottom="40dp"
|
|
||||||
>
|
|
||||||
</com.github.mikephil.charting.charts.LineChart>
|
|
||||||
<com.github.mikephil.charting.charts.LineChart
|
|
||||||
android:id="@+id/line1"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="300dp"
|
|
||||||
>
|
|
||||||
</com.github.mikephil.charting.charts.LineChart>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</ScrollView>
|
|
||||||
|
|
||||||
<!-- <com.tanshui.timeuse.util.PieChart-->
|
|
||||||
<!-- android:id="@+id/pie_chart"-->
|
|
||||||
<!-- android:layout_width="200dp"-->
|
|
||||||
<!-- android:layout_height="200dp"-->
|
|
||||||
<!-- android:background="@color/endColor"-->
|
|
||||||
<!-- />-->
|
|
||||||
</LinearLayout>
|
|
@ -1,86 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical">
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:orientation="vertical">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/taskNumber_yesterday"
|
|
||||||
android:textSize="20dp">
|
|
||||||
|
|
||||||
</TextView>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/finishRate_yesterday"
|
|
||||||
android:textSize="20dp">
|
|
||||||
|
|
||||||
</TextView>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical">
|
|
||||||
<com.tanshui.timeuse.util.PieChart
|
|
||||||
android:id="@+id/pie_chart2"
|
|
||||||
android:layout_width="200dp"
|
|
||||||
android:layout_height="200dp"
|
|
||||||
android:layout_gravity="center"/>
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="180dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_marginLeft="30dp">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="16dp"
|
|
||||||
android:id="@+id/pie_yesterday_btn1"/>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="16dp"
|
|
||||||
android:id="@+id/pie_yesterday_btn2" />
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="16dp"
|
|
||||||
android:id="@+id/pie_yesterday_btn3" />
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="16dp"
|
|
||||||
android:id="@+id/pie_yesterday_btn4" />
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="16dp"
|
|
||||||
android:id="@+id/pie_yesterday_btn5" />
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="16dp"
|
|
||||||
android:id="@+id/pie_yesterday_btn6" />
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|