|
a |
|
b/bodypostureapp/app/src/main/java/eu/alfred/bodypostureapp/MainActivity.java |
|
|
1 |
package eu.alfred.bodypostureapp;
|
|
|
2 |
|
|
|
3 |
import android.content.Intent;
|
|
|
4 |
import android.os.Bundle;
|
|
|
5 |
|
|
|
6 |
import java.util.Map;
|
|
|
7 |
|
|
|
8 |
import eu.alfred.api.proxies.interfaces.ICadeCommand;
|
|
|
9 |
import eu.alfred.bodypostureapp.actions.HelpToPostureAction;
|
|
|
10 |
import eu.alfred.ui.AppActivity;
|
|
|
11 |
import eu.alfred.ui.BackToPAButton;
|
|
|
12 |
import eu.alfred.ui.CircleButton;
|
|
|
13 |
|
|
|
14 |
|
|
|
15 |
public class MainActivity extends AppActivity implements ICadeCommand {
|
|
|
16 |
|
|
|
17 |
final static String HELP_TO_POSTURE_ACTION = "HowToPostureAction";
|
|
|
18 |
|
|
|
19 |
@Override
|
|
|
20 |
protected void onCreate(Bundle savedInstanceState) {
|
|
|
21 |
super.onCreate(savedInstanceState);
|
|
|
22 |
setContentView(R.layout.activity_main);
|
|
|
23 |
|
|
|
24 |
circleButton = (CircleButton) findViewById(R.id.voiceControlBtn);
|
|
|
25 |
circleButton.setOnTouchListener(new MicrophoneTouchListener());
|
|
|
26 |
|
|
|
27 |
backToPAButton = (BackToPAButton) findViewById(R.id.backControlBtn);
|
|
|
28 |
backToPAButton.setOnTouchListener(new BackTouchListener());
|
|
|
29 |
}
|
|
|
30 |
|
|
|
31 |
@Override
|
|
|
32 |
public void onNewIntent(Intent intent) {
|
|
|
33 |
super.onNewIntent(intent);
|
|
|
34 |
}
|
|
|
35 |
|
|
|
36 |
@Override
|
|
|
37 |
public void performAction(final String calledAction, final Map<String, String> map) {
|
|
|
38 |
switch (calledAction) {
|
|
|
39 |
case HELP_TO_POSTURE_ACTION:
|
|
|
40 |
HelpToPostureAction htpa = new HelpToPostureAction(this, cade);
|
|
|
41 |
htpa.performAction(calledAction, map);
|
|
|
42 |
break;
|
|
|
43 |
default:
|
|
|
44 |
break;
|
|
|
45 |
}
|
|
|
46 |
}
|
|
|
47 |
|
|
|
48 |
@Override
|
|
|
49 |
public void performWhQuery(final String calledAction, final Map<String, String> map) {
|
|
|
50 |
|
|
|
51 |
}
|
|
|
52 |
|
|
|
53 |
@Override
|
|
|
54 |
public void performValidity(String calledAction, Map<String, String> map) {
|
|
|
55 |
}
|
|
|
56 |
|
|
|
57 |
@Override
|
|
|
58 |
public void performEntityRecognizer(String calledAction, Map<String, String> map) {
|
|
|
59 |
}
|
|
|
60 |
|
|
|
61 |
@Override
|
|
|
62 |
public void onStart() {
|
|
|
63 |
super.onStart();
|
|
|
64 |
}
|
|
|
65 |
|
|
|
66 |
@Override
|
|
|
67 |
public void onStop() {
|
|
|
68 |
super.onStop();
|
|
|
69 |
}
|
|
|
70 |
|
|
|
71 |
@Override
|
|
|
72 |
protected void onPause() {
|
|
|
73 |
super.onPause();
|
|
|
74 |
}
|
|
|
75 |
|
|
|
76 |
@Override
|
|
|
77 |
public void onResume() {
|
|
|
78 |
super.onResume();
|
|
|
79 |
}
|
|
|
80 |
}
|