Download this file

HelpToPostureAction.java    68 lines (50 with data), 1.6 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
64
65
66
67
package eu.alfred.bodypostureapp.actions;
import android.widget.ImageView;
import java.util.Map;
import eu.alfred.api.proxies.interfaces.ICadeCommand;
import eu.alfred.api.speech.Cade;
import eu.alfred.bodypostureapp.MainActivity;
import eu.alfred.bodypostureapp.R;
/**
* Created by Gary on 26.02.2016.
*/
public class HelpToPostureAction implements ICadeCommand {
MainActivity main;
Cade cade;
public HelpToPostureAction(MainActivity main, Cade cade) {
this.main = main;
this.cade = cade;
}
@Override
public void performAction(String s, Map<String, String> map) {
ImageView howToImage = (ImageView) main.findViewById(R.id.image_howto);
String posture = map.get("selected_bodyposture");
switch (posture) {
case("sit"):
case("assis"):
case("zit"):
howToImage.setImageResource(R.drawable.howto_sit);
break;
case("stand"):
case("debout"):
case("sta"):
howToImage.setImageResource(R.drawable.howto_stand);
break;
case("lie"):
case("allong��"):
case("lig"):
howToImage.setImageResource(R.drawable.howto_lie);
break;
}
cade.sendActionResult(true);
}
@Override
public void performWhQuery(String s, Map<String, String> map) {
}
@Override
public void performValidity(String s, Map<String, String> map) {
}
@Override
public void performEntityRecognizer(String s, Map<String, String> map) {
}
}