From 14f76fb47b8f5553acd6c196da3efb1d48fc5c5d Mon Sep 17 00:00:00 2001 From: serso Date: Wed, 17 Feb 2016 13:49:39 +0100 Subject: [PATCH] Floating calculator permissions --- app/src/main/AndroidManifest.xml | 2 +- .../org/solovyev/android/calculator/App.java | 29 +++++++- .../calculator/BaseDialogFragment.java | 7 +- .../errors/FixableErrorFragment.java | 17 ++--- .../floating/FloatingCalculatorActivity.java | 66 +++++++++++++++++-- .../floating/FloatingCalculatorView.java | 46 +++++++++---- app/src/main/res/values-ar/text_imported.xml | 1 + app/src/main/res/values-ar/text_strings.xml | 2 + app/src/main/res/values-cs/text_imported.xml | 1 + app/src/main/res/values-cs/text_strings.xml | 2 + app/src/main/res/values-de/text_imported.xml | 1 + app/src/main/res/values-de/text_strings.xml | 2 + app/src/main/res/values-es/text_imported.xml | 1 + app/src/main/res/values-es/text_strings.xml | 2 + app/src/main/res/values-fi/text_imported.xml | 1 + app/src/main/res/values-fi/text_strings.xml | 2 + app/src/main/res/values-fr/text_imported.xml | 1 + app/src/main/res/values-fr/text_strings.xml | 2 + app/src/main/res/values-it/text_imported.xml | 1 + app/src/main/res/values-it/text_strings.xml | 2 + app/src/main/res/values-ja/text_imported.xml | 1 + app/src/main/res/values-ja/text_strings.xml | 2 + app/src/main/res/values-nl/text_imported.xml | 1 + app/src/main/res/values-nl/text_strings.xml | 2 + app/src/main/res/values-pl/text_imported.xml | 1 + app/src/main/res/values-pl/text_strings.xml | 2 + .../main/res/values-pt-rBR/text_imported.xml | 1 + .../main/res/values-pt-rBR/text_strings.xml | 2 + .../main/res/values-pt-rPT/text_imported.xml | 1 + .../main/res/values-pt-rPT/text_strings.xml | 2 + app/src/main/res/values-ru/text_imported.xml | 1 + app/src/main/res/values-ru/text_strings.xml | 2 + app/src/main/res/values-tr/text_imported.xml | 1 + app/src/main/res/values-tr/text_strings.xml | 2 + app/src/main/res/values-uk/text_strings.xml | 2 + app/src/main/res/values-vi/text_imported.xml | 1 + app/src/main/res/values-vi/text_strings.xml | 2 + .../main/res/values-zh-rCN/text_imported.xml | 1 + .../main/res/values-zh-rCN/text_strings.xml | 2 + .../main/res/values-zh-rTW/text_imported.xml | 1 + .../main/res/values-zh-rTW/text_strings.xml | 2 + app/src/main/res/values/text_imported.xml | 1 + app/src/main/res/values/text_strings.xml | 2 + app/src/main/res/values/theme.xml | 6 +- app/src/main/res/values/theme_material.xml | 4 +- .../android/translations/Android.java | 1 + 46 files changed, 195 insertions(+), 39 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 207a72cc..82a03149 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -123,7 +123,7 @@ android:icon="@drawable/ic_launcher_window" android:label="@string/c_app_name_on_screen" android:launchMode="singleInstance" - android:theme="@style/Cpp.Theme.Material.Dialog"> + android:theme="@style/Cpp.Theme.Translucent"> diff --git a/app/src/main/java/org/solovyev/android/calculator/App.java b/app/src/main/java/org/solovyev/android/calculator/App.java index 6d37bc37..a95ed149 100644 --- a/app/src/main/java/org/solovyev/android/calculator/App.java +++ b/app/src/main/java/org/solovyev/android/calculator/App.java @@ -22,11 +22,15 @@ package org.solovyev.android.calculator; +import android.app.Activity; import android.app.Application; +import android.content.ActivityNotFoundException; import android.content.Context; +import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.content.res.Configuration; +import android.net.Uri; import android.os.Build; import android.os.IBinder; import android.preference.PreferenceManager; @@ -37,27 +41,34 @@ import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.text.Spannable; import android.text.SpannableString; +import android.text.SpannableStringBuilder; import android.text.style.ForegroundColorSpan; +import android.util.Log; import android.view.View; import android.view.inputmethod.InputMethodManager; + import com.squareup.otto.Bus; + import org.solovyev.android.Check; import org.solovyev.android.Views; +import org.solovyev.android.calculator.floating.FloatingCalculatorService; import org.solovyev.android.calculator.ga.Ga; import org.solovyev.android.calculator.language.Languages; -import org.solovyev.android.calculator.floating.FloatingCalculatorService; import org.solovyev.android.calculator.view.ScreenMetrics; import org.solovyev.android.calculator.wizard.CalculatorWizards; import org.solovyev.android.wizard.Wizards; import org.solovyev.common.JPredicate; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import java.util.Collection; +import java.util.Formatter; import java.util.List; +import java.util.Locale; import java.util.concurrent.Executor; import java.util.concurrent.atomic.AtomicInteger; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + /** * This class aggregates several useful in any Android application interfaces and provides access to {@link android.app.Application} object from a static context. * NOTE: use this class only if you don't use and dependency injection library (if you use any you can directly set interfaces through it).
@@ -335,4 +346,16 @@ public final class App { imm.hideSoftInputFromWindow(token, 0); } } + + public static void showSystemPermissionSettings(@NonNull Activity activity, + @NonNull String action) { + try { + final Intent intent = new Intent(action); + intent.setData(Uri.parse("package:" + activity.getPackageName())); + activity.startActivity(intent); + } catch (ActivityNotFoundException e) { + Log.e(TAG, + "Failed to show permission settings for " + action, e); + } + } } \ No newline at end of file diff --git a/app/src/main/java/org/solovyev/android/calculator/BaseDialogFragment.java b/app/src/main/java/org/solovyev/android/calculator/BaseDialogFragment.java index 71f2860e..2e627b84 100644 --- a/app/src/main/java/org/solovyev/android/calculator/BaseDialogFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/BaseDialogFragment.java @@ -79,10 +79,13 @@ public abstract class BaseDialogFragment extends DialogFragment implements View. return button; } - protected abstract void onPrepareDialog(@NonNull AlertDialog.Builder builder); + protected void onPrepareDialog(@NonNull AlertDialog.Builder builder) { + } @Nullable - protected abstract View onCreateDialogView(@NonNull Context context, @NonNull LayoutInflater inflater, @Nullable Bundle savedInstanceState); + protected View onCreateDialogView(@NonNull Context context, @NonNull LayoutInflater inflater, @Nullable Bundle savedInstanceState) { + return null; + } protected void setError(@NonNull TextInputLayout textInput, @StringRes int error, Object... errorArgs) { setError(textInput, getString(error, errorArgs)); diff --git a/app/src/main/java/org/solovyev/android/calculator/errors/FixableErrorFragment.java b/app/src/main/java/org/solovyev/android/calculator/errors/FixableErrorFragment.java index 46edbde4..d20b867e 100644 --- a/app/src/main/java/org/solovyev/android/calculator/errors/FixableErrorFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/errors/FixableErrorFragment.java @@ -1,17 +1,20 @@ package org.solovyev.android.calculator.errors; import android.app.Activity; -import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.FragmentManager; import android.support.v7.app.AlertDialog; -import android.view.LayoutInflater; -import android.view.View; + import org.solovyev.android.Check; -import org.solovyev.android.calculator.*; +import org.solovyev.android.calculator.App; +import org.solovyev.android.calculator.AppComponent; +import org.solovyev.android.calculator.BaseDialogFragment; +import org.solovyev.android.calculator.Preferences; +import org.solovyev.android.calculator.PreferredPreferences; +import org.solovyev.android.calculator.R; import javax.annotation.Nonnull; import javax.inject.Inject; @@ -89,10 +92,4 @@ public class FixableErrorFragment extends BaseDialogFragment { activity = null; } } - - @Nullable - @Override - protected View onCreateDialogView(@NonNull Context context, @NonNull LayoutInflater inflater, @Nullable Bundle savedInstanceState) { - return null; - } } diff --git a/app/src/main/java/org/solovyev/android/calculator/floating/FloatingCalculatorActivity.java b/app/src/main/java/org/solovyev/android/calculator/floating/FloatingCalculatorActivity.java index 5fa4c8ce..1618e204 100644 --- a/app/src/main/java/org/solovyev/android/calculator/floating/FloatingCalculatorActivity.java +++ b/app/src/main/java/org/solovyev/android/calculator/floating/FloatingCalculatorActivity.java @@ -22,17 +22,75 @@ package org.solovyev.android.calculator.floating; -import android.app.Activity; +import android.annotation.TargetApi; +import android.content.DialogInterface; +import android.os.Build; import android.os.Bundle; +import android.provider.Settings; +import android.support.annotation.NonNull; +import android.support.v4.app.FragmentActivity; +import android.support.v7.app.AlertDialog; +import android.support.v7.app.AppCompatActivity; + +import org.solovyev.android.Check; +import org.solovyev.android.calculator.App; +import org.solovyev.android.calculator.BaseDialogFragment; +import org.solovyev.android.calculator.R; + +public class FloatingCalculatorActivity extends AppCompatActivity { + + @TargetApi(Build.VERSION_CODES.M) + public static final class MyFragment extends BaseDialogFragment { + + @Override + protected void onPrepareDialog(@NonNull AlertDialog.Builder builder) { + final String permission = getString(R.string.cpp_permission_overlay); + builder.setMessage(getString(R.string.cpp_missing_permission_msg, permission)); + builder.setTitle(R.string.cpp_missing_permission_title); + builder.setPositiveButton(R.string.ok, this); + } + + @Override + public void onClick(DialogInterface dialog, int which) { + switch (which) { + case DialogInterface.BUTTON_POSITIVE: + final FragmentActivity activity = getActivity(); + App.showSystemPermissionSettings(activity, + Settings.ACTION_MANAGE_OVERLAY_PERMISSION); + dismiss(); + break; + default: + super.onClick(dialog, which); + break; + } + } + + @Override + public void onDismiss(DialogInterface dialog) { + super.onDismiss(dialog); + final FragmentActivity activity = getActivity(); + if (activity != null) { + activity.finish(); + } + } + } -public class FloatingCalculatorActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - FloatingCalculatorService.show(this); + if (FloatingCalculatorView.isOverlayPermissionGranted(this)) { + FloatingCalculatorService.show(this); + finish(); + return; + } - this.finish(); + Check.isTrue(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M); + if (savedInstanceState == null) { + App.showDialog(new MyFragment(), "no-overlay-permission-dialog", + getSupportFragmentManager()); + } } + } diff --git a/app/src/main/java/org/solovyev/android/calculator/floating/FloatingCalculatorView.java b/app/src/main/java/org/solovyev/android/calculator/floating/FloatingCalculatorView.java index f9a07b4b..62633587 100644 --- a/app/src/main/java/org/solovyev/android/calculator/floating/FloatingCalculatorView.java +++ b/app/src/main/java/org/solovyev/android/calculator/floating/FloatingCalculatorView.java @@ -26,6 +26,10 @@ import static android.view.HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING; import static android.view.HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING; import static android.view.HapticFeedbackConstants.KEYBOARD_TAP; import static android.view.HapticFeedbackConstants.LONG_PRESS; +import static android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; +import static android.view.WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL; +import static android.view.WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH; +import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_ALERT; import static org.solovyev.android.calculator.App.cast; import android.content.Context; @@ -281,6 +285,23 @@ public class FloatingCalculatorView { } } + static boolean isOverlayPermissionGranted(@NonNull Context context) { + try { + final Context application = context.getApplicationContext(); + final WindowManager wm = + (WindowManager) application.getSystemService(Context.WINDOW_SERVICE); + if (wm == null) { + return false; + } + final View view = new View(application); + wm.addView(view, makeLayoutParams()); + wm.removeView(view); + return true; + } catch (Exception e) { + return false; + } + } + public void updateDisplayState(@Nonnull DisplayState displayState) { checkInit(); displayView.setState(displayState); @@ -406,24 +427,25 @@ public class FloatingCalculatorView { final WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); if (!attached) { - final WindowManager.LayoutParams params = new WindowManager.LayoutParams( - state.width, - state.height, - state.x, - state.y, - WindowManager.LayoutParams.TYPE_SYSTEM_ALERT, - WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE - | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL - | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH, - PixelFormat.TRANSLUCENT); - + final WindowManager.LayoutParams params = makeLayoutParams(); + params.width = state.width; + params.height = state.height; + params.x = state.x; + params.y = state.y; params.gravity = Gravity.TOP | Gravity.LEFT; - wm.addView(root, params); attached = true; } } + @Nonnull + private static WindowManager.LayoutParams makeLayoutParams() { + return new WindowManager.LayoutParams( + TYPE_SYSTEM_ALERT, + FLAG_NOT_FOCUSABLE | FLAG_NOT_TOUCH_MODAL | FLAG_WATCH_OUTSIDE_TOUCH, + PixelFormat.TRANSLUCENT); + } + private void fold() { if (!folded) { headerTitle.setImageDrawable(headerTitleDrawable); diff --git a/app/src/main/res/values-ar/text_imported.xml b/app/src/main/res/values-ar/text_imported.xml index 7c39c5a9..c831131c 100644 --- a/app/src/main/res/values-ar/text_imported.xml +++ b/app/src/main/res/values-ar/text_imported.xml @@ -5,4 +5,5 @@ اللغة المظهر البقاء في الوضع النشط + الظهور أمام التطبيقات الأخرى \ No newline at end of file diff --git a/app/src/main/res/values-ar/text_strings.xml b/app/src/main/res/values-ar/text_strings.xml index d62d201a..ee4f6854 100644 --- a/app/src/main/res/values-ar/text_strings.xml +++ b/app/src/main/res/values-ar/text_strings.xml @@ -230,4 +230,6 @@ الجديد في الإصدار %1$s هل تريد محاولة المواضيع المادية الجديدة؟ اختر منهم من القائمة: System language + إذن مفقود + يرجى تمكين إذن \"%1$s\" في إعدادات النظام diff --git a/app/src/main/res/values-cs/text_imported.xml b/app/src/main/res/values-cs/text_imported.xml index 9ba6263e..1c5af800 100644 --- a/app/src/main/res/values-cs/text_imported.xml +++ b/app/src/main/res/values-cs/text_imported.xml @@ -5,4 +5,5 @@ Jazyk Motiv Nevypínat obrazovku + Vykreslení přes další aplikace \ No newline at end of file diff --git a/app/src/main/res/values-cs/text_strings.xml b/app/src/main/res/values-cs/text_strings.xml index 5f3e43f1..c5665810 100644 --- a/app/src/main/res/values-cs/text_strings.xml +++ b/app/src/main/res/values-cs/text_strings.xml @@ -230,4 +230,6 @@ Platební informace jsou uloženy na serveru společně s vaším účtem.\n\n K Nové ve verzi %1$s Chcete vyzkoušet nové Material témata? Vyberte je ze seznamu: System language + Chybějící oprávnění + Prosím, povolte v nastaveních systému oprávnění pro \"%1$s\" diff --git a/app/src/main/res/values-de/text_imported.xml b/app/src/main/res/values-de/text_imported.xml index cb9da5e0..6261d69d 100644 --- a/app/src/main/res/values-de/text_imported.xml +++ b/app/src/main/res/values-de/text_imported.xml @@ -5,4 +5,5 @@ Sprache Design Aktiv lassen + Über anderen Apps einblenden \ No newline at end of file diff --git a/app/src/main/res/values-de/text_strings.xml b/app/src/main/res/values-de/text_strings.xml index 4477bb3d..07b4ecb8 100644 --- a/app/src/main/res/values-de/text_strings.xml +++ b/app/src/main/res/values-de/text_strings.xml @@ -229,4 +229,6 @@ Klicken Sie auf \"Weiter\" und Sie werden zu Google Play weitergeleitet, wo Sie Neu in Version %1$s Wollen Sie das neue Material-Design ausprobieren? Wählen sie aus der Liste: System language + Berechtigung fehlt + Bitte aktivieren Sie die Berechtigung \"%1$s\" in den Systemeinstellungen diff --git a/app/src/main/res/values-es/text_imported.xml b/app/src/main/res/values-es/text_imported.xml index bb74c841..6e69924c 100644 --- a/app/src/main/res/values-es/text_imported.xml +++ b/app/src/main/res/values-es/text_imported.xml @@ -5,4 +5,5 @@ Idioma Tema Pantalla activa + Escribir sobre otras aplicaciones \ No newline at end of file diff --git a/app/src/main/res/values-es/text_strings.xml b/app/src/main/res/values-es/text_strings.xml index f14df0ba..ae761c34 100644 --- a/app/src/main/res/values-es/text_strings.xml +++ b/app/src/main/res/values-es/text_strings.xml @@ -229,4 +229,6 @@ ¿Desea probar nuevos temas Material? Escojalos de la lista: System language + Falta el permiso + Por favor, activa el permiso \"%1$s\" en la configuración del sistema diff --git a/app/src/main/res/values-fi/text_imported.xml b/app/src/main/res/values-fi/text_imported.xml index a0f3ebb6..70d56d23 100644 --- a/app/src/main/res/values-fi/text_imported.xml +++ b/app/src/main/res/values-fi/text_imported.xml @@ -5,4 +5,5 @@ Kieli Teema Pysy käynnissä + Piirrä muihin sovelluksiin \ No newline at end of file diff --git a/app/src/main/res/values-fi/text_strings.xml b/app/src/main/res/values-fi/text_strings.xml index bd181b0d..45b52d4d 100644 --- a/app/src/main/res/values-fi/text_strings.xml +++ b/app/src/main/res/values-fi/text_strings.xml @@ -224,4 +224,6 @@ Uutta versiossa %1$s Haluatko kokeilla uusia materiaaliteemoja? Valitse luettelosta: System language + Käyttöoikeus puuttuu + Salli kohteen \"%1$s\" käyttöoikeus järjestelmäasetuksissa diff --git a/app/src/main/res/values-fr/text_imported.xml b/app/src/main/res/values-fr/text_imported.xml index c92983df..d0beffef 100644 --- a/app/src/main/res/values-fr/text_imported.xml +++ b/app/src/main/res/values-fr/text_imported.xml @@ -5,4 +5,5 @@ Langue Thème Rester activé + Se superposer aux autres applis \ No newline at end of file diff --git a/app/src/main/res/values-fr/text_strings.xml b/app/src/main/res/values-fr/text_strings.xml index 3bc9cdd7..3d6622d2 100644 --- a/app/src/main/res/values-fr/text_strings.xml +++ b/app/src/main/res/values-fr/text_strings.xml @@ -227,4 +227,6 @@ En cliquant sur le bouton \'Continuer\' vous serez redirigés vers l\'applicatio Nouveautés de la version %1$s Voulez-vous essayer les nouveaux thèmes Material ? Choisissez-en dans la liste : System language + Autorisation manquante + Veuillez activer l\'autorisation \"%1$s\" dans les réglages systèmes diff --git a/app/src/main/res/values-it/text_imported.xml b/app/src/main/res/values-it/text_imported.xml index bde8abf4..4e8ba1fe 100644 --- a/app/src/main/res/values-it/text_imported.xml +++ b/app/src/main/res/values-it/text_imported.xml @@ -5,4 +5,5 @@ Lingua Tema Rimani attivo + Spostamento su altre app \ No newline at end of file diff --git a/app/src/main/res/values-it/text_strings.xml b/app/src/main/res/values-it/text_strings.xml index 1f5fc7a2..ebd225d4 100644 --- a/app/src/main/res/values-it/text_strings.xml +++ b/app/src/main/res/values-it/text_strings.xml @@ -235,4 +235,6 @@ premendo \'continua\' sarai indirizzato all\'applicazione Google play per effett Novità nella versione %1$s Vuoi provare nuove temi Material design? Selezionali dalla lista: System language + Permesso assente + Per favore garantisci il permesso: \"%1$s\" nelle impostazioni diff --git a/app/src/main/res/values-ja/text_imported.xml b/app/src/main/res/values-ja/text_imported.xml index d07d1181..9133dccb 100644 --- a/app/src/main/res/values-ja/text_imported.xml +++ b/app/src/main/res/values-ja/text_imported.xml @@ -5,4 +5,5 @@ 言語 テーマ スリープモードにしない + 他のアプリの上に重ねて描画 \ No newline at end of file diff --git a/app/src/main/res/values-ja/text_strings.xml b/app/src/main/res/values-ja/text_strings.xml index cd3470c5..2dc04d0c 100644 --- a/app/src/main/res/values-ja/text_strings.xml +++ b/app/src/main/res/values-ja/text_strings.xml @@ -236,4 +236,6 @@ %1$sバージョンの新機能 新しいマテリアルテーマを試してみたいですか?リストから選択してください: System language + 不足している権限 + システム設定で \"%1$s\" へのアクセス権限を許可してください diff --git a/app/src/main/res/values-nl/text_imported.xml b/app/src/main/res/values-nl/text_imported.xml index 1460c85d..3679345d 100644 --- a/app/src/main/res/values-nl/text_imported.xml +++ b/app/src/main/res/values-nl/text_imported.xml @@ -5,4 +5,5 @@ Taal Thema Stand-by + Over andere apps tekenen \ No newline at end of file diff --git a/app/src/main/res/values-nl/text_strings.xml b/app/src/main/res/values-nl/text_strings.xml index 9a991a11..3ea8991b 100644 --- a/app/src/main/res/values-nl/text_strings.xml +++ b/app/src/main/res/values-nl/text_strings.xml @@ -228,4 +228,6 @@ Door op volgende te drukken, wordt u doorverwezen naar de Google Play store om d Nieuw in versie %1$s Wilt u nieuwe Material themes proberen? Kies ze uit de lijst: System language + Toestemming ontbreekt + Schakel \"%1$s\" toestemming in in systeeminstellingen diff --git a/app/src/main/res/values-pl/text_imported.xml b/app/src/main/res/values-pl/text_imported.xml index 420bafba..ae2cc32c 100644 --- a/app/src/main/res/values-pl/text_imported.xml +++ b/app/src/main/res/values-pl/text_imported.xml @@ -5,4 +5,5 @@ Język Motyw Pozostaw ekran włączony + Wyświetlanie nad innymi aplikacjami \ No newline at end of file diff --git a/app/src/main/res/values-pl/text_strings.xml b/app/src/main/res/values-pl/text_strings.xml index ead9c2e2..9e10d026 100644 --- a/app/src/main/res/values-pl/text_strings.xml +++ b/app/src/main/res/values-pl/text_strings.xml @@ -228,4 +228,6 @@ Proszę, oceń Calculator++ \nnaNowści w wersji %1$s Czy chcesz wypróbować nowe motywy Material? Wybierz je z listy: System language + Brak uprawnienia + Włącz uprawnienie „\"%1$s\"” w ustawieniach systemu diff --git a/app/src/main/res/values-pt-rBR/text_imported.xml b/app/src/main/res/values-pt-rBR/text_imported.xml index 937b472d..025efe52 100644 --- a/app/src/main/res/values-pt-rBR/text_imported.xml +++ b/app/src/main/res/values-pt-rBR/text_imported.xml @@ -5,4 +5,5 @@ Idioma Tema Permanecer ativo + Sobrepor a outros apps \ No newline at end of file diff --git a/app/src/main/res/values-pt-rBR/text_strings.xml b/app/src/main/res/values-pt-rBR/text_strings.xml index 6848886a..f2f96a7e 100644 --- a/app/src/main/res/values-pt-rBR/text_strings.xml +++ b/app/src/main/res/values-pt-rBR/text_strings.xml @@ -224,4 +224,6 @@ Novo na versão %1$s Você deseja testar novos temas? Escolha-os pela lista: System language + Sem permissão + Habilite a permissão de \"%1$s\" nas configurações do sistema diff --git a/app/src/main/res/values-pt-rPT/text_imported.xml b/app/src/main/res/values-pt-rPT/text_imported.xml index e47cd050..84dd9990 100644 --- a/app/src/main/res/values-pt-rPT/text_imported.xml +++ b/app/src/main/res/values-pt-rPT/text_imported.xml @@ -5,4 +5,5 @@ Idioma Tema Manter ativo + Sobrepor a outras aplicações \ No newline at end of file diff --git a/app/src/main/res/values-pt-rPT/text_strings.xml b/app/src/main/res/values-pt-rPT/text_strings.xml index a57ca624..9ad2c08c 100644 --- a/app/src/main/res/values-pt-rPT/text_strings.xml +++ b/app/src/main/res/values-pt-rPT/text_strings.xml @@ -224,4 +224,6 @@ New in %1$s version Do you want to try new Material themes? Choose them from the list: System language + Sem permissão + Por favor active as permissões de \"%1$s\" nas definiçõe de sistema diff --git a/app/src/main/res/values-ru/text_imported.xml b/app/src/main/res/values-ru/text_imported.xml index cd5f0f62..f9aee806 100644 --- a/app/src/main/res/values-ru/text_imported.xml +++ b/app/src/main/res/values-ru/text_imported.xml @@ -5,4 +5,5 @@ Язык Тема Не выключать экран + Наложение поверх других окон \ No newline at end of file diff --git a/app/src/main/res/values-ru/text_strings.xml b/app/src/main/res/values-ru/text_strings.xml index 58e44fa9..a5191921 100644 --- a/app/src/main/res/values-ru/text_strings.xml +++ b/app/src/main/res/values-ru/text_strings.xml @@ -269,4 +269,6 @@ Новое в версии %1$s Хотите попробовать новые темы в стиле Матириал? Выберите их из списка: Язык системы + Отсутствует разрешение + В системных настройках разрешите приложению доступ к следующему компоненту:\"%1$s\" diff --git a/app/src/main/res/values-tr/text_imported.xml b/app/src/main/res/values-tr/text_imported.xml index 9f10898e..0bffc4a1 100644 --- a/app/src/main/res/values-tr/text_imported.xml +++ b/app/src/main/res/values-tr/text_imported.xml @@ -5,4 +5,5 @@ Dil Tema Uyanık kal + Diğer uygl. üzerinde görüntüle \ No newline at end of file diff --git a/app/src/main/res/values-tr/text_strings.xml b/app/src/main/res/values-tr/text_strings.xml index 0dded81c..bb252fb5 100644 --- a/app/src/main/res/values-tr/text_strings.xml +++ b/app/src/main/res/values-tr/text_strings.xml @@ -227,4 +227,6 @@ Google Play,\n yorum yazın yada \n uygulamayı tartışın \non %1$s sürümünde yeni Yeni materyal temaları denemek istiyor musunuz?Listeden seçin: System language + Eksik izin + \"%1$s\" Sistem ayarlarından izini etkinleştir diff --git a/app/src/main/res/values-uk/text_strings.xml b/app/src/main/res/values-uk/text_strings.xml index e5a59d16..dd7fdd81 100644 --- a/app/src/main/res/values-uk/text_strings.xml +++ b/app/src/main/res/values-uk/text_strings.xml @@ -240,4 +240,6 @@ Нове у версії %1$s Кортить спробувати нові теми Матеріал? Вибирайте одну з них у списку: System language + Бракує дозволу + Будь ласка, відкрийте доступ до додатка \"%1$s\" у параметрах системи diff --git a/app/src/main/res/values-vi/text_imported.xml b/app/src/main/res/values-vi/text_imported.xml index 4fdec80a..3c0cce5e 100644 --- a/app/src/main/res/values-vi/text_imported.xml +++ b/app/src/main/res/values-vi/text_imported.xml @@ -5,4 +5,5 @@ Ngôn ngữ Chủ đề Không khóa màn hình + Vẽ lên trên ứng dụng khác \ No newline at end of file diff --git a/app/src/main/res/values-vi/text_strings.xml b/app/src/main/res/values-vi/text_strings.xml index ad6feec1..104858dd 100644 --- a/app/src/main/res/values-vi/text_strings.xml +++ b/app/src/main/res/values-vi/text_strings.xml @@ -230,4 +230,6 @@ Qua việc click nút \'Tiếp tục\' bạn được chuyển qua úng dụng G Mới trong phiên bản %1$s Bạn có muốn thử chủ đề Material mới? Chọn chúng từ danh sách: System language + Thiếu quyền + Vui lòng cho bật \"%1$s\" Quyền trong thiết lập hệ thống diff --git a/app/src/main/res/values-zh-rCN/text_imported.xml b/app/src/main/res/values-zh-rCN/text_imported.xml index b57c8a63..cebdfe2e 100644 --- a/app/src/main/res/values-zh-rCN/text_imported.xml +++ b/app/src/main/res/values-zh-rCN/text_imported.xml @@ -5,4 +5,5 @@ 语言 主题背景 不锁定屏幕 + 在其他应用的上层显示 \ No newline at end of file diff --git a/app/src/main/res/values-zh-rCN/text_strings.xml b/app/src/main/res/values-zh-rCN/text_strings.xml index e359e7bb..b45f8d3e 100644 --- a/app/src/main/res/values-zh-rCN/text_strings.xml +++ b/app/src/main/res/values-zh-rCN/text_strings.xml @@ -227,4 +227,6 @@ %1$s 版本的新功能 你想尝试新的Material Design主题吗?请从列表中选择: System language + 缺失许可 + 请在系统设置中启用 \"%1$s\" 许可 diff --git a/app/src/main/res/values-zh-rTW/text_imported.xml b/app/src/main/res/values-zh-rTW/text_imported.xml index 5b52d938..1abd56de 100644 --- a/app/src/main/res/values-zh-rTW/text_imported.xml +++ b/app/src/main/res/values-zh-rTW/text_imported.xml @@ -5,4 +5,5 @@ 語言 主題 螢幕不休眠 + 在其他應用程式上層繪製內容 \ No newline at end of file diff --git a/app/src/main/res/values-zh-rTW/text_strings.xml b/app/src/main/res/values-zh-rTW/text_strings.xml index ecf026be..81059538 100644 --- a/app/src/main/res/values-zh-rTW/text_strings.xml +++ b/app/src/main/res/values-zh-rTW/text_strings.xml @@ -230,4 +230,6 @@ Google Play,\n留下評論或是\n討論這個應用程式\n於 %1$s 版本的新功能 你想要嘗試新的 Material 主題風格嗎? 從清單中選擇: System language + 缺少權限 + 請在系統設定中啟用 \"%1$s\" 權限 diff --git a/app/src/main/res/values/text_imported.xml b/app/src/main/res/values/text_imported.xml index 1aad04eb..8def7aec 100644 --- a/app/src/main/res/values/text_imported.xml +++ b/app/src/main/res/values/text_imported.xml @@ -5,4 +5,5 @@ Language Theme Stay awake + Draw over other apps \ No newline at end of file diff --git a/app/src/main/res/values/text_strings.xml b/app/src/main/res/values/text_strings.xml index 969f4ed9..f2621e50 100644 --- a/app/src/main/res/values/text_strings.xml +++ b/app/src/main/res/values/text_strings.xml @@ -237,4 +237,6 @@ Do you want to try new Material themes? Choose them from the list: Don\'t show again System language + Missing permission + Please enable \"%1$s\" permission in system settings diff --git a/app/src/main/res/values/theme.xml b/app/src/main/res/values/theme.xml index 39d907c4..ef5b791d 100644 --- a/app/src/main/res/values/theme.xml +++ b/app/src/main/res/values/theme.xml @@ -40,13 +40,11 @@ @drawable/divider_dark - diff --git a/translations/src/main/java/org/solovyev/android/translations/Android.java b/translations/src/main/java/org/solovyev/android/translations/Android.java index de3b1118..4a67d2e6 100644 --- a/translations/src/main/java/org/solovyev/android/translations/Android.java +++ b/translations/src/main/java/org/solovyev/android/translations/Android.java @@ -31,6 +31,7 @@ public class Android { translationLinks.add(new TranslationLink("phone_language", "cpp_prefs_language")); translationLinks.add(new TranslationLink("night_mode_title", "cpp_prefs_theme")); translationLinks.add(new TranslationLink("keep_screen_on", "cpp_prefs_keep_screen_on")); + translationLinks.add(new TranslationLink("draw_overlay", "cpp_permission_overlay")); List languageLocales = new ArrayList<>(Utils.languageLocales); languageLocales.add("");