mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-24 12:28:10 +00:00
Add directBoot support. Fixes #917
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Beka Gozalishvili
|
||||
* Copyright (C) 2013 Reece H. Dunn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -20,6 +21,7 @@ import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.SharedPreferences;
|
||||
import android.preference.DialogPreference;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
@@ -113,6 +115,8 @@ public class SeekBarPreference extends DialogPreference implements SeekBar.OnSee
|
||||
String text = Integer.toString(mProgress);
|
||||
callChangeListener(text);
|
||||
if (shouldCommit()) {
|
||||
PreferenceManager preferenceManager = getPreferenceManager();
|
||||
preferenceManager.setStorageDeviceProtected ();
|
||||
SharedPreferences.Editor editor = getEditor();
|
||||
editor.putString(getKey(), text);
|
||||
editor.commit();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Beka Gozalishvili
|
||||
* Copyright (C) 2013 Reece H. Dunn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -20,6 +21,7 @@ import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.SharedPreferences;
|
||||
import android.preference.DialogPreference;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.text.Editable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
@@ -128,6 +130,8 @@ public class SpeakPunctuationPreference extends DialogPreference {
|
||||
onDataChanged(level, characters);
|
||||
|
||||
if (shouldCommit()) {
|
||||
PreferenceManager preferenceManager = getPreferenceManager();
|
||||
preferenceManager.setStorageDeviceProtected();
|
||||
SharedPreferences.Editor editor = getEditor();
|
||||
if (editor != null) {
|
||||
editor.putString(VoiceSettings.PREF_PUNCTUATION_CHARACTERS, characters);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Beka Gozalishvili
|
||||
* Copyright (C) 2013 Reece H. Dunn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -21,6 +22,7 @@ import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.SharedPreferences;
|
||||
import android.preference.DialogPreference;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -328,6 +330,8 @@ public class VoiceVariantPreference extends DialogPreference {
|
||||
case DialogInterface.BUTTON_POSITIVE:
|
||||
onDataChanged();
|
||||
if (shouldCommit()) {
|
||||
PreferenceManager preferenceManager = getPreferenceManager();
|
||||
preferenceManager.setStorageDeviceProtected();
|
||||
SharedPreferences.Editor editor = getEditor();
|
||||
if (editor != null) {
|
||||
VoiceVariant variant = variants[mCategoryIndex][mVariantIndex].getVariant();
|
||||
|
||||
Reference in New Issue
Block a user