mirror of
https://github.com/bspeice/itcs4180
synced 2024-11-13 19:08:20 -05:00
Add methods to be used by both button presses and gesture detection
This commit is contained in:
parent
cef01d01e0
commit
00f1f80d1a
@ -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) {
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user