Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - Fadeout animation for splash screen

I want to add fadeout animation for my splash screen, that is while closing the splash screen I want to bring the fadeout animation effect.

Here are the codes which I have tried.

overridePendingTransition(R.anim.fade_in, R.anim.fade_out);

But the above can be used only from 2.0. Ny app should support from 1.5.

So I have set the following animation for my main activity.

getWindow().setWindowAnimations(android.R.style.Animation_Toast);

OR

getWindow().setWindowAnimations(R.style.Theme_FadeIn);

My Theme.FadeIn contains

<style name="Theme.FadeIn">
<item name="android:windowNoTitle">true</item>
<item name="android:activityOpenEnterAnimation">@anim/fade_in</item>   
</style>

Now I can see the fadein effect, but I can see the blackscreen.

How to get this fadein or fadeout effect without blackscreen.

like image 422
SWDeveloper Avatar asked Oct 13 '10 15:10

SWDeveloper


1 Answers

You could try to make your activity translucent... take a look at the translucent theme in the sdk

@android:style/Theme.Translucent
like image 106
mibollma Avatar answered Oct 27 '22 00:10

mibollma