florent37 / florent37/TutoShowcase
make animated to non animated
- Dominant language
- Java
- Stars
- 499
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
i also make animated item to non animated .
code
private void displayScrollableUpOnView() {
final Rect rect = new Rect();
view.getGlobalVisibleRect(rect);
final int height = rect.height();
final ImageView hand = new ImageView(view.getContext());
hand.setImageResource(R.drawable.ic_hand_finger_on_up_arrow);
ViewGroup.MarginLayoutParams layoutParams = new ViewGroup.MarginLayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
hand.setLayoutParams(layoutParams);
hand.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
@Override
public boolean onPreDraw() {
int x = (int) (rect.centerX() - hand.getWidth() / 2f);
int y = (int) (rect.centerY() - hand.getHeight() / 2f) - getStatusBarOffset();
ViewCompat.setTranslationY(hand, y - 25);
ViewCompat.setTranslationX(hand, x);
//
// if (settings.animated)
// ViewCompat.animate(hand) // - height * 0.8f - getStatusBarOffset()
// .translationY(rect.top-50)
// .setStartDelay(settings.delay != null ? settings.delay : 1500)
// .setDuration(settings.duration != null ? settings.duration : 3000)
// .setInterpolator(new DecelerateInterpolator());
hand.getViewTreeObserver().removeOnPreDrawListener(this);
return false;
}
});
tutoShowcase.container.addView(hand, layoutParams);
tutoShowcase.container.invalidate();
}
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.