I was testing around, and came up with this.
I was testing around, and came up with this.
Animations: ‘fade’ and ‘slide’. If you don’t specify any (or a wrong one) a random one will be played each time.
Before you ask: the way this script works only allow those two animations. I’m sure it is possible to use others (maybe even create custom ones) but I couldn’t find a way.
]]>« Boy is this weird. (Previous Post)
< ![CDATA[
LL.bindClass(“android.R”);
LL.getEvent().getItem().launch();
var d=LL.getEvent().getData();
if(d!=”fade”&&d!=”slide”)d=Math.random()>0.5?”fade”:”slide”;
var animIn;
var animOut;
if(d==”fade”){
animIn=R.anim.fade_in;
animOut=R.anim.fade_out;
}
if(d==”slide”){
animIn=R.anim.slide_in_left;
animOut =R.anim.slide_out_right;
}
LL.getContext().overridePendingTransition(animIn, animOut);
]]>
< ![CDATA[
+TrianguloY I have a similar script with a completly different approach:
LL.bindClass(“android.app.ActivityOptions”);
var e=LL.getEvent();
var i=e.getItem();
var c=e.getContainer();
LL.getContext().startActivity(i.getIntent(),ActivityOptions.makeScaleUpAnimation(c.getView(),i.getPositionX()-c.getPositionX(),i.getPositionY()-c.getPositionY(),i.getWidth(),i.getHeight()).toBundle());
]]>
< ![CDATA[
Lukas Morawietz I tried a similar thing, but no luck (didn’t know the ActivityOptions)
Thanks for the demo! I’ll test more 😀
]]>
< ![CDATA[
This is really nice
]]>
< ![CDATA[
Sweet
]]>
< ![CDATA[
This script don’t work for the Google App for me.
]]>
< ![CDATA[
Which one is the ‘Google App’ for you?
]]>
< ![CDATA[
Google Now
]]>
< ![CDATA[
True, but that seems to be because of the app (strangely, it works with an old version of Google now)
I can’t do anything, you can check Lukas Morawietz script, maybe that one works.
]]>
< ![CDATA[
Ok, thanks.
Your script is awesome.
]]>
< ![CDATA[
TrianguloY it runs too fast, you barely notice the animation. Is there a way to change the duration of the animation?
]]>
< ![CDATA[
Gabriel Garcia no from script. (Using this code I mean)
However you can make the Android animations slower (in the developer settings. If you don’t see this option google it)
But keep in mind this will make ALL animations slower.
]]>
< ![CDATA[
thanks TrianguloY . I try with custom animation on code, but overridePendingTransition need the resource id. So is not the way either.
]]>
< ![CDATA[
Gabriel Garcia if you have a custom animation, try with Lukas’s code, I think you can use a custom transition there
]]>
< ![CDATA[
TrianguloY No, I think is the same problem, Lukas Morawietz ‘s code use makeScaleUpAnimation, if you want custom animation must use makeCustomAnimation(Context context, int enterResId, int exitResId) and that method ask for resource id too. But I’m not sure if there is another way.
]]>
< ![CDATA[
TrianguloY does this script work for you since the last update? I can’t get it to work now.
]]>
< ![CDATA[
Sergio Azar for some reason both fade and slide make a ‘fade’ animation.
I can’t make anything. Did you tried Lukas’s alternative code?
]]>
< ![CDATA[
Yeah I tried Lukas Morawietz code, it didn’t work either.
]]>