Android examples for User Interface:ScrollView
get View Vertical Scroll Factor
//package com.java2s; import android.util.TypedValue; import android.view.View; public class Main { public static float getVerticalScrollFactor(View view) { TypedValue outValue = new TypedValue(); if (!view .getContext()//from w ww .j ava2s . co m .getTheme() .resolveAttribute(android.R.attr.listPreferredItemHeight, outValue, true)) { throw new IllegalStateException( "Expected theme to define listPreferredItemHeight."); } return outValue.getDimension(view.getResources() .getDisplayMetrics()); } }