public class ExtendedWebView extends WebView {
public ExtendedWebView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public boolean canScrollHorizontally(int direction) {
final int offset = computeHorizontalScrollOffset () ;
final int range = computeHorizontalScrollRange () - computeHorizontalScrollExtent() ;
if ( range == 0 ) return false ;
else return ( direction < 0 ) ? ( offset > 0 ) : ( offset < range - 1 ) ;
}
}
@Override
protected boolean canScroll(View v, boolean checkV, int dx, int x, int y) {
WebView view = (ExtendedWebView) v.findViewById (R.id.nomal_link_web); //res ID
if ( view != null ) {
return view.canScrollHorizontally ( -dx ) ;
} else {
return super.canScroll ( v, checkV, dx, x, y ) ;
}
}