I\'m adding floating arrows to my HorizontalScrollView
which will let the user know that there are more item\'s outside of the current view.
What I need
The child of the horizontal scrollview should have the correct width. Try this
Log.e("ScrollWidth",Integer.toString(horizontalScrollview.getChildAt(0).getMeasuredWidth()-
getWindowManager().getDefaultDisplay().getWidth()));
This should be the max scroll amount.
Put the following code in your onCreate method
ViewTreeObserver vto = scrollView.getViewTreeObserver();
vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
scrollView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
Log.e("ScrollWidth",Integer.toString(horizontalScrollview.getChildAt(0)
.getMeasuredWidth()-getWindowManager().getDefaultDisplay().getWidth()));
}
});