티스토리 뷰
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
- winetricks
- libgcrypt11
- 인코딩
- UTF8
- 다운로드
- object orient
- 여러 인자
- 언리얼 엔진4
- locales
- utf-32
- 2의 보수
- download
- 한글
- unreal4
- void* arg
- 우분투
- libgcrypt
- Android
- docker
- ubuntu
- 컴퓨터 숫자
- 객체란
- 설치
- Uniity5
- 안드로이드
- wine1.8
- MySQL
- mariasql
- install
- 왜 0부터
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |