Floating calculator permissions

This commit is contained in:
serso 2016-02-17 13:49:39 +01:00
parent 95b22cd253
commit 14f76fb47b
46 changed files with 195 additions and 39 deletions

View File

@ -123,7 +123,7 @@
android:icon="@drawable/ic_launcher_window" android:icon="@drawable/ic_launcher_window"
android:label="@string/c_app_name_on_screen" android:label="@string/c_app_name_on_screen"
android:launchMode="singleInstance" android:launchMode="singleInstance"
android:theme="@style/Cpp.Theme.Material.Dialog"> android:theme="@style/Cpp.Theme.Translucent">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />

View File

@ -22,11 +22,15 @@
package org.solovyev.android.calculator; package org.solovyev.android.calculator;
import android.app.Activity;
import android.app.Application; import android.app.Application;
import android.content.ActivityNotFoundException;
import android.content.Context; import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.IBinder; import android.os.IBinder;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
@ -37,27 +41,34 @@ import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction; import android.support.v4.app.FragmentTransaction;
import android.text.Spannable; import android.text.Spannable;
import android.text.SpannableString; import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import android.text.style.ForegroundColorSpan; import android.text.style.ForegroundColorSpan;
import android.util.Log;
import android.view.View; import android.view.View;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import com.squareup.otto.Bus; import com.squareup.otto.Bus;
import org.solovyev.android.Check; import org.solovyev.android.Check;
import org.solovyev.android.Views; import org.solovyev.android.Views;
import org.solovyev.android.calculator.floating.FloatingCalculatorService;
import org.solovyev.android.calculator.ga.Ga; import org.solovyev.android.calculator.ga.Ga;
import org.solovyev.android.calculator.language.Languages; 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.view.ScreenMetrics;
import org.solovyev.android.calculator.wizard.CalculatorWizards; import org.solovyev.android.calculator.wizard.CalculatorWizards;
import org.solovyev.android.wizard.Wizards; import org.solovyev.android.wizard.Wizards;
import org.solovyev.common.JPredicate; import org.solovyev.common.JPredicate;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Collection; import java.util.Collection;
import java.util.Formatter;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicInteger; 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. * 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). <br/> * 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). <br/>
@ -335,4 +346,16 @@ public final class App {
imm.hideSoftInputFromWindow(token, 0); 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);
}
}
} }

View File

@ -79,10 +79,13 @@ public abstract class BaseDialogFragment extends DialogFragment implements View.
return button; return button;
} }
protected abstract void onPrepareDialog(@NonNull AlertDialog.Builder builder); protected void onPrepareDialog(@NonNull AlertDialog.Builder builder) {
}
@Nullable @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) { protected void setError(@NonNull TextInputLayout textInput, @StringRes int error, Object... errorArgs) {
setError(textInput, getString(error, errorArgs)); setError(textInput, getString(error, errorArgs));

View File

@ -1,17 +1,20 @@
package org.solovyev.android.calculator.errors; package org.solovyev.android.calculator.errors;
import android.app.Activity; import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentManager;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import org.solovyev.android.Check; 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.annotation.Nonnull;
import javax.inject.Inject; import javax.inject.Inject;
@ -89,10 +92,4 @@ public class FixableErrorFragment extends BaseDialogFragment {
activity = null; activity = null;
} }
} }
@Nullable
@Override
protected View onCreateDialogView(@NonNull Context context, @NonNull LayoutInflater inflater, @Nullable Bundle savedInstanceState) {
return null;
}
} }

View File

@ -22,17 +22,75 @@
package org.solovyev.android.calculator.floating; 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.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 @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
if (FloatingCalculatorView.isOverlayPermissionGranted(this)) {
FloatingCalculatorService.show(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());
} }
} }
}

View File

