My favorites
▼
|
Sign in
mixare
Mixare is an open source Augmented Reality Engine for Android smartphones
Project Home
Downloads
Wiki
Issues
Source
Export to GitHub
READ-ONLY: This project has been
archived
. For more information see
this post
.
Search
Search within:
All issues
Open issues
New issues
Issues to verify
for
Advanced search
Search tips
Subscriptions
Issue
8
attachment: issue8.patch
(7.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
Index: src/org/mixare/MixListView.java
===================================================================
--- src/org/mixare/MixListView.java (revision 26)
+++ src/org/mixare/MixListView.java (working copy)
@@ -22,22 +22,25 @@
import android.app.ListActivity;
import android.os.Bundle;
+import android.util.Log;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
+import android.widget.Toast;
public class MixListView extends ListActivity{
- public static Vector<String> data;
- public static Vector<String> selectedItemURL;
- public static MixContext context;
- public static DataView dataView;
+ private static Vector<String> data = null;
+ private static Vector<String> selectedItemURL= null;
+ private static MixContext context = null;
+ private static DataView dataView = null;
+ private static String info= null;
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
-
- setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,data));
+
+ setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,data));
getListView().setTextFilterEnabled(true);
}
@@ -45,10 +48,32 @@
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
- dataView.state.handleEvent(context, selectedItemURL.get(position));
+ /*if no website is available for this item*/
+ if(selectedItemURL.get(position)==""){
+
+ Toast.makeText( this, info +" "+ data.get(position), Toast.LENGTH_LONG ).show();
+ }
+ else{
+ dataView.state.handleEvent(context, selectedItemURL.get(position));
+ }
finish();
}
+ public static void setInfoText(String i){
+ info = i;
+ }
+ public static void setDataView(DataView v){
+ dataView = v;
+ }
+ public static void setMixContext(MixContext mc){
+ context = mc;
+ }
+ public static void setTitleVector(Vector<String> t){
+ data = t;
+ }
+ public static void setURLVector(Vector<String> url){
+ selectedItemURL = url;
+ }
}
Index: src/org/mixare/MixView.java
===================================================================
--- src/org/mixare/MixView.java (revision 26)
+++ src/org/mixare/MixView.java (working copy)
@@ -206,6 +206,7 @@
});
AlertDialog GPSAlert = builder.create();
GPSAlert.show();
+// Toast.makeText( this, getString(view.CONNECITON_GPS_DIALOG_TEXT), Toast.LENGTH_LONG ).show();
}
@Override
@@ -226,7 +227,7 @@
/*check if the application is launched for the first time*/
if(settings.getBoolean("firstAccess",false)==false){
//if FALSE it is the first time and the license agreements are shown before starting
- Intent intent = new Intent(MixView.this, MixLicense.class);
+ Intent intent = new Intent(MixView.this, MixTextViews.class);
startActivity(intent);
editor.putBoolean("firstAccess", true);
editor.commit();
@@ -266,12 +267,11 @@
/*set the radius in data view to the last selected by the user*/
SetZoomLevel();
- isInited = true;
-
- if(ctx.isActualLocation()==false){
- setGPSDialog();
- }
+ isInited = true;
}
+ if(ctx.isActualLocation()==false){
+ setGPSDialog();
+ }
} catch (Exception ex) {
doError(ex);
}
@@ -448,14 +448,16 @@
MenuItem item3 =menu.add(base, base+2, base+2, getString(view.MENU_ITEM_3));
MenuItem item4 =menu.add(base, base+3, base+3, getString(view.MENU_ITEM_4));
MenuItem item5 =menu.add(base, base+4, base+4, getString(view.MENU_ITEM_5));
-
+ MenuItem item6 =menu.add(base, base+5, base+5, getString(view.MENU_ITEM_6));
+
/*assign icons to the menu items*/
item1.setIcon(android.R.drawable.ic_menu_view);
item2.setIcon(android.R.drawable.ic_menu_gallery);
item3.setIcon(android.R.drawable.ic_menu_search);
item4.setIcon(android.R.drawable.ic_menu_zoom);
- item5.setIcon(android.R.drawable.ic_menu_close_clear_cancel);
-
+ item5.setIcon(android.R.drawable.ic_menu_info_details);
+ item6.setIcon(android.R.drawable.ic_menu_close_clear_cancel);
+
return true;
}
@@ -468,19 +470,31 @@
break;
/*Case 2: show all info/location points in the radius in a list*/
case 2:
- listDataVector = view.jLayer.listData;
- listURL = view.jLayer.listOnPress;
-
- //if the list of titles to show in alternative list view is not empty
+ listDataVector = new Vector();
+ listURL = new Vector();
+ /*add all marker items to a title and a URL Vector*/
+ for(int i = 0; i<view.jLayer.markers.size();i++){
+ Marker ma = new Marker();
+ ma = view.jLayer.markers.get(i);
+ listDataVector.add(ma.getText());
+ /*the website for the corresponding title*/
+ if(ma.getURL()!=null)
+ listURL.add(ma.getURL());
+ /*if no website is available for a specific title*/
+ else
+ listURL.add("");
+ }
+ /*if the list of titles to show in alternative list view is not empty*/
if(listDataVector.size()>0){
- MixListView.data= listDataVector;
- MixListView.selectedItemURL= listURL;
- MixListView.context = ctx;
- MixListView.dataView = view;
+ MixListView.setTitleVector(listDataVector);
+ MixListView.setURLVector(listURL);
+ MixListView.setMixContext(ctx);
+ MixListView.setDataView(view);
+ MixListView.setInfoText(getString(view.NO_WEBINFO_AVAILABLE));
Intent intent = new Intent(MixView.this, MixListView.class);
startActivityForResult(intent, 42);
}
- //if the list is empty
+ /*if the list is empty*/
else{
Toast.makeText( this, view.EMPTY_LIST_STRING_ID, Toast.LENGTH_LONG ).show();
}
@@ -493,11 +507,18 @@
case 4:
myZoomBar.setVisibility(View.VISIBLE);
break;
- /*Case 5: show license agreements*/
+ /*GPS Information*/
case 5:
- Intent intent1 = new Intent(MixView.this, MixLicense.class);
+ MixTextViews.MENU_VIEW = 1;
+ Intent intent1 = new Intent(MixView.this, MixTextViews.class);
startActivityForResult(intent1, 42);
break;
+ /*Case 6: show license agreements*/
+ case 6:
+ MixTextViews.MENU_VIEW = 2;
+ Intent intent2 = new Intent(MixView.this, MixTextViews.class);
+ startActivityForResult(intent2, 42);
+ break;
}
return true;
}
Index: src/org/mixare/DataView.java
===================================================================
--- src/org/mixare/DataView.java (revision 26)
+++ src/org/mixare/DataView.java (working copy)
@@ -47,6 +47,7 @@
*
*/
public class DataView {
+
/**current context */
MixContext ctx;
@@ -79,6 +80,8 @@
public int MENU_ITEM_3 = R.string.menu_item_3;
public int MENU_ITEM_4 = R.string.menu_item_4;
public int MENU_ITEM_5 = R.string.menu_item_5;
+ public int MENU_ITEM_6 = R.string.menu_item_6;
+
public int CONNECITON_ERROR_DIALOG_TEXT = R.string.connection_error_dialog;
public int CONNECITON_ERROR_DIALOG_BUTTON1 = R.string.connection_error_dialog_button1;
@@ -88,6 +91,10 @@
public int CONNECITON_GPS_DIALOG_TEXT = R.string.connection_GPS_dialog_text;
public int CONNECITON_GPS_DIALOG_BUTTON1 = R.string.connection_GPS_dialog_button1;
public int CONNECITON_GPS_DIALOG_BUTTON2 = R.string.connection_GPS_dialog_button2;
+
+ /*if in the listview option for a specific title no website is provided*/
+ public int NO_WEBINFO_AVAILABLE = R.string.no_website_available;
+
// public int ORIENTATON_NORD_ID = R.string.N;
Powered by
Google Project Hosting