some code upgrades

This commit is contained in:
gdlbo
2022-12-06 18:45:33 +03:00
parent 6b88996962
commit de511d15a6
4 changed files with 142 additions and 398 deletions
@@ -8,19 +8,21 @@ import ru.vtosters.lite.utils.ThemesUtils;
public class ToolbarHook implements BaseHook {
@Override
public void inject(View view, int i, boolean z) {
if (view instanceof Toolbar) {
var color = (ThemesUtils.isMilkshake() && !ThemesUtils.isDarkTheme()) ? ThemesUtils.getAccentColor() : ThemesUtils.getHeaderText();
var menu = ((Toolbar) view).getMenu();
for (int j = 0; j < menu.size(); ++j) {
var item = menu.getItem(j);
var icon = item.getIcon();
if (icon instanceof RecoloredDrawable)
((RecoloredDrawable) icon).a(color);
else
icon = new RecoloredDrawable(icon, color);
item.setIcon(icon);
if (icon != null) {
if (icon instanceof RecoloredDrawable)
((RecoloredDrawable) icon).a(color);
else
icon = new RecoloredDrawable(icon, color);
item.setIcon(icon);
}
}
}
}
}
@@ -19,9 +19,8 @@ public class SSFSUtils {
"&secret=" + AccountManagerUtils.getUserSecret() +
"&proxy=" + getUserProxy() +
"&lang=" + getLocale() +
"&vt=1&vksans=" + isVKSansEnabled() +
"&vt_version=" + getBuildNumber() +
"&useragent=" + Base64Utils.encodeValue(Base64Utils.encode(Network.l.c().a()) +
"&vt=1" +
"&useragent=" + Base64Utils.encodeValue(Base64Utils.encode(Network.l.c().a())) +
"&vt_debug=" + isDEVModEnabled();
}