Esempio n. 1
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            var vh   = (UserViewHolder)holder;
            var user = Users[position];

            holder.ItemView.StartAnimation(AnimationUtils.LoadAnimation(holder.ItemView.Context, Resource.Animation.anim_fade_fall));

            vh.User = user;
        }
    public async Task ShowVaso()
    {
        text.gameObject.SetActive(false);
        vaso.SetActive(true);
        dialogue.SetActive(true);
        await Task.Delay(500);

        await AnimationUtils.PushMeAnimation(dialogue.transform);
    }
Esempio n. 3
0
 public async Task ResetPociones()
 {
     selectedColorPotions.Clear();
     foreach (Pocion p in colorPotions)
     {
         p.ResetPosition();
     }
     await AnimationUtils.BlinkAnimation(seleccion);
 }
Esempio n. 4
0
        private void InitAuthenticatorList()
        {
            var viewModePref = PreferenceManager.GetDefaultSharedPreferences(this)
                               .GetString("pref_viewMode", "default");

            var viewMode = viewModePref switch
            {
                "compact" => AuthenticatorListAdapter.ViewMode.Compact,
                "tile" => AuthenticatorListAdapter.ViewMode.Tile,
                _ => AuthenticatorListAdapter.ViewMode.Default
            };

            _authListAdapter = new AuthenticatorListAdapter(_authSource, _customIconSource, viewMode, IsDark)
            {
                HasStableIds = true
            };

            _authListAdapter.ItemClick       += OnAuthenticatorClick;
            _authListAdapter.MenuClick       += OnAuthenticatorOptionsClick;
            _authListAdapter.MovementStarted += delegate
            {
                _bottomAppBar.PerformHide();
            };

            _authListAdapter.MovementFinished += async delegate
            {
                RunOnUiThread(_bottomAppBar.PerformShow);
                await NotifyWearAppOfChange();
            };

            _authList.SetAdapter(_authListAdapter);

            var minColumnWidth = viewMode switch
            {
                AuthenticatorListAdapter.ViewMode.Compact => 300,
                AuthenticatorListAdapter.ViewMode.Tile => 170,
                _ => 340
            };

            var layout = new AutoGridLayoutManager(this, minColumnWidth);

            _authList.SetLayoutManager(layout);

            _authList.AddItemDecoration(new GridSpacingItemDecoration(this, layout, 8));
            _authList.HasFixedSize = true;

            var animation =
                AnimationUtils.LoadLayoutAnimation(this, Resource.Animation.layout_animation_fall_down);

            _authList.LayoutAnimation = animation;

            var callback    = new ReorderableListTouchHelperCallback(_authListAdapter, layout);
            var touchHelper = new ItemTouchHelper(callback);

            touchHelper.AttachToRecyclerView(_authList);
        }
Esempio n. 5
0
        private void SetUpViews()
        {
            SetUpWebView();

            title = FindViewById <TextView>(Resource.Id.PDFViewerTitle);

            pdfViewer.Visibility = ViewStates.Invisible;
            title.Visibility     = ViewStates.Invisible;

            vs = FindViewById <ViewStub>(Resource.Id.progressBarStub);
            vs.LayoutResource = Resource.Layout.PrograssBarLayout;
            view = vs.Inflate();
            view.BringToFront();

            fabMain   = FindViewById <FloatingActionButton>(Resource.Id.fabMain);
            fabAction = FindViewById <FloatingActionButton>(Resource.Id.fabAction);
            fabShare  = FindViewById <FloatingActionButton>(Resource.Id.fabShare);

            fabMain.Visibility = ViewStates.Invisible;

            fabOpen        = AnimationUtils.LoadAnimation(this, Resource.Animation.FabOpen);
            fabClose       = AnimationUtils.LoadAnimation(this, Resource.Animation.FabClose);
            rotateForward  = AnimationUtils.LoadAnimation(this, Resource.Animation.RotateForward);
            rotateBackward = AnimationUtils.LoadAnimation(this, Resource.Animation.RotateBackward);

            fabMain.Click += ((sender, args) =>
            {
                AnimateFAB();
            });

            fabShare.Click += new EventHandler((sender, args) =>
            {
                Share();
            });

            if (isFileOffline)
            {
                fabAction.SetImageResource(Resource.Drawable.ic_delete_black_48dp);
                fabAction.Click += new EventHandler((sender, args) =>
                {
                    DeleteFile();
                });
            }
            else
            {
                fabAction.SetImageResource(Resource.Drawable.ic_file_download_black_48dp);
                fabAction.Click += new EventHandler((IntentSender, args) =>
                {
                    SaveFile();
                });
            }

            Functions.ResizeText(title, this);
            Functions.SetElevation(6f, 12f, title);
            title.Typeface = Typeface.CreateFromAsset(Assets, "Fonts/OpenSans/OpenSans-Bold.ttf");
        }
        public override void Dismiss()
        {
            Animation anim = AnimationUtils.LoadAnimation(activity, Resource.Animation.snackbar_hide_animation);

            anim.AnimationEnd += (sender, e) =>
            {
                base.Dismiss();
            };
            view.StartAnimation(anim);
        }
 public void Start()
 {
     if (!_running)
     {
         _triggerPercentage = 0;
         _startTime         = AnimationUtils.CurrentAnimationTimeMillis();
         _running           = true;
         _parent.PostInvalidate();
     }
 }
Esempio n. 8
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            ExamAlertViewHolder photoViewHolder1 = holder as ExamAlertViewHolder;

            photoViewHolder1.Caption.Text = examalert_list[position].content_title;
            Animation animation1 = AnimationUtils.LoadAnimation(ac, (position > lastPosition) ? Resource.Animation.slide_up1 : Resource.Animation.slide_down1);

            photoViewHolder1.ItemView.StartAnimation(animation1);
            lastPosition = position;
        }
Esempio n. 9
0
        private void Sa_AnimationEnd(object sender, Animation.AnimationEndEventArgs e)
        {
            Thread.Sleep(Config.Profile.Delay * 10);

            this.RunOnUiThread(new Action(() =>
            {
                var sa = AnimationUtils.LoadAnimation(this, Resource.Animation.translate);
                vistor.StartAnimation(sa);
            }));
        }
Esempio n. 10
0
 /**
  * Start showing the progress animation.
  */
 public void start()
 {
     if (!mRunning)
     {
         mTriggerPercentage = 0;
         mStartTime         = AnimationUtils.CurrentAnimationTimeMillis();
         mRunning           = true;
         mParent.PostInvalidate();
     }
 }
Esempio n. 11
0
 public void Start()
 {
     if (mIsRunning)
     {
         return;
     }
     mIsRunning = true;
     mStartTime = AnimationUtils.CurrentAnimationTimeMillis();
     Post(mUpdater);
 }
Esempio n. 12
0
        public override void OnStart()
        {
            mErrorInAnim  = this.CreateExitAnimation();
            mErrorXInAnim = (AnimationSet)AnimationUtils.LoadAnimation(this.Context, Resource.Animation.error_x_in);

            this.mErrorX = (ImageView)this.ContentView.FindViewById(Resource.Id.error_top_x);

            this.ContentView.StartAnimation(this.mErrorInAnim);
            this.mErrorX.StartAnimation(this.mErrorXInAnim);
        }
Esempio n. 13
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            VocabularyViewHolder photoViewHolder = holder as VocabularyViewHolder;

            photoViewHolder.Caption.Text = weekly_list[position].content_title;
            Animation animation = AnimationUtils.LoadAnimation(ac, (position > lastPosition) ? Resource.Animation.slide_up1 : Resource.Animation.slide_down1);

            photoViewHolder.ItemView.StartAnimation(animation);
            lastPosition = position;
        }
Esempio n. 14
0
            public void OnClick(View v)
            {
                Button    view    = (Button)v;
                Context   context = view.Context;
                Animation anim    = AnimationUtils.LoadAnimation(context, Resource.Animation.bounceScaleAnimation);
                ScaleBounceInterpolator scaleBounceInterpolator = new ScaleBounceInterpolator(0.1, 10);

                anim.Interpolator = scaleBounceInterpolator;
                view.StartAnimation(anim);
            }
