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


C# TextView.StartAnimation方法代码示例

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


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

示例1: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.animation_demo);

            _shake = AnimationUtils.LoadAnimation(this, Resource.Animation.shake);
            _fadeOut = AnimationUtils.LoadAnimation(this, Resource.Animation.fade_out);
            _fadeIn = AnimationUtils.LoadAnimation(this, Resource.Animation.fade_in);
            _scale = AnimationUtils.LoadAnimation(this, Resource.Animation.scale);
            _text = FindViewById<TextView>(Resource.Id.text);

            FindViewById<Button>(Resource.Id.shake_button).Click += (e, args) =>
                _text.StartAnimation(_shake);

            FindViewById<Button>(Resource.Id.fadeout_button).Click += (e, args) =>
            {
                _text.StartAnimation(_fadeOut);
                _text.Visibility = Android.Views.ViewStates.Invisible;
            };

            FindViewById<Button>(Resource.Id.fadein_button).Click += (e, args) =>
            {
                _text.Visibility = Android.Views.ViewStates.Visible;
                _text.StartAnimation(_fadeIn);
            };

            FindViewById<Button>(Resource.Id.scale_button).Click += (e, args) =>
                _text.StartAnimation(_scale);
        }
开发者ID:jorik041,项目名称:Sample-Projects,代码行数:30,代码来源:AnimationActivity.cs

示例2: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            Console.WriteLine("AboutActivity - OnCreate");
            base.OnCreate(bundle);

            _navigationManager = Bootstrapper.GetContainer().Resolve<MobileNavigationManager>();
            SetContentView(Resource.Layout.About);
            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetHomeButtonEnabled(true);

            _progressBar = FindViewById<ProgressBar>(Resource.Id.about_progressBar);
            _lblLoading = FindViewById<TextView>(Resource.Id.about_lblLoading);
            _webView = FindViewById<WebView>(Resource.Id.about_webView);
            _webViewClient = new MyWebViewClient();
            _webViewClient.PageFinished += (sender, args) => {
                Animation anim = AnimationUtils.LoadAnimation(this, Resource.Animation.fade_out);
                anim.AnimationEnd += (animSender, animArgs) => {
                    _lblLoading.Visibility = ViewStates.Gone;
                };
                _lblLoading.StartAnimation(anim);

                Animation anim2 = AnimationUtils.LoadAnimation(this, Resource.Animation.fade_out);
                anim2.AnimationEnd += (animSender, animArgs) => {
                    _progressBar.Visibility = ViewStates.Gone;
                };
                _progressBar.StartAnimation(anim2);
            };
            _webView.SetWebViewClient(_webViewClient);

            // Since the onViewReady action could not be added to an intent, tell the NavMgr the view is ready
            //((AndroidNavigationManager)_navigationManager).SetAboutActivityInstance(this);
            _navigationManager.BindAboutView(this);
        }
开发者ID:pascalfr,项目名称:MPfm,代码行数:33,代码来源:AboutActivity.cs

示例3: OnCreate

        protected async override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Favorites);

            // toolbar setup
            var toolbar = FindViewById<Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            favoritesListView = FindViewById<RecyclerView>(Resource.Id.FavoritesList);

            // use this setting to improve performance if you know that changes
            // in content do not change the layout size of the RecyclerView
            favoritesListView.HasFixedSize = true;
            // use a linear layout manager
            var layoutManager = new LinearLayoutManager(this);
            layoutManager.Orientation = (int)Orientation.Vertical;
            favoritesListView.SetLayoutManager(layoutManager);



            _favoritesService = SimpleIoc.Default.GetInstance<IFavoritesService>();
            _favorites = await _favoritesService.GetFavoritesAsync();

       
            // specify an adapter (see also next example)
            mAdapter = new FavoriteListAdapter(this, _favorites, this);
            favoritesListView.SetAdapter(mAdapter);
            favoritesListView.ChildViewRemoved += FavoritesListView_ChildViewRemoved;
            var callback = new SimpleItemTouchHelperCallback((IItemTouchHelperAdapter)mAdapter);
            _itemTouchHelper = new ItemTouchHelper(callback);
            _itemTouchHelper.AttachToRecyclerView(favoritesListView);

            _placeHolder = FindViewById<TextView>(Resource.Id.placeHolder);
            _placeHolderAnimation = AnimationUtils.LoadAnimation(this, Resource.Animation.placeholder);
            if (_favorites.Count == 0)
            {
                await Task.Delay(200);
                _placeHolder.StartAnimation(_placeHolderAnimation);
                _placeHolder.Visibility = ViewStates.Visible;
            }
        }
开发者ID:ThePublicBikeGang,项目名称:EasyBike,代码行数:43,代码来源:FavoritesActivity.cs


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