/// <summary> /// 页面控件 /// </summary> protected void InitViews(View view) { tv_btn1 = view.FindViewById <TextView>(Resource.Id.tv_btn1); tv_btn2 = view.FindViewById <TextView>(Resource.Id.tv_btn2); tv_btn3 = view.FindViewById <TextView>(Resource.Id.tv_btn3); tv_btn1.SetOnClickListener(this); tv_btn2.SetOnClickListener(this); tv_btn3.SetOnClickListener(this); mSwipeRefreshLayout = (SwipeRefreshLayout)view.FindViewById(Resource.Id.refresher); mRecyclerView = (RecyclerView)view.FindViewById(Resource.Id.recycler_view); mSwipeRefreshLayout.SetColorSchemeColors(Color.ParseColor("#db0000")); //mSwipeRefreshLayout.SetColorScheme(Resource.Color.xam_dark_blue, //Resource.Color.xam_purple, //Resource.Color.xam_gray, //Resource.Color.xam_green); linearLayoutManager = new LinearLayoutManager(CurrActivity); mAdapter = new RenewReportAdapter(CurrActivity, teachReportList); mRecyclerView.SetLayoutManager(linearLayoutManager); mRecyclerView.SetAdapter(mAdapter); mAdapter.NotifyDataSetChanged(); mSwipeRefreshLayout.SetOnRefreshListener(this); RecyclerViewItemOnGestureListener viewOnGestureListener = new RecyclerViewItemOnGestureListener(mRecyclerView, this); mRecyclerView.AddOnItemTouchListener(new RecyclerViewItemOnItemTouchListener(mRecyclerView, viewOnGestureListener)); }
protected override void InitViews() { FindViewById <TextView>(Resource.Id.tv_title).Text = string.Format("{0}教学报表", currReportInfo.Item3); tv_btn1 = FindViewById <TextView>(Resource.Id.tv_btn1); tv_btn2 = FindViewById <TextView>(Resource.Id.tv_btn2); tv_btn3 = FindViewById <TextView>(Resource.Id.tv_btn3); mSwipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.refresher); mRecyclerView = FindViewById <RecyclerView>(Resource.Id.recycler_view); mSwipeRefreshLayout.SetColorSchemeColors(Color.ParseColor("#db0000")); linearLayoutManager = new LinearLayoutManager(CurrActivity); mAdapter = new RenewReportAdapter(CurrContext, teachReportList); mRecyclerView.SetLayoutManager(linearLayoutManager); mRecyclerView.SetAdapter(mAdapter); mAdapter.NotifyDataSetChanged(); mSwipeRefreshLayout.SetOnRefreshListener(this); //mSwipeRefreshLayout.SetOnScrollChangeListener(this); //mAdapter.SetOnItemClickListener(this); RecyclerViewItemOnGestureListener viewOnGestureListener = new RecyclerViewItemOnGestureListener(mRecyclerView, this); mRecyclerView.AddOnItemTouchListener(new RecyclerViewItemOnItemTouchListener(mRecyclerView, viewOnGestureListener)); arrowDown = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.arrow_down); arrowDownOn = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.arrow_down_on); SetClassStatusImg(FindViewById <ImageButton>(Resource.Id.imgBtn_lessonIng), "init"); }
/// <summary> /// 获取报表数据 /// </summary> private void GetRenewInfoInGroup() { try { new Thread(new ThreadStart(() => { var gradeStr = ""; if (searchGradeList.Any()) { gradeStr = string.Join(",", searchGradeList.ToArray()); } var districtStr = ""; if (!string.IsNullOrEmpty(searchDistrict) && !searchDistrict.Equals("全部区域")) { districtStr = searchDistrict; } var result = RenewService.GetRenewInfoInGroup(CurrUserInfo.SchoolId, searchQuarter.Year, searchQuarter.Quarter, gradeStr, districtStr, 1, 6, 1, 30, classStatus); CurrActivity.RunOnUiThread(() => { LoadingDialogUtil.DismissLoadingDialog(); mSwipeRefreshLayout.Refreshing = false; if (result != null) { teachReportList = result.RenewInfo; mAdapter.SetData(teachReportList); mAdapter.NotifyDataSetChanged(); } }); })).Start(); } catch (Exception ex) { var msg = ex.Message.ToString(); LoadingDialogUtil.DismissLoadingDialog(); mSwipeRefreshLayout.Refreshing = false; } }