@ -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.FLAG_IGNORE_VIEW_SETTING;
import static android.view.HapticFeedbackConstants.KEYBOARD_TAP; import static android.view.HapticFeedbackConstants.KEYBOARD_TAP;
import static android.view.HapticFeedbackConstants.LONG_PRESS; 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 static org.solovyev.android.calculator.App.cast;
import android.content.Context; 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) { public void updateDisplayState(@Nonnull DisplayState displayState) {
checkInit(); checkInit();
displayView.setState(displayState); displayView.setState(displayState);
@ -406,24 +427,25 @@ public class FloatingCalculatorView {
final WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); final WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
if (!attached) { if (!attached) {
final WindowManager.LayoutParams params = new WindowManager.LayoutParams( final WindowManager.LayoutParams params = makeLayoutParams();
state.width, params.width = state.width;
state.height, params.height = state.height;
state.x, params.x = state.x;
state.y, params.y = 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);
params.gravity = Gravity.TOP | Gravity.LEFT; params.gravity = Gravity.TOP | Gravity.LEFT;
wm.addView(root, params); wm.addView(root, params);
attached = true; 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() { private void fold() {
if (!folded) { if (!folded) {
headerTitle.setImageDrawable(headerTitleDrawable); headerTitle.setImageDrawable(headerTitleDrawable);

View File

@ -5,4 +5,5 @@
<string name="cpp_prefs_language">اللغة</string> <string name="cpp_prefs_language">اللغة</string>
<string name="cpp_prefs_theme">المظهر</string> <string name="cpp_prefs_theme">المظهر</string>
<string name="cpp_prefs_keep_screen_on">البقاء في الوضع النشط</string> <string name="cpp_prefs_keep_screen_on">البقاء في الوضع النشط</string>
<string name="cpp_permission_overlay">الظهور أمام التطبيقات الأخرى</string>
</resources> </resources>

View File

@ -230,4 +230,6 @@
<string name="cpp_new_in_version">الجديد في الإصدار %1$s</string> <string name="cpp_new_in_version">الجديد في الإصدار %1$s</string>
<string name="cpp_release_notes_choose_theme">هل تريد محاولة المواضيع المادية الجديدة؟ اختر منهم من القائمة:</string> <string name="cpp_release_notes_choose_theme">هل تريد محاولة المواضيع المادية الجديدة؟ اختر منهم من القائمة:</string>
<string name="cpp_system_language">System language</string> <string name="cpp_system_language">System language</string>
<string name="cpp_missing_permission_title">إذن مفقود</string>
<string name="cpp_missing_permission_msg">يرجى تمكين إذن \"%1$s\" في إعدادات النظام</string>
</resources> </resources>

View File

@ -5,4 +5,5 @@
<string name="cpp_prefs_language">Jazyk</string> <string name="cpp_prefs_language">Jazyk</string>
<string name="cpp_prefs_theme">Motiv</string> <string name="cpp_prefs_theme">Motiv</string>
<string name="cpp_prefs_keep_screen_on">Nevypínat obrazovku</string> <string name="cpp_prefs_keep_screen_on">Nevypínat obrazovku</string>
<string name="cpp_permission_overlay">Vykreslení přes další aplikace</string>
</resources> </resources>

View File

@ -230,4 +230,6 @@ Platební informace jsou uloženy na serveru společně s vaším účtem.\n\n K
<string name="cpp_new_in_version">Nové ve verzi %1$s</string> <string name="cpp_new_in_version">Nové ve verzi %1$s</string>
<string name="cpp_release_notes_choose_theme">Chcete vyzkoušet nové Material témata? Vyberte je ze seznamu:</string> <string name="cpp_release_notes_choose_theme">Chcete vyzkoušet nové Material témata? Vyberte je ze seznamu:</string>
<string name="cpp_system_language">System language</string> <string name="cpp_system_language">System language</string>
<string name="cpp_missing_permission_title">Chybějící oprávnění</string>
<string name="cpp_missing_permission_msg">Prosím, povolte v nastaveních systému oprávnění pro \"%1$s\"</string>
</resources> </resources>

View File

@ -5,4 +5,5 @@
<string name="cpp_prefs_language">Sprache</string> <string name="cpp_prefs_language">Sprache</string>
<string name="cpp_prefs_theme">Design</string> <string name="cpp_prefs_theme">Design</string>
<string name="cpp_prefs_keep_screen_on">Aktiv lassen</string> <string name="cpp_prefs_keep_screen_on">Aktiv lassen</string>
<string name="cpp_permission_overlay">Über anderen Apps einblenden</string>
</resources> </resources>

View File

@ -229,4 +229,6 @@ Klicken Sie auf \"Weiter\" und Sie werden zu Google Play weitergeleitet, wo Sie
<string name="cpp_new_in_version">Neu in Version %1$s</string> <string name="cpp_new_in_version">Neu in Version %1$s</string>
<string name="cpp_release_notes_choose_theme">Wollen Sie das neue Material-Design ausprobieren? Wählen sie aus der Liste:</string> <string name="cpp_release_notes_choose_theme">Wollen Sie das neue Material-Design ausprobieren? Wählen sie aus der Liste:</string>
<string name="cpp_system_language">System language</string> <string name="cpp_system_language">System language</string>
<string name="cpp_missing_permission_title">Berechtigung fehlt</string>
<string name="cpp_missing_permission_msg">Bitte aktivieren Sie die Berechtigung \"%1$s\" in den Systemeinstellungen</string>
</resources> </resources>

View File

@ -5,4 +5,5 @@
<string name="cpp_prefs_language">Idioma</string> <string name="cpp_prefs_language">Idioma</string>
<string name="cpp_prefs_theme">Tema</string> <string name="cpp_prefs_theme">Tema</string>
<string name="cpp_prefs_keep_screen_on">Pantalla activa</string> <string name="cpp_prefs_keep_screen_on">Pantalla activa</string>
<string name="cpp_permission_overlay">Escribir sobre otras aplicaciones</string>
</resources> </resources>

View File

@ -229,4 +229,6 @@
<string name="cpp_release_notes_choose_theme">¿Desea probar nuevos temas Material? <string name="cpp_release_notes_choose_theme">¿Desea probar nuevos temas Material?
Escojalos de la lista:</string> Escojalos de la lista:</string>
<string name="cpp_system_language">System language</string> <string name="cpp_system_language">System language</string>
<string name="cpp_missing_permission_title">Falta el permiso</string>
<string name="cpp_missing_permission_msg">Por favor, activa el permiso \"%1$s\" en la configuración del sistema</string>
</resources> </resources>

View File

@ -5,4 +5,5 @@
<string name="cpp_prefs_language">Kieli</string> <string name="cpp_prefs_language">Kieli</string>
<string name="cpp_prefs_theme">Teema</string> <string name="cpp_prefs_theme">Teema</string>
<string name="cpp_prefs_keep_screen_on">Pysy käynnissä</string> <string name="cpp_prefs_keep_screen_on">Pysy käynnissä</string>
<string name="cpp_permission_overlay">Piirrä muihin sovelluksiin</string>
</resources> </resources>

View File

@ -224,4 +224,6 @@
<string name="cpp_new_in_version">Uutta versiossa %1$s</string> <string name="cpp_new_in_version">Uutta versiossa %1$s</string>
<string name="cpp_release_notes_choose_theme">Haluatko kokeilla uusia materiaaliteemoja? Valitse luettelosta:</string> <string name="cpp_release_notes_choose_theme">Haluatko kokeilla uusia materiaaliteemoja? Valitse luettelosta:</string>
<string name="cpp_system_language">System language</string> <string name="cpp_system_language">System language</string>
<string name="cpp_missing_permission_title">Käyttöoikeus puuttuu</string>
<string name="cpp_missing_permission_msg">Salli kohteen \"%1$s\" käyttöoikeus järjestelmäasetuksissa</string>
</resources> </resources>

View File

@ -5,4 +5,5 @@
<string name="cpp_prefs_language">Langue</string> <string name="cpp_prefs_language">Langue</string>
<string name="cpp_prefs_theme">Thème</string> <string name="cpp_prefs_theme">Thème</string>
<string name="cpp_prefs_keep_screen_on">Rester activé</string> <string name="cpp_prefs_keep_screen_on">Rester activé</string>
<string name="cpp_permission_overlay">Se superposer aux autres applis</string>
</resources> </resources>

View File

@ -227,4 +227,6 @@ En cliquant sur le bouton \'Continuer\' vous serez redirigés vers l\'applicatio
<string name="cpp_new_in_version">Nouveautés de la version %1$s</string> <string name="cpp_new_in_version">Nouveautés de la version %1$s</string>
<string name="cpp_release_notes_choose_theme">Voulez-vous essayer les nouveaux thèmes Material ? Choisissez-en dans la liste :</string> <string name="cpp_release_notes_choose_theme">Voulez-vous essayer les nouveaux thèmes Material ? Choisissez-en dans la liste :</string>
<string name="cpp_system_language">System language</string> <string name="cpp_system_language">System language</string>
<string name="cpp_missing_permission_title">Autorisation manquante</string>
<string name="cpp_missing_permission_msg">Veuillez activer l\'autorisation \"%1$s\" dans les réglages systèmes</string>
</resources> </resources>

View File

@ -5,4 +5,5 @@
<string name="cpp_prefs_language">Lingua</string> <string name="cpp_prefs_language">Lingua</string>
<string name="cpp_prefs_theme">Tema</string> <string name="cpp_prefs_theme">Tema</string>
<string name="cpp_prefs_keep_screen_on">Rimani attivo</string> <string name="cpp_prefs_keep_screen_on">Rimani attivo</string>
<string name="cpp_permission_overlay">Spostamento su altre app</string>
</resources> </resources>

View File

@ -235,4 +235,6 @@ premendo \'continua\' sarai indirizzato all\'applicazione Google play per effett
<string name="cpp_new_in_version">Novità nella versione %1$s</string> <string name="cpp_new_in_version">Novità nella versione %1$s</string>
<string name="cpp_release_notes_choose_theme">Vuoi provare nuove temi Material design? Selezionali dalla lista:</string> <string name="cpp_release_notes_choose_theme">Vuoi provare nuove temi Material design? Selezionali dalla lista:</string>
<string name="cpp_system_language">System language</string> <string name="cpp_system_language">System language</string>
<string name="cpp_missing_permission_title">Permesso assente</string>
<string name="cpp_missing_permission_msg">Per favore garantisci il permesso: \"%1$s\" nelle impostazioni</string>
</resources> </resources>

View File

@ -5,4 +5,5 @@
<string name="cpp_prefs_language">言語</string> <string name="cpp_prefs_language">言語</string>
<string name="cpp_prefs_theme">テーマ</string> <string name="cpp_prefs_theme">テーマ</string>
<string name="cpp_prefs_keep_screen_on">スリープモードにしない</string> <string name="cpp_prefs_keep_screen_on">スリープモードにしない</string>
<string name="cpp_permission_overlay">他のアプリの上に重ねて描画</string>
</resources> </resources>

View File

@ -236,4 +236,6 @@
<string name="cpp_new_in_version">%1$sバージョンの新機能</string> <string name="cpp_new_in_version">%1$sバージョンの新機能</string>
<string name="cpp_release_notes_choose_theme">新しいマテリアルテーマを試してみたいですか?リストから選択してください:</string> <string name="cpp_release_notes_choose_theme">新しいマテリアルテーマを試してみたいですか?リストから選択してください:</string>
<string name="cpp_system_language">System language</string> <string name="cpp_system_language">System language</string>
<string name="cpp_missing_permission_title">不足している権限</string>
<string name="cpp_missing_permission_msg">システム設定で \"%1$s\" へのアクセス権限を許可してください</string>
</resources> </resources>

View File

@ -5,4 +5,5 @@
<string name="cpp_prefs_language">Taal</string> <string name="cpp_prefs_language">Taal</string>
<string name="cpp_prefs_theme">Thema</string> <string name="cpp_prefs_theme">Thema</string>
<string name="cpp_prefs_keep_screen_on">Stand-by</string> <string name="cpp_prefs_keep_screen_on">Stand-by</string>
<string name="cpp_permission_overlay">Over andere apps tekenen</string>
</resources> </resources>

View File

@ -228,4 +228,6 @@ Door op volgende te drukken, wordt u doorverwezen naar de Google Play store om d
<string name="cpp_new_in_version">Nieuw in versie %1$s</string> <string name="cpp_new_in_version">Nieuw in versie %1$s</string>
<string name="cpp_release_notes_choose_theme">Wilt u nieuwe Material themes proberen? Kies ze uit de lijst:</string> <string name="cpp_release_notes_choose_theme">Wilt u nieuwe Material themes proberen? Kies ze uit de lijst:</string>
<string name="cpp_system_language">System language</string> <string name="cpp_system_language">System language</string>
<string name="cpp_missing_permission_title">Toestemming ontbreekt</string>
<string name="cpp_missing_permission_msg">Schakel \"%1$s\" toestemming in in systeeminstellingen</string>
</resources> </resources>

View File

@ -5,4 +5,5 @@
<string name="cpp_prefs_language">Język</string> <string name="cpp_prefs_language">Język</string>
<string name="cpp_prefs_theme">Motyw</string> <string name="cpp_prefs_theme">Motyw</string>
<string name="cpp_prefs_keep_screen_on">Pozostaw ekran włączony</string> <string name="cpp_prefs_keep_screen_on">Pozostaw ekran włączony</string>
<string name="cpp_permission_overlay">Wyświetlanie nad innymi aplikacjami</string>
</resources> </resources>

View File

@ -228,4 +228,6 @@ Proszę, oceń Calculator++ \nna<a href="https://market.android.com/details?id=o
<string name="cpp_new_in_version">Nowści w wersji %1$s</string> <string name="cpp_new_in_version">Nowści w wersji %1$s</string>
<string name="cpp_release_notes_choose_theme">Czy chcesz wypróbować nowe motywy Material? Wybierz je z listy:</string> <string name="cpp_release_notes_choose_theme">Czy chcesz wypróbować nowe motywy Material? Wybierz je z listy:</string>
<string name="cpp_system_language">System language</string> <string name="cpp_system_language">System language</string>
<string name="cpp_missing_permission_title">Brak uprawnienia</string>
<string name="cpp_missing_permission_msg">Włącz uprawnienie „\"%1$s\"” w ustawieniach systemu</string>
</resources> </resources>

View File

@ -5,4 +5,5 @@
<string name="cpp_prefs_language">Idioma</string> <string name="cpp_prefs_language">Idioma</string>
<string name="cpp_prefs_theme">Tema</string> <string name="cpp_prefs_theme">Tema</string>
<string name="cpp_prefs_keep_screen_on">Permanecer ativo</string> <string name="cpp_prefs_keep_screen_on">Permanecer ativo</string>
<string name="cpp_permission_overlay">Sobrepor a outros apps</string>
</resources> </resources>

View File

@ -224,4 +224,6 @@
<string name="cpp_new_in_version">Novo na versão %1$s</string> <string name="cpp_new_in_version">Novo na versão %1$s</string>
<string name="cpp_release_notes_choose_theme">Você deseja testar novos temas? Escolha-os pela lista:</string> <string name="cpp_release_notes_choose_theme">Você deseja testar novos temas? Escolha-os pela lista:</string>
<string name="cpp_system_language">System language</string> <string name="cpp_system_language">System language</string>
<string name="cpp_missing_permission_title">Sem permissão</string>
<string name="cpp_missing_permission_msg">Habilite a permissão de \"%1$s\" nas configurações do sistema</string>
</resources> </resources>

View File

@ -5,4 +5,5 @@
<string name="cpp_prefs_language">Idioma</string> <string name="cpp_prefs_language">Idioma</string>
<string name="cpp_prefs_theme">Tema</string> <string name="cpp_prefs_theme">Tema</string>
<string name="cpp_prefs_keep_screen_on">Manter ativo</string> <string name="cpp_prefs_keep_screen_on">Manter ativo</string>
<string name="cpp_permission_overlay">Sobrepor a outras aplicações</string>
</resources> </resources>

View File

@ -224,4 +224,6 @@
<string name="cpp_new_in_version">New in %1$s version</string> <string name="cpp_new_in_version">New in %1$s version</string>
<string name="cpp_release_notes_choose_theme">Do you want to try new Material themes? Choose them from the list:</string> <string name="cpp_release_notes_choose_theme">Do you want to try new Material themes? Choose them from the list:</string>
<string name="cpp_system_language">System language</string> <string name="cpp_system_language">System language</string>
<string name="cpp_missing_permission_title">Sem permissão</string>
<string name="cpp_missing_permission_msg">Por favor active as permissões de \"%1$s\" nas definiçõe de sistema</string>
</resources> </resources>

View File

@ -5,4 +5,5 @@
<string name="cpp_prefs_language">Язык</string> <string name="cpp_prefs_language">Язык</string>
<string name="cpp_prefs_theme">Тема</string> <string name="cpp_prefs_theme">Тема</string>
<string name="cpp_prefs_keep_screen_on">Не выключать экран</string> <string name="cpp_prefs_keep_screen_on">Не выключать экран</string>
<string name="cpp_permission_overlay">Наложение поверх других окон</string>
</resources> </resources>

View File

@ -269,4 +269,6 @@
<string name="cpp_new_in_version">Новое в версии %1$s</string> <string name="cpp_new_in_version">Новое в версии %1$s</string>
<string name="cpp_release_notes_choose_theme">Хотите попробовать новые темы в стиле Матириал? Выберите их из списка:</string> <string name="cpp_release_notes_choose_theme">Хотите попробовать новые темы в стиле Матириал? Выберите их из списка:</string>
<string name="cpp_system_language">Язык системы</string> <string name="cpp_system_language">Язык системы</string>
<string name="cpp_missing_permission_title">Отсутствует разрешение</string>
<string name="cpp_missing_permission_msg">В системных настройках разрешите приложению доступ к следующему компоненту:\"%1$s\"</string>
</resources> </resources>

View File

@ -5,4 +5,5 @@
<string name="cpp_prefs_language">Dil</string> <string name="cpp_prefs_language">Dil</string>
<string name="cpp_prefs_theme">Tema</string> <string name="cpp_prefs_theme">Tema</string>
<string name="cpp_prefs_keep_screen_on">Uyanık kal</string> <string name="cpp_prefs_keep_screen_on">Uyanık kal</string>
<string name="cpp_permission_overlay">Diğer uygl. üzerinde görüntüle</string>
</resources> </resources>

View File

@ -227,4 +227,6 @@ Google Play</a>,\n yorum yazın yada \n uygulamayı tartışın \non
<string name="cpp_new_in_version">%1$s sürümünde yeni</string> <string name="cpp_new_in_version">%1$s sürümünde yeni</string>
<string name="cpp_release_notes_choose_theme">Yeni materyal temaları denemek istiyor musunuz?Listeden seçin:</string> <string name="cpp_release_notes_choose_theme">Yeni materyal temaları denemek istiyor musunuz?Listeden seçin:</string>
<string name="cpp_system_language">System language</string> <string name="cpp_system_language">System language</string>
<string name="cpp_missing_permission_title">Eksik izin</string>
<string name="cpp_missing_permission_msg">\"%1$s\" Sistem ayarlarından izini etkinleştir</string>
</resources> </resources>

View File

@ -240,4 +240,6 @@
<string name="cpp_new_in_version">Нове у версії %1$s</string> <string name="cpp_new_in_version">Нове у версії %1$s</string>
<string name="cpp_release_notes_choose_theme">Кортить спробувати нові теми Матеріал? Вибирайте одну з них у списку:</string> <string name="cpp_release_notes_choose_theme">Кортить спробувати нові теми Матеріал? Вибирайте одну з них у списку:</string>
<string name="cpp_system_language">System language</string> <string name="cpp_system_language">System language</string>
<string name="cpp_missing_permission_title">Бракує дозволу</string>
<string name="cpp_missing_permission_msg">Будь ласка, відкрийте доступ до додатка \"%1$s\" у параметрах системи</string>
</resources> </resources>

View File

@ -5,4 +5,5 @@
<string name="cpp_prefs_language">Ngôn ngữ</string> <string name="cpp_prefs_language">Ngôn ngữ</string>
<string name="cpp_prefs_theme">Chủ đề</string> <string name="cpp_prefs_theme">Chủ đề</string>
<string name="cpp_prefs_keep_screen_on">Không khóa màn hình</string> <string name="cpp_prefs_keep_screen_on">Không khóa màn hình</string>
<string name="cpp_permission_overlay">Vẽ lên trên ứng dụng khác</string>
</resources> </resources>

View File

@ -230,4 +230,6 @@ Qua việc click nút \'Tiếp tục\' bạn được chuyển qua úng dụng G
<string name="cpp_new_in_version">Mới trong phiên bản %1$s</string> <string name="cpp_new_in_version">Mới trong phiên bản %1$s</string>
<string name="cpp_release_notes_choose_theme">Bạn có muốn thử chủ đề Material mới? Chọn chúng từ danh sách:</string> <string name="cpp_release_notes_choose_theme">Bạn có muốn thử chủ đề Material mới? Chọn chúng từ danh sách:</string>
<string name="cpp_system_language">System language</string> <string name="cpp_system_language">System language</string>
<string name="cpp_missing_permission_title">Thiếu quyền</string>
<string name="cpp_missing_permission_msg">Vui lòng cho bật \"%1$s\" Quyền trong thiết lập hệ thống</string>
</resources> </resources>

View File

@ -5,4 +5,5 @@
<string name="cpp_prefs_language">语言</string> <string name="cpp_prefs_language">语言</string>
<string name="cpp_prefs_theme">主题背景</string> <string name="cpp_prefs_theme">主题背景</string>
<string name="cpp_prefs_keep_screen_on">不锁定屏幕</string> <string name="cpp_prefs_keep_screen_on">不锁定屏幕</string>
<string name="cpp_permission_overlay">在其他应用的上层显示</string>
</resources> </resources>

View File

@ -227,4 +227,6 @@
<string name="cpp_new_in_version">%1$s 版本的新功能</string> <string name="cpp_new_in_version">%1$s 版本的新功能</string>
<string name="cpp_release_notes_choose_theme">你想尝试新的Material Design主题吗请从列表中选择</string> <string name="cpp_release_notes_choose_theme">你想尝试新的Material Design主题吗请从列表中选择</string>
<string name="cpp_system_language">System language</string> <string name="cpp_system_language">System language</string>
<string name="cpp_missing_permission_title">缺失许可</string>
<string name="cpp_missing_permission_msg">请在系统设置中启用 \"%1$s\" 许可</string>
</resources> </resources>

View File

@ -5,4 +5,5 @@
<string name="cpp_prefs_language">語言</string> <string name="cpp_prefs_language">語言</string>
<string name="cpp_prefs_theme">主題</string> <string name="cpp_prefs_theme">主題</string>
<string name="cpp_prefs_keep_screen_on">螢幕不休眠</string> <string name="cpp_prefs_keep_screen_on">螢幕不休眠</string>
<string name="cpp_permission_overlay">在其他應用程式上層繪製內容</string>
</resources> </resources>

View File

@ -230,4 +230,6 @@ Google Play</a>\n留下評論或是\n討論這個應用程式\n於
<string name="cpp_new_in_version">%1$s 版本的新功能</string> <string name="cpp_new_in_version">%1$s 版本的新功能</string>
<string name="cpp_release_notes_choose_theme">你想要嘗試新的 Material 主題風格嗎? 從清單中選擇:</string> <string name="cpp_release_notes_choose_theme">你想要嘗試新的 Material 主題風格嗎? 從清單中選擇:</string>
<string name="cpp_system_language">System language</string> <string name="cpp_system_language">System language</string>
<string name="cpp_missing_permission_title">缺少權限</string>
<string name="cpp_missing_permission_msg">請在系統設定中啟用 \"%1$s\" 權限</string>
</resources> </resources>

View File

@ -5,4 +5,5 @@
<string name="cpp_prefs_language">Language</string> <string name="cpp_prefs_language">Language</string>
<string name="cpp_prefs_theme">Theme</string> <string name="cpp_prefs_theme">Theme</string>
<string name="cpp_prefs_keep_screen_on">Stay awake</string> <string name="cpp_prefs_keep_screen_on">Stay awake</string>
<string name="cpp_permission_overlay">Draw over other apps</string>
</resources> </resources>

View File

@ -237,4 +237,6 @@
<string name="cpp_release_notes_choose_theme">Do you want to try new Material themes? Choose them from the list:</string> <string name="cpp_release_notes_choose_theme">Do you want to try new Material themes? Choose them from the list:</string>
<string name="cpp_dont_show_again">Don\'t show again</string> <string name="cpp_dont_show_again">Don\'t show again</string>
<string name="cpp_system_language">System language</string> <string name="cpp_system_language">System language</string>
<string name="cpp_missing_permission_title">Missing permission</string>
<string name="cpp_missing_permission_msg">Please enable \"%1$s\" permission in system settings</string>
</resources> </resources>

View File

@ -40,13 +40,11 @@
<item name="android:listDivider">@drawable/divider_dark</item> <item name="android:listDivider">@drawable/divider_dark</item>
</style> </style>
<style name="Cpp.Theme.Translucent" parent="Cpp.Theme"> <style name="Cpp.Theme.Translucent" parent="Cpp.Theme.Dialog">
<item name="windowActionBar">false</item> <item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item> <item name="windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowNoTitle">true</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item> <item name="android:windowIsTranslucent">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
</style> </style>
<style name="Cpp.Theme.Dialog" parent="@style/Theme.AppCompat.Dialog"> <style name="Cpp.Theme.Dialog" parent="@style/Theme.AppCompat.Dialog">

View File

@ -69,9 +69,7 @@
<style name="Cpp.Theme.Material.Dialog" parent="Cpp.Theme.Dialog"> <style name="Cpp.Theme.Material.Dialog" parent="Cpp.Theme.Dialog">
<item name="cpp_button_style_digit">@style/CppKeyboardButton.Material.Digit</item> <item name="cpp_button_style_digit">@style/CppKeyboardButton.Material.Digit</item>
<item name="cpp_button_style_control">@style/CppKeyboardButton.Material.Digit</item> <item name="cpp_button_style_control">@style/CppKeyboardButton.Material.Digit</item>
<item name="cpp_button_style_control_image"> <item name="cpp_button_style_control_image">@style/CppKeyboardButton.Material.Control.Image</item>
@style/CppKeyboardButton.Material.Control.Image
</item>
<item name="cpp_button_style_operation">@style/CppKeyboardButton.Material.Operation</item> <item name="cpp_button_style_operation">@style/CppKeyboardButton.Material.Operation</item>
</style> </style>

View File

@ -31,6 +31,7 @@ public class Android {
translationLinks.add(new TranslationLink("phone_language", "cpp_prefs_language")); translationLinks.add(new TranslationLink("phone_language", "cpp_prefs_language"));
translationLinks.add(new TranslationLink("night_mode_title", "cpp_prefs_theme")); 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("keep_screen_on", "cpp_prefs_keep_screen_on"));
translationLinks.add(new TranslationLink("draw_overlay", "cpp_permission_overlay"));
List<String> languageLocales = new ArrayList<>(Utils.languageLocales); List<String> languageLocales = new ArrayList<>(Utils.languageLocales);
languageLocales.add(""); languageLocales.add("");