Esempio n. 15
0
        protected override void OnElementChanged(ElementChangedEventArgs <ContentView> e)
        {
            base.OnElementChanged(e);
            global::Android.Views.Animations.Animation a = AnimationUtils.LoadAnimation(_context, Resource.Drawable.fade_in);
            a.Reset();


            this.ClearAnimation();
            this.StartAnimation(a);
        }
Esempio n. 16
0
        protected override void OnCreate(Bundle savedInstance)
        {
            base.OnCreate(savedInstance);
            SetContentView(R.Layouts.MainLayout);
            var text      = FindViewById(R.Ids.theLabel);
            var animation = AnimationUtils.LoadAnimation(this, R.Anims.Animation);

            text.SetAnimation(animation);
            animation.Start();
        }
Esempio n. 17
0
        public override bool OnTouchEvent(MotionEvent e)
        {
            TextView texto  = FindViewById <TextView>(Resource.Id.quant);
            TextView nome   = FindViewById <TextView>(Resource.Id.campoNome);
            TextView desc   = FindViewById <TextView>(Resource.Id.campoDesc);
            TextView quant  = FindViewById <TextView>(Resource.Id.campoQuant);
            TextView precoT = FindViewById <TextView>(Resource.Id.campoPrecoT);

            switch (e.Action)
            {
            case MotionEventActions.Down:
                x = e.RawX;
                break;

            case MotionEventActions.Up:
                float deltaX = e.RawX - x;
                if (Math.Abs(deltaX) > 50)
                {
                    if (e.RawX > x)
                    {
                        if (i > 0)
                        {
                            Animation a = AnimationUtils.LoadAnimation(ApplicationContext,
                                                                       Resource.Animation.centerToRight);
                            var l = FindViewById <LinearLayout>(Resource.Id.root);
                            l.StartAnimation(a);
                            a.AnimationEnd += A_AnimationEnd;
                            i--;
                        }
                    }
                    else
                    {
                        if (i < q - 1)
                        {
                            Animation a = AnimationUtils.LoadAnimation(ApplicationContext,
                                                                       Resource.Animation.centerToLeft);
                            var l = FindViewById <LinearLayout>(Resource.Id.root);
                            l.StartAnimation(a);
                            a.AnimationEnd += A_AnimationEnd1;
                            i++;
                        }
                    }
                    if (select.Count > 0)
                    {
                        texto.Text  = (i + 1) + "/" + q;
                        nome.Text   = select[i].Nome;
                        desc.Text   = select[i].Descricao;
                        precoT.Text = "R$" + select[i].PrecoTotal;
                        quant.Text  = select[i].Quantidade.ToString();
                    }
                }
                break;
            }
            return(base.OnTouchEvent(e));
        }
Esempio n. 18
0
            protected internal void SetData(App app, int position)
            {
                AppName.Text = app.Name;
                Glide.With(Application.Context).Load(app.ImagePath).Into(AppIcon);

                if (position > lastPosition)
                {
                    ItemView.StartAnimation(AnimationUtils.LoadAnimation(Application.Context, Resource.Animation.item_anim_slide_from_right));
                    lastPosition = position;
                }
            }
Esempio n. 19
0
 protected AbsQuizView(Context context, Category category) : base(context)
 {
     mCategory                   = category;
     spacingDouble               = Resources.GetDimensionPixelSize(Resource.Dimension.spacing_double);
     minHeightTouchTarget        = Resources.GetDimensionPixelSize(Resource.Dimension.min_height_touch_target);
     fastOutSlowInInterpolator   = AnimationUtils.LoadInterpolator(Context, Android.Resource.Interpolator.FastOutSlowIn);
     linearOutSlowInInterpolator = AnimationUtils.LoadInterpolator(Context, Android.Resource.Interpolator.LinearOutSlowIn);
     colorAnimationDuration      = 400;
     iconAnimationDuration       = 300;
     scaleAnimationDuration      = 200;
 }
