티스토리 뷰
public void fadeAnimation(final View tv, boolean isfadeOut) {
final Animation animationFade;
tv.setAlpha(0f);
if (isfadeOut) {
animationFade = AnimationUtils.loadAnimation(this,R.drawable.fadeout);
} else {
animationFade = AnimationUtils.loadAnimation(this,R.drawable.fadein);
}
Handler mhandler = new Handler();
mhandler.postDelayed(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
tv.setAlpha(1f);
tv.startAnimation(animationFade);
}
}, 0);
}
- fadein.xml
<?xml version="1.0" encoding="UTF-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator">
<alpha
android:fromAlpha="0"
android:toAlpha="1.0"
android:duration="1000"
/>
</set>
- fadeout.xml
<?xml version="1.0" encoding="UTF-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator">
<alpha
android:fromAlpha="1.0"
android:toAlpha="0"
android:duration="1000"
/>
</set>
'Android' 카테고리의 다른 글
Android Toast.show() 겹치는 문제 (0) | 2014.08.23 |
---|
- Total
- Today
- Yesterday
- 우분투
- MySQL
- locales
- 설치
- 2의 보수
- 한글
- UTF8
- 왜 0부터
- download
- object orient
- ubuntu
- 인코딩
- Android
- 안드로이드
- void* arg
- unreal4
- 컴퓨터 숫자
- 언리얼 엔진4
- 여러 인자
- winetricks
- libgcrypt
- utf-32
- libgcrypt11
- Uniity5
- 다운로드
- wine1.8
- install
- mariasql
- 객체란
- docker
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |