Should I animate a three dots loading animation using Core Animation or should I find a way to show a gif of the same op
Date : March 29 2020, 07:55 AM
it fixes the issue For a simple animation you can use a UIImageView animation to animate a set of images (i.e. use the images as frames in the animation). UIImageView* dotsImageView= [[UIImageView alloc] initWithFrame:dotsFrame];
// load all the frames of your animation
dotsImageView.animationImages = @[[UIImage imageNamed:@"image1.png"],
[UIImage imageNamed:@"image2.png"],
[UIImage imageNamed:@"image3.png"]];
// set how long it will take to go through all images
dotsImageView.animationDuration = 1.0;
// repeat the animation forever
dotsImageView.animationRepeatCount = 0;
// start the animation
[dotsImageView startAnimating];
// add it to the view
[self.view addSubview:dotsImageView];
|
Instant return to initial state after Angular2 Animate based animation to be able to run the animation several times
Date : March 29 2020, 07:55 AM
I wish did fix the issue. , update class AnimateBox {
//animation: Animation;
//a:Animation;
constructor(private _ab: AnimationBuilder, private _e: ElementRef) {}
createAnimation:Function = (forward:boolean, count:number):Animation => {
animation = this._ab.css();
animation.setDuration(1000);
animation.addAnimationClass("test-animation-class");
if(forward) {
animation.setFromStyles({
top: '-20px',
opacity: '100',
})
.setToStyles({
top: '-120px'
opacity: '0',
});
} else {
animation.setFromStyles({
top: '-120px',
opacity: '0',
})
.setToStyles({
opacity: '100',
top: '-20px'
});
}
a = animation.start(this._e.nativeElement);
console.log(a);
a.onComplete(() => { this.onComplete(forward, count);});
};
onComplete:Function = (forward:boolean, count:number) => {
console.log("animation finished");
//console.dir(this.a);
//animation.applyStyles({top: '-20px', opacity: '100' });
if(count) {
a = this.createAnimation(!forward, --count);
console.log('a ' + a);
}
};
toggle:Function =(isVisible: boolean = false) => {
this.createAnimation(true,10);
};
}
cb: Function = () => {
console.log("animation finished");
console.dir(this.a);
// this.a.applyStyles({top: '-20px', opacity: '100' });
};
|
Code animation - Convert a loading circle gif with check mark to animation based on JS
Date : March 29 2020, 07:55 AM
Hope this helps Yes, it is possible. You can make a large one, record its animation and then convert the HQ one to gif format. Here is one of the solution: $.getScript('https://rawgit.com/kimmobrunfeldt/progressbar.js/1.0.0/dist/progressbar.js', function(){
var loading = `<style>
div#container {
margin: 20px;
width: 200px;
height: 200px;
pointer-events: none;
user-select: none;
}
div#bkground {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
width: 200px;
height: 200px;
}
div#bkground div {
width: 182px;
height: 182px;
background-color: #a3a3ff;
border-radius: 100px;
}
div#whitecircle {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
width: 200px;
height: 200px;
}
div#whitecircle div {
width: 182px;
height: 182px;
background-color: #fff;
border-radius: 100px;
}
div#tick {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
width: 200px;
height: 200px;
}
div#tick div {
color: #E0E0FF;
font-size: 0;
font-weight: bold;
}
</style>
<div id="container">
<div id='bkground'><div></div></div>
<div id='whitecircle'><div></div></div>
<div id='tick'><div>✔</div></div>
</div>
</div>`;
$('div#check.check').html(loading);
var bar = new ProgressBar.Circle(container, {
strokeWidth: 5,
easing: 'easeInOutExpo',
duration: 1500,
color: '#a3a3ff',
trailColor: '#d1d1ff',
trailWidth: 5,
svgStyle: null,
from: { color: '#a3a3ff', width: 5 },
to: { color: '#a3a3ff', width: 5 },
step: function(state, circle) {
circle.path.setAttribute('stroke', state.color);
circle.path.setAttribute('stroke-width', state.width);
var value = Math.round(circle.value() * 100);
if (value === 0) {
circle.setText('');
} else {
circle.setText(value);
}
}
});
bar.text.style.color = 'transparent';
bar.animate(1.0);
var interval2 = setInterval(function(){
if ($('div.progressbar-text').text() == '100') {
clearInterval(interval2);
$('div#whitecircle div').animate({
width: 0,
height: 0
}, 333, function(){
$('div#tick div').animate({
fontSize: 150
}, 333);
});
};
}, 100);
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.0/jquery-ui.min.js"></script>
<div class='check' id='check'></div>
|
Show and Hide WPF window with slide animation multiple times while showing animation consistently each time
Tag : chash , By : rixtertech
Date : March 29 2020, 07:55 AM
Hope that helps Change the MouseUp EventTrigger to: Reset to the beginning of the animation, using SeekStoryboard Stop the animation, using PauseStoryboard. Using StopStoryboard run the animation to the fill state, which is not what you want: you want the window to disappear. <EventTrigger RoutedEvent="FrameworkElement.MouseUp">
<SeekStoryboard BeginStoryboardName="BeginToastAnimationStoryboard" />
<PauseStoryboard BeginStoryboardName="BeginToastAnimationStoryboard" />
</EventTrigger>
|
How to replace SwipeRefreshLayout loading animation with a Lottie animation
Date : March 29 2020, 07:55 AM
seems to work fine "LottieSwipeRefreshLayout" worked out for me. the main catch is to use attribute app:layout_type="content" in your recyclerview,scroll view, nested scroll view etc. Also to customize the Lottie animation modification can be done in listeners onTriggerListener and onProgressListener which are overridden in LottiePullToRefreshLayout class
|