From bbd7edf2a6f25ebe4cf8b6d34f9b76cec69f2a6d Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 2 Jan 2021 17:29:16 +0100 Subject: [PATCH] Add toast on click --- .../settings/fragments/VoiceAnnouncesFragment.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/VoiceAnnouncesFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/VoiceAnnouncesFragment.java index 5ed061928d..156cbd9d90 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/VoiceAnnouncesFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/VoiceAnnouncesFragment.java @@ -9,6 +9,7 @@ import android.view.LayoutInflater; import android.view.View; import android.widget.ImageView; import android.widget.TextView; +import android.widget.Toast; import androidx.appcompat.widget.SwitchCompat; import androidx.core.content.ContextCompat; @@ -110,8 +111,16 @@ public class VoiceAnnouncesFragment extends BaseSettingsFragment implements OnPr private void updateVoicePromptsTimes() { Preference pref = findPreference("voice_prompts_timetable"); if (OsmandPlugin.isDevelopment()) { - AnnounceTimeDistances atd = new AnnounceTimeDistances(getSelectedAppMode(), settings); + final AnnounceTimeDistances atd = new AnnounceTimeDistances(getSelectedAppMode(), settings); pref.setSummary(atd.getTurnsDescription().trim()); + pref.setEnabled(true); + pref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { + @Override + public boolean onPreferenceClick(Preference preference) { + app.showToastMessage(atd.getTurnsDescription().trim()); + return true; + } + }); } else { pref.setVisible(false); }