Browse Source

Add an 'Update voices' button to manually trigger an update.

master
Reece H. Dunn 12 years ago
parent
commit
9f2137a8ff

+ 22
- 2
res/layout/main.xml View File

@@ -88,8 +88,30 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="-4dp"
android:orientation="vertical" >

<LinearLayout
android:id="@+id/updateVoicesLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content" >

<Button
android:id="@+id/updateVoices"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/update_voices" />

<TextView
android:id="@+id/textView3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceLarge" />

</LinearLayout>

<LinearLayout
android:id="@+id/engineSettingsLayout"
android:layout_width="match_parent"
@@ -99,7 +121,6 @@
android:id="@+id/engineSettings"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="-4dp"
android:layout_weight="0.5"
android:text="@string/engine_settings" />

@@ -120,7 +141,6 @@
android:id="@+id/ttsSettings"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="-4dp"
android:layout_weight="0.5"
android:text="@string/tts_settings" />


+ 1
- 0
res/values/strings.xml View File

@@ -127,5 +127,6 @@
<item>4x</item>
<item>5x</item>
</string-array>
<string name="update_voices">Update voices</string>

</resources>

+ 4
- 0
src/com/googlecode/eyesfree/espeak/eSpeakActivity.java View File

@@ -192,6 +192,7 @@ public class eSpeakActivity extends Activity {
final TextView availableVoices = (TextView) findViewById(R.id.availableVoices);
availableVoices.setText(Integer.toString(mVoices.size()));

findViewById(R.id.updateVoices).setOnClickListener(mOnClickListener);
findViewById(R.id.ttsSettings).setOnClickListener(mOnClickListener);
findViewById(R.id.engineSettings).setOnClickListener(mOnClickListener);

@@ -301,6 +302,9 @@ public class eSpeakActivity extends Activity {
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.updateVoices:
downloadVoiceData();
break;
case R.id.engineSettings:
startActivityForResult(
new Intent(eSpeakActivity.this, TtsSettingsActivity.class),

Loading…
Cancel
Save