Diagonal Screen transition.

by satish bhoyar » Thu, 14 Jan 2010 01:21:51 GMT


Sponsored Links
 Hi,
I am trying to do the diagonal screen transition, & i am not able to figure
out what I should use. In my case the user should get the feel that next
screen is coming from one corner of the current screen .

Thanks,



Diagonal Screen transition.

by satish bhoyar » Thu, 14 Jan 2010 19:39:53 GMT


 Hi Guys,

I was hoping any kind of help regarding this...

please help regarding this..

Thanks
satish




>


Sponsored Links


Diagonal Screen transition.

by Sean Hodges » Thu, 14 Jan 2010 19:51:39 GMT


 As far as I'm aware, there are no diagonal screen transitions in
Android. You also can't define them per app, the activity transitions
are defined by the system theme.




>



Diagonal Screen transition.

by Justin Anderson » Thu, 14 Jan 2010 21:57:30 GMT


 You might be able to define it as a layout animation, but I have never tried
this...

So, let's say your main activity has a LinearLayout that encompasses
everything else.  You should be able to specify animations for that Layout
for when it comes on and off the screen.

Take a look at the Dev Guide where it talks about animations...




As far as I'm aware, there are no diagonal screen transitions in
Android. You also can't define them per app, the activity transitions
are defined by the system theme.

On Thu, Jan 14, 2010 at 11:39 AM, satish bhoyar <getsatonl...@gmail.com>


>



Diagonal Screen transition.

by Sean Hodges » Thu, 14 Jan 2010 22:14:32 GMT


 My understanding is that animation controllers can be applied to
layouts and views, but not whole activities.

You might be able to apply a layout animation on the root layout, and
perform a transition that appears to take up the whole screen. This
could be coupled with a screen shot of the next activity to give the
illusion that the transition is taking you to it. However, the effect
you would get is a diagonal transition, followed by the built-in
system transition (the horizontal swipe effect), which would finally
land you at the next activity.

So I think the transitions are the responsibility of the base system,
and the user-level applications have no control over them. The best
you could to is imitate them with an animation, and tell the user to
turn off the system one (Settings -> Sound & Display -> Animation);
which is not ideal.


On Thu, Jan 14, 2010 at 1:57 PM, Justin Anderson




>>



Diagonal Screen transition.

by XCaffeinated » Fri, 15 Jan 2010 09:19:27 GMT


 i Satish,

Animation between activities is indeed possible in Android 2.0 and
later, using the overridePendingTransition() API, with the caveat as
implied by Sean, that the user can override the animations if he so
wishes, in his global device settings. This API was specifically
added to give developers more control over inter-activity animations
(versus view animations which are done intra-activity).

I posted a tutorial on exactly how to use overridePendingTransition()
at anddev.org:
http://www.anddev.org/viewtopic.php?p=32766

Though the tutorial shows a fade transition between two activities, it
can easily be changed to do a diagonal transition, as per your OP: "In
my case the user should get the feel that next screen is coming from
one corner of the current screen." Here is how:

In the tutorial, replace mainfadein.xml with diagslide_enter.xml:

<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/
android"
android:fromXDelta="-100%" android:toXDelta="0%"
android:fromYDelta="-100%" android:toYDelta="0%"
android:duration="2000" />

and replace splashfadeout.xml with diagslide_leave.xml:

<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/
android"
android:fromXDelta="0%" android:toXDelta="-100%"
android:fromYDelta="0%" android:toYDelta="-100%"
android:duration="2000" />

Add diagslide_enter.xml and diagslide_leave.xml to your /res/anim
directory, and change
the overridePendingTransition() statement to:

overridePendingTransition(R.anim.diagslide_enter,
R.anim.diagslide_leave);

This will give the feel of the next screen coming from one corner,
while the previous screen leaves from the other corner.

Here's a YouTube video (forgive the quality, the emulator runs
horribly slowly on my system, but it looks terrific on the Droid):
http://www.youtube.com/watch?v=vqTbdAg_82c

If you'd rather have the next screen come from one corner, while the
previous screen stays put, do this:

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

where hold.xml is a placeholder to keep the old activity from
disappearing too soon:

<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/
android"
android:fromXDelta="0" android:toXDelta="0"
android:duration="2000" />

If you'd rather have the next screen come from one corner over an
empty background, do this:

overridePendingTransition(R.anim.diagslide_enter, 0);

Once you get it working you should probably consider shortening the
durations, 2 seconds is kind of long.

Great info on other animation attributes is here:

http://developer.android.com/intl/zh-CN/guide/topics/resources/available-resources.html#animation

There are examples in the SDK (search *.java in the 2.X platforms for
overridePendingTransition).

I will add some of this info to the anddev tutorial, and post a
trackback.

Hope this helps!
XCaf



On Jan 8, 7:55am, satish bhoyar <getsatonl...@gmail.com



Diagonal Screen transition.

by satish bhoyar » Fri, 15 Jan 2010 13:01:17 GMT


 hanks a lot guys..
I will try this out..

Thanks,
satish

On Fri, Jan 15, 2010 at 6:49 AM, XCaffeinated <ssatn...@gmail.com> wrote:

>



Other Threads

1. Android 2.1 sdk AudioManager could not control Email notifications

Hi,all

I am the author of "togglesilent".

when I got my new Nexus one phone. I detected Ringer is silent, but
the email notification still.

audioManager.setRingerMode(AudioManager.RINGER_MODE_SILENT);

could not control Email notification, I have not found some new API in
reference documents.

WOuld someone can tell us?

-- 

2. Update: WTS Nexus One BNIB, tinggal 1pc!

Prends,


Mau update,

Barang tinggal 1 pc, yang punya dah mau buru2 pergi, jadi mau dilepas
secepatnya.
BNIB, plastik blom di lepas so pasti masih kinyis2.
Dah berikut extra adaptor, jadi total dapet adaptornya 2.

Posisi di Sudirman.
First come first serve.

Japri yah.

Iwan

-- 
--------------
"Indonesian Android Community [id-android]" 

3. Android + C++

4. Menu stk N1

5. Paging boss Agus Hamonangan

6. How can a parent handle touch events BEFORE its children?

7. list view button error