2
ViewDragHelperを使用してビューを新しい場所にスライドさせていますが、viewDragHelper.smoothSlideViewTo(dragView, x, y)
を使用しようとしています。問題は次のとおりです。スライドアニメーションが完了した後に通知を受け取るにはどうすればよいですか?私はスライドアニメーションイベント(特にonSlideAnimationComplete()のようなもの)を聞く方法を探しています。任意のアイデアの人々ですか?ViewDragHelperアニメーションリスナー
private boolean smoothSlideTo(float slideOffset) {
final int topBound = getPaddingTop();
int x = (int) (slideOffset * (getWidth() - transformer.getMinWidthPlusMarginRight()));
int y = (int) (topBound + slideOffset * getVerticalDragRange());
if (viewDragHelper.smoothSlideViewTo(dragView, x, y)) {
ViewCompat.postInvalidateOnAnimation(this);
return true;
}
return false;
}
[this](https://gist.github.com/pskink/b747e89c1e1a1e314ca6)を参照してください。 – pskink
@pskinkあなたのコードは私の質問にどのように関連していますか?私はまだアニメーションの完全なイベントをキャプチャする場所を知らない。 – yongsunCN
最初にドキュメントを読んでから、自分のコードでアニメーションのサポートを実装した方法を見て、自分のコードを実行しても役に立ちます。 – pskink