Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LinearInterpolator scrollInterpolator = new LinearInterpolator();
- Scroller scroller = new Scroller(this,scrollInterpolator);
- scroller.extendDuration(10000);//I thought this was 10 seconds
- text1.setScroller(scroller);
- scrollView.post(new Runnable() {
- @RequiresApi(api = Build.VERSION_CODES.HONEYCOMB)
- @Override
- public void run() {
- scrollView.fullScroll(ScrollView.FOCUS_DOWN);
- }
- });
- final ScrollView scrollView = findViewById(R.id.scrollView);
- scrollView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
- @Override
- public void onGlobalLayout() {
- scrollView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
- ObjectAnimator objectAnimator = ObjectAnimator.ofInt(scrollView,"scrollY",scrollView.getChildAt(0).getHeight()-scrollView.getHeight());
- objectAnimator.setDuration(10000);
- objectAnimator.setInterpolator(new LinearInterpolator());
- objectAnimator.start();
- }
- });
Add Comment
Please, Sign In to add comment