Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to remove Black background between start new activity during slide_left animation?

Tags:

android

When I call new activity by animation the background gets black.
How can I remove remove the black background?

For the animation I'm using:

getWindow().setBackgroundDrawableResource(R.drawable.mainbg_);  overridePendingTransition (R.anim.push_up_in,0); 
like image 310
Hardik Gajjar Avatar asked Jun 24 '11 13:06

Hardik Gajjar


People also ask

What is transition animation in android?

Android's transition framework allows you to animate all kinds of motion in your UI by simply providing the starting layout and the ending layout.


2 Answers

Setting the Theme didn't work for me, but adding an exit animation did.

overridePendingTransition (R.anim.push_up_in,R.anim.hold); 

For the exit animation, I just used an animation that does nothing.

<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android">     <translate android:fromYDelta="0%p" android:toYDelta="0%p" android:duration="2000"/> </set> 
like image 75
Luke Wallace Avatar answered Sep 28 '22 06:09

Luke Wallace


All you really need, especially if you already got a theme set to the activity and don't want to use the Theme.Translucent suggested is add the following to your activity/app's theme:

<item name="android:windowIsTranslucent">true</item> 
like image 40
Roberto Andrade Avatar answered Sep 28 '22 07:09

Roberto Andrade