|
@@ -28,11 +28,15 @@ import android.content.pm.PackageManager;
|
28
|
28
|
import android.os.Bundle;
|
29
|
29
|
import android.view.Menu;
|
30
|
30
|
import android.view.MenuItem;
|
|
31
|
+import android.widget.ArrayAdapter;
|
31
|
32
|
import android.widget.LinearLayout;
|
|
33
|
+import android.widget.Spinner;
|
32
|
34
|
import android.widget.TextView;
|
33
|
35
|
|
34
|
36
|
import com.flurry.android.FlurryAgent;
|
35
|
37
|
import com.twofortyfouram.SharedResources;
|
|
38
|
+import java.util.Arrays;
|
|
39
|
+import java.util.List;
|
36
|
40
|
|
37
|
41
|
/**
|
38
|
42
|
* This is the "Edit" activity for the locale plugin.
|
|
@@ -63,13 +67,25 @@ public class EditActivity extends Activity {
|
63
|
67
|
((LinearLayout) findViewById(R.id.frame))
|
64
|
68
|
.setBackgroundDrawable(SharedResources.getDrawableResource(getPackageManager(),
|
65
|
69
|
SharedResources.DRAWABLE_LOCALE_BORDER));
|
|
70
|
+
|
|
71
|
+ final List<String> objects = Arrays.asList(new String[]{
|
|
72
|
+ "CLASSIFIED/IDLE/SITTING", "CLASSIFIED/IDLE/STANDING",
|
|
73
|
+ "CLASSIFIED/WALKING", "CLASSIFIED/WALKING/STAIRS",
|
|
74
|
+ "CLASSIFIED/WALKING/STAIRS/UP", "CLASSIFIED/WALKING/STAIRS/DOWN",
|
|
75
|
+ "CLASSIFIED/DANCING", "CLASSIFIED/VEHICLE",
|
|
76
|
+ "CLASSIFIED/VEHICLE/CAR", "CLASSIFIED/VEHICLE/BUS",
|
|
77
|
+ });
|
|
78
|
+
|
|
79
|
+ final Spinner spinner = (Spinner) findViewById(R.id.spinner);
|
|
80
|
+ spinner.setAdapter(new ArrayAdapter<String>(this,
|
|
81
|
+ android.R.layout.simple_spinner_item, objects));
|
66
|
82
|
|
67
|
83
|
if (savedInstanceState == null) {
|
68
|
84
|
final Bundle forwardedBundle = getIntent()
|
69
|
85
|
.getBundleExtra(com.twofortyfouram.Intent.EXTRA_BUNDLE);
|
70
|
86
|
|
71
|
87
|
if (forwardedBundle != null) {
|
72
|
|
- ((TextView) findViewById(R.id.textview)).setText(forwardedBundle.getString("activity"));
|
|
88
|
+ spinner.setSelection(objects.indexOf(forwardedBundle.getString("activity")));
|
73
|
89
|
}
|
74
|
90
|
}
|
75
|
91
|
}
|
|
@@ -89,9 +105,9 @@ public class EditActivity extends Activity {
|
89
|
105
|
final Bundle storeAndForwardExtras = new Bundle();
|
90
|
106
|
|
91
|
107
|
storeAndForwardExtras.putString("activity",
|
92
|
|
- ((TextView) findViewById(R.id.textview)).getText().toString());
|
|
108
|
+ ((Spinner) findViewById(R.id.spinner)).getSelectedItem().toString());
|
93
|
109
|
returnIntent.putExtra(com.twofortyfouram.Intent.EXTRA_STRING_BLURB,
|
94
|
|
- ((TextView) findViewById(R.id.textview)).getText().toString());
|
|
110
|
+ ((Spinner) findViewById(R.id.spinner)).getSelectedItem().toString());
|
95
|
111
|
|
96
|
112
|
returnIntent.putExtra(com.twofortyfouram.Intent.EXTRA_BUNDLE, storeAndForwardExtras);
|
97
|
113
|
setResult(RESULT_OK, returnIntent);
|