public void handleScroll ( float distY ) { if ( getHeight ( ) > 0 && originalImage != null ) { if ( scrollY <= originalImage . getHeight ( ) - getHeight ( ) ) { adaptedImage = Bitmap . createBitmap ( originalImage , 0 , ( int ) - distY , screenWidth , getHeight ( ) ) ; invalidate ( ) ; } } }
Handle an external scroll and render the image by switching it by a distance