Oh, fixes?
-Added styles list for dark and light themes -Updated libs -Auto refactored resources for easy editing -Improved amoled theme
This commit is contained in:
@@ -3,8 +3,6 @@ package bruhcollective.itaysonlab.libvkx.client;
|
||||
import android.content.Context;
|
||||
import android.os.RemoteException;
|
||||
|
||||
import bruhcollective.itaysonlab.libvkx.ILibVkxService;
|
||||
|
||||
import com.vk.core.b.PackageManagerHelper;
|
||||
import com.vk.dto.music.MusicTrack;
|
||||
import com.vk.music.PlayerRefer;
|
||||
@@ -13,8 +11,7 @@ import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
import ru.vtosters.lite.utils.Prefs;
|
||||
import bruhcollective.itaysonlab.libvkx.ILibVkxService;
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
import ru.vtosters.lite.utils.Prefs;
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package com.aefyr.tsg.g2;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
@@ -10,11 +7,13 @@ import android.content.Context;
|
||||
import android.os.Build;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.core.app.NotificationManagerCompat;
|
||||
|
||||
import com.aefyr.tsg.g2.stickersgrabber.TelegramStickersGrabber;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
|
||||
/**
|
||||
* Created by Aefyr on 20.05.2018.
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
package com.aefyr.tsg.g2;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.util.Log;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.util.Log;
|
||||
|
||||
/**
|
||||
* Created by Aefyr on 18.05.2018.
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
package com.aefyr.tsg.g2;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
|
||||
import com.aefyr.tsg.g2.sql.TelegramStickersDbHelper;
|
||||
import com.aefyr.tsg.g2.stickersgrabber.TelegramStickersGrabber;
|
||||
import com.aefyr.tsg.g2.stickersgrabber.TelegramStickersPackInfo;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
@@ -7,18 +17,8 @@ import java.util.List;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
import com.aefyr.tsg.g2.sql.TelegramStickersDbHelper;
|
||||
import com.aefyr.tsg.g2.stickersgrabber.TelegramStickersGrabber;
|
||||
import com.aefyr.tsg.g2.stickersgrabber.TelegramStickersPackInfo;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
import ru.vtosters.lite.ui.fragments.tgstickers.StickersFragment;
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
|
||||
/**
|
||||
* Created by Aefyr on 19.05.2018.
|
||||
|
||||
@@ -11,12 +11,12 @@ import android.util.Log;
|
||||
|
||||
import com.aefyr.tsg.g2.TelegramStickersPack;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Created by Aefyr on 19.05.2018.
|
||||
*/
|
||||
|
||||
@@ -9,12 +9,6 @@ import android.util.Log;
|
||||
import com.aefyr.tsg.g2.stickersgrabber.util.Flag;
|
||||
import com.aefyr.tsg.g2.stickersgrabber.util.GoalCounter;
|
||||
|
||||
import ru.f0x1d.net.NetCall;
|
||||
import ru.f0x1d.net.NetCallback;
|
||||
import ru.f0x1d.net.NetClient;
|
||||
import ru.f0x1d.net.NetRequest;
|
||||
import ru.f0x1d.net.NetResponse;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
@@ -33,6 +27,12 @@ import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import ru.f0x1d.net.NetCall;
|
||||
import ru.f0x1d.net.NetCallback;
|
||||
import ru.f0x1d.net.NetClient;
|
||||
import ru.f0x1d.net.NetRequest;
|
||||
import ru.f0x1d.net.NetResponse;
|
||||
|
||||
/**
|
||||
* Created by Aefyr on 11.05.2018.
|
||||
*/
|
||||
|
||||
@@ -7,10 +7,8 @@ import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import okhttp3.Headers;
|
||||
import okhttp3.internal.Util;
|
||||
import okhttp3.internal.b.HttpMethod;
|
||||
import okhttp3.Request;
|
||||
|
||||
public final class Request {
|
||||
/* renamed from: a reason: collision with root package name */
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package ru.f0x1d.net;
|
||||
|
||||
import android.util.Base64;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
@@ -13,8 +15,6 @@ import java.nio.charset.StandardCharsets;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import android.util.Base64;
|
||||
|
||||
public final class NetCall {
|
||||
private NetRequest req;
|
||||
private NetClient cl;
|
||||
|
||||
@@ -22,7 +22,7 @@ public class DockBarAdapter extends RecyclerView.a
|
||||
public static final int DISABLED_TAB_TYPE = 2;
|
||||
public static final int GROUP_TITLE_TYPE = 3;
|
||||
|
||||
|
||||
|
||||
private final DockBarManager mDockBarManager = DockBarManager.getInstance();
|
||||
|
||||
@Override
|
||||
|
||||
@@ -36,7 +36,7 @@ public class DockBarFragment extends ToolbarFragment {
|
||||
Helper.convertDpToPixel(10)
|
||||
);
|
||||
container.addView(buttonsContainer, new LinearLayout.LayoutParams(-1, -2));
|
||||
|
||||
|
||||
Button save = new Button(n());
|
||||
save.setText("Сохранить");
|
||||
save.setOnClickListener(v -> {
|
||||
|
||||
@@ -224,7 +224,8 @@ public class DockBarManager {
|
||||
int target = adapter.getIndexByViewType(toPosition, adapter.getItemType(toPosition));
|
||||
if (fromPosition < toPosition) {
|
||||
|
||||
if (mSelectedTabs.size() <= MIN_SELECTED_TABS_LIMIT || mSelectedTabs.get(curr).tag.equals("tab_menu")) return;
|
||||
if (mSelectedTabs.size() <= MIN_SELECTED_TABS_LIMIT || mSelectedTabs.get(curr).tag.equals("tab_menu"))
|
||||
return;
|
||||
|
||||
DockBarTab tab = mSelectedTabs.get(curr);
|
||||
mSelectedTabs.remove(tab);
|
||||
@@ -237,7 +238,7 @@ public class DockBarManager {
|
||||
for (int i = 0; i < target; i++) {
|
||||
Collections.swap(mDisabledTabs, i, i + 1);
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
|
||||
if (mSelectedTabs.size() >= MAX_SELECTED_TABS_LIMIT) return;
|
||||
|
||||
|
||||
+2
-2
@@ -83,10 +83,10 @@ public class MultiAccountAdapter extends RecyclerView.a<MultiAccountAdapter.Mult
|
||||
|
||||
return new MultiAccountViewHolder(layout);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void a(MultiAccountViewHolder holder, int pos) {
|
||||
holder.bind(pos == 0 ? null : mAccounts.get(pos-1), pos);
|
||||
holder.bind(pos == 0 ? null : mAccounts.get(pos - 1), pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ public class MultiAccountManager {
|
||||
}
|
||||
|
||||
private static int getAccountPrefsCount() {
|
||||
File[] prefs = new File(Helper.GetContext().getFilesDir().getParent(), "shared_prefs")
|
||||
File[] prefs = new File(Helper.GetContext().getFilesDir().getParent(), "shared_prefs")
|
||||
.listFiles((dir, name) -> {
|
||||
return name.matches("pref_account_manager\\d+\\.xml");
|
||||
});
|
||||
|
||||
@@ -166,10 +166,10 @@ public class StickersFragment extends ToolbarFragment {
|
||||
TGPref.setTGBotKey(editText.getText().toString());
|
||||
if (r != null) r.run();
|
||||
}).setNegativeButton(android.R.string.cancel, null).setNeutralButton(Helper.getString("stickersapi7"), (dialog, which) -> new AlertDialog.Builder(super.n())
|
||||
.setTitle(Helper.getString("stickersapi8"))
|
||||
.setMessage(Helper.getString("stickersapi9") +
|
||||
Helper.getString("stickersapi10")).setPositiveButton(android.R.string.ok, null)
|
||||
.create().show()).create().show();
|
||||
.setTitle(Helper.getString("stickersapi8"))
|
||||
.setMessage(Helper.getString("stickersapi9") +
|
||||
Helper.getString("stickersapi10")).setPositiveButton(android.R.string.ok, null)
|
||||
.create().show()).create().show();
|
||||
}
|
||||
|
||||
private void checkApiKey(final Runnable r) {
|
||||
|
||||
@@ -65,7 +65,7 @@ public class Helper {
|
||||
return extendedUserProfile.a;
|
||||
}
|
||||
|
||||
public static void restarting(){
|
||||
public static void restarting() {
|
||||
Context ctx = GetContext();
|
||||
PackageManager pm = ctx.getPackageManager();
|
||||
Intent intent = pm.getLaunchIntentForPackage(ctx.getPackageName());
|
||||
@@ -141,6 +141,6 @@ public class Helper {
|
||||
public static boolean isNetworkConnected() {
|
||||
ConnectivityManager cm = (ConnectivityManager) GetContext().getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
|
||||
return activeNetwork != null ? activeNetwork.isConnectedOrConnecting() :false;
|
||||
return activeNetwork != null ? activeNetwork.isConnectedOrConnecting() : false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.utils.Proxy.setProxy;
|
||||
import static ru.vtosters.lite.utils.Themes.amoled;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
@@ -274,7 +273,8 @@ public class Prefs {
|
||||
}
|
||||
|
||||
public static String getAmoledVKUI() {
|
||||
return amoled() ? "1" : "0";
|
||||
String string = Helper.GetPreferences().getString("darktheme", "");
|
||||
return string.equals("amoled") ? "1" : "0";
|
||||
}
|
||||
|
||||
public static String getMeToken() {
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.widget.ImageButton;
|
||||
import com.vk.core.d.RecoloredDrawable;
|
||||
import com.vk.core.ui.themes.VKTheme;
|
||||
import com.vk.core.ui.themes.VKThemeHelper;
|
||||
import com.vk.im.ui.themes.ImTheme;
|
||||
import com.vtosters.lite.R;
|
||||
|
||||
public class Themes {
|
||||
@@ -37,8 +38,42 @@ public class Themes {
|
||||
return Helper.GetContext().getResources().getIdentifier("VkIm.Theme.VkApp.Amoled", "style", Helper.GetContext().getPackageName());
|
||||
}
|
||||
|
||||
public static VKTheme getCurrentDarkTheme() {
|
||||
return amoled() ? VKTheme.AMOLED : VKTheme.DARK;
|
||||
public static VKTheme getDarkTheme() {
|
||||
String string = Helper.GetPreferences().getString("darktheme", "");
|
||||
if (string.isEmpty()) {
|
||||
return VKTheme.DARK;
|
||||
}
|
||||
if (string.equals("amoled")) {
|
||||
return VKTheme.AMOLED;
|
||||
}
|
||||
return VKTheme.DARK;
|
||||
}
|
||||
|
||||
public static ImTheme getImDarkTheme() {
|
||||
String string = Helper.GetPreferences().getString("darktheme", "");
|
||||
if (string.isEmpty()) {
|
||||
return ImTheme.VKAPP_DARK;
|
||||
}
|
||||
if (string.equals("amoled")) {
|
||||
return ImTheme.VKAPP_AMOLED;
|
||||
}
|
||||
return ImTheme.VKAPP_DARK;
|
||||
}
|
||||
|
||||
public static VKTheme getLightTheme() {
|
||||
String string = Helper.GetPreferences().getString("lighttheme", "");
|
||||
if (string.isEmpty()) {
|
||||
return VKTheme.DEFAULT_LIGHT;
|
||||
}
|
||||
return VKTheme.DEFAULT_LIGHT;
|
||||
}
|
||||
|
||||
public static ImTheme getImLightTheme() {
|
||||
String string = Helper.GetPreferences().getString("lighttheme", "");
|
||||
if (string.isEmpty()) {
|
||||
return ImTheme.VKAPP_LIGHT;
|
||||
}
|
||||
return ImTheme.VKAPP_LIGHT;
|
||||
}
|
||||
|
||||
public static int getColorFromAttr(int attr) {
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.utils.Themes.amoled;
|
||||
|
||||
import android.util.Base64;
|
||||
import android.util.Log;
|
||||
import android.webkit.WebView;
|
||||
|
||||
import com.vtosters.lite.R;
|
||||
@@ -61,6 +58,7 @@ public class VKUIInjector {
|
||||
}
|
||||
|
||||
public static void inject(WebView webView) {
|
||||
String string = Helper.GetPreferences().getString("darktheme", "");
|
||||
if (Prefs.BooleanTrue("VKUI_INJ")) {
|
||||
if (!isLoaded) {
|
||||
load();
|
||||
@@ -70,7 +68,7 @@ public class VKUIInjector {
|
||||
sb.append("\n\n");
|
||||
sb.append(loadedCSS);
|
||||
}
|
||||
if (amoled() == true) {
|
||||
if (string.equals("amoled")) {
|
||||
sb.append("\n\n");
|
||||
sb.append(loadedCSSAmoled);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user