… | |
… | |
63 | {
|
63 | {
|
64 | super(context);
|
64 | super(context);
|
65 |
|
65 |
|
66 | text_paint.setColor(Color.WHITE);
|
66 | text_paint.setColor(Color.WHITE);
|
67 | // text_paint.setStyle(Paint.Style.FILL);
|
67 | // text_paint.setStyle(Paint.Style.FILL);
|
68 | text_paint.setTextSize(16);
|
68 | text_paint.setTextSize(16 * aagtl.Global_dpi_factor);
|
69 | // text_paint.setTypeface(Typeface.DEFAULT_BOLD);
|
69 | // text_paint.setTypeface(Typeface.DEFAULT_BOLD);
|
70 | text_paint.setAntiAlias(true);
|
70 | text_paint.setAntiAlias(true);
|
71 |
|
71 |
|
72 | this.main_aagtl = main_aagtl;
|
72 | this.main_aagtl = main_aagtl;
|
73 | this.clear_stuff();
|
73 | this.clear_stuff();
|
… | |
… | |
195 | else
|
195 | else
|
196 | {
|
196 | {
|
197 | try
|
197 | try
|
198 | {
|
198 | {
|
199 | c.drawColor(Color.BLACK);
|
199 | c.drawColor(Color.BLACK);
|
200 | c.drawText(gc.name, 10, 50, text_paint);
|
200 | c.drawText(gc.name, 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor, text_paint);
|
201 | c.drawText(gc.title, 10, 50 + 30, text_paint);
|
201 | c.drawText(gc.title, 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor + 30 * aagtl.Global_dpi_factor, text_paint);
|
202 | c.drawText(gc.type, 10, 50 + 2 * 30, text_paint);
|
202 | c.drawText(gc.type, 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor + 2 * 30 * aagtl.Global_dpi_factor, text_paint);
|
203 | c.drawText("size: " + String.valueOf(gc.size), 10, 50 + 3 * 30, text_paint);
|
203 | c.drawText("size: " + String.valueOf(gc.size), 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor + 3 * 30 * aagtl.Global_dpi_factor, text_paint);
|
204 | c.drawText("terrain: " + String.valueOf(gc.terrain), 10, 50 + 4 * 30, text_paint);
|
204 | c.drawText("terrain: " + String.valueOf(gc.terrain), 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor + 4 * 30 * aagtl.Global_dpi_factor, text_paint);
|
205 |
|
205 |
|
206 | if (this.get_gc_from_db == 1)
|
206 | if (this.get_gc_from_db == 1)
|
207 | {
|
207 | {
|
208 | // check in db for cache details
|
208 | // check in db for cache details
|
209 | c.drawText("checking database ...", 10, 50 + 6 * 30, text_paint);
|
209 | c.drawText("checking database ...", 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor + 6 * 30 * aagtl.Global_dpi_factor, text_paint);
|
210 | this.gc = this.main_aagtl.pv.get_point_full(this.gc.name);
|
210 | this.gc = this.main_aagtl.pv.get_point_full(this.gc.name);
|
211 | System.out.println("checking database");
|
211 | System.out.println("checking database");
|
212 | System.out.println("DESC=" + this.gc.desc);
|
212 | System.out.println("DESC=" + this.gc.desc);
|
213 | if (this.gc.desc==null)
|
213 | if (this.gc.desc == null)
|
214 | {
|
214 | {
|
215 | this.gc.desc="please update details";
|
215 | this.gc.desc = "please update details";
|
216 | }
|
216 | }
|
217 | this.get_gc_from_db = 0;
|
217 | this.get_gc_from_db = 0;
|
218 | }
|
218 | }
|
219 |
|
219 |
|
220 | if (this.details_loaded == 0)
|
220 | if (this.details_loaded == 0)
|
221 | {
|
221 | {
|
222 | if (!this.override_download)
|
222 | if (!this.override_download)
|
223 | {
|
223 | {
|
224 | // check in db for cache details
|
224 | // check in db for cache details
|
225 | c.drawText("checking database ...", 10, 50 + 6 * 30, text_paint);
|
225 | c.drawText("checking database ...", 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor + 6 * 30 * aagtl.Global_dpi_factor, text_paint);
|
226 | this.gc = this.main_aagtl.pv.get_point_full(this.gc.name);
|
226 | this.gc = this.main_aagtl.pv.get_point_full(this.gc.name);
|
227 | System.out.println("checking database");
|
227 | System.out.println("checking database");
|
228 | System.out.println("DESC=" + this.gc.desc);
|
228 | System.out.println("DESC=" + this.gc.desc);
|
229 | }
|
229 | }
|
230 | else
|
230 | else
|
… | |
… | |
240 | if (this.gc.desc == null)
|
240 | if (this.gc.desc == null)
|
241 | {
|
241 | {
|
242 | // download from internet (in background thread)
|
242 | // download from internet (in background thread)
|
243 | c.drawColor(Color.BLACK);
|
243 | c.drawColor(Color.BLACK);
|
244 |
|
244 |
|
245 | c.drawText(gc.name, 10, 50, text_paint);
|
245 | c.drawText(gc.name, 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor, text_paint);
|
246 | c.drawText(gc.title, 10, 50 + 30, text_paint);
|
246 | c.drawText(gc.title, 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor + 30 * aagtl.Global_dpi_factor, text_paint);
|
247 | c.drawText(gc.type, 10, 50 + 2 * 30, text_paint);
|
247 | c.drawText(gc.type, 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor + 2 * 30 * aagtl.Global_dpi_factor, text_paint);
|
248 | c.drawText("size: " + String.valueOf(gc.size), 10, 50 + 3 * 30, text_paint);
|
248 | c.drawText("size: " + String.valueOf(gc.size), 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor + 3 * 30 * aagtl.Global_dpi_factor, text_paint);
|
249 | c.drawText("terrain: " + String.valueOf(gc.terrain), 10, 50 + 4 * 30, text_paint);
|
249 | c.drawText("terrain: " + String.valueOf(gc.terrain), 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor + 4 * 30 * aagtl.Global_dpi_factor, text_paint);
|
250 |
|
250 |
|
251 | c.drawText("downloading ...", 10, 50 + 6 * 30, text_paint);
|
251 | c.drawText("downloading ...", 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor + 6 * 30 * aagtl.Global_dpi_factor, text_paint);
|
252 |
|
252 |
|
253 | // System.out.println("downloading from internet");
|
253 | // System.out.println("downloading from internet");
|
254 | this.download_details_thread_finished = false;
|
254 | this.download_details_thread_finished = false;
|
255 | this.details_loaded = 1;
|
255 | this.details_loaded = 1;
|
256 | Thread_gcv2 t2 = new Thread_gcv2(this);
|
256 | Thread_gcv2 t2 = new Thread_gcv2(this);
|
… | |
… | |
269 |
|
269 |
|
270 | }
|
270 | }
|
271 | else if (this.details_loaded == 1)
|
271 | else if (this.details_loaded == 1)
|
272 | {
|
272 | {
|
273 | c.drawColor(Color.BLACK);
|
273 | c.drawColor(Color.BLACK);
|
274 | c.drawText(gc.name, 10, 50, text_paint);
|
274 | c.drawText(gc.name, 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor, text_paint);
|
275 | c.drawText(gc.title, 10, 50 + 30, text_paint);
|
275 | c.drawText(gc.title, 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor + 30 * aagtl.Global_dpi_factor, text_paint);
|
276 | c.drawText(gc.type, 10, 50 + 2 * 30, text_paint);
|
276 | c.drawText(gc.type, 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor + 2 * 30 * aagtl.Global_dpi_factor, text_paint);
|
277 | c.drawText("size: " + String.valueOf(gc.size), 10, 50 + 3 * 30, text_paint);
|
277 | c.drawText("size: " + String.valueOf(gc.size), 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor + 3 * 30 * aagtl.Global_dpi_factor, text_paint);
|
278 | c.drawText("status: " + String.valueOf(GeocacheCoordinate.STATUS_HASH.get(gc.status)), 150, 50 + 3 * 30, text_paint);
|
278 | c.drawText("status: " + String.valueOf(GeocacheCoordinate.STATUS_HASH.get(gc.status)), 150, 50 + 3 * 30, text_paint);
|
279 | c.drawText("diff: " + String.valueOf((float) gc.difficulty / 10f), 10, 50 + 4 * 30, text_paint);
|
279 | c.drawText("diff: " + String.valueOf((float) gc.difficulty / 10f), 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor + 4 * 30 * aagtl.Global_dpi_factor, text_paint);
|
280 | c.drawText("terrain: " + String.valueOf((float) gc.terrain / 10f), 10, 50 + 5 * 30, text_paint);
|
280 | c.drawText("terrain: " + String.valueOf((float) gc.terrain / 10f), 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor + 5 * 30 * aagtl.Global_dpi_factor, text_paint);
|
281 |
|
281 |
|
282 | c.drawText("downloading ...", 10, 50 + 6 * 30, text_paint);
|
282 | c.drawText("downloading ...", 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor + 6 * 30 * aagtl.Global_dpi_factor, text_paint);
|
283 | }
|
283 | }
|
284 |
|
284 |
|
285 | if (this.details_loaded == 2)
|
285 | if (this.details_loaded == 2)
|
286 | {
|
286 | {
|
287 | if (!need_repaint) // &&
|
287 | if (!need_repaint) // &&
|
… | |
… | |
291 | return;
|
291 | return;
|
292 | }
|
292 | }
|
293 |
|
293 |
|
294 | need_repaint = false;
|
294 | need_repaint = false;
|
295 | c.drawColor(Color.BLACK);
|
295 | c.drawColor(Color.BLACK);
|
296 | c.drawText(gc.name, 10, 50, text_paint);
|
296 | c.drawText(gc.name, 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor, text_paint);
|
297 | c.drawText(gc.title, 10, 50 + 30, text_paint);
|
297 | c.drawText(gc.title, 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor + 30 * aagtl.Global_dpi_factor, text_paint);
|
298 | c.drawText(gc.type, 10, 50 + 2 * 30, text_paint);
|
298 | c.drawText(gc.type, 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor + 2 * 30 * aagtl.Global_dpi_factor, text_paint);
|
299 | c.drawText("size: " + String.valueOf(gc.size), 10, 50 + 3 * 30, text_paint);
|
299 | c.drawText("size: " + String.valueOf(gc.size), 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor + 3 * 30 * aagtl.Global_dpi_factor, text_paint);
|
300 | c.drawText("status: " + String.valueOf(GeocacheCoordinate.STATUS_HASH.get(gc.status)), 150, 50 + 3 * 30, text_paint);
|
300 | c.drawText("status: " + String.valueOf(GeocacheCoordinate.STATUS_HASH.get(gc.status)), 150 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor + 3 * 30 * aagtl.Global_dpi_factor, text_paint);
|
301 | c.drawText("diff: " + String.valueOf((float) gc.difficulty / 10f), 10, 50 + 4 * 30, text_paint);
|
301 | c.drawText("diff: " + String.valueOf((float) gc.difficulty / 10f), 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor + 4 * 30 * aagtl.Global_dpi_factor, text_paint);
|
302 | c.drawText("terrain: " + String.valueOf((float) gc.terrain / 10f), 10, 50 + 5 * 30, text_paint);
|
302 | c.drawText("terrain: " + String.valueOf((float) gc.terrain / 10f), 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor + 5 * 30 * aagtl.Global_dpi_factor, text_paint);
|
303 |
|
303 |
|
304 | // c.drawText("details loaded", 10, 50 + 6 * 30, text_paint);
|
304 | // c.drawText("details loaded", 10, 50 + 6 * 30, text_paint);
|
305 | c.drawText("", 10, 50 + 6 * 30, text_paint);
|
305 | c.drawText("", 10 * aagtl.Global_dpi_factor, 50 * aagtl.Global_dpi_factor + 6 * 30 * aagtl.Global_dpi_factor, text_paint);
|
306 |
|
306 |
|
307 | String show_field_text = this.gc.shortdesc;
|
307 | String show_field_text = this.gc.shortdesc;
|
308 | switch (this.show_field)
|
308 | switch (this.show_field)
|
309 | {
|
309 | {
|
310 | case GCacheView.SHOW_SHORT_DESC:
|
310 | case GCacheView.SHOW_SHORT_DESC:
|