source: other-projects/tipple-android/trunk/src/org/mapsforge/android/maps/ArrayItemizedTextAudioOverlay.java@ 23977

Last change on this file since 23977 was 23977, checked in by davidb, 13 years ago

Initial set of files for the Tipple project, to be run on an Android device

File size: 1.3 KB
Line 
1package org.mapsforge.android.maps;
2
3import org.greenstone.android.tipple.TippleActivity;
4
5import android.app.AlertDialog;
6import android.content.Context;
7import android.graphics.drawable.Drawable;
8import android.speech.tts.TextToSpeech;
9
10public class ArrayItemizedTextAudioOverlay extends ArrayItemizedOverlayTweaked
11{
12 protected final TextToSpeech tts_;
13 protected AlertDialog dialogAlert;
14
15 public ArrayItemizedTextAudioOverlay(Drawable defaultMarker, Context context, TextToSpeech tts)
16 {
17 super(defaultMarker,context);
18 tts_ = tts;
19 }
20
21 @Override
22 public synchronized boolean onTap(int index) {
23 this.item = this.overlayItems.get(index);
24 this.dialog = new AlertDialog.Builder(this.context);
25 this.dialog.setTitle(this.item.getTitle());
26 this.dialog.setMessage(this.item.getSnippet());
27 dialogAlert = this.dialog.show();
28
29 TippleActivity.log.optMessage("Manual Location Tap", "Title: " + item.getTitle());
30
31 //OverlayTextAudioItem ta_item = (OverlayTextAudioItem)this.overlayItems.get(index);
32 //tts_.speak(ta_item.getTitle(), TextToSpeech.QUEUE_FLUSH, null);
33 //tts_.speak(ta_item.getTTSSnippet(), TextToSpeech.QUEUE_ADD, null);
34
35 return true;
36 }
37
38 public synchronized boolean unTap() {
39
40 dialogAlert.cancel();
41 tts_.stop();
42 return true;
43 }
44}
45
Note: See TracBrowser for help on using the repository browser.