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