안드로이드 2.0 ( api level 5 ) 부터 액티비티가 보여지고, 없어질때 뷰처럼 애니메이션을
설정할 수 있다.
사용법도 간단하다.
startActivity(); 를 하고, overridePendingTransition( R.anim.new_activity, R.anim.old_activity );
애니메이션이 설정되지 않은 경우는 새 액티비티는 오른쪽에서 슬라이드-인 되고,
기존 액티비티는 왼쪽으로 슬라이드-아웃 된다.
애니메이션은 기존 방식과 동일하게 res/anim 폴더에 xml 로 작성하던가,
Animation 객체를 생성해 사용해도 된다.
[ fade - animation ]
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator"
android:fromAlpha="0.0" android:toAlpha="1.0"
android:duration="@android:integer/config_longAnimTime" />
[ hold - animation ]
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator"
android:fromXDelta="0" android:toXDelta="0"
android:duration="@android:integer/config_longAnimTime" />
[ zoom_enter- animation ]
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/decelerate_interpolator">
<scale android:fromXScale="2.0" android:toXScale="1.0"
android:fromYScale="2.0" android:toYScale="1.0"
android:pivotX="50%p" android:pivotY="50%p"
android:duration="@android:integer/config_mediumAnimTime" />
</set>
[ zoom_exit - animation ]
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/decelerate_interpolator"
android:zAdjustment="top">
<scale android:fromXScale="1.0" android:toXScale=".5"
android:fromYScale="1.0" android:toYScale=".5"
android:pivotX="50%p" android:pivotY="50%p"
android:duration="@android:integer/config_mediumAnimTime" />
<alpha android:fromAlpha="1.0" android:toAlpha="0"
android:duration="@android:integer/config_mediumAnimTime"/>
</set>
2011년 5월 23일 월요일
2011년 4월 12일 화요일
IPC - (Interprocess Communication)
IPC[아이피씨]는 프로그래머가 하나의 운영체계에서 동시에 수행될 개별 프로그램을 생성하고 다룰 수 있도록 해주는 프로그래밍 인터페이스 집합으로서, 하나의 프로그램이 동시에 많은 사용자의 요구를 처리할 수 있도록 한다. 단일 사용자의 요구가 운영체계에서 여러 프로세스를 수행시키는 결과를 가져올 수 있기 때문에, 이러한 사용자를 위해 프로세스간 통신이 필요하게 되는데 IPC 인터페이스가 이를 가능케 한다. 모든 IPC 메쏘드들은 각각 장점 및 한계점이 있어서 한 프로그램에서 모든 IPC 메쏘드를 사용하는 예는 드물다. IPC 메쏘드는 다음의 것들을 포함한다.
- Pipes와 named pipes
- Message queueing
- Semaphores
- Shared memory
- 소켓
2011년 4월 11일 월요일
피드 구독하기:
글 (Atom)