startActivity() 나 finish() 다음에


overridePendingTransition(); 호출 하면 됌.


ex)

startActivity( Intent );

overridePendingTransition( R.anim.anim_start_activity, R.anim.anim_finish_activity );


or


finish( Intent );

overridePendingTransition( R.anim.anim_start_activity, R.anim.anim_finish_activity );

'Android' 카테고리의 다른 글

xml animation 예제  (0) 2015.04.16
LayoutParams에서 dp 단위 쓰기  (0) 2015.04.08
File String path에서 Uri 뽑아내기  (0) 2015.03.03
freemp3fordroid  (0) 2014.04.25
Lock screen orientation  (0) 2013.11.07
Posted by LeeSh217
,

xml animation 예제

Android 2015. 4. 16. 19:55

Reference

http://www.androidhive.info/2013/06/android-working-with-xml-animations/


ex)

<?xml version="1.0" encoding="utf-8"?>

<set

xmlns:android="http://schemas.android.com/apk/res/android"

android:interpolator="@android:anim/accelerate_interpolator"

>

<scale

android:fromXScale="1.0"

android:toXScale="20.0"

android:fromYScale="1.0"

android:toYScale="20.0"

android:pivotX="50%"

android:pivotY="50%"

android:duration="500"

/>

<alpha

android:fromAlpha="1.0"

android:toAlpha="-1.0"

android:duration="500"

/>

<rotate

android:fromDegrees="0.0"

android:toDegrees="360.0"

android:pivotX="50%"

android:pivotY="50%"

android:duration="500"

/>

</set>




fade_in.xml

<?xml version="1.0" encoding="utf-8"?>

<set xmlns:android="http://schemas.android.com/apk/res/android"

    android:interpolator="@android:anim/accelerate_interpolator" >

    <alpha

        android:duration="2000"

        android:fromAlpha="0.0"

        android:toAlpha="1.0"

         />

</set>



fade_out.xml

<?xml version="1.0" encoding="utf-8"?>

<set xmlns:android="http://schemas.android.com/apk/res/android"

    android:interpolator="@android:anim/accelerate_interpolator" >

    <alpha

        android:duration="2000"

        android:fromAlpha="1.0"

        android:toAlpha="0.0"

         />

</set>

'Android' 카테고리의 다른 글

Activity 전환 간에 animation  (0) 2015.04.16
LayoutParams에서 dp 단위 쓰기  (0) 2015.04.08
File String path에서 Uri 뽑아내기  (0) 2015.03.03
freemp3fordroid  (0) 2014.04.25
Lock screen orientation  (0) 2013.11.07
Posted by LeeSh217
,

xml 에서 width, height의 dp와


java code 상에서 LayoutParams(w, h)와 단위가 다름.


final int width = (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 240, getResources().getDisplayMetrics());

final int height = (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 320, getResources().getDisplayMetrics());


LinearLayout.LayoutParams paramlinear = new LinearLayout.LayoutParams(width,height);


위와 같이 하면 됌.

'Android' 카테고리의 다른 글

Activity 전환 간에 animation  (0) 2015.04.16
xml animation 예제  (0) 2015.04.16
File String path에서 Uri 뽑아내기  (0) 2015.03.03
freemp3fordroid  (0) 2014.04.25
Lock screen orientation  (0) 2013.11.07
Posted by LeeSh217
,