mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-21 05:43:37 +00:00
[android] Explain why the TTS button doesn't work when no engine installed
Signed-off-by: Harry Bond <me@hbond.xyz>
This commit is contained in:
committed by
Konstantin Pastbin
parent
eaeae8f31d
commit
a338a18590
@@ -3,6 +3,7 @@ package app.organicmaps.widget.menu;
|
|||||||
import android.location.Location;
|
import android.location.Location;
|
||||||
import android.util.Pair;
|
import android.util.Pair;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.Toast;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
@@ -10,6 +11,7 @@ import app.organicmaps.MwmApplication;
|
|||||||
import app.organicmaps.R;
|
import app.organicmaps.R;
|
||||||
import app.organicmaps.sdk.routing.RoutingInfo;
|
import app.organicmaps.sdk.routing.RoutingInfo;
|
||||||
import app.organicmaps.sdk.sound.TtsPlayer;
|
import app.organicmaps.sdk.sound.TtsPlayer;
|
||||||
|
import app.organicmaps.sdk.util.Config;
|
||||||
import app.organicmaps.sdk.util.StringUtils;
|
import app.organicmaps.sdk.util.StringUtils;
|
||||||
import app.organicmaps.util.Graphics;
|
import app.organicmaps.util.Graphics;
|
||||||
import app.organicmaps.util.ThemeUtils;
|
import app.organicmaps.util.ThemeUtils;
|
||||||
@@ -125,6 +127,8 @@ public class NavMenu
|
|||||||
|
|
||||||
private void onTtsClicked()
|
private void onTtsClicked()
|
||||||
{
|
{
|
||||||
|
if (!TtsPlayer.isReady())
|
||||||
|
Toast.makeText(mActivity, R.string.pref_tts_no_system_tts_short, Toast.LENGTH_SHORT).show();
|
||||||
TtsPlayer.setEnabled(!TtsPlayer.isEnabled());
|
TtsPlayer.setEnabled(!TtsPlayer.isEnabled());
|
||||||
refreshTts();
|
refreshTts();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -941,4 +941,5 @@
|
|||||||
<!-- Title of the bottom sheet when sharing the track -->
|
<!-- Title of the bottom sheet when sharing the track -->
|
||||||
<string name="share_track">Share Track</string>
|
<string name="share_track">Share Track</string>
|
||||||
<string name="delete_track_dialog_title">Delete %s?</string>
|
<string name="delete_track_dialog_title">Delete %s?</string>
|
||||||
|
<string name="pref_tts_no_system_tts_short">No text-to-speech engine found, check the app settings</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ public enum TtsPlayer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isReady()
|
public static boolean isReady()
|
||||||
{
|
{
|
||||||
return (INSTANCE.mTts != null && !INSTANCE.mUnavailable && !INSTANCE.mInitializing);
|
return (INSTANCE.mTts != null && !INSTANCE.mUnavailable && !INSTANCE.mInitializing);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user