@Override public void onClick(View v) { switch (v.getId()) { case R.id.zhou_1: initScheduleData("1", doctorId, merchantId, FunUtils.getDateStr(time, 14)); LoadingView.baseAdapter.notifyDataSetChanged(); break; case R.id.zhou_2: initScheduleData("1", doctorId, merchantId, FunUtils.getDateStr(time, 15)); LoadingView.baseAdapter.notifyDataSetChanged(); break; case R.id.zhou_3: initScheduleData("1", doctorId, merchantId, FunUtils.getDateStr(time, 16)); LoadingView.baseAdapter.notifyDataSetChanged(); break; case R.id.zhou_4: initScheduleData("1", doctorId, merchantId, FunUtils.getDateStr(time, 17)); LoadingView.baseAdapter.notifyDataSetChanged(); break; case R.id.zhou_5: initScheduleData("1", doctorId, merchantId, FunUtils.getDateStr(time, 18)); LoadingView.baseAdapter.notifyDataSetChanged(); break; case R.id.zhou_6: initScheduleData("1", doctorId, merchantId, FunUtils.getDateStr(time, 19)); LoadingView.baseAdapter.notifyDataSetChanged(); break; case R.id.zhou_7: initScheduleData("1", doctorId, merchantId, FunUtils.getDateStr(time, 20)); LoadingView.baseAdapter.notifyDataSetChanged(); break; } }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.hospital_schedule_model, container, false); String d = ScheduleActivity.doctorId; long mtime = MainActivity.cb.getTime(); time = FunUtils.shortTime(mtime); initView(view); return view; }
private void initView(View view) { gv1 = (GridView) view.findViewById(R.id.gridview); // new LoadingView(getActivity(), gv1, ScheduleActivity.list.size(), 0); // // http://101.200.1.168:8080/pets_know_api/schedul/open/find_schedul_by_mechant_id_or_doctor_id?merchantId=1&dateStrStart=2015-10-28&daySize=7 initScheduleData("1", doctorId, merchantId, FunUtils.getDateStr(time, 14)); zhou_1 = (Button) view.findViewById(R.id.zhou_1); zhou_2 = (Button) view.findViewById(R.id.zhou_2); zhou_3 = (Button) view.findViewById(R.id.zhou_3); zhou_4 = (Button) view.findViewById(R.id.zhou_4); zhou_5 = (Button) view.findViewById(R.id.zhou_5); zhou_6 = (Button) view.findViewById(R.id.zhou_6); zhou_7 = (Button) view.findViewById(R.id.zhou_7); zhou_1.setOnClickListener(this); zhou_2.setOnClickListener(this); zhou_3.setOnClickListener(this); zhou_4.setOnClickListener(this); zhou_5.setOnClickListener(this); zhou_6.setOnClickListener(this); zhou_7.setOnClickListener(this); String[] dayF = FunUtils.getDateStr1(time, 14).split("-"); String[] dayL = FunUtils.getDateStr1(time, 20).split("-"); firstDay = dayF[0] + "月" + dayF[1] + "日"; lastDay = dayL[0] + "月" + dayL[1] + "日"; zhou_1.setText( FunUtils.getWeekday(FunUtils.getDateStr(time, 14)) + "\n" + FunUtils.getDateStr1(time, 14)); zhou_2.setText( FunUtils.getWeekday(FunUtils.getDateStr(time, 15)) + "\n" + FunUtils.getDateStr1(time, 15)); zhou_3.setText( FunUtils.getWeekday(FunUtils.getDateStr(time, 16)) + "\n" + FunUtils.getDateStr1(time, 16)); zhou_4.setText( FunUtils.getWeekday(FunUtils.getDateStr(time, 17)) + "\n" + FunUtils.getDateStr1(time, 17)); zhou_5.setText( FunUtils.getWeekday(FunUtils.getDateStr(time, 18)) + "\n" + FunUtils.getDateStr1(time, 18)); zhou_6.setText( FunUtils.getWeekday(FunUtils.getDateStr(time, 19)) + "\n" + FunUtils.getDateStr1(time, 19)); zhou_7.setText( FunUtils.getWeekday(FunUtils.getDateStr(time, 20)) + "\n" + FunUtils.getDateStr1(time, 20)); }