diff --git a/doc/大作业一_模板.docx b/doc/大作业一_模板.docx
new file mode 100644
index 0000000..f66360f
Binary files /dev/null and b/doc/大作业一_模板.docx differ
diff --git a/doc/大作业二_-模板.docx b/doc/大作业二_-模板.docx
new file mode 100644
index 0000000..cfb5919
Binary files /dev/null and b/doc/大作业二_-模板.docx differ
diff --git a/doc/软件系统的需求构思及描述.docx b/doc/软件系统的需求构思及描述.docx
new file mode 100644
index 0000000..4622cc8
Binary files /dev/null and b/doc/软件系统的需求构思及描述.docx differ
diff --git a/model/分析类图.png b/model/分析类图.png
new file mode 100644
index 0000000..e363d5e
Binary files /dev/null and b/model/分析类图.png differ
diff --git a/model/开发视图.png b/model/开发视图.png
new file mode 100644
index 0000000..351c116
Binary files /dev/null and b/model/开发视图.png differ
diff --git a/model/数据设计模型.png b/model/数据设计模型.png
new file mode 100644
index 0000000..4f8a828
Binary files /dev/null and b/model/数据设计模型.png differ
diff --git a/model/用例图.png b/model/用例图.png
new file mode 100644
index 0000000..de2e07b
Binary files /dev/null and b/model/用例图.png differ
diff --git a/model/用例描述.docx b/model/用例描述.docx
new file mode 100644
index 0000000..fa28d9a
Binary files /dev/null and b/model/用例描述.docx differ
diff --git a/model/用户顺序图.png b/model/用户顺序图.png
new file mode 100644
index 0000000..ace4d02
Binary files /dev/null and b/model/用户顺序图.png differ
diff --git a/model/界面流顺序图.png b/model/界面流顺序图.png
new file mode 100644
index 0000000..d0654d1
Binary files /dev/null and b/model/界面流顺序图.png differ
diff --git a/model/界面设计.docx b/model/界面设计.docx
new file mode 100644
index 0000000..5faa161
Binary files /dev/null and b/model/界面设计.docx differ
diff --git a/model/系统顺序图.png b/model/系统顺序图.png
new file mode 100644
index 0000000..ff87e88
Binary files /dev/null and b/model/系统顺序图.png differ
diff --git a/model/设计类图.png b/model/设计类图.png
new file mode 100644
index 0000000..c457e22
Binary files /dev/null and b/model/设计类图.png differ
diff --git a/model/逻辑视图.png b/model/逻辑视图.png
new file mode 100644
index 0000000..15b106c
Binary files /dev/null and b/model/逻辑视图.png differ
diff --git a/src/timeUse/.gitignore b/src/timeUse/.gitignore
new file mode 100644
index 0000000..aa724b7
--- /dev/null
+++ b/src/timeUse/.gitignore
@@ -0,0 +1,15 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
+local.properties
diff --git a/src/timeUse/.idea/.gitignore b/src/timeUse/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/src/timeUse/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/src/timeUse/.idea/compiler.xml b/src/timeUse/.idea/compiler.xml
new file mode 100644
index 0000000..fb7f4a8
--- /dev/null
+++ b/src/timeUse/.idea/compiler.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/.idea/gradle.xml b/src/timeUse/.idea/gradle.xml
new file mode 100644
index 0000000..a2d7c21
--- /dev/null
+++ b/src/timeUse/.idea/gradle.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/.idea/misc.xml b/src/timeUse/.idea/misc.xml
new file mode 100644
index 0000000..eac11ea
--- /dev/null
+++ b/src/timeUse/.idea/misc.xml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/.gitignore b/src/timeUse/app/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/src/timeUse/app/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/src/timeUse/app/build.gradle b/src/timeUse/app/build.gradle
new file mode 100644
index 0000000..f31304c
--- /dev/null
+++ b/src/timeUse/app/build.gradle
@@ -0,0 +1,38 @@
+plugins {
+ id 'com.android.application'
+}
+
+android {
+ compileSdk 32
+
+ defaultConfig {
+ applicationId "com.tanshui.timeuse"
+ minSdk 29
+ targetSdk 32
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+
+ implementation 'androidx.appcompat:appcompat:1.3.0'
+ implementation 'com.google.android.material:material:1.4.0'
+ implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
+ testImplementation 'junit:junit:4.13.2'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.3'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
+}
\ No newline at end of file
diff --git a/src/timeUse/app/proguard-rules.pro b/src/timeUse/app/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/src/timeUse/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/src/timeUse/app/src/androidTest/java/com/tanshui/timeuse/ExampleInstrumentedTest.java b/src/timeUse/app/src/androidTest/java/com/tanshui/timeuse/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..d103772
--- /dev/null
+++ b/src/timeUse/app/src/androidTest/java/com/tanshui/timeuse/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.tanshui.timeuse;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.tanshui.timeuse", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/AndroidManifest.xml b/src/timeUse/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..51801e0
--- /dev/null
+++ b/src/timeUse/app/src/main/AndroidManifest.xml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/java/com/tanshui/timeuse/AppInfo.java b/src/timeUse/app/src/main/java/com/tanshui/timeuse/AppInfo.java
new file mode 100644
index 0000000..e9483c0
--- /dev/null
+++ b/src/timeUse/app/src/main/java/com/tanshui/timeuse/AppInfo.java
@@ -0,0 +1,53 @@
+package com.tanshui.timeuse;
+
+import android.graphics.drawable.Drawable;
+
+import java.util.List;
+
+public class AppInfo {
+ public int uid;
+ public String label;//应用名称
+ public String package_name;//应用包名
+ public Drawable icon;//应用icon
+ public List times;
+
+ public AppInfo() {
+ uid = 0;
+ label = "";
+ package_name = "";
+ icon = null;
+ times=null;
+ }
+
+ public int getUid() {
+ return uid;
+ }
+
+ public void setUid(int uid) {
+ this.uid = uid;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
+ public String getPackage_name() {
+ return package_name;
+ }
+
+ public void setPackage_name(String package_name) {
+ this.package_name = package_name;
+ }
+
+ public Drawable getIcon() {
+ return icon;
+ }
+
+ public void setIcon(Drawable icon) {
+ this.icon = icon;
+ }
+}
diff --git a/src/timeUse/app/src/main/java/com/tanshui/timeuse/CheckboxAdapter.java b/src/timeUse/app/src/main/java/com/tanshui/timeuse/CheckboxAdapter.java
new file mode 100644
index 0000000..bb40d7b
--- /dev/null
+++ b/src/timeUse/app/src/main/java/com/tanshui/timeuse/CheckboxAdapter.java
@@ -0,0 +1,104 @@
+package com.tanshui.timeuse;
+
+import android.content.ContentValues;
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.ListView;
+import android.widget.Switch;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class CheckboxAdapter extends BaseAdapter {
+ private List> list;
+ private LayoutInflater inflater=null;
+ private Context context;
+
+
+ public CheckboxAdapter(Context context,List> list) {
+ inflater = LayoutInflater.from(context);
+ this.list=list;
+ }
+
+
+ public Context getContext() {
+ return context;
+ }
+
+ public void setContext(Context context) {
+ this.context = context;
+ }
+
+ @Override
+ public int getCount() {
+ if (list == null) {
+ return 0;
+ }
+ return list.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return list.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(final int position, View convertView, ViewGroup parent) {
+
+ ViewHolder viewHolder = null;
+ if (convertView == null) {
+ convertView = inflater.inflate(R.layout.taskitem, null);
+ viewHolder = new ViewHolder();
+ viewHolder.content = convertView.findViewById(R.id.content);
+ viewHolder.startTime = convertView.findViewById(R.id.startTime);
+ viewHolder.endTime = convertView.findViewById(R.id.endTime);
+ viewHolder.isFinished = convertView.findViewById(R.id.isFinished);
+ convertView.setTag(viewHolder);
+
+ } else {
+ viewHolder = (ViewHolder) convertView.getTag();
+ }
+ viewHolder.content.setText(list.get(position).get("ItemContent").toString());
+ viewHolder.startTime.setText(list.get(position).get("ItemStartTime").toString());
+ viewHolder.endTime.setText(list.get(position).get("ItemEndTime").toString());
+
+// viewHolder.tv_addTokenContent.setText(list.get(position));
+// viewHolder.tv_addTokenAddress.setText(list.get(position));
+// viewHolder.switch_addToken.setChecked(isSelected.get(position));
+// final int pos = position; //pos必须声明为final
+// viewHolder.isFinished.setTag(position);
+
+// viewHolder.isFinished.setOnCheckedChangeListener(null);
+
+ viewHolder.isFinished.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ Toast.makeText(context, "123", Toast.LENGTH_SHORT).show();
+ }
+ });
+
+
+ return convertView;
+ }
+
+
+
+
+}
diff --git a/src/timeUse/app/src/main/java/com/tanshui/timeuse/MainActivity.java b/src/timeUse/app/src/main/java/com/tanshui/timeuse/MainActivity.java
new file mode 100644
index 0000000..a191a23
--- /dev/null
+++ b/src/timeUse/app/src/main/java/com/tanshui/timeuse/MainActivity.java
@@ -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;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/java/com/tanshui/timeuse/ViewHolder.java b/src/timeUse/app/src/main/java/com/tanshui/timeuse/ViewHolder.java
new file mode 100644
index 0000000..555f286
--- /dev/null
+++ b/src/timeUse/app/src/main/java/com/tanshui/timeuse/ViewHolder.java
@@ -0,0 +1,13 @@
+package com.tanshui.timeuse;
+
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.TextView;
+
+public class ViewHolder {
+ public TextView content=null;
+ public TextView startTime=null;
+ public TextView endTime=null;
+ public CheckBox isFinished=null;
+ public Button deleteTask=null;
+}
diff --git a/src/timeUse/app/src/main/java/com/tanshui/timeuse/adapter/MainViewPagerAdapter.java b/src/timeUse/app/src/main/java/com/tanshui/timeuse/adapter/MainViewPagerAdapter.java
new file mode 100644
index 0000000..3ea3cf8
--- /dev/null
+++ b/src/timeUse/app/src/main/java/com/tanshui/timeuse/adapter/MainViewPagerAdapter.java
@@ -0,0 +1,35 @@
+package com.tanshui.timeuse.adapter;
+
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentPagerAdapter;
+import androidx.viewpager2.adapter.FragmentStateAdapter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class MainViewPagerAdapter extends FragmentPagerAdapter {
+
+ private final List mFragmentList = new ArrayList<>();
+
+ public MainViewPagerAdapter(FragmentManager manager) {
+ super(manager);
+ }
+
+ public void addFragment(Fragment fragment) {
+ mFragmentList.add(fragment);
+ }
+
+ @Override
+ public int getCount() {
+ return mFragmentList.size();
+ }
+
+ @NonNull
+ @Override
+ public Fragment getItem(int position) {
+ return mFragmentList.get(position);
+ }
+}
diff --git a/src/timeUse/app/src/main/java/com/tanshui/timeuse/add_task.java b/src/timeUse/app/src/main/java/com/tanshui/timeuse/add_task.java
new file mode 100644
index 0000000..1115dfa
--- /dev/null
+++ b/src/timeUse/app/src/main/java/com/tanshui/timeuse/add_task.java
@@ -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();
+ }
+}
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/java/com/tanshui/timeuse/appTimeUse.java b/src/timeUse/app/src/main/java/com/tanshui/timeuse/appTimeUse.java
new file mode 100644
index 0000000..cf73bcc
--- /dev/null
+++ b/src/timeUse/app/src/main/java/com/tanshui/timeuse/appTimeUse.java
@@ -0,0 +1,229 @@
+package com.tanshui.timeuse;
+
+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.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.provider.Settings;
+import android.util.Log;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.ListView;
+import android.widget.SimpleAdapter;
+import android.widget.Toast;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class appTimeUse extends AppCompatActivity {
+
+ private ListView lv_app;
+ private ArrayList mApplicationInfos;
+ private Button list;
+ private Button report;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_app_time_use);
+ lv_app = findViewById(R.id.lv_app);
+ list=findViewById(R.id.jump_app_list);
+ report=findViewById(R.id.jump_app_report);
+// 如果第一次打开查看app使用界面,打开应用权限
+ if (!isStatAccessPermissionSet()) {
+ Intent intent = new Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS);
+ this.startActivity(intent);
+ }
+
+ list.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent intent=new Intent(appTimeUse.this,task_show.class);
+ startActivity(intent);
+ }
+ });
+ report.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent intent=new Intent(appTimeUse.this,report.class);
+ startActivity(intent);
+ }
+ });
+
+
+ mApplicationInfos=getAllAppInfo(this);
+// 从早上8点开始监听
+ Calendar setBeginCal=Calendar.getInstance();
+
+
+ Calendar setEndCal=Calendar.getInstance();
+
+
+ Calendar beginCal = Calendar.getInstance();
+// beginCal.set(Calendar.HOUR_OF_DAY,8);
+// beginCal.set(Calendar.MINUTE,0);
+// beginCal.set(Calendar.SECOND,0);
+ 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 stats=manager.queryUsageStats(UsageStatsManager.INTERVAL_DAILY,beginCal.getTimeInMillis(),endCal.getTimeInMillis());
+ Map statsMap = manager.queryAndAggregateUsageStats(setBeginCal.getTimeInMillis(), setEndCal.getTimeInMillis());
+
+ ArrayList> listItem = new ArrayList<>();
+
+ List name = new ArrayList<>();
+ List icons = new ArrayList<>();
+
+ for(UsageStats us:stats){
+ try {
+ PackageManager pm=getApplicationContext().getPackageManager();
+ ApplicationInfo applicationInfo=pm.getApplicationInfo(us.getPackageName(),PackageManager.GET_META_DATA);
+ 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.package_name)){
+ appName=app.label;
+ name.add(appName);
+ icon=app.icon;
+ icons.add(icon);
+ }
+ }
+
+ if(getTimeFromInt(us.getTotalTimeInForeground())!="已结束"){
+ UsageStats usageStats=statsMap.get(applicationInfo.packageName);
+// 判断是否为系统应用系统
+ if((flags & ApplicationInfo.FLAG_SYSTEM) == 0){
+
+ HashMap map = new HashMap<>();
+ //加入图片
+ map.put("ItemImage", icon);
+// 添加app名称
+ map.put("ItemLabel", appName);
+// 添加app使用时间
+ map.put("ItemTime",getTimeFromInt(usageStats.getTotalTimeInForeground()));
+
+ listItem.add(map);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ SimpleAdapter adapter = 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(adapter);
+
+
+// 显示app图标
+ adapter.setViewBinder(new SimpleAdapter.ViewBinder() {
+ @Override
+ public boolean setViewValue(View view, Object o, String s) {
+ if(view instanceof ImageView && o instanceof Drawable){
+
+ ImageView iv=(ImageView)view;
+ iv.setImageDrawable((Drawable)o);
+ return true;
+ }
+ else return false;
+ }
+ });
+// t1.setText(sb1);
+ }
+
+ public static String getTimeFromInt(long time) {
+
+ if (time <= 0) { return "已结束"; }
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+
+// 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+"秒";
+
+ }
+ /**
+ * 获取手机已安装应用列表
+ * @param ctx
+ * isFilterSystem 是否过滤系统应用
+ * @return
+ */
+ public ArrayList getAllAppInfo(Context ctx) {
+ ArrayList appBeanList = new ArrayList<>();
+ AppInfo bean = null;
+ PackageManager packageManager = ctx.getPackageManager();
+ List 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 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;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/java/com/tanshui/timeuse/database/timeUseDBHelper.java b/src/timeUse/app/src/main/java/com/tanshui/timeuse/database/timeUseDBHelper.java
new file mode 100644
index 0000000..1891a09
--- /dev/null
+++ b/src/timeUse/app/src/main/java/com/tanshui/timeuse/database/timeUseDBHelper.java
@@ -0,0 +1,117 @@
+package com.tanshui.timeuse.database;
+
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+import android.util.Log;
+import android.widget.Toast;
+
+import com.tanshui.timeuse.taskInfo;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class timeUseDBHelper extends SQLiteOpenHelper {
+ private static final String DB_NAME="timeUse.db";
+ private static final String TABLE_taskList="taskList";
+ private static final String TABLE_UserList="UserList";
+ private static final int DB_VERSION=1;
+ private static timeUseDBHelper timeUseDBHelper=null;
+ private SQLiteDatabase mRDB=null;
+ private SQLiteDatabase mWDB=null;
+ private timeUseDBHelper(Context context){
+ super(context,DB_NAME,null,DB_VERSION);
+ }
+// 利用单例模式获取数据库帮助器的唯一实例
+ public synchronized static timeUseDBHelper getInstance(Context context){
+ if(timeUseDBHelper==null){
+ timeUseDBHelper=new timeUseDBHelper(context);
+ }
+ return timeUseDBHelper;
+ }
+// 打开数据库的读连接
+ public SQLiteDatabase openReadLink(){
+ if(mRDB==null||!mRDB.isOpen()){
+ mRDB=timeUseDBHelper.getReadableDatabase();
+ }
+ return mRDB;
+ }
+ // 打开数据库的写连接
+ public SQLiteDatabase openWriteLink(){
+ if(mWDB==null||!mWDB.isOpen()){
+ mWDB=timeUseDBHelper.getWritableDatabase();
+ }
+ return mWDB;
+ }
+// 关闭数据库连接
+ public void closeLink(){
+ if(mRDB!=null&&mRDB.isOpen()){
+ mRDB.close();
+ mRDB=null;
+ }
+ if(mWDB!=null&&mWDB.isOpen()){
+ mWDB.close();
+ mWDB=null;
+ }
+ }
+// 创建数据库,执行建表语句
+
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+ String sql="CREATE TABLE IF NOT EXISTS "+TABLE_taskList+
+ "(_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,"+
+ "date VARCHAR NOT NULL,"+
+ "startTime VARCHAR NOT NULL,"+
+ "endTime VARCHAR NOT NULL,"+
+ "content VARCHAR NOT NULL,"+
+ "isFinished INTEGER NOT NULL);";
+ db.execSQL(sql);
+ String sql1="CREATE TABLE IF NOT EXISTS "+TABLE_UserList+
+ "(_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,"+
+ "username VARCHAR NOT NULL,"+
+ "password VARCHAR NOT NULL);";
+ db.execSQL(sql1);
+ }
+
+ @Override
+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+
+ }
+// 获取数据库中的任务列表
+ public List queryAllTaskInfo(){
+// String sql="select * from "+TABLE_taskList;
+ List list=new ArrayList<>();
+// Cursor cursor=mRDB.rawQuery(sql,null);
+ Cursor cursor=mRDB.query(TABLE_taskList,null,null,null,null,null,null);
+ while(cursor.moveToNext()){
+ taskInfo task=new taskInfo();
+ task.id=cursor.getInt(0);
+ task.startTime=cursor.getString(2);
+ task.endTime=cursor.getString(3);
+ task.isFinished=cursor.getInt(5)!=0;
+ task.content=cursor.getString(4);
+ task.date=cursor.getString(1);
+
+ list.add(task);
+ }
+ cursor.close();
+ return list;
+ }
+// 向数据库添加任务信息
+ public long insertTaskInfos(taskInfo task){
+ ContentValues values=new ContentValues();
+ values.put("date",task.date);
+ values.put("content",task.content);
+ values.put("startTime",task.startTime);
+ values.put("endTime",task.endTime);
+ values.put("isFinished",task.isFinished);
+
+ return mWDB.insert(TABLE_taskList,null,values);
+ }
+// 删除数据库中的信息
+ public long deleteTaskInfos(String data){
+ return mWDB.delete(TABLE_taskList,"content=?",new String[]{data});
+ }
+}
diff --git a/src/timeUse/app/src/main/java/com/tanshui/timeuse/fragment/TaskListFragment.java b/src/timeUse/app/src/main/java/com/tanshui/timeuse/fragment/TaskListFragment.java
new file mode 100644
index 0000000..662ffa9
--- /dev/null
+++ b/src/timeUse/app/src/main/java/com/tanshui/timeuse/fragment/TaskListFragment.java
@@ -0,0 +1,66 @@
+package com.tanshui.timeuse.fragment;
+
+import android.os.Bundle;
+
+import androidx.fragment.app.Fragment;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.tanshui.timeuse.R;
+
+/**
+ * A simple {@link Fragment} subclass.
+ * Use the {@link TaskListFragment#newInstance} factory method to
+ * create an instance of this fragment.
+ */
+public class TaskListFragment extends Fragment {
+
+ // TODO: Rename parameter arguments, choose names that match
+ // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
+ private static final String ARG_PARAM1 = "param1";
+ private static final String ARG_PARAM2 = "param2";
+
+ // TODO: Rename and change types of parameters
+ private String mParam1;
+ private String mParam2;
+
+ public TaskListFragment() {
+ // Required empty public constructor
+ }
+
+ /**
+ * Use this factory method to create a new instance of
+ * this fragment using the provided parameters.
+ *
+ * @param param1 Parameter 1.
+ * @param param2 Parameter 2.
+ * @return A new instance of fragment TaskListFragment.
+ */
+ // TODO: Rename and change types and number of parameters
+ public static TaskListFragment newInstance(String param1, String param2) {
+ TaskListFragment fragment = new TaskListFragment();
+ Bundle args = new Bundle();
+ args.putString(ARG_PARAM1, param1);
+ args.putString(ARG_PARAM2, param2);
+ fragment.setArguments(args);
+ return fragment;
+ }
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ if (getArguments() != null) {
+ mParam1 = getArguments().getString(ARG_PARAM1);
+ mParam2 = getArguments().getString(ARG_PARAM2);
+ }
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ // Inflate the layout for this fragment
+ return inflater.inflate(R.layout.fragment_task_list, container, false);
+ }
+}
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/java/com/tanshui/timeuse/fragment/appUseFragment.java b/src/timeUse/app/src/main/java/com/tanshui/timeuse/fragment/appUseFragment.java
new file mode 100644
index 0000000..02851ea
--- /dev/null
+++ b/src/timeUse/app/src/main/java/com/tanshui/timeuse/fragment/appUseFragment.java
@@ -0,0 +1,66 @@
+package com.tanshui.timeuse.fragment;
+
+import android.os.Bundle;
+
+import androidx.fragment.app.Fragment;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.tanshui.timeuse.R;
+
+/**
+ * A simple {@link Fragment} subclass.
+ * Use the {@link appUseFragment#newInstance} factory method to
+ * create an instance of this fragment.
+ */
+public class appUseFragment extends Fragment {
+
+ // TODO: Rename parameter arguments, choose names that match
+ // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
+ private static final String ARG_PARAM1 = "param1";
+ private static final String ARG_PARAM2 = "param2";
+
+ // TODO: Rename and change types of parameters
+ private String mParam1;
+ private String mParam2;
+
+ public appUseFragment() {
+ // Required empty public constructor
+ }
+
+ /**
+ * Use this factory method to create a new instance of
+ * this fragment using the provided parameters.
+ *
+ * @param param1 Parameter 1.
+ * @param param2 Parameter 2.
+ * @return A new instance of fragment appUseFragment.
+ */
+ // TODO: Rename and change types and number of parameters
+ public static appUseFragment newInstance(String param1, String param2) {
+ appUseFragment fragment = new appUseFragment();
+ Bundle args = new Bundle();
+ args.putString(ARG_PARAM1, param1);
+ args.putString(ARG_PARAM2, param2);
+ fragment.setArguments(args);
+ return fragment;
+ }
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ if (getArguments() != null) {
+ mParam1 = getArguments().getString(ARG_PARAM1);
+ mParam2 = getArguments().getString(ARG_PARAM2);
+ }
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ // Inflate the layout for this fragment
+ return inflater.inflate(R.layout.fragment_app_use, container, false);
+ }
+}
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/java/com/tanshui/timeuse/fragment/main_tabFragment.java b/src/timeUse/app/src/main/java/com/tanshui/timeuse/fragment/main_tabFragment.java
new file mode 100644
index 0000000..e808253
--- /dev/null
+++ b/src/timeUse/app/src/main/java/com/tanshui/timeuse/fragment/main_tabFragment.java
@@ -0,0 +1,106 @@
+package com.tanshui.timeuse.fragment;
+
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentTransaction;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.ImageButton;
+import android.widget.LinearLayout;
+
+import com.tanshui.timeuse.R;
+import com.tanshui.timeuse.appTimeUse;
+import com.tanshui.timeuse.task_show;
+
+public class main_tabFragment extends Fragment implements View.OnClickListener{
+ private Button jump_appUse;
+ private Button jump_report;
+ private Fragment TaskListFragment,reportFragment,appUseFragment;
+ private FragmentManager fragmentManager;
+ @Nullable
+ @Override
+ public Context getContext() {
+ return super.getContext();
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ // Inflate the layout for this fragment
+ View view=inflater.inflate(R.layout.fragment_main_tab, container, false);
+ initViews(view);
+ setTabSelection(R.id.jump_list);
+ return view;
+ }
+ //初始化视图对象
+ private void initViews(View view){
+ //主页面
+ Button jump_list = (Button) view.findViewById(R.id.jump_list);
+ jump_list.setOnClickListener(this);
+ //分类页面
+ jump_appUse=(Button)view.findViewById(R.id.jump_appUse);
+ jump_appUse.setOnClickListener(this);
+ //购物车页面
+ jump_report=(Button) view.findViewById(R.id.jump_report);
+ jump_report.setOnClickListener(this);
+ fragmentManager=getFragmentManager();//获得Fragment管理类
+ }
+ //点击事件
+ @Override
+ public void onClick(View v) {
+ setTabSelection(v.getId());
+ }
+ //设置Tab选中
+ public void setTabSelection(int id) {
+ //开启一个事务
+ FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
+ //隐藏所有Fragment
+ if (TaskListFragment != null) {
+ fragmentTransaction.hide(TaskListFragment);
+ }
+ if (reportFragment != null) {
+ fragmentTransaction.hide(reportFragment);
+ }
+ if (appUseFragment != null) {
+ fragmentTransaction.hide(appUseFragment);
+ }
+
+ //根据tabItem的id来执行不同的操作
+ switch (id) {
+ case R.id.jump_list:
+ if (TaskListFragment == null) {
+ TaskListFragment = new TaskListFragment();
+ fragmentTransaction.add(R.id.fg_content, TaskListFragment);
+ } else {
+ fragmentTransaction.show(TaskListFragment);
+ }
+ break;
+ case R.id.jump_appUse:
+ if (appUseFragment == null) {
+ appUseFragment = new appUseFragment();
+ fragmentTransaction.add(R.id.fg_content, appUseFragment);
+ } else {
+ fragmentTransaction.show(appUseFragment);
+ }
+ break;
+ case R.id.jump_report:
+ if (reportFragment == null) {
+ reportFragment = new reportFragment();
+ fragmentTransaction.add(R.id.fg_content, reportFragment);
+ } else {
+ fragmentTransaction.show(reportFragment);
+ }
+ break;
+ }
+ fragmentTransaction.commit();
+
+ }
+}
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/java/com/tanshui/timeuse/fragment/reportFragment.java b/src/timeUse/app/src/main/java/com/tanshui/timeuse/fragment/reportFragment.java
new file mode 100644
index 0000000..ed05a4e
--- /dev/null
+++ b/src/timeUse/app/src/main/java/com/tanshui/timeuse/fragment/reportFragment.java
@@ -0,0 +1,66 @@
+package com.tanshui.timeuse.fragment;
+
+import android.os.Bundle;
+
+import androidx.fragment.app.Fragment;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.tanshui.timeuse.R;
+
+/**
+ * A simple {@link Fragment} subclass.
+ * Use the {@link reportFragment#newInstance} factory method to
+ * create an instance of this fragment.
+ */
+public class reportFragment extends Fragment {
+
+ // TODO: Rename parameter arguments, choose names that match
+ // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
+ private static final String ARG_PARAM1 = "param1";
+ private static final String ARG_PARAM2 = "param2";
+
+ // TODO: Rename and change types of parameters
+ private String mParam1;
+ private String mParam2;
+
+ public reportFragment() {
+ // Required empty public constructor
+ }
+
+ /**
+ * Use this factory method to create a new instance of
+ * this fragment using the provided parameters.
+ *
+ * @param param1 Parameter 1.
+ * @param param2 Parameter 2.
+ * @return A new instance of fragment reportFragment.
+ */
+ // TODO: Rename and change types and number of parameters
+ public static reportFragment newInstance(String param1, String param2) {
+ reportFragment fragment = new reportFragment();
+ Bundle args = new Bundle();
+ args.putString(ARG_PARAM1, param1);
+ args.putString(ARG_PARAM2, param2);
+ fragment.setArguments(args);
+ return fragment;
+ }
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ if (getArguments() != null) {
+ mParam1 = getArguments().getString(ARG_PARAM1);
+ mParam2 = getArguments().getString(ARG_PARAM2);
+ }
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ // Inflate the layout for this fragment
+ return inflater.inflate(R.layout.fragment_report, container, false);
+ }
+}
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/java/com/tanshui/timeuse/login/login.java b/src/timeUse/app/src/main/java/com/tanshui/timeuse/login/login.java
new file mode 100644
index 0000000..7d7d487
--- /dev/null
+++ b/src/timeUse/app/src/main/java/com/tanshui/timeuse/login/login.java
@@ -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);
+ }
+}
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/java/com/tanshui/timeuse/login/registered.java b/src/timeUse/app/src/main/java/com/tanshui/timeuse/login/registered.java
new file mode 100644
index 0000000..2509173
--- /dev/null
+++ b/src/timeUse/app/src/main/java/com/tanshui/timeuse/login/registered.java
@@ -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);
+ }
+}
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/java/com/tanshui/timeuse/report.java b/src/timeUse/app/src/main/java/com/tanshui/timeuse/report.java
new file mode 100644
index 0000000..c120302
--- /dev/null
+++ b/src/timeUse/app/src/main/java/com/tanshui/timeuse/report.java
@@ -0,0 +1,44 @@
+package com.tanshui.timeuse;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.TextView;
+
+public class report extends AppCompatActivity {
+ private TextView title;
+ private Button jump_appUse;
+ private Button jump_list;
+ private Button jump_report;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_report);
+ title=findViewById(R.id.title);
+ jump_appUse = findViewById(R.id.jump_appUse2);
+ jump_list=findViewById(R.id.jump_list2);
+ jump_report=findViewById(R.id.jump_report2);
+
+ jump_appUse.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent intent=new Intent(report.this,appTimeUse.class);
+ startActivity(intent);
+
+ }
+ });
+
+ jump_list.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent intent=new Intent(report.this,task_show.class);
+ startActivity(intent);
+
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/java/com/tanshui/timeuse/show_task.java b/src/timeUse/app/src/main/java/com/tanshui/timeuse/show_task.java
new file mode 100644
index 0000000..17c798c
--- /dev/null
+++ b/src/timeUse/app/src/main/java/com/tanshui/timeuse/show_task.java
@@ -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 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 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();
+ }
+
+}
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/java/com/tanshui/timeuse/software_classification.java b/src/timeUse/app/src/main/java/com/tanshui/timeuse/software_classification.java
new file mode 100644
index 0000000..042d59e
--- /dev/null
+++ b/src/timeUse/app/src/main/java/com/tanshui/timeuse/software_classification.java
@@ -0,0 +1,22 @@
+package com.tanshui.timeuse;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.os.Bundle;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.Spinner;
+import android.widget.Toast;
+
+public class software_classification extends AppCompatActivity {
+ private Spinner classify;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_software_classification);
+ classify=findViewById(R.id.classify1);
+
+
+ }
+}
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/java/com/tanshui/timeuse/taskInfo.java b/src/timeUse/app/src/main/java/com/tanshui/timeuse/taskInfo.java
new file mode 100644
index 0000000..eebc976
--- /dev/null
+++ b/src/timeUse/app/src/main/java/com/tanshui/timeuse/taskInfo.java
@@ -0,0 +1,33 @@
+package com.tanshui.timeuse;
+
+import java.util.ArrayList;
+
+public class taskInfo {
+ public String date;
+ public int id;
+ public String content;
+ public boolean isFinished;
+ public String startTime;
+ public String endTime;
+ public taskInfo(String content,boolean isFinished,String startTime,String endTime,int id,String date){
+ this.content=content;
+ this.isFinished=isFinished;
+ this.endTime=endTime;
+ this.startTime=startTime;
+ this.date=date;
+ this.id=id;
+ }
+ public taskInfo(){}
+ public boolean isFinished() {
+
+ return isFinished;
+
+ }
+
+ public void setChecked(boolean isFinished) {
+
+ this.isFinished = isFinished;
+
+ }
+
+}
diff --git a/src/timeUse/app/src/main/java/com/tanshui/timeuse/taskManager.java b/src/timeUse/app/src/main/java/com/tanshui/timeuse/taskManager.java
new file mode 100644
index 0000000..7a15ab2
--- /dev/null
+++ b/src/timeUse/app/src/main/java/com/tanshui/timeuse/taskManager.java
@@ -0,0 +1,7 @@
+package com.tanshui.timeuse;
+
+public class taskManager {
+ public void addTask(){
+
+ }
+}
diff --git a/src/timeUse/app/src/main/java/com/tanshui/timeuse/task_add.java b/src/timeUse/app/src/main/java/com/tanshui/timeuse/task_add.java
new file mode 100644
index 0000000..0cf2b55
--- /dev/null
+++ b/src/timeUse/app/src/main/java/com/tanshui/timeuse/task_add.java
@@ -0,0 +1,150 @@
+package com.tanshui.timeuse;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.app.TimePickerDialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Handler;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.TextView;
+import android.widget.TimePicker;
+import android.widget.Toast;
+
+import com.tanshui.timeuse.database.timeUseDBHelper;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.List;
+
+public class task_add extends AppCompatActivity {
+ private EditText task_content;
+ private Button StartTime;
+ private Button EndTime;
+ private Button btn_down;
+ private Button btn_del;
+ private TextView tv_startTime;
+ private TextView tv_endTime;
+ private String decs;
+ private timeUseDBHelper dbHelper;
+ private String date;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_task_add);
+ taskInfo task=new taskInfo();
+
+ task_content=findViewById(R.id.task_content);
+ StartTime=findViewById(R.id.StartTime);
+ EndTime=findViewById(R.id.EndTime);
+ btn_down=findViewById(R.id.btn_down);
+ tv_startTime=findViewById(R.id.tv_startTime);
+ tv_endTime=findViewById(R.id.tv_endTime);
+
+ Intent intent=getIntent();
+ date=intent.getStringExtra("date");
+// 默认task属性
+ task.isFinished=false;
+ task.date=date;
+
+ StartTime.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Dialog dia=new Dialog(task_add.this);
+ dia.create();
+ Calendar time=Calendar.getInstance();
+// 显示时间选择器
+ TimePickerDialog timeDialog=new TimePickerDialog(task_add.this, new TimePickerDialog.OnTimeSetListener() {
+ @Override
+ public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
+ String min= Integer.toString(minute);
+ min=minute>=10?min:"0"+min;
+
+ decs = String.format("%s点%s分", hourOfDay, min);
+ task.startTime=decs;
+ tv_startTime.setText("任务开始时间:"+decs);
+ }
+ },time.get(Calendar.HOUR_OF_DAY),time.get(Calendar.MINUTE),true);
+ timeDialog.show();
+ }
+ });
+
+ EndTime.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Dialog dia=new Dialog(task_add.this);
+ dia.create();
+ Calendar time=Calendar.getInstance();
+// 显示时间选择器
+ TimePickerDialog timeDialog=new TimePickerDialog(task_add.this, new TimePickerDialog.OnTimeSetListener() {
+ @Override
+ public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
+ String min= Integer.toString(minute);
+ min=minute>=10?min:"0"+min;
+ decs = String.format("%s点%s分", hourOfDay, min);
+ task.endTime=decs;
+ tv_endTime.setText("任务结束时间:"+decs);
+ }
+ },time.get(Calendar.HOUR_OF_DAY),time.get(Calendar.MINUTE),true);
+ timeDialog.show();
+ }
+ });
+
+ btn_down.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+
+ if(!task_content.getText().toString().isEmpty()){
+ task.content=task_content.getText().toString();
+ }else{
+// list为空,弹出提示
+ AlertDialog.Builder builder = new AlertDialog.Builder(task_add.this);
+ builder.setTitle("标题");
+ builder.setMessage("内容11111");
+ builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ Toast.makeText(task_add.this, "确定", Toast.LENGTH_SHORT).show();
+ }
+ });
+ builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ Toast.makeText(task_add.this, "取消", Toast.LENGTH_SHORT).show();
+ }
+ });
+ AlertDialog alertDialog = builder.create();
+ alertDialog.show();
+ return;
+ }
+// 将新增的任务添加到数据库
+ if(dbHelper.insertTaskInfos(task)>0)
+ Toast.makeText(task_add.this,"添加任务成功",Toast.LENGTH_SHORT).show();
+// 延时1秒跳转页面
+ new Handler().postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ Intent intent=new Intent(task_add.this,task_show.class);
+ startActivity(intent);
+ }
+ },1000);
+
+ }
+ });
+
+
+ }
+
+ @Override
+ protected void onStart() {
+ super.onStart();
+ dbHelper = timeUseDBHelper.getInstance(this);
+ dbHelper.openWriteLink();
+ dbHelper.openReadLink();
+ }
+}
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/java/com/tanshui/timeuse/task_show.java b/src/timeUse/app/src/main/java/com/tanshui/timeuse/task_show.java
new file mode 100644
index 0000000..e0bd0f6
--- /dev/null
+++ b/src/timeUse/app/src/main/java/com/tanshui/timeuse/task_show.java
@@ -0,0 +1,296 @@
+package com.tanshui.timeuse;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.viewpager.widget.ViewPager;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.DatePickerDialog;
+import android.app.FragmentTransaction;
+import android.app.Person;
+import android.content.ContentValues;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.os.Bundle;
+import android.text.method.DigitsKeyListener;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.DatePicker;
+import android.widget.EditText;
+import android.widget.LinearLayout;
+import android.widget.ListView;
+import android.widget.RadioGroup;
+import android.widget.SimpleAdapter;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.google.android.material.bottomnavigation.BottomNavigationView;
+import com.tanshui.timeuse.adapter.MainViewPagerAdapter;
+import com.tanshui.timeuse.database.timeUseDBHelper;
+import com.tanshui.timeuse.fragment.main_tabFragment;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.List;
+
+public class task_show extends Activity {
+ private TextView textView;
+ private Button changeDate;
+ private Button addTask;
+ private Button jump_list;
+ private Button jump_appUse;
+ private Button jump_report;
+ private String decs;
+ private int nowYear;
+ private int nowMonth;
+ private int nowDay;
+ private timeUseDBHelper dbHelper;
+ private ListView lv_task;
+ private List taskInfos;
+ private ArrayList> listItem;
+ private SimpleAdapter adapter;
+ private SQLiteDatabase write;
+ private LayoutInflater mlayoutInflater;
+ private View dialogView;
+ private Button dialog_delete;
+ private EditText dialog_edit;
+ private CheckBox dialog_check;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_task_show);
+// main_tabFragment main_tabFragment=new main_tabFragment();
+// getSupportFragmentManager().beginTransaction().add(R.id.main_frame, main_tabFragment).show(main_tabFragment).commitAllowingStateLoss();
+
+ textView = findViewById(R.id.tv);
+ lv_task=findViewById(R.id.lv_task);
+ changeDate = findViewById(R.id.changeDate);
+ addTask=findViewById(R.id.addTask);
+ jump_appUse=findViewById(R.id.jump_appUse);
+ jump_list=findViewById(R.id.jump_list);
+ jump_report=findViewById(R.id.jump_report);
+
+// 获取当前日期
+ 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);
+
+
+ listItem= new ArrayList<>();
+
+
+
+// 点击按钮更改日期
+ changeDate.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Calendar calendar = Calendar.getInstance();
+ DatePickerDialog dateDialog = new DatePickerDialog(task_show.this,
+ new DatePickerDialog.OnDateSetListener() {
+ @Override
+ public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
+// 更新日期选择器为新选的日期
+ nowYear=year;
+ nowMonth=month;
+ nowDay=dayOfMonth;
+ decs = String.format("%s-%s-%s", year, month, dayOfMonth);
+ setList();
+ textView.setText(decs);
+ }
+ },
+
+ nowYear,
+ nowMonth,
+ nowDay);
+
+ dateDialog.show();
+
+ }
+ });
+// 点击按钮添加任务
+ addTask.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent intent=new Intent();
+ intent.setClass(task_show.this, task_add.class);
+ intent.putExtra("date",decs);
+ startActivity(intent);
+ }
+ });
+// 点击按钮跳转
+ jump_appUse.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent intent=new Intent(task_show.this,appTimeUse.class);
+ startActivity(intent);
+
+ }
+ });
+
+ jump_report.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent intent=new Intent(task_show.this,report.class);
+ startActivity(intent);
+
+ }
+ });
+// CheckboxAdapter checkboxAdapter=new CheckboxAdapter(task_show.this,listItem);
+// lv_task.setAdapter(checkboxAdapter);
+
+ lv_task.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+ @Override
+ public void onItemClick(AdapterView> parent, View view, int position, long id) {
+// CheckboxAdapter checkboxAdapter=new CheckboxAdapter(task_show.this,listItem);
+// checkboxAdapter.getViews(position,view,parent,lv_task,task_show.this);
+// 修改任务弹窗
+ showCustomInputDialog(position);
+
+ LinearLayout ll = (LinearLayout)lv_task.getChildAt(position);// 获得子级
+ // 从子级中获得控件
+ CheckBox isFinished = ll.findViewById(R.id.isFinished);
+ TextView content = ll.findViewById(R.id.content);
+
+// if(isFinished ==null){
+// Toast.makeText(task_show.this, "error", Toast.LENGTH_SHORT).show();
+// }
+// 改变任务状态
+// isFinished.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+// @Override
+// public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+// ContentValues values = new ContentValues();
+// values.put("isFinished" , isChecked);
+// write.update("taskList",values,"content=?",new String[]{content.getText().toString()});
+// taskInfos=dbHelper.queryAllTaskInfo();
+// setList();
+// Toast.makeText(task_show.this, isChecked+"("+position+")", Toast.LENGTH_SHORT).show();
+// }
+// });
+//
+
+// Toast.makeText(task_show.this, position+"", Toast.LENGTH_SHORT).show();
+ }
+
+ });
+ }
+
+ @Override
+ protected void onStart() {
+ super.onStart();
+ dbHelper = timeUseDBHelper.getInstance(task_show.this);
+ dbHelper.openReadLink();
+ write=dbHelper.openWriteLink();
+// 从数据库获取任务列表
+ taskInfos=dbHelper.queryAllTaskInfo();
+ setList();
+ }
+// 生成任务列表
+ public void setList(){
+
+ if(!taskInfos.isEmpty()){
+ listItem.clear();
+ for(taskInfo item:taskInfos){
+// 根据日期获取任务
+ if(item.date.equals(decs)){
+ HashMap map = new HashMap<>();
+// 添加任务内容
+ map.put("ItemContent", item.content);
+// 添加任务开始时间
+ map.put("ItemStartTime", item.startTime+"-");
+// 添加任务结束时间
+ map.put("ItemEndTime",item.endTime);
+// 添加任务完成状态
+ map.put("ItemISFinished",item.isFinished);
+
+ listItem.add(map);
+ }
+ }
+ adapter = new SimpleAdapter(this,
+ //绑定的数据
+ listItem,
+ //每一行的布局
+ R.layout.taskitem,
+ //动态数组中的数据源的键映射到布局文件对应的控件中
+ new String[] {"ItemContent", "ItemStartTime","ItemEndTime","ItemISFinished"},
+ new int[] {R.id.content, R.id.startTime,R.id.endTime,R.id.isFinished});
+ lv_task.setAdapter(adapter);
+
+ }
+ }
+//显示修改任务的dialog
+ public void showCustomInputDialog(final int position) {
+ // 设置任务修改弹窗
+ mlayoutInflater=LayoutInflater.from(this);
+ dialogView=mlayoutInflater.inflate(R.layout.dialog, null);
+ // 注意MainActivity如有自己的布局文件,这个dialog是view的布局文件,一定要把View写上
+ dialog_delete =(Button) dialogView.findViewById(R.id.dialog_delete);
+
+ dialog_edit =(EditText) dialogView.findViewById(R.id.dialog_edit);
+
+ dialog_check =(CheckBox) dialogView.findViewById(R.id.dialog_check);
+
+ dialog_delete.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ AlertDialog.Builder builder1=new AlertDialog.Builder(task_show.this);
+ builder1.setMessage("确定删除?");
+ builder1.setPositiveButton("确定", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ ContentValues values = new ContentValues();
+ values.put("content" , dialog_edit.getText().toString());
+ write.delete("taskList","content=?",new String[]{listItem.get(position).get("ItemContent").toString()});
+ // 重新从数据库获取修改的数据
+ taskInfos=dbHelper.queryAllTaskInfo();
+ setList();
+ Toast.makeText(task_show.this, "删除成功", Toast.LENGTH_SHORT).show();
+ }
+ });
+ builder1.setNegativeButton("取消", null);
+ builder1.show();
+ }
+ });
+ /*Dialog dialog = new MyDialog(PublishActivity.this,R.style.MyDialog);
+ dialog.show();*/
+
+ AlertDialog.Builder builder=new AlertDialog.Builder(task_show.this);
+
+ builder.setView(dialogView);
+ dialog_edit.setText(listItem.get(position).get("ItemContent").toString());
+ boolean b=Boolean.parseBoolean(listItem.get(position).get("ItemISFinished").toString());
+ dialog_check.setChecked(b);
+ builder.setPositiveButton("保存", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ ContentValues values = new ContentValues();
+ values.put("content" , dialog_edit.getText().toString());
+ values.put("isFinished",dialog_check.isChecked());
+ write.update("taskList",values,"content=?",new String[]{listItem.get(position).get("ItemContent").toString()});
+
+// 重新从数据库获取修改的数据
+ taskInfos=dbHelper.queryAllTaskInfo();
+ setList();
+ Toast.makeText(task_show.this, "修改成功", Toast.LENGTH_SHORT).show();
+ }
+ });
+ builder.setNegativeButton("取消", null);
+ builder.show();
+ }
+}
diff --git a/src/timeUse/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/src/timeUse/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 0000000..2b068d1
--- /dev/null
+++ b/src/timeUse/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/drawable/btn_basic.xml b/src/timeUse/app/src/main/res/drawable/btn_basic.xml
new file mode 100644
index 0000000..5724a46
--- /dev/null
+++ b/src/timeUse/app/src/main/res/drawable/btn_basic.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/drawable/btn_color.xml b/src/timeUse/app/src/main/res/drawable/btn_color.xml
new file mode 100644
index 0000000..e9097c5
--- /dev/null
+++ b/src/timeUse/app/src/main/res/drawable/btn_color.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/drawable/btn_color_enter.xml b/src/timeUse/app/src/main/res/drawable/btn_color_enter.xml
new file mode 100644
index 0000000..fe59826
--- /dev/null
+++ b/src/timeUse/app/src/main/res/drawable/btn_color_enter.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/drawable/btn_common.xml b/src/timeUse/app/src/main/res/drawable/btn_common.xml
new file mode 100644
index 0000000..5b94d21
--- /dev/null
+++ b/src/timeUse/app/src/main/res/drawable/btn_common.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/drawable/ic_launcher_background.xml b/src/timeUse/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..07d5da9
--- /dev/null
+++ b/src/timeUse/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/timeUse/app/src/main/res/drawable/list_round_btn.xml b/src/timeUse/app/src/main/res/drawable/list_round_btn.xml
new file mode 100644
index 0000000..4be1db7
--- /dev/null
+++ b/src/timeUse/app/src/main/res/drawable/list_round_btn.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/layout/activity_add_task.xml b/src/timeUse/app/src/main/res/layout/activity_add_task.xml
new file mode 100644
index 0000000..8e5098a
--- /dev/null
+++ b/src/timeUse/app/src/main/res/layout/activity_add_task.xml
@@ -0,0 +1,9 @@
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/layout/activity_app_time_use.xml b/src/timeUse/app/src/main/res/layout/activity_app_time_use.xml
new file mode 100644
index 0000000..6b4e866
--- /dev/null
+++ b/src/timeUse/app/src/main/res/layout/activity_app_time_use.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/layout/activity_login.xml b/src/timeUse/app/src/main/res/layout/activity_login.xml
new file mode 100644
index 0000000..8d1b819
--- /dev/null
+++ b/src/timeUse/app/src/main/res/layout/activity_login.xml
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/layout/activity_main.xml b/src/timeUse/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..d8a11b2
--- /dev/null
+++ b/src/timeUse/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/layout/activity_registered.xml b/src/timeUse/app/src/main/res/layout/activity_registered.xml
new file mode 100644
index 0000000..d6d7aa7
--- /dev/null
+++ b/src/timeUse/app/src/main/res/layout/activity_registered.xml
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/layout/activity_report.xml b/src/timeUse/app/src/main/res/layout/activity_report.xml
new file mode 100644
index 0000000..5261c5b
--- /dev/null
+++ b/src/timeUse/app/src/main/res/layout/activity_report.xml
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/layout/activity_show_task.xml b/src/timeUse/app/src/main/res/layout/activity_show_task.xml
new file mode 100644
index 0000000..0b23163
--- /dev/null
+++ b/src/timeUse/app/src/main/res/layout/activity_show_task.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/layout/activity_software_classification.xml b/src/timeUse/app/src/main/res/layout/activity_software_classification.xml
new file mode 100644
index 0000000..3619c1d
--- /dev/null
+++ b/src/timeUse/app/src/main/res/layout/activity_software_classification.xml
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/layout/activity_task_add.xml b/src/timeUse/app/src/main/res/layout/activity_task_add.xml
new file mode 100644
index 0000000..ed7371e
--- /dev/null
+++ b/src/timeUse/app/src/main/res/layout/activity_task_add.xml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/layout/activity_task_show.xml b/src/timeUse/app/src/main/res/layout/activity_task_show.xml
new file mode 100644
index 0000000..dae559b
--- /dev/null
+++ b/src/timeUse/app/src/main/res/layout/activity_task_show.xml
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/layout/appitem.xml b/src/timeUse/app/src/main/res/layout/appitem.xml
new file mode 100644
index 0000000..9f4e255
--- /dev/null
+++ b/src/timeUse/app/src/main/res/layout/appitem.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/layout/dialog.xml b/src/timeUse/app/src/main/res/layout/dialog.xml
new file mode 100644
index 0000000..9b85496
--- /dev/null
+++ b/src/timeUse/app/src/main/res/layout/dialog.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/layout/fragment_app_use.xml b/src/timeUse/app/src/main/res/layout/fragment_app_use.xml
new file mode 100644
index 0000000..7eb934f
--- /dev/null
+++ b/src/timeUse/app/src/main/res/layout/fragment_app_use.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/layout/fragment_main_tab.xml b/src/timeUse/app/src/main/res/layout/fragment_main_tab.xml
new file mode 100644
index 0000000..09f2967
--- /dev/null
+++ b/src/timeUse/app/src/main/res/layout/fragment_main_tab.xml
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/layout/fragment_report.xml b/src/timeUse/app/src/main/res/layout/fragment_report.xml
new file mode 100644
index 0000000..4f2052c
--- /dev/null
+++ b/src/timeUse/app/src/main/res/layout/fragment_report.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/layout/fragment_task_list.xml b/src/timeUse/app/src/main/res/layout/fragment_task_list.xml
new file mode 100644
index 0000000..8655245
--- /dev/null
+++ b/src/timeUse/app/src/main/res/layout/fragment_task_list.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/layout/taskitem.xml b/src/timeUse/app/src/main/res/layout/taskitem.xml
new file mode 100644
index 0000000..cc3066e
--- /dev/null
+++ b/src/timeUse/app/src/main/res/layout/taskitem.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/src/timeUse/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/src/timeUse/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/src/timeUse/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/src/timeUse/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/src/timeUse/app/src/main/res/mipmap-hdpi/ic_launcher.webp
new file mode 100644
index 0000000..c209e78
Binary files /dev/null and b/src/timeUse/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ
diff --git a/src/timeUse/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/src/timeUse/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..b2dfe3d
Binary files /dev/null and b/src/timeUse/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ
diff --git a/src/timeUse/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/src/timeUse/app/src/main/res/mipmap-mdpi/ic_launcher.webp
new file mode 100644
index 0000000..4f0f1d6
Binary files /dev/null and b/src/timeUse/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ
diff --git a/src/timeUse/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/src/timeUse/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..62b611d
Binary files /dev/null and b/src/timeUse/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ
diff --git a/src/timeUse/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/src/timeUse/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
new file mode 100644
index 0000000..948a307
Binary files /dev/null and b/src/timeUse/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ
diff --git a/src/timeUse/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/src/timeUse/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..1b9a695
Binary files /dev/null and b/src/timeUse/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ
diff --git a/src/timeUse/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/src/timeUse/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..28d4b77
Binary files /dev/null and b/src/timeUse/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ
diff --git a/src/timeUse/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/src/timeUse/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9287f50
Binary files /dev/null and b/src/timeUse/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ
diff --git a/src/timeUse/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/src/timeUse/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
new file mode 100644
index 0000000..aa7d642
Binary files /dev/null and b/src/timeUse/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ
diff --git a/src/timeUse/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/src/timeUse/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
new file mode 100644
index 0000000..9126ae3
Binary files /dev/null and b/src/timeUse/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ
diff --git a/src/timeUse/app/src/main/res/values-night/themes.xml b/src/timeUse/app/src/main/res/values-night/themes.xml
new file mode 100644
index 0000000..310e0d1
--- /dev/null
+++ b/src/timeUse/app/src/main/res/values-night/themes.xml
@@ -0,0 +1,16 @@
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/values/appClassify.xml b/src/timeUse/app/src/main/res/values/appClassify.xml
new file mode 100644
index 0000000..93435f9
--- /dev/null
+++ b/src/timeUse/app/src/main/res/values/appClassify.xml
@@ -0,0 +1,8 @@
+
+
+
+ - 娱乐
+ - 生活
+ - 学习
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/values/colors.xml b/src/timeUse/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..fb0a1e8
--- /dev/null
+++ b/src/timeUse/app/src/main/res/values/colors.xml
@@ -0,0 +1,14 @@
+
+
+ #FFBB86FC
+ #FF6200EE
+ #FF3700B3
+ #FF03DAC5
+ #FF018786
+ #FF000000
+ #FFFFFFFF
+ #5489e7
+ #2cc9df
+ #ebebeb
+ #00c3e1
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/values/strings.xml b/src/timeUse/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..f2e940e
--- /dev/null
+++ b/src/timeUse/app/src/main/res/values/strings.xml
@@ -0,0 +1,9 @@
+
+ timeUse
+ 添加任务
+ 更改日期
+ 设置任务开始时间
+ 设置任务结束时间
+
+ Hello blank fragment
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/values/themes.xml b/src/timeUse/app/src/main/res/values/themes.xml
new file mode 100644
index 0000000..9259601
--- /dev/null
+++ b/src/timeUse/app/src/main/res/values/themes.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/xml/backup_rules.xml b/src/timeUse/app/src/main/res/xml/backup_rules.xml
new file mode 100644
index 0000000..fa0f996
--- /dev/null
+++ b/src/timeUse/app/src/main/res/xml/backup_rules.xml
@@ -0,0 +1,13 @@
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/main/res/xml/data_extraction_rules.xml b/src/timeUse/app/src/main/res/xml/data_extraction_rules.xml
new file mode 100644
index 0000000..9ee9997
--- /dev/null
+++ b/src/timeUse/app/src/main/res/xml/data_extraction_rules.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/timeUse/app/src/test/java/com/tanshui/timeuse/ExampleUnitTest.java b/src/timeUse/app/src/test/java/com/tanshui/timeuse/ExampleUnitTest.java
new file mode 100644
index 0000000..a1accf9
--- /dev/null
+++ b/src/timeUse/app/src/test/java/com/tanshui/timeuse/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.tanshui.timeuse;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/src/timeUse/build.gradle b/src/timeUse/build.gradle
new file mode 100644
index 0000000..5ae9a7b
--- /dev/null
+++ b/src/timeUse/build.gradle
@@ -0,0 +1,9 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+plugins {
+ id 'com.android.application' version '7.2.2' apply false
+ id 'com.android.library' version '7.2.2' apply false
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
\ No newline at end of file
diff --git a/src/timeUse/gradle.properties b/src/timeUse/gradle.properties
new file mode 100644
index 0000000..dab7c28
--- /dev/null
+++ b/src/timeUse/gradle.properties
@@ -0,0 +1,21 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app"s APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.useAndroidX=true
+# Enables namespacing of each library's R class so that its R class includes only the
+# resources declared in the library itself and none from the library's dependencies,
+# thereby reducing the size of the R class for that library
+android.nonTransitiveRClass=true
\ No newline at end of file
diff --git a/src/timeUse/gradle/wrapper/gradle-wrapper.jar b/src/timeUse/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..e708b1c
Binary files /dev/null and b/src/timeUse/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/src/timeUse/gradle/wrapper/gradle-wrapper.properties b/src/timeUse/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..4964745
--- /dev/null
+++ b/src/timeUse/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Fri Sep 16 13:30:37 CST 2022
+distributionBase=GRADLE_USER_HOME
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
+distributionPath=wrapper/dists
+zipStorePath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
diff --git a/src/timeUse/gradlew b/src/timeUse/gradlew
new file mode 100644
index 0000000..4f906e0
--- /dev/null
+++ b/src/timeUse/gradlew
@@ -0,0 +1,185 @@
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# 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\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# 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
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+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" -a "$nonstop" = "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 or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # 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=`expr $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
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/src/timeUse/gradlew.bat b/src/timeUse/gradlew.bat
new file mode 100644
index 0000000..107acd3
--- /dev/null
+++ b/src/timeUse/gradlew.bat
@@ -0,0 +1,89 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@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
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@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="-Xmx64m" "-Xms64m"
+
+@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 execute
+
+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 execute
+
+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
+
+: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 %*
+
+: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
diff --git a/src/timeUse/settings.gradle b/src/timeUse/settings.gradle
new file mode 100644
index 0000000..88d0cda
--- /dev/null
+++ b/src/timeUse/settings.gradle
@@ -0,0 +1,16 @@
+pluginManagement {
+ repositories {
+ gradlePluginPortal()
+ google()
+ mavenCentral()
+ }
+}
+dependencyResolutionManagement {
+ repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
+ repositories {
+ google()
+ mavenCentral()
+ }
+}
+rootProject.name = "timeUse"
+include ':app'