maxScrollX = horizontalScrollView.getChildAt(0).getMeasuredWidth()-horizontalScrollView.getMeasuredWidth(); if (horizontalScrollView.getScrollX() == 0) { lImageView.setImageResource(R.drawable.left_green); } else { lImageView.setImageResource(R.drawable.left); } if (horizontalScrollView.getScrollX() == maxScrollX) { rImageView.setImageResource(R.drawable.right_green); } else { rImageView.setImageResource(R.drawable.right); }
source share