text-to-speech icon indicating copy to clipboard operation
text-to-speech copied to clipboard

feat (settings): Open Native Settings

Open dtrigo opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe: It would be great to implement a method to launch system's TTS Settings.

Describe the solution you'd like: A new method like

@PluginMethod
    public void openTTSSettings(PluginCall call) {
        JSObject ret = new JSObject();
        final PackageManager manager = getContext().getPackageManager();
        Intent launchIntent = new Intent("com.android.settings.TTS_SETTINGS");

        try {
            getActivity().startActivity(launchIntent);
            ret.put("completed", true);
        } catch (Exception ex) {
            launchIntent = manager.getLaunchIntentForPackage(url);
            try {
                getActivity().startActivity(launchIntent);
                ret.put("completed", true);
            } catch (Exception expgk) {
                ret.put("completed", false);
            }
        }
        call.resolve(ret);
    }

dtrigo avatar Feb 21 '23 11:02 dtrigo