안드로이드 개발 질문/답변
(글 수 45,052)
소스에서 버튼을 클릭하면 클릭 이벤트를 받아서 레이아웃을 윗쪽으로 올리는 에니메이션을 구현 하였습니다.
근데.. 이상한점이 있네요..
최초에 한번은 에니메이션이 작동을 하지 않고 사라졌다가 나타 나네요.
그 뒤부터는 정상적으로 되는데
왜 최초에 한번만 그렇게 되는지를 모르겠네요.
final View target = findViewById(R.id.DetailTagListLayout01);
mDetailhidebutton.setBackgroundDrawable(getResources().getDrawable(
R.drawable.note_tag_btn_up));
if (mRowId != -1) {
// Cursor note = mDbHelper.fetchNote(mRowId);
// startManagingCursor(note);
setDate(mTagdate_hide, mRowId);
setTagsText(mTagtitle_hide, mRowId);
// note.close();
}
setBookmode(false, getBookMarkState());
Animation a = new TranslateAnimation(0.0f, 0.0f, 75.0f, 0.0f); a.setDuration(1000);
a.setInterpolator(AnimationUtils.loadInterpolator(this,
android.R.anim.decelerate_interpolator));
a.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
// TODO Auto-generated method stub
}
@Override
public void onAnimationRepeat(Animation animation) {
// TODO Auto-generated method stub
}
@Override
public void onAnimationEnd(Animation animation) {
target.setVisibility(View.VISIBLE);
mDetailhidebutton.setBackgroundDrawable(getResources()
.getDrawable(R.drawable.note_tag_btn_down));
}
});
target.startAnimation(a);
mDetailShowButton.setVisibility(View.GONE);
mTaganotherlayout_show.setVisibility(View.GONE);
위 소스가 버튼 클릭 하였을때 올리게 하는 소스 입니다.
어떤게 잘못되었는지 알고 계시는분 있으신지 혹시 알고 계시다면 좀 알려주세요..



