395 lines
12 KiB
Smali
395 lines
12 KiB
Smali
.class public Landroidx/core/app/NotificationCompat$DecoratedCustomViewStyle;
|
|
.super Landroidx/core/app/NotificationCompat$Style;
|
|
.source "NotificationCompat.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Landroidx/core/app/NotificationCompat;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x9
|
|
name = "DecoratedCustomViewStyle"
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field private static final MAX_ACTION_BUTTONS:I = 0x3
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Landroidx/core/app/NotificationCompat$Style;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private createRemoteViews(Landroid/widget/RemoteViews;Z)Landroid/widget/RemoteViews;
|
|
.locals 6
|
|
|
|
sget v0, Landroidx/core/R$layout;->notification_template_custom_big:I
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-virtual {p0, v1, v0, v2}, Landroidx/core/app/NotificationCompat$DecoratedCustomViewStyle;->applyStandardTemplate(ZIZ)Landroid/widget/RemoteViews;
|
|
|
|
move-result-object v0
|
|
|
|
sget v3, Landroidx/core/R$id;->actions:I
|
|
|
|
invoke-virtual {v0, v3}, Landroid/widget/RemoteViews;->removeAllViews(I)V
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
iget-object p2, p0, Landroidx/core/app/NotificationCompat$DecoratedCustomViewStyle;->mBuilder:Landroidx/core/app/NotificationCompat$Builder;
|
|
|
|
iget-object p2, p2, Landroidx/core/app/NotificationCompat$Builder;->mActions:Ljava/util/ArrayList;
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
iget-object p2, p0, Landroidx/core/app/NotificationCompat$DecoratedCustomViewStyle;->mBuilder:Landroidx/core/app/NotificationCompat$Builder;
|
|
|
|
iget-object p2, p2, Landroidx/core/app/NotificationCompat$Builder;->mActions:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {p2}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result p2
|
|
|
|
const/4 v3, 0x3
|
|
|
|
invoke-static {p2, v3}, Ljava/lang/Math;->min(II)I
|
|
|
|
move-result p2
|
|
|
|
if-lez p2, :cond_0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
:goto_0
|
|
if-ge v3, p2, :cond_1
|
|
|
|
iget-object v4, p0, Landroidx/core/app/NotificationCompat$DecoratedCustomViewStyle;->mBuilder:Landroidx/core/app/NotificationCompat$Builder;
|
|
|
|
iget-object v4, v4, Landroidx/core/app/NotificationCompat$Builder;->mActions:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {v4, v3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v4
|
|
|
|
check-cast v4, Landroidx/core/app/NotificationCompat$Action;
|
|
|
|
invoke-direct {p0, v4}, Landroidx/core/app/NotificationCompat$DecoratedCustomViewStyle;->generateActionButton(Landroidx/core/app/NotificationCompat$Action;)Landroid/widget/RemoteViews;
|
|
|
|
move-result-object v4
|
|
|
|
sget v5, Landroidx/core/R$id;->actions:I
|
|
|
|
invoke-virtual {v0, v5, v4}, Landroid/widget/RemoteViews;->addView(ILandroid/widget/RemoteViews;)V
|
|
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v1, 0x0
|
|
|
|
:cond_1
|
|
if-eqz v1, :cond_2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
const/16 v2, 0x8
|
|
|
|
:goto_1
|
|
sget p2, Landroidx/core/R$id;->actions:I
|
|
|
|
invoke-virtual {v0, p2, v2}, Landroid/widget/RemoteViews;->setViewVisibility(II)V
|
|
|
|
sget p2, Landroidx/core/R$id;->action_divider:I
|
|
|
|
invoke-virtual {v0, p2, v2}, Landroid/widget/RemoteViews;->setViewVisibility(II)V
|
|
|
|
invoke-virtual {p0, v0, p1}, Landroidx/core/app/NotificationCompat$DecoratedCustomViewStyle;->buildIntoRemoteViews(Landroid/widget/RemoteViews;Landroid/widget/RemoteViews;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private generateActionButton(Landroidx/core/app/NotificationCompat$Action;)Landroid/widget/RemoteViews;
|
|
.locals 6
|
|
|
|
iget-object v0, p1, Landroidx/core/app/NotificationCompat$Action;->actionIntent:Landroid/app/PendingIntent;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
new-instance v1, Landroid/widget/RemoteViews;
|
|
|
|
iget-object v2, p0, Landroidx/core/app/NotificationCompat$DecoratedCustomViewStyle;->mBuilder:Landroidx/core/app/NotificationCompat$Builder;
|
|
|
|
iget-object v2, v2, Landroidx/core/app/NotificationCompat$Builder;->mContext:Landroid/content/Context;
|
|
|
|
invoke-virtual {v2}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
sget v3, Landroidx/core/R$layout;->notification_action_tombstone:I
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
sget v3, Landroidx/core/R$layout;->notification_action:I
|
|
|
|
:goto_1
|
|
invoke-direct {v1, v2, v3}, Landroid/widget/RemoteViews;-><init>(Ljava/lang/String;I)V
|
|
|
|
sget v2, Landroidx/core/R$id;->action_image:I
|
|
|
|
invoke-virtual {p1}, Landroidx/core/app/NotificationCompat$Action;->getIcon()I
|
|
|
|
move-result v3
|
|
|
|
iget-object v4, p0, Landroidx/core/app/NotificationCompat$DecoratedCustomViewStyle;->mBuilder:Landroidx/core/app/NotificationCompat$Builder;
|
|
|
|
iget-object v4, v4, Landroidx/core/app/NotificationCompat$Builder;->mContext:Landroid/content/Context;
|
|
|
|
invoke-virtual {v4}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object v4
|
|
|
|
sget v5, Landroidx/core/R$color;->notification_action_color_filter:I
|
|
|
|
invoke-virtual {v4, v5}, Landroid/content/res/Resources;->getColor(I)I
|
|
|
|
move-result v4
|
|
|
|
invoke-virtual {p0, v3, v4}, Landroidx/core/app/NotificationCompat$DecoratedCustomViewStyle;->createColoredBitmap(II)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v1, v2, v3}, Landroid/widget/RemoteViews;->setImageViewBitmap(ILandroid/graphics/Bitmap;)V
|
|
|
|
sget v2, Landroidx/core/R$id;->action_text:I
|
|
|
|
iget-object v3, p1, Landroidx/core/app/NotificationCompat$Action;->title:Ljava/lang/CharSequence;
|
|
|
|
invoke-virtual {v1, v2, v3}, Landroid/widget/RemoteViews;->setTextViewText(ILjava/lang/CharSequence;)V
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
sget v0, Landroidx/core/R$id;->action_container:I
|
|
|
|
iget-object v2, p1, Landroidx/core/app/NotificationCompat$Action;->actionIntent:Landroid/app/PendingIntent;
|
|
|
|
invoke-virtual {v1, v0, v2}, Landroid/widget/RemoteViews;->setOnClickPendingIntent(ILandroid/app/PendingIntent;)V
|
|
|
|
:cond_2
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v2, 0xf
|
|
|
|
if-lt v0, v2, :cond_3
|
|
|
|
sget v0, Landroidx/core/R$id;->action_container:I
|
|
|
|
iget-object p1, p1, Landroidx/core/app/NotificationCompat$Action;->title:Ljava/lang/CharSequence;
|
|
|
|
invoke-virtual {v1, v0, p1}, Landroid/widget/RemoteViews;->setContentDescription(ILjava/lang/CharSequence;)V
|
|
|
|
:cond_3
|
|
return-object v1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public apply(Landroidx/core/app/NotificationBuilderWithBuilderAccessor;)V
|
|
.locals 2
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
value = {
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP:Landroidx/annotation/RestrictTo$Scope;
|
|
}
|
|
.end annotation
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v1, 0x18
|
|
|
|
if-lt v0, v1, :cond_0
|
|
|
|
invoke-interface {p1}, Landroidx/core/app/NotificationBuilderWithBuilderAccessor;->getBuilder()Landroid/app/Notification$Builder;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance v0, Landroid/app/Notification$DecoratedCustomViewStyle;
|
|
|
|
invoke-direct {v0}, Landroid/app/Notification$DecoratedCustomViewStyle;-><init>()V
|
|
|
|
invoke-virtual {p1, v0}, Landroid/app/Notification$Builder;->setStyle(Landroid/app/Notification$Style;)Landroid/app/Notification$Builder;
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public makeBigContentView(Landroidx/core/app/NotificationBuilderWithBuilderAccessor;)Landroid/widget/RemoteViews;
|
|
.locals 2
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
value = {
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP:Landroidx/annotation/RestrictTo$Scope;
|
|
}
|
|
.end annotation
|
|
|
|
sget p1, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const/16 v1, 0x18
|
|
|
|
if-lt p1, v1, :cond_0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
iget-object p1, p0, Landroidx/core/app/NotificationCompat$DecoratedCustomViewStyle;->mBuilder:Landroidx/core/app/NotificationCompat$Builder;
|
|
|
|
invoke-virtual {p1}, Landroidx/core/app/NotificationCompat$Builder;->getBigContentView()Landroid/widget/RemoteViews;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
iget-object p1, p0, Landroidx/core/app/NotificationCompat$DecoratedCustomViewStyle;->mBuilder:Landroidx/core/app/NotificationCompat$Builder;
|
|
|
|
invoke-virtual {p1}, Landroidx/core/app/NotificationCompat$Builder;->getContentView()Landroid/widget/RemoteViews;
|
|
|
|
move-result-object p1
|
|
|
|
:goto_0
|
|
if-nez p1, :cond_2
|
|
|
|
return-object v0
|
|
|
|
:cond_2
|
|
const/4 v0, 0x1
|
|
|
|
invoke-direct {p0, p1, v0}, Landroidx/core/app/NotificationCompat$DecoratedCustomViewStyle;->createRemoteViews(Landroid/widget/RemoteViews;Z)Landroid/widget/RemoteViews;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public makeContentView(Landroidx/core/app/NotificationBuilderWithBuilderAccessor;)Landroid/widget/RemoteViews;
|
|
.locals 2
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
value = {
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP:Landroidx/annotation/RestrictTo$Scope;
|
|
}
|
|
.end annotation
|
|
|
|
sget p1, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const/16 v1, 0x18
|
|
|
|
if-lt p1, v1, :cond_0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
iget-object p1, p0, Landroidx/core/app/NotificationCompat$DecoratedCustomViewStyle;->mBuilder:Landroidx/core/app/NotificationCompat$Builder;
|
|
|
|
invoke-virtual {p1}, Landroidx/core/app/NotificationCompat$Builder;->getContentView()Landroid/widget/RemoteViews;
|
|
|
|
move-result-object p1
|
|
|
|
if-nez p1, :cond_1
|
|
|
|
return-object v0
|
|
|
|
:cond_1
|
|
iget-object p1, p0, Landroidx/core/app/NotificationCompat$DecoratedCustomViewStyle;->mBuilder:Landroidx/core/app/NotificationCompat$Builder;
|
|
|
|
invoke-virtual {p1}, Landroidx/core/app/NotificationCompat$Builder;->getContentView()Landroid/widget/RemoteViews;
|
|
|
|
move-result-object p1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-direct {p0, p1, v0}, Landroidx/core/app/NotificationCompat$DecoratedCustomViewStyle;->createRemoteViews(Landroid/widget/RemoteViews;Z)Landroid/widget/RemoteViews;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public makeHeadsUpContentView(Landroidx/core/app/NotificationBuilderWithBuilderAccessor;)Landroid/widget/RemoteViews;
|
|
.locals 2
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
value = {
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP:Landroidx/annotation/RestrictTo$Scope;
|
|
}
|
|
.end annotation
|
|
|
|
sget p1, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const/16 v1, 0x18
|
|
|
|
if-lt p1, v1, :cond_0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
iget-object p1, p0, Landroidx/core/app/NotificationCompat$DecoratedCustomViewStyle;->mBuilder:Landroidx/core/app/NotificationCompat$Builder;
|
|
|
|
invoke-virtual {p1}, Landroidx/core/app/NotificationCompat$Builder;->getHeadsUpContentView()Landroid/widget/RemoteViews;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
move-object v1, p1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
iget-object v1, p0, Landroidx/core/app/NotificationCompat$DecoratedCustomViewStyle;->mBuilder:Landroidx/core/app/NotificationCompat$Builder;
|
|
|
|
invoke-virtual {v1}, Landroidx/core/app/NotificationCompat$Builder;->getContentView()Landroid/widget/RemoteViews;
|
|
|
|
move-result-object v1
|
|
|
|
:goto_0
|
|
if-nez p1, :cond_2
|
|
|
|
return-object v0
|
|
|
|
:cond_2
|
|
const/4 p1, 0x1
|
|
|
|
invoke-direct {p0, v1, p1}, Landroidx/core/app/NotificationCompat$DecoratedCustomViewStyle;->createRemoteViews(Landroid/widget/RemoteViews;Z)Landroid/widget/RemoteViews;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|