private void InitView() { //设置标题栏 var img_header_back = FindViewById<ImageView> (Resource.Id.img_header_back); img_header_back.Click += (sender, e) => { SetResult(Result.Canceled); 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 = "选择银行卡"; lv_bankType = FindViewById<ListView> (Resource.Id.lv_bankType); bankCardInfoListAdapter = new BankCardInfoListAdapter (this); lv_bankType.Adapter = bankCardInfoListAdapter; //设置滑动listview停止加载图片 lv_bankType.SetOnScrollListener (new PauseOnScrollListener(Global.imageLoader,false,false)); lv_bankType.SetSelector (Resource.Color.red);//设置被选中项颜色为红 LoadTypeData (); //点击列表详细 lv_bankType.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => { var intent = new Intent(); intent.PutExtra("choosebankTypeId",bankCardInfoListAdapter.GetItem(e.Position).BankCardTypeId); intent.PutExtra("choosebankImgUrl",bankCardInfoListAdapter.GetItem(e.Position).BankCardImageUrl); SetResult(Result.Ok,intent); this.Finish(); }; }
private void InitView() { //设置标题栏 var img_header_back = FindViewById <ImageView> (Resource.Id.img_header_back); img_header_back.Click += (sender, e) => { SetResult(Result.Canceled); 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 = "选择银行卡"; lv_bankType = FindViewById <ListView> (Resource.Id.lv_bankType); bankCardInfoListAdapter = new BankCardInfoListAdapter(this); lv_bankType.Adapter = bankCardInfoListAdapter; //设置滑动listview停止加载图片 lv_bankType.SetOnScrollListener(new PauseOnScrollListener(Global.imageLoader, false, false)); lv_bankType.SetSelector(Resource.Color.red); //设置被选中项颜色为红 LoadTypeData(); //点击列表详细 lv_bankType.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => { var intent = new Intent(); intent.PutExtra("choosebankTypeId", bankCardInfoListAdapter.GetItem(e.Position).BankCardTypeId); intent.PutExtra("choosebankImgUrl", bankCardInfoListAdapter.GetItem(e.Position).BankCardImageUrl); SetResult(Result.Ok, intent); this.Finish(); }; }
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 = "银行卡"; var tv_action = FindViewById <TextView> (Resource.Id.tv_action); tv_action.Text = "添加"; tv_action.Click += (object sender, EventArgs e) => { //跳转添加银行卡页面 StartActivity(typeof(AddBankStepOneActivity)); }; //设置下拉刷新动画 lv_bankCards = FindViewById <PullToRefreshListView> (Resource.Id.lv_bankcard); actualListView = (ListView)lv_bankCards.RefreshableView; //设置可以上拉加载。下拉刷新 lv_bankCards.Mode = PullToRefreshBase.PullToRefreshMode.PullFromStart; //下拉刷新提示文本 lv_bankCards.GetLoadingLayoutProxy(true, false).SetPullLabel(string.Empty); lv_bankCards.GetLoadingLayoutProxy(true, false).SetRefreshingLabel(string.Empty); lv_bankCards.GetLoadingLayoutProxy(true, false).SetReleaseLabel(string.Empty); //绑定监听事件 lv_bankCards.SetOnRefreshListener(this); //设置自定义列表adapter bankCardAdapter = new BankCardInfoListAdapter(this); actualListView.Adapter = bankCardAdapter; //第一次不为空设置自动刷新view new Handler().PostDelayed(() => { lv_bankCards.Refreshing = true; }, 500); }
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 = "银行卡"; var tv_action = FindViewById<TextView> (Resource.Id.tv_action); tv_action.Text = "添加"; tv_action.Click += (object sender, EventArgs e) => { //跳转添加银行卡页面 StartActivity(typeof(AddBankStepOneActivity)); }; //设置下拉刷新动画 lv_bankCards = FindViewById<PullToRefreshListView> (Resource.Id.lv_bankcard); actualListView = (ListView)lv_bankCards.RefreshableView; //设置可以上拉加载。下拉刷新 lv_bankCards.Mode = PullToRefreshBase.PullToRefreshMode.PullFromStart; //下拉刷新提示文本 lv_bankCards.GetLoadingLayoutProxy(true,false).SetPullLabel(string.Empty); lv_bankCards.GetLoadingLayoutProxy (true,false).SetRefreshingLabel(string.Empty); lv_bankCards.GetLoadingLayoutProxy (true, false).SetReleaseLabel (string.Empty); //绑定监听事件 lv_bankCards.SetOnRefreshListener(this); //设置自定义列表adapter bankCardAdapter = new BankCardInfoListAdapter (this); actualListView.Adapter = bankCardAdapter; //第一次不为空设置自动刷新view new Handler ().PostDelayed (() => { lv_bankCards.Refreshing = true; }, 500); }