-
Notifications
You must be signed in to change notification settings - Fork 157
Expand file tree
/
Copy pathMainActivity.java
More file actions
63 lines (58 loc) · 2.3 KB
/
MainActivity.java
File metadata and controls
63 lines (58 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* Copyright (c) 2012 Wireless Designs, LLC
*
* See the file license.txt for copying permission.
*/
package com.examples.customtouch;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
public class MainActivity extends ListActivity implements OnItemClickListener {
private static final String[] ITEMS = {
"Pan Example", "Pan Gesture Example",
"Multi-Touch Example", "Touch Forward Example",
"Touch Delegate Example", "Touch Listener Example",
"Move Logger Example", "Hover Emulator"};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, ITEMS);
getListView().setAdapter(adapter);
getListView().setOnItemClickListener(this);
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
switch (position) {
case 0: //2D Scrolling
startActivity(new Intent(this, TwoDimensionScrollActivity.class));
break;
case 1: //2D GestureDetector Scrolling
startActivity(new Intent(this, TwoDimensionGestureScrollActivity.class));
break;
case 2: //Multi-Touch Image View
startActivity(new Intent(this, MultitouchActivity.class));
break;
case 3: //Touch Forwarding
startActivity(new Intent(this, TouchForwardActivity.class));
break;
case 4: //Touch Delegate
startActivity(new Intent(this, TouchDelegateActivity.class));
break;
case 5: //Touch Listener
startActivity(new Intent(this, TouchListenerActivity.class));
break;
case 6: //Move Logger View
startActivity(new Intent(this, MoveLoggerActivity.class));
break;
case 7: //Hover emulator
startActivity(new Intent(this, HoverEmulatorActivity.class));
break;
default:
break;
}
}
}