added text coloring
This commit is contained in:
@@ -0,0 +1,134 @@
|
||||
package com.vk.core.extensions;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.AttrRes;
|
||||
import androidx.annotation.ColorRes;
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
import b.h.v.InitialValueObservable;
|
||||
import b.h.v.TextViewTextChangeEvent;
|
||||
import b.h.v.TextViewTextChangeEventObservable;
|
||||
import com.vk.core.util.ContextExtKt;
|
||||
import ru.vtosters.lite.utils.ThemesUtils;
|
||||
|
||||
public final class TextViewExt {
|
||||
public static void a(TextView textView, Drawable drawable) {
|
||||
a(textView, null, drawable);
|
||||
|
||||
ThemesUtils.colorTextView(textView);
|
||||
}
|
||||
|
||||
public static boolean b(TextView textView) {
|
||||
return textView == null || TextUtils.isEmpty(textView.getEditableText());
|
||||
}
|
||||
|
||||
public static InitialValueObservable<TextViewTextChangeEvent> c(TextView textView) {
|
||||
return new TextViewTextChangeEventObservable(textView);
|
||||
}
|
||||
|
||||
public static void d(TextView textView, @DrawableRes int i, @AttrRes int i2) {
|
||||
b(textView, ThemesUtils.recolorDrawable(ContextExtKt.a(textView.getContext(), i, ContextExtKt.h(textView.getContext(), i2))));
|
||||
}
|
||||
|
||||
public static void a(TextView textView, Drawable drawable, ColorStateList colorStateList) {
|
||||
a(textView, null, a(drawable, colorStateList));
|
||||
}
|
||||
|
||||
public static void b(TextView textView, Drawable drawable) {
|
||||
a(textView, drawable, (Drawable) null);
|
||||
}
|
||||
|
||||
public static void c(TextView textView, @DrawableRes int i, @ColorRes int i2) {
|
||||
if (i == 0) {
|
||||
b(textView, null);
|
||||
} else if (i2 == 0) {
|
||||
b(textView, ContextCompat.getDrawable(textView.getContext(), i));
|
||||
} else {
|
||||
b(textView, ContextCompat.getDrawable(textView.getContext(), i), ContextCompat.getColorStateList(textView.getContext(), i2));
|
||||
}
|
||||
}
|
||||
|
||||
public static void d(TextView textView, int i) {
|
||||
textView.setTextSize(0, i);
|
||||
}
|
||||
|
||||
public static void a(TextView textView, @DrawableRes int i) {
|
||||
a(textView, i, 0);
|
||||
}
|
||||
|
||||
public static void b(TextView textView, Drawable drawable, ColorStateList colorStateList) {
|
||||
a(textView, a(drawable, colorStateList), (Drawable) null);
|
||||
}
|
||||
|
||||
public static void a(TextView textView, @DrawableRes int i, @ColorRes int i2) {
|
||||
if (i == 0) {
|
||||
a(textView, (Drawable) null);
|
||||
} else if (i2 == 0) {
|
||||
a(textView, ContextCompat.getDrawable(textView.getContext(), i));
|
||||
} else {
|
||||
a(textView, ContextCompat.getDrawable(textView.getContext(), i), ContextCompat.getColorStateList(textView.getContext(), i2));
|
||||
}
|
||||
}
|
||||
|
||||
public static void b(TextView textView, @DrawableRes int i) {
|
||||
c(textView, i, 0);
|
||||
}
|
||||
|
||||
public static void b(TextView textView, @DrawableRes int i, @AttrRes int i2) {
|
||||
if (i == 0) {
|
||||
a(textView, (Drawable) null);
|
||||
} else if (i2 == 0) {
|
||||
a(textView, ContextCompat.getDrawable(textView.getContext(), i));
|
||||
} else {
|
||||
Drawable drawable = ContextCompat.getDrawable(textView.getContext(), i);
|
||||
a(textView, drawable, ColorStateList.valueOf(ContextExtKt.h(textView.getContext(), i2)));
|
||||
}
|
||||
}
|
||||
|
||||
public static void c(TextView textView, @ColorRes int i) {
|
||||
textView.setTextColor(ContextExtKt.a(textView.getContext(), i));
|
||||
}
|
||||
|
||||
private static void a(TextView textView, Drawable drawable, Drawable drawable2) {
|
||||
textView.setCompoundDrawablesRelativeWithIntrinsicBounds(drawable, null, drawable2, null);
|
||||
|
||||
ThemesUtils.colorTextView(textView);
|
||||
}
|
||||
|
||||
public static void a(TextView textView) {
|
||||
textView.setCompoundDrawablesRelativeWithIntrinsicBounds(null, null, null, null);
|
||||
|
||||
ThemesUtils.colorTextView(textView);
|
||||
}
|
||||
|
||||
public static Drawable a(Drawable drawable, ColorStateList colorStateList) {
|
||||
if (colorStateList == null) return drawable;
|
||||
|
||||
if (drawable != null) {
|
||||
Drawable wrap = DrawableCompat.wrap(drawable.mutate());
|
||||
DrawableCompat.setTintList(wrap, colorStateList);
|
||||
return wrap;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void a(TextView textView, CharSequence charSequence) {
|
||||
if (TextUtils.isEmpty(charSequence)) {
|
||||
textView.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
|
||||
textView.setVisibility(View.VISIBLE);
|
||||
textView.setText(charSequence);
|
||||
}
|
||||
|
||||
public static void a(TextView textView, float f) {
|
||||
textView.setTextSize(0, f);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.vk.extensions;
|
||||
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.AttrRes;
|
||||
import com.vk.core.ui.themes.VKThemeHelper;
|
||||
import ru.vtosters.lite.utils.ThemesUtils;
|
||||
|
||||
public final class TextViewExt {
|
||||
public static void a(TextView textView, @AttrRes int i) {
|
||||
VKThemeHelper.a(textView, i);
|
||||
|
||||
ThemesUtils.colorTextView(textView);
|
||||
}
|
||||
}
|
||||
@@ -115,6 +115,13 @@ public class ThemesUtils {
|
||||
return getMutedColor(getAccentColor());
|
||||
}
|
||||
|
||||
public static void colorTextView(TextView view) {
|
||||
try {
|
||||
ThemesUtils.colorHandles(view);
|
||||
ThemesUtils.setCursorColor((EditText) view);
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
|
||||
@SuppressLint("DiscouragedPrivateApi")
|
||||
public static void setCursorColor(EditText view) {
|
||||
try {
|
||||
|
||||
@@ -1,506 +0,0 @@
|
||||
.class public final Lcom/vk/core/extensions/TextViewExt;
|
||||
.super Ljava/lang/Object;
|
||||
.source "TextViewExt.kt"
|
||||
|
||||
|
||||
# direct methods
|
||||
.method public static final a(Landroid/graphics/drawable/Drawable;Landroid/content/res/ColorStateList;)Landroid/graphics/drawable/Drawable;
|
||||
.locals 1
|
||||
|
||||
if-nez p1, :cond_0
|
||||
|
||||
return-object p0
|
||||
|
||||
:cond_0
|
||||
if-eqz p0, :cond_1
|
||||
|
||||
.line 9
|
||||
invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->mutate()Landroid/graphics/drawable/Drawable;
|
||||
|
||||
move-result-object p0
|
||||
|
||||
invoke-static {p0}, Landroidx/core/graphics/drawable/DrawableCompat;->wrap(Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;
|
||||
|
||||
move-result-object p0
|
||||
|
||||
const-string v0, "DrawableCompat.wrap(drawable.mutate())"
|
||||
|
||||
invoke-static {p0, v0}, Lkotlin/jvm/internal/Intrinsics;->a(Ljava/lang/Object;Ljava/lang/String;)V
|
||||
|
||||
.line 10
|
||||
invoke-static {p0, p1}, Landroidx/core/graphics/drawable/DrawableCompat;->setTintList(Landroid/graphics/drawable/Drawable;Landroid/content/res/ColorStateList;)V
|
||||
|
||||
goto :goto_0
|
||||
|
||||
:cond_1
|
||||
const/4 p0, 0x0
|
||||
|
||||
:goto_0
|
||||
return-object p0
|
||||
.end method
|
||||
|
||||
.method public static final a(Landroid/widget/TextView;)V
|
||||
.locals 1
|
||||
|
||||
const/4 v0, 0x0
|
||||
|
||||
.line 8
|
||||
invoke-virtual {p0, v0, v0, v0, v0}, Landroid/widget/TextView;->setCompoundDrawablesRelativeWithIntrinsicBounds(Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public static final a(Landroid/widget/TextView;F)V
|
||||
.locals 1
|
||||
|
||||
const/4 v0, 0x0
|
||||
|
||||
.line 15
|
||||
invoke-virtual {p0, v0, p1}, Landroid/widget/TextView;->setTextSize(IF)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public static final a(Landroid/widget/TextView;I)V
|
||||
.locals 1
|
||||
.param p1 # I
|
||||
.annotation build Landroidx/annotation/DrawableRes;
|
||||
.end annotation
|
||||
.end param
|
||||
|
||||
const/4 v0, 0x0
|
||||
|
||||
.line 3
|
||||
invoke-static {p0, p1, v0}, Lcom/vk/core/extensions/TextViewExt;->a(Landroid/widget/TextView;II)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public static final a(Landroid/widget/TextView;II)V
|
||||
.locals 1
|
||||
.param p1 # I
|
||||
.annotation build Landroidx/annotation/DrawableRes;
|
||||
.end annotation
|
||||
.end param
|
||||
.param p2 # I
|
||||
.annotation build Landroidx/annotation/ColorRes;
|
||||
.end annotation
|
||||
.end param
|
||||
|
||||
if-nez p1, :cond_0
|
||||
|
||||
const/4 p1, 0x0
|
||||
|
||||
.line 4
|
||||
invoke-static {p0, p1}, Lcom/vk/core/extensions/TextViewExt;->a(Landroid/widget/TextView;Landroid/graphics/drawable/Drawable;)V
|
||||
|
||||
goto :goto_0
|
||||
|
||||
:cond_0
|
||||
if-nez p2, :cond_1
|
||||
|
||||
.line 5
|
||||
invoke-virtual {p0}, Landroid/widget/TextView;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object p2
|
||||
|
||||
invoke-static {p2, p1}, Landroidx/core/content/ContextCompat;->getDrawable(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
invoke-static {p0, p1}, Lcom/vk/core/extensions/TextViewExt;->a(Landroid/widget/TextView;Landroid/graphics/drawable/Drawable;)V
|
||||
|
||||
goto :goto_0
|
||||
|
||||
.line 6
|
||||
:cond_1
|
||||
invoke-virtual {p0}, Landroid/widget/TextView;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
invoke-static {v0, p1}, Landroidx/core/content/ContextCompat;->getDrawable(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
invoke-virtual {p0}, Landroid/widget/TextView;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
invoke-static {v0, p2}, Landroidx/core/content/ContextCompat;->getColorStateList(Landroid/content/Context;I)Landroid/content/res/ColorStateList;
|
||||
|
||||
move-result-object p2
|
||||
|
||||
invoke-static {p0, p1, p2}, Lcom/vk/core/extensions/TextViewExt;->a(Landroid/widget/TextView;Landroid/graphics/drawable/Drawable;Landroid/content/res/ColorStateList;)V
|
||||
|
||||
:goto_0
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public static final a(Landroid/widget/TextView;Landroid/graphics/drawable/Drawable;)V
|
||||
.locals 1
|
||||
|
||||
const/4 v0, 0x0
|
||||
|
||||
.line 1
|
||||
invoke-static {p0, v0, p1}, Lcom/vk/core/extensions/TextViewExt;->a(Landroid/widget/TextView;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public static final a(Landroid/widget/TextView;Landroid/graphics/drawable/Drawable;Landroid/content/res/ColorStateList;)V
|
||||
.locals 0
|
||||
|
||||
.line 2
|
||||
invoke-static {p1, p2}, Lcom/vk/core/extensions/TextViewExt;->a(Landroid/graphics/drawable/Drawable;Landroid/content/res/ColorStateList;)Landroid/graphics/drawable/Drawable;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
const/4 p2, 0x0
|
||||
|
||||
invoke-static {p0, p2, p1}, Lcom/vk/core/extensions/TextViewExt;->a(Landroid/widget/TextView;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method private static final a(Landroid/widget/TextView;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;)V
|
||||
.locals 1
|
||||
|
||||
const/4 v0, 0x0
|
||||
|
||||
.line 7
|
||||
invoke-virtual {p0, p1, v0, p2, v0}, Landroid/widget/TextView;->setCompoundDrawablesRelativeWithIntrinsicBounds(Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public static final a(Landroid/widget/TextView;Ljava/lang/CharSequence;)V
|
||||
.locals 1
|
||||
|
||||
.line 11
|
||||
invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
||||
|
||||
move-result v0
|
||||
|
||||
if-eqz v0, :cond_0
|
||||
|
||||
const/16 p1, 0x8
|
||||
|
||||
.line 12
|
||||
invoke-virtual {p0, p1}, Landroid/widget/TextView;->setVisibility(I)V
|
||||
|
||||
goto :goto_0
|
||||
|
||||
:cond_0
|
||||
const/4 v0, 0x0
|
||||
|
||||
.line 13
|
||||
invoke-virtual {p0, v0}, Landroid/widget/TextView;->setVisibility(I)V
|
||||
|
||||
.line 14
|
||||
invoke-virtual {p0, p1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
||||
|
||||
:goto_0
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public static final b(Landroid/widget/TextView;I)V
|
||||
.locals 1
|
||||
.param p1 # I
|
||||
.annotation build Landroidx/annotation/DrawableRes;
|
||||
.end annotation
|
||||
.end param
|
||||
|
||||
const/4 v0, 0x0
|
||||
|
||||
.line 4
|
||||
invoke-static {p0, p1, v0}, Lcom/vk/core/extensions/TextViewExt;->c(Landroid/widget/TextView;II)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public static final b(Landroid/widget/TextView;II)V
|
||||
.locals 2
|
||||
.param p1 # I
|
||||
.annotation build Landroidx/annotation/DrawableRes;
|
||||
.end annotation
|
||||
.end param
|
||||
.param p2 # I
|
||||
.annotation build Landroidx/annotation/AttrRes;
|
||||
.end annotation
|
||||
.end param
|
||||
|
||||
if-nez p1, :cond_0
|
||||
|
||||
const/4 p1, 0x0
|
||||
|
||||
.line 5
|
||||
invoke-static {p0, p1}, Lcom/vk/core/extensions/TextViewExt;->a(Landroid/widget/TextView;Landroid/graphics/drawable/Drawable;)V
|
||||
|
||||
goto :goto_0
|
||||
|
||||
:cond_0
|
||||
if-nez p2, :cond_1
|
||||
|
||||
.line 6
|
||||
invoke-virtual {p0}, Landroid/widget/TextView;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object p2
|
||||
|
||||
invoke-static {p2, p1}, Landroidx/core/content/ContextCompat;->getDrawable(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
invoke-static {p0, p1}, Lcom/vk/core/extensions/TextViewExt;->a(Landroid/widget/TextView;Landroid/graphics/drawable/Drawable;)V
|
||||
|
||||
goto :goto_0
|
||||
|
||||
.line 7
|
||||
:cond_1
|
||||
invoke-virtual {p0}, Landroid/widget/TextView;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
invoke-static {v0, p1}, Landroidx/core/content/ContextCompat;->getDrawable(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
invoke-virtual {p0}, Landroid/widget/TextView;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
const-string v1, "context"
|
||||
|
||||
invoke-static {v0, v1}, Lkotlin/jvm/internal/Intrinsics;->a(Ljava/lang/Object;Ljava/lang/String;)V
|
||||
|
||||
invoke-static {v0, p2}, Lcom/vk/core/util/ContextExtKt;->h(Landroid/content/Context;I)I
|
||||
|
||||
move-result p2
|
||||
|
||||
invoke-static {p2}, Landroid/content/res/ColorStateList;->valueOf(I)Landroid/content/res/ColorStateList;
|
||||
|
||||
move-result-object p2
|
||||
|
||||
invoke-static {p0, p1, p2}, Lcom/vk/core/extensions/TextViewExt;->a(Landroid/widget/TextView;Landroid/graphics/drawable/Drawable;Landroid/content/res/ColorStateList;)V
|
||||
|
||||
:goto_0
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public static final b(Landroid/widget/TextView;Landroid/graphics/drawable/Drawable;)V
|
||||
.locals 1
|
||||
|
||||
const/4 v0, 0x0
|
||||
|
||||
.line 2
|
||||
invoke-static {p0, p1, v0}, Lcom/vk/core/extensions/TextViewExt;->a(Landroid/widget/TextView;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public static final b(Landroid/widget/TextView;Landroid/graphics/drawable/Drawable;Landroid/content/res/ColorStateList;)V
|
||||
.locals 0
|
||||
|
||||
.line 3
|
||||
invoke-static {p1, p2}, Lcom/vk/core/extensions/TextViewExt;->a(Landroid/graphics/drawable/Drawable;Landroid/content/res/ColorStateList;)Landroid/graphics/drawable/Drawable;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
const/4 p2, 0x0
|
||||
|
||||
invoke-static {p0, p1, p2}, Lcom/vk/core/extensions/TextViewExt;->a(Landroid/widget/TextView;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public static final b(Landroid/widget/TextView;)Z
|
||||
.locals 0
|
||||
|
||||
if-eqz p0, :cond_1
|
||||
|
||||
.line 1
|
||||
invoke-virtual {p0}, Landroid/widget/TextView;->getEditableText()Landroid/text/Editable;
|
||||
|
||||
move-result-object p0
|
||||
|
||||
invoke-static {p0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
||||
|
||||
move-result p0
|
||||
|
||||
if-eqz p0, :cond_0
|
||||
|
||||
goto :goto_0
|
||||
|
||||
:cond_0
|
||||
const/4 p0, 0x0
|
||||
|
||||
goto :goto_1
|
||||
|
||||
:cond_1
|
||||
:goto_0
|
||||
const/4 p0, 0x1
|
||||
|
||||
:goto_1
|
||||
return p0
|
||||
.end method
|
||||
|
||||
.method public static final c(Landroid/widget/TextView;)Lb/h/v/InitialValueObservable;
|
||||
.locals 1
|
||||
.annotation system Ldalvik/annotation/Signature;
|
||||
value = {
|
||||
"(",
|
||||
"Landroid/widget/TextView;",
|
||||
")",
|
||||
"Lb/h/v/InitialValueObservable<",
|
||||
"Lb/h/v/TextViewTextChangeEvent;",
|
||||
">;"
|
||||
}
|
||||
.end annotation
|
||||
|
||||
.line 1
|
||||
new-instance v0, Lb/h/v/TextViewTextChangeEventObservable;
|
||||
|
||||
invoke-direct {v0, p0}, Lb/h/v/TextViewTextChangeEventObservable;-><init>(Landroid/widget/TextView;)V
|
||||
|
||||
return-object v0
|
||||
.end method
|
||||
|
||||
.method public static final c(Landroid/widget/TextView;I)V
|
||||
.locals 2
|
||||
.param p1 # I
|
||||
.annotation build Landroidx/annotation/ColorRes;
|
||||
.end annotation
|
||||
.end param
|
||||
|
||||
.line 5
|
||||
invoke-virtual {p0}, Landroid/widget/TextView;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
const-string v1, "this.context"
|
||||
|
||||
invoke-static {v0, v1}, Lkotlin/jvm/internal/Intrinsics;->a(Ljava/lang/Object;Ljava/lang/String;)V
|
||||
|
||||
invoke-static {v0, p1}, Lcom/vk/core/util/ContextExtKt;->a(Landroid/content/Context;I)I
|
||||
|
||||
move-result p1
|
||||
|
||||
invoke-virtual {p0, p1}, Landroid/widget/TextView;->setTextColor(I)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public static final c(Landroid/widget/TextView;II)V
|
||||
.locals 1
|
||||
.param p1 # I
|
||||
.annotation build Landroidx/annotation/DrawableRes;
|
||||
.end annotation
|
||||
.end param
|
||||
.param p2 # I
|
||||
.annotation build Landroidx/annotation/ColorRes;
|
||||
.end annotation
|
||||
.end param
|
||||
|
||||
if-nez p1, :cond_0
|
||||
|
||||
const/4 p1, 0x0
|
||||
|
||||
.line 2
|
||||
invoke-static {p0, p1}, Lcom/vk/core/extensions/TextViewExt;->b(Landroid/widget/TextView;Landroid/graphics/drawable/Drawable;)V
|
||||
|
||||
goto :goto_0
|
||||
|
||||
:cond_0
|
||||
if-nez p2, :cond_1
|
||||
|
||||
.line 3
|
||||
invoke-virtual {p0}, Landroid/widget/TextView;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object p2
|
||||
|
||||
invoke-static {p2, p1}, Landroidx/core/content/ContextCompat;->getDrawable(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
invoke-static {p0, p1}, Lcom/vk/core/extensions/TextViewExt;->b(Landroid/widget/TextView;Landroid/graphics/drawable/Drawable;)V
|
||||
|
||||
goto :goto_0
|
||||
|
||||
.line 4
|
||||
:cond_1
|
||||
invoke-virtual {p0}, Landroid/widget/TextView;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
invoke-static {v0, p1}, Landroidx/core/content/ContextCompat;->getDrawable(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
invoke-virtual {p0}, Landroid/widget/TextView;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
invoke-static {v0, p2}, Landroidx/core/content/ContextCompat;->getColorStateList(Landroid/content/Context;I)Landroid/content/res/ColorStateList;
|
||||
|
||||
move-result-object p2
|
||||
|
||||
invoke-static {p0, p1, p2}, Lcom/vk/core/extensions/TextViewExt;->b(Landroid/widget/TextView;Landroid/graphics/drawable/Drawable;Landroid/content/res/ColorStateList;)V
|
||||
|
||||
:goto_0
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public static final d(Landroid/widget/TextView;I)V
|
||||
.locals 1
|
||||
|
||||
int-to-float p1, p1
|
||||
|
||||
const/4 v0, 0x0
|
||||
|
||||
.line 2
|
||||
invoke-virtual {p0, v0, p1}, Landroid/widget/TextView;->setTextSize(IF)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public static final d(Landroid/widget/TextView;II)V
|
||||
.locals 3
|
||||
.param p1 # I
|
||||
.annotation build Landroidx/annotation/DrawableRes;
|
||||
.end annotation
|
||||
.end param
|
||||
.param p2 # I
|
||||
.annotation build Landroidx/annotation/AttrRes;
|
||||
.end annotation
|
||||
.end param
|
||||
|
||||
.line 1
|
||||
invoke-virtual {p0}, Landroid/widget/TextView;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
const-string v1, "context"
|
||||
|
||||
invoke-static {v0, v1}, Lkotlin/jvm/internal/Intrinsics;->a(Ljava/lang/Object;Ljava/lang/String;)V
|
||||
|
||||
invoke-virtual {p0}, Landroid/widget/TextView;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v2
|
||||
|
||||
invoke-static {v2, v1}, Lkotlin/jvm/internal/Intrinsics;->a(Ljava/lang/Object;Ljava/lang/String;)V
|
||||
|
||||
invoke-static {v2, p2}, Lcom/vk/core/util/ContextExtKt;->h(Landroid/content/Context;I)I
|
||||
|
||||
move-result p2
|
||||
|
||||
invoke-static {v0, p1, p2}, Lcom/vk/core/util/ContextExtKt;->a(Landroid/content/Context;II)Landroid/graphics/drawable/Drawable;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
invoke-static {p1}, Lru/vtosters/lite/utils/ThemesUtils;->recolorDrawable(Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
invoke-static {p0, p1}, Lcom/vk/core/extensions/TextViewExt;->b(Landroid/widget/TextView;Landroid/graphics/drawable/Drawable;)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
@@ -1,18 +0,0 @@
|
||||
.class public final Lcom/vk/extensions/TextViewExt;
|
||||
.super Ljava/lang/Object;
|
||||
.source "TextViewExt.kt"
|
||||
|
||||
|
||||
# direct methods
|
||||
.method public static final a(Landroid/widget/TextView;I)V
|
||||
.locals 0
|
||||
.param p1 # I
|
||||
.annotation build Landroidx/annotation/AttrRes;
|
||||
.end annotation
|
||||
.end param
|
||||
|
||||
.line 1
|
||||
invoke-static {p0, p1}, Lcom/vk/core/ui/themes/VKThemeHelper;->a(Landroid/widget/TextView;I)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
Reference in New Issue
Block a user