288 lines
6.5 KiB
Smali
288 lines
6.5 KiB
Smali
.class final Landroidx/appcompat/widget/AppCompatReceiveContentHelper;
|
|
.super Ljava/lang/Object;
|
|
.source "AppCompatReceiveContentHelper.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Landroidx/appcompat/widget/AppCompatReceiveContentHelper$OnDropApi24Impl;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field private static final EXTRA_INPUT_CONTENT_INFO:Ljava/lang/String; = "androidx.core.view.extra.INPUT_CONTENT_INFO"
|
|
|
|
.field private static final LOG_TAG:Ljava/lang/String; = "ReceiveContent"
|
|
|
|
|
|
# direct methods
|
|
.method private constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 53
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method static createOnCommitContentListener(Landroid/view/View;)Landroidx/core/view/inputmethod/InputConnectionCompat$OnCommitContentListener;
|
|
.locals 1
|
|
|
|
.line 179
|
|
new-instance v0, Landroidx/appcompat/widget/AppCompatReceiveContentHelper$1;
|
|
|
|
invoke-direct {v0, p0}, Landroidx/appcompat/widget/AppCompatReceiveContentHelper$1;-><init>(Landroid/view/View;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method static maybeHandleDragEventViaPerformReceiveContent(Landroid/view/View;Landroid/view/DragEvent;)Z
|
|
.locals 4
|
|
|
|
.line 89
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/16 v2, 0x18
|
|
|
|
if-lt v0, v2, :cond_4
|
|
|
|
.line 90
|
|
invoke-virtual {p1}, Landroid/view/DragEvent;->getLocalState()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_4
|
|
|
|
.line 91
|
|
invoke-static {p0}, Landroidx/core/view/ViewCompat;->getOnReceiveContentMimeTypes(Landroid/view/View;)[Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
.line 98
|
|
:cond_0
|
|
invoke-static {p0}, Landroidx/appcompat/widget/AppCompatReceiveContentHelper;->tryGetActivity(Landroid/view/View;)Landroid/app/Activity;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
.line 100
|
|
new-instance p1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v0, "Can\'t handle drop: no activity: view="
|
|
|
|
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
const-string p1, "ReceiveContent"
|
|
|
|
invoke-static {p1, p0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
return v1
|
|
|
|
.line 103
|
|
:cond_1
|
|
invoke-virtual {p1}, Landroid/view/DragEvent;->getAction()I
|
|
|
|
move-result v2
|
|
|
|
const/4 v3, 0x1
|
|
|
|
if-ne v2, v3, :cond_2
|
|
|
|
.line 109
|
|
instance-of p0, p0, Landroid/widget/TextView;
|
|
|
|
xor-int/2addr p0, v3
|
|
|
|
return p0
|
|
|
|
.line 111
|
|
:cond_2
|
|
invoke-virtual {p1}, Landroid/view/DragEvent;->getAction()I
|
|
|
|
move-result v2
|
|
|
|
const/4 v3, 0x3
|
|
|
|
if-ne v2, v3, :cond_4
|
|
|
|
.line 112
|
|
instance-of v1, p0, Landroid/widget/TextView;
|
|
|
|
if-eqz v1, :cond_3
|
|
|
|
.line 113
|
|
check-cast p0, Landroid/widget/TextView;
|
|
|
|
invoke-static {p1, p0, v0}, Landroidx/appcompat/widget/AppCompatReceiveContentHelper$OnDropApi24Impl;->onDropForTextView(Landroid/view/DragEvent;Landroid/widget/TextView;Landroid/app/Activity;)Z
|
|
|
|
move-result p0
|
|
|
|
goto :goto_0
|
|
|
|
.line 114
|
|
:cond_3
|
|
invoke-static {p1, p0, v0}, Landroidx/appcompat/widget/AppCompatReceiveContentHelper$OnDropApi24Impl;->onDropForView(Landroid/view/DragEvent;Landroid/view/View;Landroid/app/Activity;)Z
|
|
|
|
move-result p0
|
|
|
|
:goto_0
|
|
return p0
|
|
|
|
:cond_4
|
|
:goto_1
|
|
return v1
|
|
.end method
|
|
|
|
.method static maybeHandleMenuActionViaPerformReceiveContent(Landroid/widget/TextView;I)Z
|
|
.locals 5
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const v1, 0x1020022
|
|
|
|
if-eq p1, v1, :cond_0
|
|
|
|
const v2, 0x1020031
|
|
|
|
if-ne p1, v2, :cond_1
|
|
|
|
.line 66
|
|
:cond_0
|
|
invoke-static {p0}, Landroidx/core/view/ViewCompat;->getOnReceiveContentMimeTypes(Landroid/view/View;)[Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
if-nez v2, :cond_2
|
|
|
|
:cond_1
|
|
return v0
|
|
|
|
.line 69
|
|
:cond_2
|
|
invoke-virtual {p0}, Landroid/widget/TextView;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v2
|
|
|
|
const-string v3, "clipboard"
|
|
|
|
invoke-virtual {v2, v3}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Landroid/content/ClipboardManager;
|
|
|
|
if-nez v2, :cond_3
|
|
|
|
const/4 v2, 0x0
|
|
|
|
goto :goto_0
|
|
|
|
.line 71
|
|
:cond_3
|
|
invoke-virtual {v2}, Landroid/content/ClipboardManager;->getPrimaryClip()Landroid/content/ClipData;
|
|
|
|
move-result-object v2
|
|
|
|
:goto_0
|
|
const/4 v3, 0x1
|
|
|
|
if-eqz v2, :cond_5
|
|
|
|
.line 72
|
|
invoke-virtual {v2}, Landroid/content/ClipData;->getItemCount()I
|
|
|
|
move-result v4
|
|
|
|
if-lez v4, :cond_5
|
|
|
|
.line 73
|
|
new-instance v4, Landroidx/core/view/ContentInfoCompat$Builder;
|
|
|
|
invoke-direct {v4, v2, v3}, Landroidx/core/view/ContentInfoCompat$Builder;-><init>(Landroid/content/ClipData;I)V
|
|
|
|
if-ne p1, v1, :cond_4
|
|
|
|
goto :goto_1
|
|
|
|
:cond_4
|
|
move v0, v3
|
|
|
|
.line 74
|
|
:goto_1
|
|
invoke-virtual {v4, v0}, Landroidx/core/view/ContentInfoCompat$Builder;->setFlags(I)Landroidx/core/view/ContentInfoCompat$Builder;
|
|
|
|
move-result-object p1
|
|
|
|
.line 75
|
|
invoke-virtual {p1}, Landroidx/core/view/ContentInfoCompat$Builder;->build()Landroidx/core/view/ContentInfoCompat;
|
|
|
|
move-result-object p1
|
|
|
|
.line 76
|
|
invoke-static {p0, p1}, Landroidx/core/view/ViewCompat;->performReceiveContent(Landroid/view/View;Landroidx/core/view/ContentInfoCompat;)Landroidx/core/view/ContentInfoCompat;
|
|
|
|
:cond_5
|
|
return v3
|
|
.end method
|
|
|
|
.method static tryGetActivity(Landroid/view/View;)Landroid/app/Activity;
|
|
.locals 1
|
|
|
|
.line 159
|
|
invoke-virtual {p0}, Landroid/view/View;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object p0
|
|
|
|
.line 160
|
|
:goto_0
|
|
instance-of v0, p0, Landroid/content/ContextWrapper;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 161
|
|
instance-of v0, p0, Landroid/app/Activity;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 162
|
|
check-cast p0, Landroid/app/Activity;
|
|
|
|
return-object p0
|
|
|
|
.line 164
|
|
:cond_0
|
|
check-cast p0, Landroid/content/ContextWrapper;
|
|
|
|
invoke-virtual {p0}, Landroid/content/ContextWrapper;->getBaseContext()Landroid/content/Context;
|
|
|
|
move-result-object p0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 p0, 0x0
|
|
|
|
return-object p0
|
|
.end method
|