fixes + more translations

This commit is contained in:
gdlbo
2022-06-08 15:14:34 +03:00
parent c5bf617f65
commit f701993b0f
12 changed files with 86 additions and 38 deletions
@@ -1,5 +1,7 @@
package ru.vtosters.lite.downloaders;
import static ru.vtosters.lite.utils.Globals.getString;
import android.app.AlertDialog;
import android.app.DownloadManager;
import android.content.Context;
@@ -48,7 +50,7 @@ public class VideoDownloader {
}
if (list.isEmpty()) {
ToastUtils.a("Данное видео невозможно скачать");
ToastUtils.a(getString("videodownloaderr"));
return;
}
@@ -2,6 +2,7 @@ package ru.vtosters.lite.f0x1d;
import static ru.vtosters.lite.utils.About.getBuildNumber;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getString;
import android.app.Activity;
import android.app.Notification;
@@ -60,13 +61,13 @@ public class Crashreporter {
var builder = new Notification.Builder(getContext());
builder.setSmallIcon(R.drawable.ic_bug_24);
builder.setContentTitle("Произошла ошибка в работе VTLite!");
builder.setContentTitle(getString("vtl_crashed"));
builder.setContentText(logString);
builder.setStyle(new Notification.BigTextStyle().bigText(logString));
builder.setAutoCancel(true);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {
builder.addAction(new Notification.Action(0, "Загрузить логи", PendingIntent.getActivity(getContext(), (int) (Math.random() * 100.0d), foxbinIntent, PendingIntent.FLAG_CANCEL_CURRENT)));
builder.addAction(new Notification.Action(0, "Сохранить в файл", psaveLogIntent));
builder.addAction(new Notification.Action(0, getString("vtl_crash_upload"), PendingIntent.getActivity(getContext(), (int) (Math.random() * 100.0d), foxbinIntent, PendingIntent.FLAG_CANCEL_CURRENT)));
builder.addAction(new Notification.Action(0, getString("vtl_crash_save"), psaveLogIntent));
} else {
builder.setContentIntent(PendingIntent.getActivity(activity, 0, foxbinIntent, PendingIntent.FLAG_ONE_SHOT));
}
@@ -63,7 +63,7 @@ public class FoafBase {
public static void loadAndShow(Context context, int i) {
ProgressDialog progressDialog = new ProgressDialog(context);
progressDialog.setMessage("Загрузка...");
progressDialog.setMessage(getString("com_facebook_loading"));
progressDialog.setCancelable(false);
progressDialog.show();
@@ -2,6 +2,7 @@ package ru.vtosters.lite.ui.dialogs;
import static ru.vtosters.lite.utils.Globals.edit;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getString;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import android.app.Activity;
@@ -21,10 +22,10 @@ public class DisableBattery {
final Context context = getContext();
if (!((PowerManager) context.getSystemService(Context.POWER_SERVICE)).isIgnoringBatteryOptimizations(context.getPackageName())) {
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle("Выключите оптимизацию батареи!");
builder.setMessage("Из-за того, что Вы используете оболочку из списка ниже - уведомления могут приходить с задержкой или не приходить вовсе. \n Для того, чтобы это исправить - нажмите на кнопку \"Отключить оптимизацию\". \n\nПрошивки на которых наблюдаются проблемы с пушами:\nFlyme, EMUI, MIUI, ColorOS, Samsung Experience или TouchWiz, Magic UI, ZenUI, Funtouch OS");
builder.setTitle(getString("batteryissuetitle"));
builder.setMessage(getString("batteryissuesumm"));
builder.setCancelable(false);
builder.setPositiveButton("Отключить оптимизацию", new DialogInterface.OnClickListener() {
builder.setPositiveButton(getString("batteryissuebtn1"), new DialogInterface.OnClickListener() {
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
Intent intent = new Intent("android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS");
@@ -35,7 +36,7 @@ public class DisableBattery {
context.startActivity(intent);
}
});
builder.setNeutralButton("Игнорировать", new DialogInterface.OnClickListener() {
builder.setNeutralButton(getString("batteryissuebtn2"), new DialogInterface.OnClickListener() {
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
edit().putBoolean("showDoze", false).apply();
@@ -2,6 +2,7 @@ package ru.vtosters.lite.ui.dialogs;
import static ru.vtosters.lite.utils.Globals.edit;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getString;
import static ru.vtosters.lite.utils.Globals.isGmsInstalled;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
@@ -19,17 +20,17 @@ public class InstallGMS {
public static void alert(final Activity activity) {
if (!isGmsInstalled()) {
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle("Внимание!");
builder.setMessage(Text());
builder.setTitle(getString("debug_warning"));
builder.setMessage(getString("gmsissuesumm"));
builder.setCancelable(false);
builder.setPositiveButton("Продолжить без GMS", new DialogInterface.OnClickListener() {
builder.setPositiveButton(getString("gmsissuebtn1"), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
edit().putBoolean("showAlertGms", false).apply();
}
});
builder.setNeutralButton("Установить GMS", new DialogInterface.OnClickListener() {
builder.setNeutralButton(getString("gmsissuebtn2"), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
@@ -44,8 +45,4 @@ public class InstallGMS {
}
}
}
private static String Text() {
return "На вашем устройстве отсутствует компонент Google Play Services (GMS), который необходим для корректной работы VTosters Lite";
}
}
@@ -1,6 +1,7 @@
package ru.vtosters.lite.ui.dialogs;
import static ru.vtosters.lite.utils.Globals.edit;
import static ru.vtosters.lite.utils.Globals.getString;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import android.app.Activity;
@@ -18,17 +19,17 @@ public class Start {
activity.requestPermissions(new String[]{"android.permission.WRITE_EXTERNAL_STORAGE"}, 228);
}
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle("Внимание!");
builder.setTitle(getString("debug_warning"));
builder.setMessage(getWelcome());
builder.setCancelable(false);
builder.setPositiveButton("Продолжить", new DialogInterface.OnClickListener() {
builder.setPositiveButton(getString("startbtn2"), new DialogInterface.OnClickListener() {
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
edit().putBoolean("showAlert", false).apply();
}
});
builder.setNeutralButton("Новости", new DialogInterface.OnClickListener() {
builder.setNeutralButton(getString("startbtn1"), new DialogInterface.OnClickListener() {
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
@@ -42,9 +43,12 @@ public class Start {
}
private static String getWelcome() {
if (!OEMDetector.isOEM()) {
return "Модификация VTosters Lite не имеет никакого отношения к VK Group!\nРаспространяется полностью бесплатно!";
String Default = getString("startsumm1");
if (OEMDetector.isOEM()){
return Default + getString("startsumm2");
}
return "Модификация VTosters Lite не имеет никакого отношения к VK Group!\nРаспространяется полностью бесплатно!\n\nПриложение может некорректно работать в связи с тем, что вы, скорее всего, используете оболочку из списка ниже. Все проблемы с отображением и работой приложения связаны только с вашей прошивкой и только с ней. Все багрепорты, присланные из-за проблем на этой прошивке, не рассматриваются разработчиками и не будут исправлены.\n\nНажимая на кнопку \"Продолжить\", вы соглашаетесь с тем, что возможные баги приложения могут произойти из-за специфики вашей прошивки. Рекомендуем использовать прошивки на базе AOSP для получения максимальной стабильности.\n\nПрошивки на которых наблюдаются проблемы с приложениями:\nFlyme, EMUI, MIUI, ColorOS, Samsung Experience или TouchWiz, Magic UI, ZenUI, Funtouch OS";
return Default;
}
}
@@ -1,6 +1,6 @@
package ru.vtosters.lite.ui.fragments.dockbar;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getResources;
import static ru.vtosters.lite.utils.Themes.getAccentColor;
import android.content.res.ColorStateList;
@@ -63,7 +63,7 @@ public class DockBarInjector {
for (DockBarTab tab : sManager.getSelectedTabs()) {
MenuItem add = menu.add(0, tab.id, 0, tab.titleID);
Drawable drawable = getContext().getResources().getDrawable(tab.iconID);
Drawable drawable = getResources().getDrawable(tab.iconID);
ColorStateList dockcolors = new ColorStateList(
new int[][]{
new int[]{android.R.attr.state_checked},
@@ -1,6 +1,6 @@
package ru.vtosters.lite.ui.fragments.tgstickers;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getIdentifier;
import static ru.vtosters.lite.utils.Globals.getString;
import android.os.Bundle;
@@ -19,7 +19,7 @@ public class StickersPreferencesFragment extends MaterialPreferenceToolbarFragme
public void b(Bundle bundle) {
super.b(bundle);
int vtosterXml = getContext().getResources().getIdentifier("empty", "xml", getContext().getPackageName());
int vtosterXml = getIdentifier("empty", "xml");
this.a(vtosterXml);
PreferencesUtil.addPreferenceCategory(this, getString("sprefsstickers"));
@@ -85,7 +85,7 @@ public class StickersPreferencesFragment extends MaterialPreferenceToolbarFragme
@Override
public int aq() {
return getContext().getResources().getIdentifier("vtltgs", "string", getContext().getPackageName());
return getIdentifier("vtltgs", "string");
}
}
@@ -140,7 +140,7 @@ public class Globals {
} // Get res id
public static String getString(String resourcename) {
return getContext().getString(Integer.parseInt(String.valueOf(getContext().getResources().getIdentifier(resourcename, "string", getContext().getPackageName()))));
return getContext().getString(getIdentifier(resourcename, "string"));
} // Get string via getIdentifier
public static String getPackageName() {
@@ -148,7 +148,7 @@ public class Globals {
}
public static int convertDpToPixel(float f) {
return (int) (f * ((float) getContext().getResources().getDisplayMetrics().densityDpi / 160.0f));
return (int) (f * ((float) getResources().getDisplayMetrics().densityDpi / 160.0f));
}
public static SharedPreferences getPreferences() {
@@ -2,8 +2,9 @@ package ru.vtosters.lite.utils;
import static android.view.View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
import static java.util.Arrays.asList;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getIdentifier;
import static ru.vtosters.lite.utils.Globals.getPrefsValue;
import static ru.vtosters.lite.utils.Globals.getResources;
import static ru.vtosters.lite.utils.Preferences.color_grishka;
import static ru.vtosters.lite.utils.Preferences.isBGStickersEnabled;
import static ru.vtosters.lite.utils.Preferences.navbar;
@@ -71,19 +72,19 @@ public class Themes {
} // Header/Toolbar color text
public static int getAmoledTheme() {
return getContext().getResources().getIdentifier("BaseAmoledStyle", "style", getContext().getPackageName());
return getIdentifier("BaseAmoledStyle", "style");
} // Get Amoled theme id
public static int picFix() {
return getContext().getResources().getIdentifier("ActionBarThemeFix", "style", getContext().getPackageName());
return getIdentifier("ActionBarThemeFix", "style");
} // Fix tabbar color in photo viewer
public static int getAmoledImTheme() {
return getContext().getResources().getIdentifier("VkIm.Theme.VkApp.Amoled", "style", getContext().getPackageName());
return getIdentifier("VkIm.Theme.VkApp.Amoled", "style");
} // Get Amoled theme id for messages
public static int getAttrId(String attr) {
return getContext().getResources().getIdentifier(attr, "attr", getContext().getPackageName());
return getIdentifier(attr, "attr");
}
public static void setBarTheme(View getview) {
@@ -234,14 +235,14 @@ public class Themes {
if (Build.VERSION.SDK_INT >= 23) {
return context.getColor(i);
}
return context.getResources().getColor(i);
return getResources().getColor(i);
} // Android Support color injector + accent color checker
public static int getColor2(int i) {
if (isColorRefAccented(i) && isAndroidMonet()) {
return getAccentColor();
}
return getContext().getResources().getColor(i);
return getResources().getColor(i);
} // Android Support color injector + accent color checker
public static void setNavbarColor(Window window, int i) {
@@ -293,7 +294,7 @@ public class Themes {
public static void systemThemeChanger() {
if (!systemtheme())
return;
int currentNightMode = getContext().getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
int currentNightMode = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
switch (currentNightMode) {
case Configuration.UI_MODE_NIGHT_UNDEFINED:
applyTheme(getLightTheme(), getImLightTheme());
+21
View File
@@ -4416,5 +4416,26 @@
<string name="DNR_ON">Включить нечиталку</string>
<string name="DNR_OFF">Отключить нечиталку</string>
<string name="vtl_crashed">Произошла ошибка в работе Vtosters!</string>
<string name="vtl_crash_upload">Загрузить логи</string>
<string name="vtl_crash_save">Сохранить в файл</string>
<string name="batteryissuetitle">Отключите оптимизацию батареи!</string>
<string name="batteryissuesumm">В связи с тем, что вы используете прошивку сторонних производителей из приведенного ниже списка - уведомления могут приходить с задержкой или не приходить вовсе. \n Нажмите на кнопку \"Отключить оптимизацию\" чтобы исправить проблему. \n\nСторонние прошивки на которых наблюдаются проблемы с пушами:\nFlyme, EMUI, MIUI, ColorOS, Samsung Experience или TouchWiz, Magic UI, ZenUI, Funtouch OS</string>
<string name="batteryissuebtn1">Отключить оптимизацию</string>
<string name="batteryissuebtn2">Игнорировать</string>
<string name="gmsissuesumm">На вашем устройстве отсутствует компонент Google Play Services (GMS), который необходим для корректной работы VTosters Lite</string>
<string name="gmsissuebtn1">Продолжить без GMS</string>
<string name="gmsissuebtn2">Установить GMS</string>
<string name="startsumm1">Модификация VTosters Lite не имеет никакого отношения к VK Group!\nРаспространяется полностью бесплатно!</string>
<string name="startsumm2">\n\nПриложение может некорректно работать в связи с тем, что вы, скорее всего, используете оболочку из списка ниже. Все проблемы с отображением и работой приложения связаны только с вашей прошивкой и только с ней. Все багрепорты, присланные из-за проблем на этой прошивке, не рассматриваются разработчиками и не будут исправлены.\n\nНажимая на кнопку \"Продолжить\", вы соглашаетесь с тем, что возможные баги приложения могут произойти из-за специфики вашей прошивки. Рекомендуем использовать прошивки на базе AOSP для получения максимальной стабильности.\n\n Прошивки на которых наблюдаются проблемы с приложениями:\nFlyme, EMUI, MIUI, ColorOS, Samsung Experience или TouchWiz, Magic UI, ZenUI, Funtouch OS</string>
<string name="startbtn1">Новости</string>
<string name="startbtn2">Продолжить</string>
<string name="videodownloaderr">Данное видео невозможно скачать</string>
<string name="empty_text" />
</resources>
+21
View File
@@ -4550,6 +4550,27 @@ May look like a fake leaving the online"</string>
<string name="DNR_ON">Enable Do Not Read</string>
<string name="DNR_OFF">Disable Do Not Read</string>
<string name="vtl_crashed">An error has occurred in VTL!</string>
<string name="vtl_crash_upload">Upload logs</string>
<string name="vtl_crash_save">Save to local file</string>
<string name="batteryissuetitle">Disable battery optimization!</string>
<string name="batteryissuesumm">Due to the fact that you are using a third-party firmware from the list below, notifications may come with a delay or not at all. \n Click on the \"Disable optimization\" button to fix this problem. \n\nThird-party firmware on which problems with push are observed:\nFlyme, EMUI, MIUI, ColorOS, Samsung Experience or TouchWiz, Magic UI, ZenUI, Funtouch OS</string>
<string name="batteryissuebtn1">Disable optimization</string>
<string name="batteryissuebtn2">Ignore</string>
<string name="gmsissuesumm">There is no Google Play Services (GMS) component on your device, which is necessary for VTosters Lite to work correctly</string>
<string name="gmsissuebtn1">Continue without GMS</string>
<string name="gmsissuebtn2">Install GMS</string>
<string name="startsumm1">The VTosters Lite modification has nothing with VK Group!\nDistributed completely free of fee!</string>
<string name="startsumm2">\n\nThe application may not work correctly due to the fact that you are most likely using the shell from the list below. All problems with the display and work of the application are related only to your firmware and only with it. All bug reports sent due to problems on this firmware are not considered by the developers and will not be fixed.\n\n Pressing the \"Continue\" button, you agree that possible application bugs may occur due to the specifics of your firmware. We recommend using AOSP-based firmware for maximum stability.\n\n Firmware on which there are problems with applications:\nFlyme, EMUI, MIUI, ColorOS, Samsung Experience or TouchWiz, Magic UI, ZenUI, Funtouch OS</string>
<string name="startbtn1">News</string>
<string name="startbtn2">Continue</string>
<string name="videodownloaderr">This video cannot be downloaded</string>
<item type="string" name="APKTOOL_DUMMY_10be" />
<item type="string" name="APKTOOL_DUMMY_10bf" />
<item type="string" name="APKTOOL_DUMMY_10c0" />