package com.cookandroid.project6;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ViewFlipper;

public class MainActivity extends AppCompatActivity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		Button btnPrev, btnNext;
		final ViewFlipper vFlipper;

		btnPrev = (Button) findViewById(R.id.btnPrev);
		btnNext = (Button) findViewById(R.id.btnNext);

		vFlipper = (ViewFlipper) findViewById(R.id.viewFlipper1);

		btnPrev.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				vFlipper.showPrevious();
			}
		});

		btnNext.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				vFlipper.showNext();
			}
		});
	}
}
