¡@

Home 

2014/10/16 ¤W¤È 08:11:56

android Programming Glossary: currenty

Android: Scrolling an Imageview

http://stackoverflow.com/questions/3058164/android-scrolling-an-imageview

onTouch View view MotionEvent event float currentX currentY switch event.getAction case MotionEvent.ACTION_DOWN downX.. break case MotionEvent.ACTION_MOVE currentX event.getX currentY event.getY scrollByX int downX currentX scrollByY int downY.. scrollByX int downX currentX scrollByY int downY currentY scrolling to left side of image pic moving to the right if..

Images in ScrollView in android

http://stackoverflow.com/questions/4990682/images-in-scrollview-in-android

LinearLayout container private int currentX private int currentY @Override public void onCreate Bundle savedInstanceState super.onCreate.. case MotionEvent.ACTION_DOWN currentX int event.getRawX currentY int event.getRawY break case MotionEvent.ACTION_MOVE int.. int y2 int event.getRawY container.scrollBy currentX x2 currentY y2 currentX x2 currentY y2 break case MotionEvent.ACTION_UP..

Android: Scrolling an Imageview

http://stackoverflow.com/questions/3058164/android-scrolling-an-imageview

downY int totalX totalY int scrollByX scrollByY public boolean onTouch View view MotionEvent event float currentX currentY switch event.getAction case MotionEvent.ACTION_DOWN downX event.getX downY event.getY break case MotionEvent.ACTION_MOVE.. MotionEvent.ACTION_DOWN downX event.getX downY event.getY break case MotionEvent.ACTION_MOVE currentX event.getX currentY event.getY scrollByX int downX currentX scrollByY int downY currentY scrolling to left side of image pic moving to the.. MotionEvent.ACTION_MOVE currentX event.getX currentY event.getY scrollByX int downX currentX scrollByY int downY currentY scrolling to left side of image pic moving to the right if currentX downX if totalX maxLeft scrollByX 0 if totalX..

Images in ScrollView in android

http://stackoverflow.com/questions/4990682/images-in-scrollview-in-android

scroll it public class StartActivity extends Activity private LinearLayout container private int currentX private int currentY @Override public void onCreate Bundle savedInstanceState super.onCreate savedInstanceState setContentView R.layout.main.. onTouchEvent MotionEvent event switch event.getAction case MotionEvent.ACTION_DOWN currentX int event.getRawX currentY int event.getRawY break case MotionEvent.ACTION_MOVE int x2 int event.getRawX int y2 int event.getRawY container.scrollBy.. case MotionEvent.ACTION_MOVE int x2 int event.getRawX int y2 int event.getRawY container.scrollBy currentX x2 currentY y2 currentX x2 currentY y2 break case MotionEvent.ACTION_UP break return true Here many improvements can be made..