This commit is contained in:
gdlbo
2022-06-16 01:06:11 +03:00
parent 5c882c5ce2
commit fe5616b3f7
8 changed files with 29 additions and 22 deletions
@@ -1,5 +1,7 @@
package ru.vtosters.lite.downloaders;
import static ru.vtosters.lite.utils.Globals.getString;
import android.app.DownloadManager;
import android.content.BroadcastReceiver;
import android.content.Context;
@@ -46,7 +48,7 @@ public class OTADownloader {
File apk = maxIndex == -1 ? new File(downloadDir, "VTLite.apk") : new File(downloadDir, "VTLite-" + maxIndex + ".apk");
APKInstallActivity.installOta(context, FileUtils.h(apk));
} else if (status == DownloadManager.STATUS_FAILED) {
// do something
Globals.sendToast(getString("downloaderr"));
}
}
}
@@ -54,7 +56,6 @@ public class OTADownloader {
public static void downloadBuild(String url) {
var context = Globals.getContext();
url = "https://github.com/vtosters/lite/releases/download/v0.2.9-beta2/VTLite.apk";
var uri = Uri.parse(url);
context.registerReceiver(callback, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
@@ -1,5 +1,7 @@
package ru.vtosters.lite.ui.dialogs;
import static ru.vtosters.lite.utils.Globals.getString;
import android.app.Activity;
import ru.vtosters.lite.downloaders.OTADownloader;
@@ -29,7 +31,7 @@ public class OTADialog implements OTAHelper.OTAListener {
// Toast.makeText(mActivity, "Обновления найдены", Toast.LENGTH_SHORT).show();
new ModalBottomSheetWrapper(mActivity)
.setUpdateInfoView(mHelper.getNewVersionName(), mHelper.getUpdateDescription())
.setPositiveButton("Обновить", () -> {
.setPositiveButton(getString("updateanddownload"), () -> {
OTADownloader.downloadBuild(mHelper.getDownloadUrl());
})
.show();
@@ -18,6 +18,10 @@ public class MessagesFragment extends MaterialPreferenceToolbarFragment {
private void prefs() {
a("vkme").a(new MessagesFragment.restart());
a("vkme_notifs").a(new MessagesFragment.restart());
a("isBGStickersEnabled").a(new MessagesFragment.restart());
a("roundedmsgs").a(new MessagesFragment.restart());
a("systememoji").a(new MessagesFragment.restart());
}
public boolean restart(Preference preference, Object obj) {
@@ -1,9 +1,9 @@
package ru.vtosters.lite.ui.vkui;
import static ru.vtosters.lite.utils.Globals.getString;
import android.app.Activity;
import android.content.Context;
import android.graphics.Typeface;
import android.util.TypedValue;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
@@ -33,7 +33,7 @@ public class ModalBottomSheetWrapper {
container.setOrientation(LinearLayout.VERTICAL);
title.setText("Новая версия " + version);
title.setText(getString("newversion") + " " + version);
title.setTypeface(title.getTypeface(), Typeface.BOLD);
title.setSingleLine(true);
title.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
@@ -42,7 +42,7 @@ public class ModalBottomSheetWrapper {
container.addView(title, new LinearLayout.LayoutParams(-1, -2));
changelogView.setPadding(0, Globals.convertDpToPixel(8), 0, 0);
changelogView.setText("Изменения: \n" + changelog);
changelogView.setText(getString("changelog") + ": \n" + changelog);
changelogView.setTextColor(Themes.getTextAttr());
container.addView(changelogView, new LinearLayout.LayoutParams(-1, -2));