Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to find not animated down finger image #27

Open
rtinku opened this issue Feb 16, 2018 · 0 comments
Open

unable to find not animated down finger image #27

rtinku opened this issue Feb 16, 2018 · 0 comments

Comments

@rtinku
Copy link

rtinku commented Feb 16, 2018

i'm unable to find not animated down finger in you library. so i have make some adjustment in your code to get this functionality.

here code to make adjustment to get this functionality

private void displayScrollableDownOnView() {
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_tutoshowcase_finger_moving_down);
        hand.setLayoutParams(new ViewGroup.MarginLayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));


        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();

                if (Build.VERSION.SDK_INT > 20) {
                    ViewCompat.setTranslationY(hand, y - 215);
                } else {
                    ViewCompat.setTranslationY(hand, y - 150);
                }


                ViewCompat.setTranslationX(hand, x);

// if (settings.animated)
// ViewCompat.animate(hand) //- height * 0.8f - getStatusBarOffset()
// .translationY(x)
// .setStartDelay(settings.delay != null ? settings.delay : 500)
// .setDuration(settings.duration != null ? settings.duration : 600)
// .setInterpolator(new DecelerateInterpolator());

                hand.getViewTreeObserver().removeOnPreDrawListener(this);
                return false;
            }
        });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant