fixes some themes logic
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package com.vk.core.ui.themes;
|
||||
|
||||
import com.vk.s.R;
|
||||
import ru.vtosters.lite.utils.Themes;
|
||||
|
||||
public enum VKTheme {
|
||||
DEFAULT_LIGHT(0, R.g.BaseStyle),
|
||||
DARK(1, R.g.BaseDarkStyle),
|
||||
AMOLED(2, Themes.getAmoledTheme());
|
||||
|
||||
private final long id;
|
||||
private final int themeResId;
|
||||
|
||||
VKTheme(long j, int i) {
|
||||
this.id = j;
|
||||
this.themeResId = i;
|
||||
}
|
||||
|
||||
public final long a() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public final int b() {
|
||||
return this.themeResId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.vk.im.ui.themes;
|
||||
|
||||
import static com.vk.im.ui.R.m.VkIm_Theme_VkApp_Dark;
|
||||
import static com.vk.im.ui.R.m.VkIm_Theme_VkApp_Light;
|
||||
import static com.vk.im.ui.R.m.VkIm_Theme_VkMe_Dark;
|
||||
import static com.vk.im.ui.R.m.VkIm_Theme_VkMe_Light;
|
||||
|
||||
import ru.vtosters.lite.utils.Themes;
|
||||
|
||||
public enum ImTheme {
|
||||
VKAPP_LIGHT(0, VkIm_Theme_VkApp_Light),
|
||||
VKAPP_DARK(3, VkIm_Theme_VkApp_Dark),
|
||||
VKME_LIGHT(1, VkIm_Theme_VkMe_Light),
|
||||
VKME_DARK(2, VkIm_Theme_VkMe_Dark),
|
||||
VKAPP_AMOLED(4, Themes.getAmoledImTheme());
|
||||
|
||||
private final int id;
|
||||
private final int themeResId;
|
||||
|
||||
ImTheme(int i, int i2) {
|
||||
this.id = i;
|
||||
this.themeResId = i2;
|
||||
}
|
||||
|
||||
public final int a() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public final int b() {
|
||||
return this.themeResId;
|
||||
}
|
||||
}
|
||||
@@ -147,15 +147,15 @@ public class Newsfeed {
|
||||
}
|
||||
|
||||
public static String friendsads() {
|
||||
return !postsrecomm() ? "user_rec" : "null";
|
||||
return postsrecomm() ? "null" : "user_rec";
|
||||
}
|
||||
|
||||
public static String getFriendRecomm() {
|
||||
return !friendsrecomm() ? "friends_recommendations" : "null";
|
||||
return friendsrecomm() ? "null" : "friends_recommendations";
|
||||
}
|
||||
|
||||
public static String authorsads() {
|
||||
return !authorsrecomm() ? "authors_rec" : "null";
|
||||
return authorsrecomm() ? "null" : "authors_rec";
|
||||
}
|
||||
|
||||
public static String widgetads() {
|
||||
|
||||
@@ -330,6 +330,10 @@ public class Preferences {
|
||||
return getBoolValue("vkme_msg", false);
|
||||
}
|
||||
|
||||
public static boolean vkme_theme() {
|
||||
return getBoolValue("vkme_theme", false);
|
||||
}
|
||||
|
||||
public static boolean donaterecomm() {
|
||||
return getBoolValue("donaterecomm", false);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ 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;
|
||||
import static ru.vtosters.lite.utils.Preferences.systemtheme;
|
||||
import static ru.vtosters.lite.utils.Preferences.vkme_theme;
|
||||
import static ru.vtosters.lite.utils.Preferences.vksans;
|
||||
|
||||
import android.content.Context;
|
||||
@@ -119,7 +120,7 @@ public class Themes {
|
||||
case "amoled":
|
||||
return ImTheme.VKAPP_AMOLED;
|
||||
default:
|
||||
return ImTheme.VKAPP_DARK;
|
||||
return vkme_theme() ? ImTheme.VKME_DARK : ImTheme.VKAPP_DARK;
|
||||
}
|
||||
} // Return needed theme for theme changer
|
||||
|
||||
@@ -133,7 +134,7 @@ public class Themes {
|
||||
public static ImTheme getImLightTheme() {
|
||||
switch (getPrefsValue("lighttheme")) {
|
||||
default:
|
||||
return ImTheme.VKAPP_LIGHT;
|
||||
return vkme_theme() ? ImTheme.VKME_LIGHT : ImTheme.VKAPP_LIGHT;
|
||||
}
|
||||
} // Return needed theme for theme changer
|
||||
|
||||
|
||||
@@ -6490,7 +6490,7 @@
|
||||
</item>
|
||||
</style>
|
||||
|
||||
<style name="VkIm.Theme.VkApp.Dark" parent="@style/VkIm.Theme.VkApp">
|
||||
<style name="VkIm.Theme.VkApp.Dark" parent="@style/VkIm.Theme.VkMe">
|
||||
<item name="accent">@color/sky_300</item>
|
||||
<item name="action_sheet_action_foreground">@color/white</item>
|
||||
<item name="action_sheet_separator">@color/white_alpha12</item>
|
||||
@@ -6769,7 +6769,7 @@
|
||||
<item name="writebar_icon">@color/gray_400</item>
|
||||
</style>
|
||||
|
||||
<style name="VkIm.Theme.VkApp.Light" parent="@style/VkIm.Theme.VkApp">
|
||||
<style name="VkIm.Theme.VkApp.Light" parent="@style/VkIm.Theme.VkMe">
|
||||
<item name="accent">@color/blue_300</item>
|
||||
<item name="action_sheet_action_foreground">@color/azure_A100</item>
|
||||
<item name="action_sheet_separator">@color/black_alpha12</item>
|
||||
@@ -7066,8 +7066,8 @@
|
||||
<item name="im_contact_avatar_end_color">#ff3f8ae0</item>
|
||||
<item name="im_contact_avatar_start_color">#ff66ccff</item>
|
||||
<item name="im_dialogs_divider">?background_content</item>
|
||||
<item name="im_dialogs_item_style">@style/VkIm.Theme.DialogItem.VkMe</item>
|
||||
<item name="im_dialogs_state_style">@style/VkIm.Theme.DialogsStateProgress.VkMe</item>
|
||||
<item name="im_dialogs_item_style">@style/VkIm.Theme.DialogItem.VkApp</item>
|
||||
<item name="im_dialogs_state_style">@style/VkIm.Theme.DialogsStateProgress.VkApp</item>
|
||||
<item name="im_divider_color">?separator_common</item>
|
||||
<item name="im_history_fwd_padding_bottom">0.0dip</item>
|
||||
<item name="im_history_fwd_padding_end">0.0dip</item>
|
||||
|
||||
@@ -10,6 +10,10 @@
|
||||
android:key="devmenu"
|
||||
android:title="@string/debug_show_settings_item" />
|
||||
<PreferenceCategory android:title="@string/debug_experimental">
|
||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="vkme_theme"
|
||||
android:title="VKME Тема сообщений" />
|
||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="usevkui"
|
||||
|
||||
@@ -1,174 +0,0 @@
|
||||
.class public final enum Lcom/vk/core/ui/themes/VKTheme;
|
||||
.super Ljava/lang/Enum;
|
||||
.source "VKThemeHelper.kt"
|
||||
|
||||
|
||||
# annotations
|
||||
.annotation system Ldalvik/annotation/Signature;
|
||||
value = {
|
||||
"Ljava/lang/Enum<",
|
||||
"Lcom/vk/core/ui/themes/VKTheme;",
|
||||
">;"
|
||||
}
|
||||
.end annotation
|
||||
|
||||
|
||||
# static fields
|
||||
.field private static final synthetic $VALUES:[Lcom/vk/core/ui/themes/VKTheme;
|
||||
|
||||
.field public static final enum DARK:Lcom/vk/core/ui/themes/VKTheme;
|
||||
|
||||
.field public static final enum AMOLED:Lcom/vk/core/ui/themes/VKTheme;
|
||||
|
||||
.field public static final enum DEFAULT_LIGHT:Lcom/vk/core/ui/themes/VKTheme;
|
||||
|
||||
|
||||
# instance fields
|
||||
.field private final id:J
|
||||
|
||||
.field private final themeResId:I
|
||||
|
||||
|
||||
# direct methods
|
||||
.method static constructor <clinit>()V
|
||||
.locals 14
|
||||
|
||||
const/4 v0, 0x3
|
||||
|
||||
new-array v0, v0, [Lcom/vk/core/ui/themes/VKTheme;
|
||||
|
||||
new-instance v7, Lcom/vk/core/ui/themes/VKTheme;
|
||||
|
||||
const-string v2, "DEFAULT_LIGHT"
|
||||
|
||||
.line 291
|
||||
sget v6, Lcom/vk/s/R$g;->BaseStyle:I
|
||||
|
||||
const/4 v3, 0x0
|
||||
|
||||
const-wide/16 v4, 0x0
|
||||
|
||||
move-object v1, v7
|
||||
|
||||
invoke-direct/range {v1 .. v6}, Lcom/vk/core/ui/themes/VKTheme;-><init>(Ljava/lang/String;IJI)V
|
||||
|
||||
sput-object v7, Lcom/vk/core/ui/themes/VKTheme;->DEFAULT_LIGHT:Lcom/vk/core/ui/themes/VKTheme;
|
||||
|
||||
const/4 v1, 0x0
|
||||
|
||||
aput-object v7, v0, v1
|
||||
|
||||
new-instance v1, Lcom/vk/core/ui/themes/VKTheme;
|
||||
|
||||
const-string v9, "DARK"
|
||||
|
||||
.line 292
|
||||
sget v13, Lcom/vk/s/R$g;->BaseDarkStyle:I
|
||||
|
||||
const/4 v10, 0x1
|
||||
|
||||
const-wide/16 v11, 0x1
|
||||
|
||||
move-object v8, v1
|
||||
|
||||
invoke-direct/range {v8 .. v13}, Lcom/vk/core/ui/themes/VKTheme;-><init>(Ljava/lang/String;IJI)V
|
||||
|
||||
sput-object v1, Lcom/vk/core/ui/themes/VKTheme;->DARK:Lcom/vk/core/ui/themes/VKTheme;
|
||||
|
||||
const/4 v2, 0x1
|
||||
|
||||
aput-object v1, v0, v2
|
||||
|
||||
new-instance v1, Lcom/vk/core/ui/themes/VKTheme;
|
||||
|
||||
const-string v9, "AMOLED"
|
||||
|
||||
.line 292
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->getAmoledTheme()I
|
||||
|
||||
move-result v13
|
||||
|
||||
const/4 v10, 0x2
|
||||
|
||||
const-wide/16 v11, 0x2
|
||||
|
||||
move-object v8, v1
|
||||
|
||||
invoke-direct/range {v8 .. v13}, Lcom/vk/core/ui/themes/VKTheme;-><init>(Ljava/lang/String;IJI)V
|
||||
|
||||
sput-object v1, Lcom/vk/core/ui/themes/VKTheme;->AMOLED:Lcom/vk/core/ui/themes/VKTheme;
|
||||
|
||||
const/4 v2, 0x2
|
||||
|
||||
aput-object v1, v0, v2
|
||||
|
||||
sput-object v0, Lcom/vk/core/ui/themes/VKTheme;->$VALUES:[Lcom/vk/core/ui/themes/VKTheme;
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method protected constructor <init>(Ljava/lang/String;IJI)V
|
||||
.locals 0
|
||||
.annotation system Ldalvik/annotation/Signature;
|
||||
value = {
|
||||
"(JI)V"
|
||||
}
|
||||
.end annotation
|
||||
|
||||
.line 289
|
||||
invoke-direct {p0, p1, p2}, Ljava/lang/Enum;-><init>(Ljava/lang/String;I)V
|
||||
|
||||
iput-wide p3, p0, Lcom/vk/core/ui/themes/VKTheme;->id:J
|
||||
|
||||
iput p5, p0, Lcom/vk/core/ui/themes/VKTheme;->themeResId:I
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public static valueOf(Ljava/lang/String;)Lcom/vk/core/ui/themes/VKTheme;
|
||||
.locals 1
|
||||
|
||||
const-class v0, Lcom/vk/core/ui/themes/VKTheme;
|
||||
|
||||
invoke-static {v0, p0}, Ljava/lang/Enum;->valueOf(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;
|
||||
|
||||
move-result-object p0
|
||||
|
||||
check-cast p0, Lcom/vk/core/ui/themes/VKTheme;
|
||||
|
||||
return-object p0
|
||||
.end method
|
||||
|
||||
.method public static values()[Lcom/vk/core/ui/themes/VKTheme;
|
||||
.locals 1
|
||||
|
||||
sget-object v0, Lcom/vk/core/ui/themes/VKTheme;->$VALUES:[Lcom/vk/core/ui/themes/VKTheme;
|
||||
|
||||
invoke-virtual {v0}, [Lcom/vk/core/ui/themes/VKTheme;->clone()Ljava/lang/Object;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
check-cast v0, [Lcom/vk/core/ui/themes/VKTheme;
|
||||
|
||||
return-object v0
|
||||
.end method
|
||||
|
||||
|
||||
# virtual methods
|
||||
.method public final a()J
|
||||
.locals 2
|
||||
|
||||
.line 289
|
||||
iget-wide v0, p0, Lcom/vk/core/ui/themes/VKTheme;->id:J
|
||||
|
||||
return-wide v0
|
||||
.end method
|
||||
|
||||
.method public final b()I
|
||||
.locals 1
|
||||
|
||||
.line 290
|
||||
iget v0, p0, Lcom/vk/core/ui/themes/VKTheme;->themeResId:I
|
||||
|
||||
return v0
|
||||
.end method
|
||||
@@ -1,195 +0,0 @@
|
||||
.class public final enum Lcom/vk/im/ui/themes/ImTheme;
|
||||
.super Ljava/lang/Enum;
|
||||
.source "ImThemeHelper.kt"
|
||||
|
||||
|
||||
# annotations
|
||||
.annotation system Ldalvik/annotation/Signature;
|
||||
value = {
|
||||
"Ljava/lang/Enum<",
|
||||
"Lcom/vk/im/ui/themes/ImTheme;",
|
||||
">;"
|
||||
}
|
||||
.end annotation
|
||||
|
||||
|
||||
# static fields
|
||||
.field private static final synthetic $VALUES:[Lcom/vk/im/ui/themes/ImTheme;
|
||||
|
||||
.field public static final enum VKAPP_DARK:Lcom/vk/im/ui/themes/ImTheme;
|
||||
|
||||
.field public static final enum VKAPP_LIGHT:Lcom/vk/im/ui/themes/ImTheme;
|
||||
|
||||
.field public static final enum VKME_DARK:Lcom/vk/im/ui/themes/ImTheme;
|
||||
|
||||
.field public static final enum VKME_LIGHT:Lcom/vk/im/ui/themes/ImTheme;
|
||||
|
||||
.field public static final enum VKAPP_AMOLED:Lcom/vk/im/ui/themes/ImTheme;
|
||||
|
||||
|
||||
# instance fields
|
||||
.field private final id:I
|
||||
|
||||
.field private final themeResId:I
|
||||
|
||||
|
||||
# direct methods
|
||||
.method static constructor <clinit>()V
|
||||
.locals 7
|
||||
|
||||
const/4 v0, 0x5
|
||||
|
||||
new-array v0, v0, [Lcom/vk/im/ui/themes/ImTheme;
|
||||
|
||||
new-instance v1, Lcom/vk/im/ui/themes/ImTheme;
|
||||
|
||||
const-string v2, "VKAPP_LIGHT"
|
||||
|
||||
.line 57
|
||||
sget v3, Lcom/vk/im/ui/R$m;->VkIm_Theme_VkApp_Light:I
|
||||
|
||||
const/4 v4, 0x0
|
||||
|
||||
invoke-direct {v1, v2, v4, v4, v3}, Lcom/vk/im/ui/themes/ImTheme;-><init>(Ljava/lang/String;III)V
|
||||
|
||||
sput-object v1, Lcom/vk/im/ui/themes/ImTheme;->VKAPP_LIGHT:Lcom/vk/im/ui/themes/ImTheme;
|
||||
|
||||
aput-object v1, v0, v4
|
||||
|
||||
new-instance v1, Lcom/vk/im/ui/themes/ImTheme;
|
||||
|
||||
const-string v2, "VKAPP_DARK"
|
||||
|
||||
.line 58
|
||||
sget v3, Lcom/vk/im/ui/R$m;->VkIm_Theme_VkApp_Dark:I
|
||||
|
||||
const/4 v4, 0x3
|
||||
|
||||
const/4 v5, 0x1
|
||||
|
||||
invoke-direct {v1, v2, v5, v4, v3}, Lcom/vk/im/ui/themes/ImTheme;-><init>(Ljava/lang/String;III)V
|
||||
|
||||
sput-object v1, Lcom/vk/im/ui/themes/ImTheme;->VKAPP_DARK:Lcom/vk/im/ui/themes/ImTheme;
|
||||
|
||||
aput-object v1, v0, v5
|
||||
|
||||
new-instance v1, Lcom/vk/im/ui/themes/ImTheme;
|
||||
|
||||
const-string v2, "VKME_LIGHT"
|
||||
|
||||
.line 59
|
||||
sget v3, Lcom/vk/im/ui/R$m;->VkIm_Theme_VkMe_Light:I
|
||||
|
||||
const/4 v6, 0x2
|
||||
|
||||
invoke-direct {v1, v2, v6, v5, v3}, Lcom/vk/im/ui/themes/ImTheme;-><init>(Ljava/lang/String;III)V
|
||||
|
||||
sput-object v1, Lcom/vk/im/ui/themes/ImTheme;->VKME_LIGHT:Lcom/vk/im/ui/themes/ImTheme;
|
||||
|
||||
aput-object v1, v0, v6
|
||||
|
||||
new-instance v1, Lcom/vk/im/ui/themes/ImTheme;
|
||||
|
||||
const-string v2, "VKME_DARK"
|
||||
|
||||
.line 60
|
||||
sget v3, Lcom/vk/im/ui/R$m;->VkIm_Theme_VkMe_Dark:I
|
||||
|
||||
invoke-direct {v1, v2, v4, v6, v3}, Lcom/vk/im/ui/themes/ImTheme;-><init>(Ljava/lang/String;III)V
|
||||
|
||||
sput-object v1, Lcom/vk/im/ui/themes/ImTheme;->VKME_DARK:Lcom/vk/im/ui/themes/ImTheme;
|
||||
|
||||
aput-object v1, v0, v4
|
||||
|
||||
|
||||
new-instance v1, Lcom/vk/im/ui/themes/ImTheme;
|
||||
|
||||
const-string v2, "VKAPP_AMOLED"
|
||||
|
||||
.line 58
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->getAmoledImTheme()I
|
||||
|
||||
move-result v3
|
||||
|
||||
const/4 v4, 0x4
|
||||
|
||||
const/4 v5, 0x4
|
||||
|
||||
invoke-direct {v1, v2, v5, v4, v3}, Lcom/vk/im/ui/themes/ImTheme;-><init>(Ljava/lang/String;III)V
|
||||
|
||||
sput-object v1, Lcom/vk/im/ui/themes/ImTheme;->VKAPP_AMOLED:Lcom/vk/im/ui/themes/ImTheme;
|
||||
|
||||
aput-object v1, v0, v5
|
||||
|
||||
|
||||
|
||||
sput-object v0, Lcom/vk/im/ui/themes/ImTheme;->$VALUES:[Lcom/vk/im/ui/themes/ImTheme;
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method protected constructor <init>(Ljava/lang/String;III)V
|
||||
.locals 0
|
||||
.annotation system Ldalvik/annotation/Signature;
|
||||
value = {
|
||||
"(II)V"
|
||||
}
|
||||
.end annotation
|
||||
|
||||
.line 55
|
||||
invoke-direct {p0, p1, p2}, Ljava/lang/Enum;-><init>(Ljava/lang/String;I)V
|
||||
|
||||
iput p3, p0, Lcom/vk/im/ui/themes/ImTheme;->id:I
|
||||
|
||||
iput p4, p0, Lcom/vk/im/ui/themes/ImTheme;->themeResId:I
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public static valueOf(Ljava/lang/String;)Lcom/vk/im/ui/themes/ImTheme;
|
||||
.locals 1
|
||||
|
||||
const-class v0, Lcom/vk/im/ui/themes/ImTheme;
|
||||
|
||||
invoke-static {v0, p0}, Ljava/lang/Enum;->valueOf(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;
|
||||
|
||||
move-result-object p0
|
||||
|
||||
check-cast p0, Lcom/vk/im/ui/themes/ImTheme;
|
||||
|
||||
return-object p0
|
||||
.end method
|
||||
|
||||
.method public static values()[Lcom/vk/im/ui/themes/ImTheme;
|
||||
.locals 1
|
||||
|
||||
sget-object v0, Lcom/vk/im/ui/themes/ImTheme;->$VALUES:[Lcom/vk/im/ui/themes/ImTheme;
|
||||
|
||||
invoke-virtual {v0}, [Lcom/vk/im/ui/themes/ImTheme;->clone()Ljava/lang/Object;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
check-cast v0, [Lcom/vk/im/ui/themes/ImTheme;
|
||||
|
||||
return-object v0
|
||||
.end method
|
||||
|
||||
|
||||
# virtual methods
|
||||
.method public final a()I
|
||||
.locals 1
|
||||
|
||||
.line 55
|
||||
iget v0, p0, Lcom/vk/im/ui/themes/ImTheme;->id:I
|
||||
|
||||
return v0
|
||||
.end method
|
||||
|
||||
.method public final b()I
|
||||
.locals 1
|
||||
|
||||
.line 56
|
||||
iget v0, p0, Lcom/vk/im/ui/themes/ImTheme;->themeResId:I
|
||||
|
||||
return v0
|
||||
.end method
|
||||
Reference in New Issue
Block a user