public override void OnActivityCreated(Bundle savedInstanceState)
        {
            base.OnActivityCreated(savedInstanceState);

            myhealthRefreshListView = View.FindViewById <PullToRefreshListView> (Resource.Id.lv_MyHealth);
            actualListView          = (ListView)myhealthRefreshListView.RefreshableView;

            //设置可以上拉加载。下拉刷新
            myhealthRefreshListView.Mode = PullToRefreshBase.PullToRefreshMode.Both;
            //下拉刷新提示文本
            myhealthRefreshListView.GetLoadingLayoutProxy(true, false).SetPullLabel(GetString(Resource.String.pullDownLbl));
            myhealthRefreshListView.GetLoadingLayoutProxy(true, false).SetRefreshingLabel(GetString(Resource.String.pullDownRefreshLbl));
            myhealthRefreshListView.GetLoadingLayoutProxy(true, false).SetReleaseLabel(GetString(Resource.String.pullDownReleaseLbl));
            //上拉加载提示文本
            myhealthRefreshListView.GetLoadingLayoutProxy(false, true).SetPullLabel(GetString(Resource.String.pullUpLbl));
            myhealthRefreshListView.GetLoadingLayoutProxy(false, true).SetRefreshingLabel(GetString(Resource.String.pullUpRefreshLbl));
            myhealthRefreshListView.GetLoadingLayoutProxy(false, true).SetReleaseLabel(GetString(Resource.String.pullUpReleaseLbl));

            //绑定监听事件
            myhealthRefreshListView.SetOnRefreshListener(this);
            //myAlarmRefreshListView.SetOnLastItemVisibleListener (this);

            //加载view
            edit_my_searchTime = View.FindViewById <EditText>(Resource.Id.edit_my_searchTime);
//			edit_my_searchTime.Click += (sender, e) =>
//			{
//				var datepickdialog = new DatePickDialogUtil(Activity,edit_my_searchTime.Text);
//				datepickdialog.DatePickDialogShow(edit_my_searchTime);
//			};
            edit_my_searchTime.OnFocusChangeListener = this;
            edit_my_searchTime.InputType             = Android.Text.InputTypes.Null;
            my_searchTime_default   = DateTime.Now.ToString("yyyy-MM-dd");
            edit_my_searchTime.Text = my_searchTime_default;

            btn_my_search = View.FindViewById <Button> (Resource.Id.btn_my_search);
            //查询按钮
            btn_my_search.Click += (sender, e) =>
            {
                btnSearchFlag = true;
                loadData();
            };

            //设置adapter
            healthInfoAdapter      = new HealthInfoListAdapter(Activity);
            actualListView.Adapter = healthInfoAdapter;

            //点击列表详细
            actualListView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) =>
            {
                //将
                //var intent  = new Intent(Activity,typeof(HealthDetailInfoActivity));
                var intent          = new Intent(Activity, typeof(PhysicalDetailInfoActivity));
                var _healthInfoItem = healthInfoAdapter.GetItem(e.Position - 1);
                var _healthInfoJson = JsonConvert.SerializeObject(_healthInfoItem);
                intent.PutExtra("healthInfo", _healthInfoJson);
                Activity.StartActivity(intent);
                Activity.OverridePendingTransition(Android.Resource.Animation.SlideInLeft, Android.Resource.Animation.SlideOutRight);
            };

            healthInfoParam = new SearchHealthInforParam()
            {
                Id = Global.MyInfo.UId
            };

            //初始化view完成
            IsPrepared = true;
            LasyloadData();
        }
Exemple #2
0
        private void InitView()
        {
            //设置标题栏
            var img_header_back = FindViewById <ImageView> (Resource.Id.img_header_back);

            img_header_back.Click += (sender, e) =>
            {
                this.Finish();
                OverridePendingTransition(Android.Resource.Animation.SlideInLeft, Android.Resource.Animation.SlideOutRight);
            };

            var tv_back = FindViewById <TextView> (Resource.Id.tv_back);

            tv_back.Text = "管理员";
            var tv_desc = FindViewById <TextView> (Resource.Id.tv_desc);

            tv_desc.Text = "健康记录";


            otherhealthRefreshListView = FindViewById <PullToRefreshListView> (Resource.Id.lv_otherHealth);
            actualListView             = (ListView)otherhealthRefreshListView.RefreshableView;

            //设置可以上拉加载。下拉刷新
            otherhealthRefreshListView.Mode = PullToRefreshBase.PullToRefreshMode.Both;
            //下拉刷新提示文本
            otherhealthRefreshListView.GetLoadingLayoutProxy(true, false).SetPullLabel(GetString(Resource.String.pullDownLbl));
            otherhealthRefreshListView.GetLoadingLayoutProxy(true, false).SetRefreshingLabel(GetString(Resource.String.pullDownRefreshLbl));
            otherhealthRefreshListView.GetLoadingLayoutProxy(true, false).SetReleaseLabel(GetString(Resource.String.pullDownReleaseLbl));
            //上拉加载提示文本
            otherhealthRefreshListView.GetLoadingLayoutProxy(false, true).SetPullLabel(GetString(Resource.String.pullUpLbl));
            otherhealthRefreshListView.GetLoadingLayoutProxy(false, true).SetRefreshingLabel(GetString(Resource.String.pullUpRefreshLbl));
            otherhealthRefreshListView.GetLoadingLayoutProxy(false, true).SetReleaseLabel(GetString(Resource.String.pullUpReleaseLbl));
            //绑定监听事件
            otherhealthRefreshListView.SetOnRefreshListener(this);

            //加载view
            edit_other_searchTime = FindViewById <EditText>(Resource.Id.edit_other_searchTime);
            edit_other_searchTime.OnFocusChangeListener = this;
            edit_other_searchTime.InputType             = Android.Text.InputTypes.Null;
            other_searchTime_default   = DateTime.Now.ToString("yyyy-MM-dd");
            edit_other_searchTime.Text = other_searchTime_default;
            btn_other_search           = FindViewById <Button> (Resource.Id.btn_other_search);
            //查询按钮
            btn_other_search.Click += (sender, e) =>
            {
                btnSearchFlag = true;
                loadData();
            };
            //下拉框
            sp_other_guardian = FindViewById <Spinner>(Resource.Id.sp_other_guardian);
            sp_other_guardian.OnItemSelectedListener = this;
            sp_other_guardian.Visibility             = ViewStates.Visible;//设置默认值


            //设置自定义列表adapter
            healthInfoAdapter      = new HealthInfoListAdapter(this);
            actualListView.Adapter = healthInfoAdapter;

            actualListView.ItemClick += (sender, e) =>
            {
                var intent          = new Intent(this, typeof(PhysicalDetailInfoActivity));
                var _healthInfoItem = healthInfoAdapter.GetItem(e.Position - 1);
                var _healthInfoJson = JsonConvert.SerializeObject(_healthInfoItem);
                intent.PutExtra("healthInfo", _healthInfoJson);

                StartActivity(intent);
                OverridePendingTransition(Android.Resource.Animation.SlideInLeft, Android.Resource.Animation.SlideOutRight);
            };

            healthInfoParam = new SearchHealthInforParam();
            //初始化view完成
            LasyloadData();
        }