private void RunAnimation(RecyclerView recycView, int type) { var context = recycView.Context; LayoutAnimationController controller = null; if (type == 0) { controller = AnimationUtils.LoadLayoutAnimation(context, Resource.Animation.layout_fall_down); } else if (type == 1) { controller = AnimationUtils.LoadLayoutAnimation(context, Resource.Animation.layout_slide_from_bottom); } else if (type == 2) { controller = AnimationUtils.LoadLayoutAnimation(context, Resource.Animation.layout_slide_from_left); } recyclerView.SetLayoutManager(new GridLayoutManager(this, 4)); SimpleRecyclerAdapter adapter = new SimpleRecyclerAdapter(); recyclerView.SetAdapter(adapter); recyclerView.LayoutAnimation = controller; recyclerView.GetAdapter().NotifyDataSetChanged(); recyclerView.ScheduleLayoutAnimation(); }
private void RunAnimation() { var topTitle = FindViewById <TextView>(Resource.Id.SplashTopTitleTextView); var firstFadeIn = AnimationUtils.LoadAnimation(this, Resource.Animation.FadeIn); topTitle.StartAnimation(firstFadeIn); var bottomTitle = FindViewById <TextView>(Resource.Id.SplashBottomTitleTextView); var secondFadeIn = AnimationUtils.LoadAnimation(this, Resource.Animation.FadeInAfteDelay); secondFadeIn.AnimationEnd += (sender, e) => { StartActivity(new Intent(this, typeof(MenuScreenActivity))); Finish(); }; bottomTitle.StartAnimation(secondFadeIn); var spinIn = AnimationUtils.LoadAnimation(this, Resource.Animation.GradualApproach); var controller = new LayoutAnimationController(spinIn) { Order = DelayOrder.Normal }; var tableLayout = FindViewById <TableLayout>(Resource.Id.TableLayoutId); for (var i = 0; i < tableLayout.ChildCount; i++) { if (tableLayout.GetChildAt(i) is TableRow rowView) { rowView.LayoutAnimation = controller; } } }
public static LayoutAnimationController getListAnimTranslate() { try { AnimationSet set = new AnimationSet(true); Animation animation = new AlphaAnimation(0.0f, 1.0f); animation.Duration = 500;//(500); set.AddAnimation(animation); animation = new TranslateAnimation(Dimension.RelativeToSelf, 0.0f, Dimension.RelativeToSelf, 0.0f, Dimension.RelativeToSelf, -1.0f, Dimension.RelativeToSelf, 0.0f); animation.Duration = 800; //(800); set.AddAnimation(animation); LayoutAnimationController controller = new LayoutAnimationController( set, 0.5f); controller.Order = DelayOrder.Random; return(controller); } catch (Exception) { return(null); } }
/// <summary> /// Instantiates the <see cref="NativeViewHierarchyManager"/>. /// </summary> /// <param name="viewManagers">The view manager registry.</param> public NativeViewHierarchyManager(ViewManagerRegistry viewManagers) { _viewManagers = viewManagers; _layoutAnimator = new LayoutAnimationController(); _tagsToViews = new Dictionary <int, DependencyObject>(); _tagsToViewManagers = new Dictionary <int, IViewManager>(); _rootTags = new Dictionary <int, bool>(); _rootViewManager = new RootViewManager(); }
/// <summary> /// Instantiates the <see cref="NativeViewHierarchyManager"/>. /// </summary> /// <param name="viewManagers">The view manager registry.</param> public NativeViewHierarchyManager(ViewManagerRegistry viewManagers) { _viewManagers = viewManagers; _layoutAnimator = new LayoutAnimationController(); _tagsToViews = new Dictionary <int, Widget>(); _tagsToViewManagers = new Dictionary <int, IViewManager>(); _rootTags = new Dictionary <int, bool>(); //_jsResponderHandler = new JavaScriptResponderHandler(); _rootViewManager = new RootViewManager(); }
/// <summary> /// Instantiates the <see cref="NativeViewHierarchyManager"/>. /// </summary> /// <param name="viewManagers">The view manager registry.</param> public NativeViewHierarchyManager(ViewManagerRegistry viewManagers) { _viewManagers = viewManagers; _layoutAnimator = new LayoutAnimationController(); _tagsToViews = new Dictionary<int, DependencyObject>(); _tagsToViewManagers = new Dictionary<int, IViewManager>(); _rootTags = new Dictionary<int, bool>(); _jsResponderHandler = new JavaScriptResponderHandler(); _rootViewManager = new RootViewManager(); }
/// <summary> /// Instantiates the <see cref="NativeViewHierarchyManager"/>. /// </summary> /// <param name="viewManagers">The view manager registry.</param> /// <param name="dispatcher">The dispatcher of the view.</param> /// <param name="onDropView">Notification callback to be passed lists of dropped views tags.</param> public NativeViewHierarchyManager(ViewManagerRegistry viewManagers, #if WINDOWS_UWP CoreDispatcher dispatcher, #else Dispatcher notUsed, #endif Action <List <int> > onDropView ) { _viewManagers = viewManagers; _layoutAnimator = new LayoutAnimationController(); _tagsToViews = new Dictionary <int, DependencyObject>(); _tagsToViewManagers = new Dictionary <int, IViewManager>(); _rootTags = new Dictionary <int, bool>(); _rootViewManager = new RootViewManager(); #if WINDOWS_UWP Dispatcher = dispatcher; #endif _deletedTagsBatchReporter = new DeletedTagsBatchReporter(onDropView); }
public ColorBoxAdapter(Activity context, RecyclerView recycler) { try { ActivityContext = context; var mainRecyclerView = recycler; mainRecyclerView.SetLayoutManager(new LinearLayoutManager(ActivityContext, LinearLayoutManager.Horizontal, false)); LayoutAnimationController controller = AnimationUtils.LoadLayoutAnimation(context, Resource.Animation.layout_animation_slide_right); mainRecyclerView.LayoutAnimation = controller; if (ListUtils.SettingsSiteList?.PostColors != null && ListUtils.SettingsSiteList?.PostColors?.PostColorsList != null && !ListUtils.SettingsSiteList.PostColors.Value.PostColorsList.ContainsKey("white")) { ListUtils.SettingsSiteList?.PostColors?.PostColorsList.Add("white", new PostColorsObject { Color1 = "#ffffff", Color2 = "#efefef", TextColor = "#444444" }); } if (ListUtils.SettingsSiteList?.PostColors != null && ListUtils.SettingsSiteList?.PostColors?.PostColorsList != null) { ColorsList = new ObservableCollection <PostColorsObject>(ListUtils.SettingsSiteList?.PostColors?.PostColorsList.Values); } mainRecyclerView.SetAdapter(this); NotifyDataSetChanged(); mainRecyclerView.ScheduleLayoutAnimation(); mainRecyclerView.Visibility = ColorsList.Count switch { 0 => ViewStates.Invisible, _ => mainRecyclerView.Visibility }; } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); RequestWindowFeature(WindowFeatures.NoTitle); SetContentView(Resource.Layout.Main); items = new string[] { "Zero", "One", "Two", "Three", "Four", "Five" }; _btn = FindViewById <Button> (Resource.Id.btnCategory); _lstcategory = FindViewById <ListView> (Resource.Id.listcategory); _rltBar = FindViewById <RelativeLayout> (Resource.Id.rltBar); _txtCategory = FindViewById <TextView> (Resource.Id.txtCategory); _lstcategory.Visibility = ViewStates.Gone; _btn.Click += delegate { _rltBar.Visibility = ViewStates.Gone; _lstcategory.Visibility = ViewStates.Visible; _lstcategory.Adapter = new HomeScreenAdapter(this, items); LayoutAnimationController controller = AnimationUtils.LoadLayoutAnimation( this, Resource.Animation.list_layout_controller); _lstcategory.LayoutAnimation = (controller); }; _lstcategory.ItemClick += OnListItemClick; }