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 = "报警记录";


			otherAlarmRefreshListView = FindViewById<PullToRefreshListView> (Resource.Id.lv_otherAlarm);
			actualListView = (ListView)otherAlarmRefreshListView.RefreshableView;
			//设置可以上拉加载。下拉刷新
			otherAlarmRefreshListView.Mode = PullToRefreshBase.PullToRefreshMode.Both;

			//下拉刷新提示文本
			otherAlarmRefreshListView.GetLoadingLayoutProxy(true,false).SetPullLabel(GetString(Resource.String.pullDownLbl));
			otherAlarmRefreshListView.GetLoadingLayoutProxy (true,false).SetRefreshingLabel(GetString(Resource.String.pullDownRefreshLbl));
			otherAlarmRefreshListView.GetLoadingLayoutProxy (true, false).SetReleaseLabel (GetString(Resource.String.pullDownReleaseLbl));
			//上拉加载提示文本
			otherAlarmRefreshListView.GetLoadingLayoutProxy(false,true).SetPullLabel(GetString(Resource.String.pullUpLbl));
			otherAlarmRefreshListView.GetLoadingLayoutProxy (false, true).SetRefreshingLabel (GetString(Resource.String.pullUpRefreshLbl));
			otherAlarmRefreshListView.GetLoadingLayoutProxy (false, true).SetReleaseLabel (GetString(Resource.String.pullUpReleaseLbl));



			otherAlarmRefreshListView.SetOnRefreshListener (this);
	


			//加载view
			edit_other_startTime = FindViewById<EditText>(Resource.Id.edit_other_startTime);

			edit_other_startTime.OnFocusChangeListener = this;
			edit_other_startTime.InputType = Android.Text.InputTypes.Null;
			edit_other_endTime = FindViewById<EditText> (Resource.Id.edit_other_endTime);

			edit_other_endTime.OnFocusChangeListener = this;
			edit_other_endTime.InputType = Android.Text.InputTypes.Null;
			other_endTime_default = DateTime.Now.ToString ("yyyy-MM-dd");
			other_startTime_default = DateTime.Now.AddDays (-7).ToString ("yyyy-MM-dd");
			edit_other_startTime.Text = other_startTime_default;
			edit_other_endTime.Text = other_endTime_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;//设置默认值


			//下拉框
			sp_alarmType = FindViewById<Spinner>(Resource.Id.sp_alarmType);
			sp_alarmType.OnItemSelectedListener = this;   
			sp_alarmType.Visibility = ViewStates.Visible;//设置默认值

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

			actualListView.ItemClick += (sender, e) => 
			{
				var intent  = new Intent(this,typeof(AlarmDetailInfoActivity));
				var bundle = new Bundle();
				bundle.PutString("alarmOrigin","alarmList");
				bundle.PutString("alarmId",alarmInfoAdapter.GetItem(e.Position-1).AId);
				intent.PutExtras(bundle);
				StartActivity(intent);
				OverridePendingTransition(Android.Resource.Animation.SlideInLeft,Android.Resource.Animation.SlideOutRight);
			};

			alarmInfoListParam =  new AlarmInfoListParam();
			//初始化view完成
			LasyloadData ();
		}
Exemplo n.º 2
0
        public override void OnActivityCreated(Bundle savedInstanceState)
        {
            base.OnActivityCreated(savedInstanceState);
            myAlarmRefreshListView = View.FindViewById <PullToRefreshListView> (Resource.Id.lv_MyAlarm);
            actualListView         = (ListView)myAlarmRefreshListView.RefreshableView;

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

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


            //下拉框
            sp_alarmType = View.FindViewById <Spinner>(Resource.Id.sp_alarmType);
            sp_alarmType.OnItemSelectedListener = this;
            sp_alarmType.Visibility             = ViewStates.Visible;//设置默认值



            //加载view
            edit_my_startTime = View.FindViewById <EditText>(Resource.Id.edit_my_startTime);
            edit_my_startTime.OnFocusChangeListener = this;
            edit_my_startTime.InputType             = Android.Text.InputTypes.Null;

            edit_my_endTime = View.FindViewById <EditText> (Resource.Id.edit_my_endTime);
            edit_my_endTime.OnFocusChangeListener = this;
            edit_my_endTime.InputType             = Android.Text.InputTypes.Null;
            my_endTime_default     = DateTime.Now.ToString("yyyy-MM-dd");
            my_startTime_default   = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd");
            edit_my_startTime.Text = my_startTime_default;
            edit_my_endTime.Text   = my_endTime_default;

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

            //设置adapter
            alarmInfoAdapter       = new AlarmInfoListAdapter(Activity);
            actualListView.Adapter = alarmInfoAdapter;

            //点击列表详细
            actualListView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) =>
            {
                //将
                var intent = new Intent(Activity, typeof(AlarmDetailInfoActivity));
                var bundle = new Bundle();
                bundle.PutString("alarmOrigin", "alarmList");
                bundle.PutString("alarmId", alarmInfoAdapter.GetItem(e.Position - 1).AId);
                intent.PutExtras(bundle);
                Activity.StartActivity(intent);
            };

            alarmInfoListParam = new AlarmInfoListParam()
            {
                UserId = Global.MyInfo.UId
            };

            //初始化view完成
            IsPrepared = true;
            LasyloadData();
        }
