mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-08 06:42:21 -04:00
Text to speech button should now be visible #411
This commit is contained in:
parent
75e4ecce7c
commit
42c4e03250
@ -522,9 +522,9 @@ public class KiwixMobileActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
private void setUpTTS() {
|
||||
tts = new KiwixTextToSpeech(this, new KiwixTextToSpeech.OnInitSucceedListener() {
|
||||
@Override
|
||||
public void onInitSucceed() {
|
||||
tts = new KiwixTextToSpeech(this, () -> {
|
||||
if (menu != null) {
|
||||
menu.findItem(R.id.menu_read_aloud).setVisible(true);
|
||||
}
|
||||
}, new KiwixTextToSpeech.OnSpeakingListener() {
|
||||
@Override
|
||||
@ -555,9 +555,7 @@ public class KiwixMobileActivity extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
|
||||
pauseTTSButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
pauseTTSButton.setOnClickListener(view -> {
|
||||
if (tts.currentTTSTask == null) {
|
||||
tts.stop();
|
||||
return;
|
||||
@ -570,7 +568,6 @@ public class KiwixMobileActivity extends AppCompatActivity {
|
||||
tts.pauseOrResume();
|
||||
pauseTTSButton.setText(R.string.tts_resume);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
stopTTSButton.setOnClickListener((View view) -> tts.stop());
|
||||
|
@ -51,9 +51,7 @@ public class KiwixTextToSpeech {
|
||||
}
|
||||
|
||||
private void initTTS(final OnInitSucceedListener onInitSucceedListener) {
|
||||
tts = new TextToSpeech(context, new TextToSpeech.OnInitListener() {
|
||||
@Override
|
||||
public void onInit(int status) {
|
||||
tts = new TextToSpeech(context, status -> {
|
||||
if (status == TextToSpeech.SUCCESS) {
|
||||
Log.d(TAG_KIWIX, "TextToSpeech was initialized successfully.");
|
||||
initialized = true;
|
||||
@ -61,7 +59,6 @@ public class KiwixTextToSpeech {
|
||||
} else {
|
||||
Log.e(TAG_KIWIX, "Initilization of TextToSpeech Failed!");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user