Esempio n. 20
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activityManageCategories);

            _preferences = new PreferenceWrapper(this);

            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);

            SupportActionBar.SetTitle(Resource.String.categories);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowHomeEnabled(true);
            SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_action_arrow_back);

            _rootLayout = FindViewById <RelativeLayout>(Resource.Id.layoutRoot);

            _addButton        = FindViewById <FloatingActionButton>(Resource.Id.buttonAdd);
            _addButton.Click += OnAddClick;

            var connection = await Database.GetSharedConnection();

            _categorySource                   = new CategorySource(connection);
            _categoryListAdapter              = new ManageCategoriesListAdapter(_categorySource);
            _categoryListAdapter.MenuClick   += OnMenuClick;
            _categoryListAdapter.HasStableIds = true;
            _categoryListAdapter.DefaultId    = _preferences.DefaultCategory;

            _categoryList     = FindViewById <RecyclerView>(Resource.Id.list);
            _emptyStateLayout = FindViewById <LinearLayout>(Resource.Id.layoutEmptyState);

            _categoryList.SetAdapter(_categoryListAdapter);
            _categoryList.HasFixedSize = true;

            var layout = new FixedGridLayoutManager(this, 1);

            _categoryList.SetLayoutManager(layout);

            var callback    = new ReorderableListTouchHelperCallback(this, _categoryListAdapter, layout);
            var touchHelper = new ItemTouchHelper(callback);

            touchHelper.AttachToRecyclerView(_categoryList);

            var decoration = new DividerItemDecoration(this, layout.Orientation);

            _categoryList.AddItemDecoration(decoration);

            var layoutAnimation = AnimationUtils.LoadLayoutAnimation(this, Resource.Animation.layout_animation_fade_in);

            _categoryList.LayoutAnimation = layoutAnimation;

            await Refresh();
        }
        public void Start()
        {
            if (IsRunning)
            {
                return;
            }

            IsRunning = true;
            startTime = AnimationUtils.CurrentAnimationTimeMillis();
            Post(OnUpdate);
        }
Esempio n. 22
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.FirstView);

            Animation textAnimation = AnimationUtils.LoadAnimation(Application.ApplicationContext,
                                                                   Resource.Drawable.TextAnimation);
            TextView textHello = FindViewById <TextView>(Resource.Id.TextHello);

            textHello.StartAnimation(textAnimation);
        }
Esempio n. 23
0
        private void InitSpinner()
        {
            var rotation = AnimationUtils.LoadAnimation(this, Resource.Animation.rotate);

            rotation.FillAfter = true;
            sendProgressIndeterminate.StartAnimation(rotation);

            sendProgress.Visibility              = ViewStates.Invisible;
            sendProgressPercent.Visibility       = ViewStates.Invisible;
            sendProgressIndeterminate.Visibility = ViewStates.Visible;
        }
Esempio n. 24
0
    public void Show(UnityAction postActionCallback)
    {
        CanvasGroup.alpha = 0.0f;

        gameObject.SetActive(true);

        StartCoroutine(AnimationUtils.Animate(mDuration, (time) =>
        {
            CanvasGroup.alpha = time / mDuration;
        }, postActionCallback));
    }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            RequestWindowFeature(Android.Views.WindowFeatures.NoTitle);
            SetContentView(Resource.Layout.SplashScreen);
            image            = FindViewById <ImageView>(Resource.Id.splashImage);
            splashAnimatioin = AnimationUtils.LoadAnimation(this, Resource.Animation.splash_animation);

            image.StartAnimation(splashAnimatioin);
            splashAnimatioin.AnimationEnd += Rotate_AnimationEnd;
        }
