当前位置: 首页>>代码示例>>C#>>正文


C# RecyclerView.StartAnimation方法代码示例

本文整理汇总了C#中RecyclerView.StartAnimation方法的典型用法代码示例。如果您正苦于以下问题:C# RecyclerView.StartAnimation方法的具体用法?C# RecyclerView.StartAnimation怎么用?C# RecyclerView.StartAnimation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RecyclerView的用法示例。


在下文中一共展示了RecyclerView.StartAnimation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnCreateView

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = (View) inflater.Inflate(Resource.Layout.cardView_layout,container, false);

            mProgressbar = view.FindViewById<ProgressBar> (Resource.Id.progressBarhuoJing);
            mProgressbar.Visibility = ViewStates.Visible;

            mActivityGuZhangBianHao.Clear ();
            mGuZhangDanWei.Clear ();

            mNoShiShiText = view.FindViewById<TextView> (Resource.Id.txtNoShiShi);

            //CardView
            mRecyclerView = view.FindViewById<RecyclerView>(Resource.Id.recyclerView);

            fragmentManager1 = Activity.FragmentManager;

            //swipeRefresh
            mSwipeRefreshLayout = view.FindViewById<mSwipeRefreshlayout> (Resource.Id.swipeLayout);
            mSwipeRefreshLayout.SetColorScheme (Android.Resource.Color.HoloBlueBright, Android.Resource.Color.HoloRedLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloPurple);
            mSwipeRefreshLayout.Refresh += mSwipeRefreshLayout_Refresh;

            //Animation shift_in = AnimationUtils.LoadAnimation (Application.Context, Resource.Animation.slide_in_bottom);

            mWorkerHttp = new BackgroundWorker ();
            mWorkerHttp.WorkerSupportsCancellation = true;

            mWorkerHttp.DoWork += delegate (object sender, DoWorkEventArgs e) {

                BackgroundWorker mworker = sender as BackgroundWorker;

                if (mworker.CancellationPending == true) {
                    e.Cancel = true;
                } else {

                    DateTime mWorkerBegin = DateTime.Now;

                    myHttp ();

                    if (((int)(DateTime.Now - mWorkerBegin).TotalMilliseconds) <= 1000) {
                        Thread.Sleep (1000 - (int)((DateTime.Now - mWorkerBegin).TotalMilliseconds));
                    }

                }

            };

            mWorkerHttp.RunWorkerCompleted += delegate(object sender, RunWorkerCompletedEventArgs e) {
                if (e.Cancelled == true) {

                } else if (!(e.Error == null)) {

                } else {
                    mProgressbar.Visibility = ViewStates.Gone;

                    if (backgroundWorkerFlag == 1) {

                        mNoShiShiText.Visibility = ViewStates.Invisible;
                        mLayoutManager = new LinearLayoutManager (Application.Context);
                        mRecyclerView.SetLayoutManager (mLayoutManager);
                        mAdapter1 = new RecyclerAdapter (mGuZhangDanWei, mRecyclerView, 3, Application.Context, fragmentManager1);
                        mRecyclerView.SetAdapter (mAdapter1);

                        mRecyclerView.StartAnimation (shift_in);

                        if (mAdapter1.ItemCount == 0) {

                            mNoShiShiText.Visibility = ViewStates.Visible;
                        }
                    }

                    else if (backgroundWorkerFlag == 0) {

                        mNoShiShiText.Visibility = ViewStates.Visible;
                        Toast mToast = Toast.MakeText (Application.Context, "网络异常", ToastLength.Short);
                        mToast.Show ();

                    }

                }

            };

            if (mWorkerHttp.IsBusy != true) {
                mWorkerHttp.RunWorkerAsync ();
            }

            mNoShiShiText.Visibility = ViewStates.Invisible;
            mLayoutManager = new LinearLayoutManager (Application.Context);
            mRecyclerView.SetLayoutManager (mLayoutManager);
            mAdapter1 = new RecyclerAdapter (mGuZhangDanWeiTemp, mRecyclerView, 3, Application.Context, fragmentManager1);
            mRecyclerView.SetAdapter (mAdapter1);

            return view ;
        }
开发者ID:coroner4817,项目名称:ShangShuiXiaoFang,代码行数:95,代码来源:GuZhangDanWeiFrag.cs


注:本文中的RecyclerView.StartAnimation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。