現在参考になっているように見えるので、プロジェクトで Google Plus アプリケーションを模倣しようとしています。
スクロール時のリストビュー効果は本当に素晴らしく、似たようなことをしたいと思っています。
私は LayoutAnimationController http://android-er.blogspot.be/2009/10/listview-and-listactivity-layout.htmlから始めました
LayoutAnimationController controller
= AnimationUtils.loadLayoutAnimation(
this, R.anim.list_layout_controller);
getListView().setLayoutAnimation(controller);
すべての要素がアニメーション化されているわけではないため、これは悪いようです。
だから私はアダプターの getView を使用してこれを使用して終了しました:
AnimationSet set = new AnimationSet(true);
Animation animation = new AlphaAnimation(0.0f, 1.0f);
animation.setDuration(800);
set.addAnimation(animation);
animation = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0.0f,Animation.RELATIVE_TO_SELF, 0.0f,
Animation.RELATIVE_TO_SELF, 1.0f,Animation.RELATIVE_TO_SELF, 0.0f
);
animation.setDuration(600);
set.addAnimation(animation);
row.startAnimation(set);
結果は素晴らしく、本当に満足しています!
残念ながら、リストを上から下にスクロールした場合にのみ機能します。
反対側にスクロールするときに機能させたいのですが、TranslateAnimation を少し変更する必要があります。
私の質問は、アダプタで上方向または下方向にスクロールしたかどうかを検出する方法はありますか?