| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import cn.flightfeather.thirdappmodule.CommonApplication; |
| | | import cn.flightfeather.thirdappmodule.activity.NewMonthTaskActivity; |
| | | import cn.flightfeather.thirdappmodule.activity.ScenseMapActivity; |
| | | import cn.flightfeather.thirdappmodule.activity.TaskActivity; |
| | |
| | | |
| | | taskViewModel = ViewModelProviders.of(this).get(DCTaskViewModel.class); |
| | | |
| | | return inflater.inflate(R.layout.fragment_task, container, false); |
| | | return inflater.inflate(R.layout.dc_fragment_task, container, false); |
| | | } |
| | | |
| | | @Override |
| | |
| | | super.onViewCreated(view, savedInstanceState); |
| | | initUI(view); |
| | | initData(); |
| | | |
| | | // view.findViewById(R.id.ll_container_todytask).setOnClickListener(new View.OnClickListener() { |
| | | // @Override |
| | | // public void onClick(View v) { |
| | | // try { |
| | | // int a = 0 / 0; |
| | | // } catch (Exception e) { |
| | | // MyCrashHandler c = MyCrashHandler.Companion.getInstance(); |
| | | // if (c != null) { |
| | | // c.catchException(e); |
| | | // } |
| | | // } |
| | | // } |
| | | // }); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | private void initUI(View view) { |
| | | ViewGroup rl_addTask = view.findViewById(R.id.rl_add_task); |
| | | ViewGroup rl_add_scense = view.findViewById(R.id.rl_add_scense); |
| | | view.findViewById(R.id.rl_scense_map).setOnClickListener(this); |
| | | view.findViewById(R.id.cl_add_subTask).setOnClickListener(this); |
| | | view.findViewById(R.id.rl_add_scense).setOnClickListener(this); |
| | | view.findViewById(R.id.day_task).setOnClickListener(this); |
| | | view.findViewById(R.id.week_task).setOnClickListener(this); |
| | | view.findViewById(R.id.month_task).setOnClickListener(this); |
| | | view.findViewById(R.id.ll_container_taskadjust).setOnClickListener(this); |
| | | view.findViewById(R.id.rl_container_task_export).setOnClickListener(this); |
| | | |
| | | // 只有管理人员可以看到“总任务管理”和“新增场景”按钮 |
| | | if (CommonApplication.getInstance().getCurrentUser().getUsertypeid() == 0) { |
| | | rl_addTask.setOnClickListener(this); |
| | | rl_add_scense.setOnClickListener(this); |
| | | } else { |
| | | rl_addTask.setVisibility(View.GONE); |
| | | rl_add_scense.setVisibility(View.GONE); |
| | | } |
| | | |
| | | view_waiting = view.findViewById(R.id.view_waiting); |
| | | tv_no_task = view.findViewById(R.id.tv_no_task); |
| | | RecyclerView mRecyclerView = view.findViewById(R.id.rv_container); |
| | |
| | | daytask_circleprogress.setProgress(0, 0); |
| | | weektask_circleprogress.setProgress(0, 0); |
| | | monthtask_circleprogress.setProgress(0, 0); |
| | | rl_addTask.setOnClickListener(this); |
| | | } |
| | | |
| | | private void getTodaySubTask() { |
| | |
| | | getActivity().startActivityForResult(intent1, Constant.REQUESTCODE_FROM_TASKFRAGMENT); |
| | | break; |
| | | case R.id.cl_add_subTask: |
| | | showTaskKindDialog(); |
| | | // showTaskKindDialog(); |
| | | startActivity(new Intent(getActivity(), DCNewTempTaskActivity.class)); |
| | | break; |
| | | case R.id.rl_add_scense: |
| | | startActivity(new Intent(getActivity(), SceneDetailActivity.class)); |