mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-10 08:13:55 +00:00
Add an 'Update voices' button to manually trigger an update.
This commit is contained in:
+22
-2
@@ -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" />
|
||||
|
||||
|
||||
@@ -127,5 +127,6 @@
|
||||
<item>4x</item>
|
||||
<item>5x</item>
|
||||
</string-array>
|
||||
<string name="update_voices">Update voices</string>
|
||||
|
||||
</resources>
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user