Esempio n. 26
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            _flurryClient    = new FlurryClient();
            AppInfo._display = WindowManager.DefaultDisplay;

            AppInfo.IsLocaleRu = false;
            var locale = Java.Util.Locale.Default.DisplayLanguage;

            if (locale == "русский")
            {
                AppInfo.IsLocaleRu = true;
            }


            AppInfo._badgesCount   = 0;
            AppInfo._subcategCount = 0;
            AppInfo._bonusesCount  = 0;

            Vibrator vibe = (Vibrator)this.GetSystemService(Context.VibratorService);


            SetContentView(Resource.Layout.loginactivitylayout);
            buttonClickAnimation = AnimationUtils.LoadAnimation(this, Android.Resource.Animation.FadeIn);

            ImageButton loginButton    = FindViewById <ImageButton>(Resource.Id.login);
            TextView    signUpTextView = FindViewById <TextView>(Resource.Id.signUpTextView);
            TextView    signInTextView = FindViewById <TextView>(Resource.Id.login_signinTextView);
            TextView    centerTextView = FindViewById <TextView>(Resource.Id.login_centerTextView);

            if (!AppInfo.IsLocaleRu)
            {
                signUpTextView.Text = "About project";
                signInTextView.Text = "               Sign in with";
                centerTextView.Text = "Collect all your achievements";
            }


            //login_centerTextView
            signUpTextView.Click += delegate
            {
                Intent browserIntent = new Intent(Intent.ActionView, Android.Net.Uri.Parse("http://itsbeta.com/"));
                StartActivity(browserIntent);
            };

            loginButton.Click += delegate
            {
                loginButton.StartAnimation(buttonClickAnimation);
                vibe.Vibrate(50);
                Finish();
                StartActivity(typeof(LoginWebActivity));
            };
        }
Esempio n. 27
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            SearchResult option = GetItem(position);

            if (convertView == null)
            {
                convertView = LayoutInflater.From(Context).Inflate(
                    Resource.Layout.SearchOption, parent, false);

                if (_animate)
                {
                    Animation anim = AnimationUtils.LoadAnimation(Context,
                                                                  Resource.Animation.AnimDown);
                    anim.Duration = 400;
                    convertView.StartAnimation(anim);
                    if (count == Count)
                    {
                        _animate = false;
                    }
                    count++;
                }
            }

            View border = convertView.FindViewById(Resource.Id.sb_border);

            if (position == 0)
            {
                border.Visibility = ViewStates.Visible;
            }
            else
            {
                border.Visibility = ViewStates.Gone;
            }
            TextView title = convertView.FindViewById <TextView>(Resource.Id.sb_title);

            title.Text = option.Title;
            if (option.Icon != null)
            {
                ImageView icon = convertView.FindViewById <ImageView>(Resource.Id.sb_icon);
                icon.SetImageDrawable(option.Icon);
            }
            //ImageView up = (ImageView) convertView.FindViewById<ImageView>(R.id.up);
            //up.setOnClickListener(new OnClickListener() {

            //	@Override
            //	public void onClick(View v) {
            //                 mSearch.setText(title.getText().toString());
            //                 mSearch.setSelection(mSearch.getText().length());
            //	}

            //});

            return(convertView);
        }
Esempio n. 28
0
            protected internal void SetData(VideoStatus video, int position)
            {
                VideoTitle.Text = video.Title;
                Glide.With(Application.Context).Load(video.CoverPath).Placeholder(Application.Context.GetDrawable(Resource.Drawable.video)).Into(CoverImage);

                if (position > lastPosition)
                {
                    ItemView.StartAnimation(AnimationUtils.LoadAnimation(Application.Context, Resource.Animation.item_anim_slide_from_right));
                    lastPosition = position;
                }
            }
Esempio n. 29
0
 private void InternalReload(bool firstAttack = false)
 {
     Arrow.gameObject.SetActive(true);
     AnimationUtils.PlayAnimation(
         "Reload", Avatar
         , playImediatly: !firstAttack
         , accessory: Cape, accessoryName: "Body"
         , accessory2: Bow, accessory2Name: "Bow"
         , accessory3: Arrow, accessory3Name: "Arrow"
         );
 }
        void Spin()
        {
            if (!isRotating)
            {
                return;
            }

            Animation rotation = AnimationUtils.LoadAnimation(this.Context, Resource.Animation.image_rotate);

            this.StartAnimation(rotation);
        }