mirror of
				https://github.com/bspeice/itcs4180
				synced 2025-11-04 02:10:32 -05:00 
			
		
		
		
	Add methods to be used by both button presses and gesture detection
This commit is contained in:
		@ -32,17 +32,27 @@ public class ImageViewerActivity extends Activity {
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public void onClickPrev(View v) {
 | 
			
		||||
		
 | 
			
		||||
		displayPrev();
 | 
			
		||||
	}
 | 
			
		||||
		
 | 
			
		||||
	public void onClickNext(View v) {
 | 
			
		||||
		
 | 
			
		||||
		displayNext();
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public void onClickBack(View v) {
 | 
			
		||||
		finish();
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private void displayPrev() {
 | 
			
		||||
		currentIndex -= 1;
 | 
			
		||||
		displayImage(currentIndex);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private void displayNext() {
 | 
			
		||||
		currentIndex += 1;
 | 
			
		||||
		displayImage(currentIndex);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public void displayImage(int indexToDisplay) {
 | 
			
		||||
		
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user