本文整理汇总了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 ;
}