David Morrissey | 44e2492 | 2017-11-20 10:36:41 +0000 | [diff] [blame] | 1 | package com.davemorrissey.labs.subscaleview.test.eventhandling; |
David Morrissey | 00cce30 | 2014-06-10 00:28:49 +0100 | [diff] [blame] | 2 | |
David Morrissey | 00cce30 | 2014-06-10 00:28:49 +0100 | [diff] [blame] | 3 | import android.os.Bundle; |
David Morrissey | 00cce30 | 2014-06-10 00:28:49 +0100 | [diff] [blame] | 4 | import android.view.View; |
David Morrissey | 00cce30 | 2014-06-10 00:28:49 +0100 | [diff] [blame] | 5 | import android.widget.Toast; |
David Morrissey | 59a6c8b | 2015-03-03 22:36:16 +0000 | [diff] [blame] | 6 | |
| 7 | import com.davemorrissey.labs.subscaleview.ImageSource; |
David Morrissey | 00cce30 | 2014-06-10 00:28:49 +0100 | [diff] [blame] | 8 | import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView; |
David Morrissey | 44e2492 | 2017-11-20 10:36:41 +0000 | [diff] [blame] | 9 | import com.davemorrissey.labs.subscaleview.test.AbstractPagesActivity; |
| 10 | import com.davemorrissey.labs.subscaleview.test.Page; |
| 11 | import com.davemorrissey.labs.subscaleview.test.R.id; |
David Morrissey | 00cce30 | 2014-06-10 00:28:49 +0100 | [diff] [blame] | 12 | |
| 13 | import java.util.Arrays; |
David Morrissey | 00cce30 | 2014-06-10 00:28:49 +0100 | [diff] [blame] | 14 | |
David Morrissey | 44e2492 | 2017-11-20 10:36:41 +0000 | [diff] [blame] | 15 | import static com.davemorrissey.labs.subscaleview.test.R.layout.*; |
| 16 | import static com.davemorrissey.labs.subscaleview.test.R.string.*; |
David Morrissey | 00cce30 | 2014-06-10 00:28:49 +0100 | [diff] [blame] | 17 | |
David Morrissey | c930ef7 | 2017-11-02 18:27:22 +0000 | [diff] [blame] | 18 | public class EventHandlingActivity extends AbstractPagesActivity { |
David Morrissey | 00cce30 | 2014-06-10 00:28:49 +0100 | [diff] [blame] | 19 | |
David Morrissey | c930ef7 | 2017-11-02 18:27:22 +0000 | [diff] [blame] | 20 | public EventHandlingActivity() { |
| 21 | super(event_title, pages_activity, Arrays.asList( |
| 22 | new Page(event_p1_subtitle, event_p1_text), |
| 23 | new Page(event_p2_subtitle, event_p2_text), |
| 24 | new Page(event_p3_subtitle, event_p3_text) |
| 25 | )); |
| 26 | } |
David Morrissey | 00cce30 | 2014-06-10 00:28:49 +0100 | [diff] [blame] | 27 | |
| 28 | @Override |
| 29 | protected void onCreate(Bundle savedInstanceState) { |
| 30 | super.onCreate(savedInstanceState); |
David Morrissey | c930ef7 | 2017-11-02 18:27:22 +0000 | [diff] [blame] | 31 | SubsamplingScaleImageView imageView = findViewById(id.imageView); |
David Morrissey | f953721 | 2017-12-11 09:00:33 +0000 | [diff] [blame] | 32 | imageView.setImage(ImageSource.asset("sanmartino.jpg")); |
David Morrissey | c930ef7 | 2017-11-02 18:27:22 +0000 | [diff] [blame] | 33 | imageView.setOnClickListener(new View.OnClickListener() { |
| 34 | @Override public void onClick(View v) { Toast.makeText(v.getContext(), "Clicked", Toast.LENGTH_SHORT).show(); } |
| 35 | }); |
| 36 | imageView.setOnLongClickListener(new View.OnLongClickListener() { |
| 37 | @Override public boolean onLongClick(View v) { Toast.makeText(v.getContext(), "Long clicked", Toast.LENGTH_SHORT).show(); return true; } |
| 38 | }); |
David Morrissey | 00cce30 | 2014-06-10 00:28:49 +0100 | [diff] [blame] | 39 | } |
| 40 | |
| 41 | } |