protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.TebriklerSablonGonderildiBaseActivity); DinamikStatusBarColor dinamikStatusBarColor = new DinamikStatusBarColor(); dinamikStatusBarColor.SetFullScreen(this); animationView = FindViewById <LottieAnimationView>(Resource.Id.animation_view1); animationView2 = FindViewById <LottieAnimationView>(Resource.Id.animation_view2); DevamEtButton = FindViewById <Button>(Resource.Id.button1); UcretsizDevamEt = FindViewById <Button>(Resource.Id.button2); Baslik = FindViewById <TextView>(Resource.Id.textView1); Acikalama = FindViewById <TextView>(Resource.Id.textView2); DevamEtButton.Visibility = ViewStates.Invisible; Baslik.Visibility = ViewStates.Invisible; Acikalama.Visibility = ViewStates.Invisible; if (!TebriklerSablonGonderildiBaseActivity_Helper.OdemeliMusteri) { Acikalama.Text = "İşletmeniz için oluşturduğunuz paylaşım akışı şuan bize aktarılıyor. Ücretsiz deneme sürümü boyunca ilk 3 içerik 5 günde paylaşılmak üzere hazırlanacak! Eğer devam etmek istersen, sonraki 24 saat içerisinde uzman tasarımcılarımız bir aylık içeriğinizi tasarlayıp paylaşıma hazır getirecek!"; } else { Acikalama.Text = "İşletmeniz için oluşturduğunuz paylaşım akışı şuan bize aktarılıyor. Aktarım tamamlandıktan sonraki 24 saat içerisinde uzman tasarımcılarımız ile birlikte paylaşımlarınızı hazır hale getireceğiz. Tasarım sürecini AnaSayfa'dan takip edebilirsiniz."; } DevamEtButton.Click += DevamEtButton_Click; UcretsizDevamEt.Click += UcretsizDevamEt_Click; }
public EmptyStateViewHolder(View itemView) : base(itemView) { try { MainView = itemView; EmptyStateIcon = (TextView)itemView.FindViewById(Resource.Id.emtyicon); TitleText = (TextView)itemView.FindViewById(Resource.Id.headText); DescriptionText = (TextView)itemView.FindViewById(Resource.Id.seconderyText); EmptyStateButton = itemView.FindViewById <Button>(Resource.Id.button); LottieAnimationView = itemView.FindViewById <LottieAnimationView>(Resource.Id.animation_view); LottieAnimationView.Visibility = ViewStates.Gone; EmptyStateIcon.Visibility = ViewStates.Visible; FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, EmptyStateIcon, IonIconsFonts.Search); EmptyStateIcon.SetTextSize(ComplexUnitType.Dip, 45f); TitleText.Text = Application.Context.GetText(Resource.String.Lbl_NoSearchResult_TitleText); DescriptionText.Text = Application.Context.GetText(Resource.String.Lbl_NoSearchResult_DescriptionText); EmptyStateButton.Text = Application.Context.GetText(Resource.String.Lbl_NoSearchResult_Button); } catch (Exception exception) { Console.WriteLine(exception); } }
public void LottieAnimationViewURL() { tlog.Debug(tag, $"LottieAnimationViewURL START"); using (Uint16Pair size = new Uint16Pair(40, 60)) { var testingTarget = new LottieAnimationView(1.0f, true); Assert.IsNotNull(testingTarget, "Can't create success object LottieAnimationView"); Assert.IsInstanceOf <LottieAnimationView>(testingTarget, "Should be an instance of LottieAnimationView type."); testingTarget.URL = lottieFilePath; try { var result = testingTarget.URL; } catch (Exception e) { tlog.Debug(tag, e.Message.ToString()); Assert.Fail("Caught Exception: Failed!"); } } tlog.Debug(tag, $"LottieAnimationViewURL END (OK)"); }
public StickerViewHolder(View itemView, Action <MesClickEventArgs> clickListener, Action <MesClickEventArgs> longClickListener, bool showName) : base(itemView) { try { MainView = itemView; LytParent = itemView.FindViewById <LinearLayout>(Resource.Id.main); ImageView = itemView.FindViewById <ImageView>(Resource.Id.imgDisplay); LoadingProgressview = itemView.FindViewById <ProgressBar>(Resource.Id.loadingProgressview); Time = itemView.FindViewById <TextView>(Resource.Id.time); Seen = itemView.FindViewById <TextView>(Resource.Id.seen); StarImage = itemView.FindViewById <ImageView>(Resource.Id.fav); StarImage.Visibility = ViewStates.Gone; StarIcon = itemView.FindViewById <LottieAnimationView>(Resource.Id.starIcon); StarIcon.Progress = 0; StarIcon.CancelAnimation(); StarIcon.Visibility = ViewStates.Gone; UserName = itemView.FindViewById <TextView>(Resource.Id.name); if (UserName != null) { UserName.Visibility = showName ? ViewStates.Visible : ViewStates.Gone; } itemView.Click += (sender, args) => clickListener(new MesClickEventArgs { View = itemView, Position = AdapterPosition, Type = TypeClick.Sticker }); itemView.LongClick += (sender, args) => longClickListener(new MesClickEventArgs { View = itemView, Position = AdapterPosition, Type = TypeClick.Sticker }); } catch (Exception e) { Console.WriteLine(e); } }
private void StartSessionMonitor() { sessionMonitor = new Windows.SessionMonitor((object sender, SessionSwitchEventArgs args) => { switch (args.Reason) { case SessionSwitchReason.SessionUnlock: case SessionSwitchReason.SessionLogon: if (Status == Models.ConnectionState.Protected) { ConstructRippleAnimation().ContinueWith(task => StartRippleAnimation()); } break; case SessionSwitchReason.SessionLock: case SessionSwitchReason.SessionLogoff: if (Status == Models.ConnectionState.Protected) { StopRippleAnimation(); Application.Current.Dispatcher.Invoke(() => { rippleAnimation = null; }); } break; } }); sessionMonitor.StartMonitor(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Window.SetFlags(WindowManagerFlags.LayoutNoLimits, WindowManagerFlags.LayoutNoLimits); Xamarin.Essentials.Platform.Init(this, savedInstanceState); MobileBarcodeScanner.Initialize(Application); SetContentView(Resource.Layout.activity_main); animationView = FindViewById <LottieAnimationView>(Resource.Id.animation); scanButton = FindViewById <MaterialButton>(Resource.Id.button); scanButton.Click += OnScanButtonClicked; playButton = FindViewById <MaterialButton>(Resource.Id.playbutton); playButton.Click += OnPlayButtonClicked; var background = FindViewById(Resource.Id.background); var whiteButton = FindViewById(Resource.Id.color_button_white); whiteButton.Click += (s, a) => background.SetBackgroundResource(Resource.Drawable.color_background_white); var blackButton = FindViewById(Resource.Id.color_button_black); blackButton.Click += (s, a) => background.SetBackgroundResource(Resource.Drawable.color_background_black); var transparentButton = FindViewById(Resource.Id.color_button_transparent); transparentButton.Click += (s, a) => background.SetBackgroundResource(Resource.Drawable.color_background_transparent); }
public void LottieAnimationViewRedrawInScalingDown() { tlog.Debug(tag, $"LottieAnimationViewRedrawInScalingDown START"); using (Uint16Pair size = new Uint16Pair(40, 60)) { var testingTarget = new LottieAnimationView(1.0f, true); Assert.IsNotNull(testingTarget, "Can't create success object LottieAnimationView"); Assert.IsInstanceOf <LottieAnimationView>(testingTarget, "Should be an instance of LottieAnimationView type."); testingTarget.URL = lottieFilePath; PropertyMap map = new PropertyMap(); map.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image)) .Add(ImageVisualProperty.URL, new PropertyValue(url)) .Add(ImageVisualProperty.LoopCount, new PropertyValue(2)); testingTarget.Image = map; testingTarget.RedrawInScalingDown = true; Assert.IsTrue(testingTarget.RedrawInScalingDown); testingTarget.Dispose(); } tlog.Debug(tag, $"LottieAnimationViewRedrawInScalingDown END (OK)"); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.StartGame); mStartGame = FindViewById <Button>(Resource.Id.mainButton); AdView adView = FindViewById <AdView>(Resource.Id.adView); LottieAnimationView LoadingView = FindViewById <LottieAnimationView>(Resource.Id.animation_loading); AdRequest adRequest = new AdRequest.Builder().Build(); adView.LoadAd(adRequest); mStartGame.Click += async(object sender, EventArgs args) => { LoadingView.SetAnimation("trail_loading.json"); LoadingView.Loop(true); mStartGame.Visibility = ViewStates.Invisible; await Task.Delay(7000); var intent = new Intent(this, typeof(FirstPage)); intent.SetFlags(ActivityFlags.NewTask); StartActivity(intent); Finish(); }; }
public async Task StopBehavior_SET_GET_VALUE() { L.Debug(tag, $" StopBehavior_SET_GET_VALUE() "); await Task.Delay(500); var lottie = new LottieAnimationView(); await Task.Delay(500); lottie.URL = lottieFilePath + "/lottie.json"; await Task.Delay(500); NUIApplication.GetDefaultWindow().Add(lottie); await Task.Delay(500); var stopBehavior = LottieAnimationView.StopBehaviorType.MaximumFrame; lottie.StopBehavior = stopBehavior; Assert.IsTrue(stopBehavior == lottie.StopBehavior, "should be same as previously set value"); stopBehavior = LottieAnimationView.StopBehaviorType.CurrentFrame; lottie.StopBehavior = stopBehavior; Assert.IsTrue(stopBehavior == lottie.StopBehavior, "should be same as previously set value"); stopBehavior = LottieAnimationView.StopBehaviorType.MinimumFrame; lottie.StopBehavior = stopBehavior; Assert.IsTrue(stopBehavior == lottie.StopBehavior, "should be same as previously set value"); L.Debug(tag, $"if some fail comes above, this will be not be shown!"); lottie.Unparent(); lottie.Dispose(); L.Debug(tag, $"lottie.Dispose() called"); await Task.Delay(500); }
public async Task TotalFrame_GET_VALUE() { L.Debug(tag, $" TotalFrame_GET_VALUE() "); await Task.Delay(500); var lottie = new LottieAnimationView(); await Task.Delay(500); lottie.URL = lottieFilePath + "/lottie.json"; NUIApplication.GetDefaultWindow().Add(lottie); await Task.Delay(500); lottie.Stop(); const int fixedTotalFrameOfLottieFile = 124; // this 124 value is fixed one, that is lottie.json file were created as 124 frames originally. obviously it varies by lottile resource file. L.Debug(tag, $"total frame={lottie.TotalFrame}"); // this 124 value is fixed one, that is lottie.json file were created as 124 frames originally. obviously it varies by lottile resource file. Assert.IsTrue(fixedTotalFrameOfLottieFile == lottie.TotalFrame, "should be same as previously set value"); L.Debug(tag, $"if some fail comes above, this will be not be shown!"); lottie.Unparent(); lottie.Dispose(); L.Debug(tag, $"lottie.Dispose() called"); await Task.Delay(500); }
public async Task LoopingMode_SET_GET_VALUE() { L.Debug(tag, $" LoopingMode_SET_GET_VALUE() "); await Task.Delay(500); var lottie = new LottieAnimationView(); await Task.Delay(500); lottie.URL = lottieFilePath + "/lottie.json"; await Task.Delay(500); NUIApplication.GetDefaultWindow().Add(lottie); await Task.Delay(500); var loopingMode = LottieAnimationView.LoopingModeType.AutoReverse; lottie.LoopingMode = loopingMode; Assert.IsTrue(loopingMode == lottie.LoopingMode); loopingMode = LottieAnimationView.LoopingModeType.Restart; lottie.LoopingMode = loopingMode; Assert.IsTrue(loopingMode == lottie.LoopingMode); L.Debug(tag, $"if some fail comes above, this will be not be shown!"); lottie.Unparent(); lottie.Dispose(); L.Debug(tag, $"lottie.Dispose() called"); await Task.Delay(500); }
public async Task GetContentInfo_CHECK() { L.Debug(tag, $" GetContentInfo_CHECK() "); await Task.Delay(500); var lottie = new LottieAnimationView(); await Task.Delay(500); lottie.URL = lottieFilePath + "/lottie.json"; NUIApplication.GetDefaultWindow().Add(lottie); await Task.Delay(500); // this content info values are fixed ones, that were written in lottie.json file created as like that originally. obviously these vary by lottile resource file. const string firstContentInfo = ".chris-gannon-instagram-lottie"; const int secondContentInfo = 0; const int thirdContentInfo = 124; var fixedContentInfoOfLottieFile = lottie.GetContentInfo(); // this content info values are fixed ones, that were written in lottie.json file created as like that originally. obviously these vary by lottile resource file. Assert.IsTrue(fixedContentInfoOfLottieFile[0].Item1 == firstContentInfo, "should be same as previously set value"); Assert.IsTrue(fixedContentInfoOfLottieFile[0].Item2 == secondContentInfo, "should be same as previously set value"); Assert.IsTrue(fixedContentInfoOfLottieFile[0].Item3 == thirdContentInfo, "should be same as previously set value"); L.Debug(tag, $"if some fail comes above, this will be not be shown!"); lottie.Unparent(); lottie.Dispose(); L.Debug(tag, $"lottie.Dispose() called"); await Task.Delay(500); }
public async Task Stop_CHECK() { L.Debug(tag, $" Stop_CHECK() "); await Task.Delay(500); var lottie = new LottieAnimationView(); await Task.Delay(500); lottie.URL = lottieFilePath + "/lottie.json"; NUIApplication.GetDefaultWindow().Add(lottie); await Task.Delay(500); lottie.LoopCount = -1; lottie.Play(); lottie.Stop(); await Task.Delay(100); L.Debug(tag, $"state={lottie.PlayState}"); Assert.IsTrue(LottieAnimationView.PlayStateType.Stopped == lottie.PlayState, "should be same as previously set value"); L.Debug(tag, $"if some fail comes above, this will be not be shown!"); lottie.Unparent(); lottie.Dispose(); L.Debug(tag, $"lottie.Dispose() called"); await Task.Delay(500); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.fragment_animation, container, false); this.toolbar = view.FindViewById <Toolbar>(Resource.Id.toolbar); this.instructionsContainer = view.FindViewById <ViewGroup>(Resource.Id.instructions); this.animationContainer = view.FindViewById <ViewGroup>(Resource.Id.animation_container); this.animationView = view.FindViewById <LottieAnimationView>(Resource.Id.animation_view); this.seekBar = view.FindViewById <AppCompatSeekBar>(Resource.Id.seek_bar); this.invertButton = view.FindViewById <ImageButton>(Resource.Id.invert_colors); this.playButton = view.FindViewById <ImageButton>(Resource.Id.play_button); this.scaleSeekBar = view.FindViewById <AppCompatSeekBar>(Resource.Id.scale_seek_bar); this.scaleTextView = view.FindViewById <TextView>(Resource.Id.scale_text); this.loopButton = view.FindViewById <ImageButton>(Resource.Id.loop); this.animationNameView = view.FindViewById <TextView>(Resource.Id.animation_name); ImageButton restartButton = view.FindViewById <ImageButton>(Resource.Id.restart); ImageButton loadAssetButton = view.FindViewById <ImageButton>(Resource.Id.load_asset); ImageButton qrscanButton = view.FindViewById <ImageButton>(Resource.Id.qrscan); ImageButton loadFieButton = view.FindViewById <ImageButton>(Resource.Id.load_file); ImageButton loadUrlButton = view.FindViewById <ImageButton>(Resource.Id.load_url); playButton.Click += PlayButton_Click; restartButton.Click += RestartButton_Click; loopButton.Click += LoopButton_Click; invertButton.Click += InvertButton_Click; loadAssetButton.Click += LoadAssetButton_Click; loadFieButton.Click += LoadFileButton_Click; loadUrlButton.Click += LoadUrlButton_Click; qrscanButton.Click += QRScanButton_Click; (this.Activity as AppCompatActivity).SetSupportActionBar(toolbar); toolbar.SetNavigationIcon(Resource.Drawable.ic_back); toolbar.NavigationClick += (sender, e) => FragmentManager.PopBackStack(); this.HasOptionsMenu = true; PostUpdatePlayButtonText(); LoopButton_Click(null, EventArgs.Empty); this.animationView.AddAnimatorListener(this); this.animationView.AddAnimatorUpdateListener(this); this.seekBar.ProgressChanged += (sender, e) => { if (!animationView.IsAnimating) { animationView.Progress = e.Progress / 100f; } }; this.scaleSeekBar.ProgressChanged += (sender, e) => { this.animationView.Scale = e.Progress / ScaleSliderFactor; this.scaleTextView.Text = String.Format("{0:0.00}", this.animationView.Scale); }; return(view); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.AppIntroParcaFragment, container, false); devamet = view.FindViewById <Button>(Resource.Id.button1); MetinText1 = view.FindViewById <TextView>(Resource.Id.textView1); MetinText2 = view.FindViewById <TextView>(Resource.Id.textView2); MetinText3 = view.FindViewById <TextView>(Resource.Id.textView3); animationView = view.FindViewById <LottieAnimationView>(Resource.Id.follow_icon2); MetinText1.Text = Metin1; MetinText2.Text = Metin2; MetinText3.Text = Metin3; if (buttondurum == false) { devamet.Visibility = ViewStates.Invisible; } else { devamet.Click += Devamet_Click; } animationView.SetAnimation(imageid); animationView.PlayAnimation(); return(view); }
private void RangeBase_OnValueChanged(object sender, RangeBaseValueChangedEventArgs e) { LottieAnimationView.PauseAnimation(); var slider = (Slider)sender; LottieAnimationView.Progress = (float)(e.NewValue / slider.Maximum); }
private void InitUi() { var toolbar = (Toolbar)FindViewById(Resource.Id.toolbar); SetSupportActionBar(toolbar); Title = "Glicemie"; SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetDisplayShowHomeEnabled(true); toolbar.NavigationClick += delegate { Finish(); }; LbStatus = FindViewById <TextView>(Resource.Id.status); _dataContainer = FindViewById <ConstraintLayout>(Resource.Id.dataContainer); _manualRegisterButton = FindViewById <Button>(Resource.Id.manual_register); _dataContainer.Visibility = ViewStates.Gone; _glucose = FindViewById <TextView>(Resource.Id.GlucoseTextView); //_scanButton = FindViewById<Button>(Resource.Id.ScanButton); _animationView = FindViewById <LottieAnimationView>(Resource.Id.animation_view); var filter = new SimpleColorFilter(ContextCompat.GetColor(this, Resource.Color.accent)); _animationView.AddValueCallback(new KeyPath("**"), LottieProperty.ColorFilter, new LottieValueCallback(filter)); }
public void LottieAnimationViewGetMinMaxFrame() { tlog.Debug(tag, $"LottieAnimationViewGetMinMaxFrame START"); var testingTarget = new LottieAnimationView(); Assert.IsNotNull(testingTarget, "Can't create success object LottieAnimationView"); Assert.IsInstanceOf <LottieAnimationView>(testingTarget, "Should be an instance of LottieAnimationView type."); testingTarget.URL = lottieFilePath; PropertyMap map = new PropertyMap(); map.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image)) .Add(ImageVisualProperty.URL, new PropertyValue(url)) .Add(ImageVisualProperty.LoopCount, new PropertyValue(2)) .Add(ImageVisualProperty.PlayRange, new PropertyValue(50)); testingTarget.Image = map; string maker = "startframe: 1; endframe: 10"; testingTarget.SetMinMaxFrameByMarker(maker, null); try { testingTarget.GetMinMaxFrame(); } catch (Exception e) { tlog.Debug(tag, e.Message.ToString()); Assert.Fail("Caught Exception: Failed!"); } tlog.Debug(tag, $"LottieAnimationViewGetMinMaxFrame END (OK)"); }
public async Task RedrawInScalingDown_SET_GET_VALUE() { L.Debug(tag, $" RedrawInScalingDown_SET_GET_VALUE() "); await Task.Delay(500); var lottie = new LottieAnimationView(); await Task.Delay(500); lottie.URL = lottieFilePath + "/lottie.json"; await Task.Delay(500); NUIApplication.GetDefaultWindow().Add(lottie); await Task.Delay(500); var redraw = false; lottie.RedrawInScalingDown = redraw; Assert.IsTrue(redraw == lottie.RedrawInScalingDown, "should be same as previously set value"); redraw = true; lottie.RedrawInScalingDown = redraw; Assert.IsTrue(redraw == lottie.RedrawInScalingDown, "should be same as previously set value"); L.Debug(tag, $"if some fail comes above, this will be not be shown!"); lottie.Unparent(); lottie.Dispose(); L.Debug(tag, $"lottie.Dispose() called"); await Task.Delay(500); }
public void LottieAnimationViewSetMinMaxFrameByMarker() { tlog.Debug(tag, $"LottieAnimationViewSetMinMaxFrameByMarker START"); var testingTarget = new LottieAnimationView(); Assert.IsNotNull(testingTarget, "Can't create success object LottieAnimationView"); Assert.IsInstanceOf <LottieAnimationView>(testingTarget, "Should be an instance of LottieAnimationView type."); testingTarget.URL = lottieFilePath; string maker = "startframe: 1; endframe: 10"; try { testingTarget.SetMinMaxFrameByMarker(maker, null); } catch (Exception e) { tlog.Debug(tag, e.Message.ToString()); Assert.Fail("Caught Exception: Failed!"); } tlog.Debug(tag, $"LottieAnimationViewSetMinMaxFrameByMarker END (OK)"); }
public void ShowNotificationBadge(bool showBadge) { try { LottieAnimationView animationView2 = MainContext.FindViewById <LottieAnimationView>(Resource.Id.animation_view2); if (showBadge) { NotificationImage.SetImageDrawable(null); animationView2.SetAnimation("NotificationLotti.json"); animationView2.PlayAnimation(); } else { animationView2.Progress = 0; animationView2.CancelAnimation(); NotificationImage.SetImageResource(Resource.Drawable.icon_notification_vector); } } catch (Exception e) { Console.WriteLine(e); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_from_web); this.FileLocation = FindViewById <TextView>(Resource.Id.file_location); var tb = FindViewById <Toolbar>(Resource.Id.toolbar); SetActionBar(tb); ActionBar.SetDisplayHomeAsUpEnabled(true); this.Test1 = FindViewById <Button>(Resource.Id.button_1); this.Test1.Click += (sender, e) => { loadTest(0); }; this.Test2 = FindViewById <Button>(Resource.Id.button_2); this.Test2.Click += (sender, e) => { loadTest(1); }; this.Test3 = FindViewById <Button>(Resource.Id.button_3); this.Test3.Click += (sender, e) => { loadTest(2); }; this.LottieView = FindViewById <LottieAnimationView>(Resource.Id.lottie); }
public async Task LoopCount_SET_GET_VALUE() { L.Debug(tag, $" LoopCount_SET_GET_VALUE() "); await Task.Delay(500); var lottie = new LottieAnimationView(); await Task.Delay(500); lottie.URL = lottieFilePath + "/lottie2.json"; NUIApplication.GetDefaultWindow().Add(lottie); await Task.Delay(500); var loopCount = -1; lottie.LoopCount = loopCount; Assert.IsTrue(loopCount == lottie.LoopCount, "should be same as previously set value"); loopCount = 7; lottie.LoopCount = loopCount; Assert.IsTrue(loopCount == lottie.LoopCount, "should be same as previously set value"); L.Debug(tag, $"if some fail comes above, this will be not be shown!"); lottie.Unparent(); lottie.Dispose(); L.Debug(tag, $"lottie.Dispose() called"); await Task.Delay(500); }
public void Update(AnimatedVisualPlayer player) { if (_animation == null) { _animation = new LottieAnimationView(Android.App.Application.Context); _animation.EnableMergePathsForKitKatAndAbove(true); _animation.UseHardwareAcceleration(UseHardwareAcceleration); //_animation.Scale = (float)Scale; SetProperties(); player.AddView(_animation); } else { SetProperties(); } void SetProperties() { _animation.SetAnimation(UriSource?.PathAndQuery ?? ""); if (player.AutoPlay && !_isPlaying) { Play(true); } } _player = player; }
protected void Init(Context context, IAttributeSet attrs, int defStyleAttr, int defStyleRes) { var view = LayoutInflater.From(context).Inflate(Resource.Layout.LottieFavoriteButton, root: this, attachToRoot: false); AddView(view, new LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent)); animationView = view.FindViewById <LottieAnimationView>(Resource.Id.lottie_favorite_button_image); animationView.SetAnimation("favorite_black.json"); animationView.Progress = AnimationProgressStartFrame; FindViewById(Resource.Id.lottie_favorite_button).Click += delegate { animator = ValueAnimator.OfFloat(AnimationProgressStartFrame, AnimationProgressEndFrame); animator.SetDuration(500); animator.AddUpdateListener(new OnAnimationClickListener(animationView)); if (animationView.Progress == AnimationProgressStartFrame) { animator.Start(); OnClickCommandLike.Execute(null); } else { animationView.Progress = AnimationProgressStartFrame; OnClickCommandDisLike.Execute(null); } }; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Spash_Screen); LottieAnimationView animationView = (LottieAnimationView)FindViewById(Resource.Id.animation_sreen); animationView.AddAnimatorListener(this); }
public LottieProgressControl(Context context, IAttributeSet attrs) : base(context, attrs) { _lottieAnimationView = new LottieAnimationView(context); var attributes = context.ObtainStyledAttributes(attrs, Resource.Styleable.LottieProgressControl); IsIndeterminate = attributes.GetBoolean(Resource.Styleable.LottieProgressControl_IsIndeterminate, true); SetView(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.activity_main); Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); animationView = FindViewById <LottieAnimationView>(Resource.Id.animation_view); linear = FindViewById <LinearLayout>(Resource.Id.linearLayout1); lightSwitch = FindViewById <ToggleButton>(Resource.Id.toggleLightSwitch); lightState = FindViewById <TextView>(Resource.Id.textLightState); pumpButton = FindViewById <Button>(Resource.Id.buttonPump); pumpButton.Click += PumpButton_Click; dhtButton = FindViewById <Button>(Resource.Id.buttonGetDht); dhtButton.Click += DhtButton_Click; feederButton = FindViewById <Button>(Resource.Id.buttonFeed); feederButton.Click += FeederButton_Click; tempGauge = new Gauge(this) { LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent, 1f), TotalNicks = 120, MinValue = 0, MaxValue = 100, ValuePerNick = 1, InitValue = 0, UpperText = Resources.GetString(Resource.String.temperature), LowerText = Resources.GetString(Resource.String.temp_unit) }; humidityGauge = new Gauge(this) { LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent, 1f), TotalNicks = 120, MinValue = 0, MaxValue = 100, ValuePerNick = 1, InitValue = 0, UpperText = Resources.GetString(Resource.String.humidity), LowerText = Resources.GetString(Resource.String.humidity_unit) }; linear.AddView(tempGauge); linear.AddView(humidityGauge); communicationService = new CommunicationService(); uiManager = new UIManager(); Task.Run(() => SetupData()); }
public async Task RedrawInScalingDown_AnimationTest() { L.Debug(tag, $" RedrawInScalingDown_AnimationTest() "); await Task.Delay(500); var lottie = new LottieAnimationView(); var lottieRedrawTrue = new LottieAnimationView(); await Task.Delay(500); lottie.URL = lottieFilePath + "/lottie.json"; lottieRedrawTrue.URL = lottieFilePath + "/lottie.json"; await Task.Delay(500); NUIApplication.GetDefaultWindow().Add(lottie); NUIApplication.GetDefaultWindow().Add(lottieRedrawTrue); await Task.Delay(500); lottie.Size = new Size(1000, 1000); lottie.Position = new Position(0, 0); lottie.LoopCount = -1; lottie.Play(); lottieRedrawTrue.Size = new Size(1000, 1000); lottieRedrawTrue.Position = new Position(1000, 10); lottieRedrawTrue.LoopCount = -1; lottieRedrawTrue.Play(); await Task.Delay(1000); var redraw = false; var redraw2 = true; lottie.RedrawInScalingDown = redraw; lottieRedrawTrue.RedrawInScalingDown = redraw2; for (int i = 1000; i > 100; i -= 10) { lottie.Size = new Size(i, i, 0); lottieRedrawTrue.Size = new Size(i, i, 0); await Task.Delay(100); } await Task.Delay(9000); Assert.IsTrue(redraw == lottie.RedrawInScalingDown, "should be same as previously set value"); Assert.IsTrue(redraw2 == lottieRedrawTrue.RedrawInScalingDown, "should be same as previously set value"); L.Debug(tag, $"if some fail comes above, this will be not be shown!"); lottie.Unparent(); lottie.Dispose(); lottieRedrawTrue.Unparent(); lottieRedrawTrue.Dispose(); L.Debug(tag, $"lottie.Dispose() called"); await Task.Delay(500); }
public void Activate() { lav = new LottieAnimationView(); lav.URL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "a.json"; lav.LoopCount = -1; lav.BackgroundColor = Color.White; NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(lav); lav.Play(); }