Exemplo n.º 3
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 = "报警记录";


            otherAlarmRefreshListView = FindViewById <PullToRefreshListView> (Resource.Id.lv_otherAlarm);
            actualListView            = (ListView)otherAlarmRefreshListView.RefreshableView;
            //设置可以上拉加载。下拉刷新
            otherAlarmRefreshListView.Mode = PullToRefreshBase.PullToRefreshMode.Both;

            //下拉刷新提示文本
            otherAlarmRefreshListView.GetLoadingLayoutProxy(true, false).SetPullLabel(GetString(Resource.String.pullDownLbl));
            otherAlarmRefreshListView.GetLoadingLayoutProxy(true, false).SetRefreshingLabel(GetString(Resource.String.pullDownRefreshLbl));
            otherAlarmRefreshListView.GetLoadingLayoutProxy(true, false).SetReleaseLabel(GetString(Resource.String.pullDownReleaseLbl));
            //上拉加载提示文本
            otherAlarmRefreshListView.GetLoadingLayoutProxy(false, true).SetPullLabel(GetString(Resource.String.pullUpLbl));
            otherAlarmRefreshListView.GetLoadingLayoutProxy(false, true).SetRefreshingLabel(GetString(Resource.String.pullUpRefreshLbl));
            otherAlarmRefreshListView.GetLoadingLayoutProxy(false, true).SetReleaseLabel(GetString(Resource.String.pullUpReleaseLbl));



            otherAlarmRefreshListView.SetOnRefreshListener(this);



            //加载view
            edit_other_startTime = FindViewById <EditText>(Resource.Id.edit_other_startTime);

            edit_other_startTime.OnFocusChangeListener = this;
            edit_other_startTime.InputType             = Android.Text.InputTypes.Null;
            edit_other_endTime = FindViewById <EditText> (Resource.Id.edit_other_endTime);

            edit_other_endTime.OnFocusChangeListener = this;
            edit_other_endTime.InputType             = Android.Text.InputTypes.Null;
            other_endTime_default     = DateTime.Now.ToString("yyyy-MM-dd");
            other_startTime_default   = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd");
            edit_other_startTime.Text = other_startTime_default;
            edit_other_endTime.Text   = other_endTime_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;//设置默认值


            //下拉框
            sp_alarmType = FindViewById <Spinner>(Resource.Id.sp_alarmType);
            sp_alarmType.OnItemSelectedListener = this;
            sp_alarmType.Visibility             = ViewStates.Visible;//设置默认值

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

            actualListView.ItemClick += (sender, e) =>
            {
                var intent = new Intent(this, typeof(AlarmDetailInfoActivity));
                var bundle = new Bundle();
                bundle.PutString("alarmOrigin", "alarmList");
                bundle.PutString("alarmId", alarmInfoAdapter.GetItem(e.Position - 1).AId);
                intent.PutExtras(bundle);
                StartActivity(intent);
                OverridePendingTransition(Android.Resource.Animation.SlideInLeft, Android.Resource.Animation.SlideOutRight);
            };

            alarmInfoListParam = new AlarmInfoListParam();
            //初始化view完成
            LasyloadData();
        }
Exemplo n.º 4
0
		public override void OnActivityCreated (Bundle savedInstanceState)
		{
			
			base.OnActivityCreated (savedInstanceState);
			myAlarmRefreshListView = View.FindViewById<PullToRefreshListView> (Resource.Id.lv_MyAlarm);
			actualListView = (ListView)myAlarmRefreshListView.RefreshableView;

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

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


			//下拉框
			sp_alarmType = View.FindViewById<Spinner>(Resource.Id.sp_alarmType);
			sp_alarmType.OnItemSelectedListener = this;   
			sp_alarmType.Visibility = ViewStates.Visible;//设置默认值

		    

			//加载view
			edit_my_startTime = View.FindViewById<EditText>(Resource.Id.edit_my_startTime);
			edit_my_startTime.OnFocusChangeListener = this;
			edit_my_startTime.InputType = Android.Text.InputTypes.Null;

			edit_my_endTime = View.FindViewById<EditText> (Resource.Id.edit_my_endTime);
			edit_my_endTime.OnFocusChangeListener = this;
			edit_my_endTime.InputType = Android.Text.InputTypes.Null;
			my_endTime_default = DateTime.Now.ToString ("yyyy-MM-dd");
			my_startTime_default = DateTime.Now.AddDays (-7).ToString ("yyyy-MM-dd");
			edit_my_startTime.Text = my_startTime_default;
			edit_my_endTime.Text = my_endTime_default;

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

			//设置adapter		
			alarmInfoAdapter = new AlarmInfoListAdapter (Activity);
			actualListView.Adapter = alarmInfoAdapter;

			//点击列表详细
			actualListView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => 
			{
				//将
				var intent  = new Intent(Activity,typeof(AlarmDetailInfoActivity));
				var bundle = new Bundle();
				bundle.PutString("alarmOrigin","alarmList");
				bundle.PutString("alarmId",alarmInfoAdapter.GetItem(e.Position-1).AId);
				intent.PutExtras(bundle);
				Activity.StartActivity(intent);

			};

			alarmInfoListParam =  new AlarmInfoListParam(){UserId = Global.MyInfo.UId};

			//初始化view完成
			IsPrepared = true;
			LasyloadData ();

		}