apkfuckery/com.discord/smali/androidx/preference/PreferenceFragmentCompat$DividerDecoration.smali

264 lines
7.2 KiB
Smali
Raw Normal View History

2019-12-06 03:29:40 +00:00
.class public Landroidx/preference/PreferenceFragmentCompat$DividerDecoration;
2019-11-15 02:21:15 +00:00
.super Landroidx/recyclerview/widget/RecyclerView$ItemDecoration;
.source "PreferenceFragmentCompat.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Landroidx/preference/PreferenceFragmentCompat;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
2019-12-06 03:29:40 +00:00
accessFlags = 0x1
2019-11-15 02:21:15 +00:00
name = "DividerDecoration"
.end annotation
# instance fields
2019-12-06 03:29:40 +00:00
.field public mAllowDividerAfterLastItem:Z
2019-11-15 02:21:15 +00:00
2019-12-06 03:29:40 +00:00
.field public mDivider:Landroid/graphics/drawable/Drawable;
2019-11-15 02:21:15 +00:00
2019-12-06 03:29:40 +00:00
.field public mDividerHeight:I
2019-11-15 02:21:15 +00:00
2019-12-06 03:29:40 +00:00
.field public final synthetic this$0:Landroidx/preference/PreferenceFragmentCompat;
2019-11-15 02:21:15 +00:00
# direct methods
2019-12-06 03:29:40 +00:00
.method public constructor <init>(Landroidx/preference/PreferenceFragmentCompat;)V
2019-11-15 02:21:15 +00:00
.locals 0
iput-object p1, p0, Landroidx/preference/PreferenceFragmentCompat$DividerDecoration;->this$0:Landroidx/preference/PreferenceFragmentCompat;
invoke-direct {p0}, Landroidx/recyclerview/widget/RecyclerView$ItemDecoration;-><init>()V
const/4 p1, 0x1
iput-boolean p1, p0, Landroidx/preference/PreferenceFragmentCompat$DividerDecoration;->mAllowDividerAfterLastItem:Z
return-void
.end method
.method private shouldDrawDividerBelow(Landroid/view/View;Landroidx/recyclerview/widget/RecyclerView;)Z
.locals 4
invoke-virtual {p2, p1}, Landroidx/recyclerview/widget/RecyclerView;->getChildViewHolder(Landroid/view/View;)Landroidx/recyclerview/widget/RecyclerView$ViewHolder;
move-result-object v0
instance-of v1, v0, Landroidx/preference/PreferenceViewHolder;
const/4 v2, 0x0
const/4 v3, 0x1
if-eqz v1, :cond_0
check-cast v0, Landroidx/preference/PreferenceViewHolder;
invoke-virtual {v0}, Landroidx/preference/PreferenceViewHolder;->isDividerAllowedBelow()Z
move-result v0
if-eqz v0, :cond_0
const/4 v0, 0x1
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
if-nez v0, :cond_1
return v2
:cond_1
iget-boolean v0, p0, Landroidx/preference/PreferenceFragmentCompat$DividerDecoration;->mAllowDividerAfterLastItem:Z
2019-12-06 03:29:40 +00:00
invoke-virtual {p2, p1}, Landroid/view/ViewGroup;->indexOfChild(Landroid/view/View;)I
2019-11-15 02:21:15 +00:00
move-result p1
2019-12-06 03:29:40 +00:00
invoke-virtual {p2}, Landroid/view/ViewGroup;->getChildCount()I
2019-11-15 02:21:15 +00:00
move-result v1
sub-int/2addr v1, v3
if-ge p1, v1, :cond_3
add-int/2addr p1, v3
2019-12-06 03:29:40 +00:00
invoke-virtual {p2, p1}, Landroid/view/ViewGroup;->getChildAt(I)Landroid/view/View;
2019-11-15 02:21:15 +00:00
move-result-object p1
invoke-virtual {p2, p1}, Landroidx/recyclerview/widget/RecyclerView;->getChildViewHolder(Landroid/view/View;)Landroidx/recyclerview/widget/RecyclerView$ViewHolder;
move-result-object p1
instance-of p2, p1, Landroidx/preference/PreferenceViewHolder;
if-eqz p2, :cond_2
check-cast p1, Landroidx/preference/PreferenceViewHolder;
invoke-virtual {p1}, Landroidx/preference/PreferenceViewHolder;->isDividerAllowedAbove()Z
move-result p1
if-eqz p1, :cond_2
const/4 v0, 0x1
goto :goto_1
:cond_2
const/4 v0, 0x0
:cond_3
:goto_1
return v0
.end method
# virtual methods
.method public getItemOffsets(Landroid/graphics/Rect;Landroid/view/View;Landroidx/recyclerview/widget/RecyclerView;Landroidx/recyclerview/widget/RecyclerView$State;)V
.locals 0
invoke-direct {p0, p2, p3}, Landroidx/preference/PreferenceFragmentCompat$DividerDecoration;->shouldDrawDividerBelow(Landroid/view/View;Landroidx/recyclerview/widget/RecyclerView;)Z
move-result p2
if-eqz p2, :cond_0
iget p2, p0, Landroidx/preference/PreferenceFragmentCompat$DividerDecoration;->mDividerHeight:I
iput p2, p1, Landroid/graphics/Rect;->bottom:I
:cond_0
return-void
.end method
.method public onDrawOver(Landroid/graphics/Canvas;Landroidx/recyclerview/widget/RecyclerView;Landroidx/recyclerview/widget/RecyclerView$State;)V
.locals 6
iget-object p3, p0, Landroidx/preference/PreferenceFragmentCompat$DividerDecoration;->mDivider:Landroid/graphics/drawable/Drawable;
if-nez p3, :cond_0
return-void
:cond_0
2019-12-06 03:29:40 +00:00
invoke-virtual {p2}, Landroid/view/ViewGroup;->getChildCount()I
2019-11-15 02:21:15 +00:00
move-result p3
2019-12-06 03:29:40 +00:00
invoke-virtual {p2}, Landroid/view/ViewGroup;->getWidth()I
2019-11-15 02:21:15 +00:00
move-result v0
const/4 v1, 0x0
const/4 v2, 0x0
:goto_0
if-ge v2, p3, :cond_2
2019-12-06 03:29:40 +00:00
invoke-virtual {p2, v2}, Landroid/view/ViewGroup;->getChildAt(I)Landroid/view/View;
2019-11-15 02:21:15 +00:00
move-result-object v3
invoke-direct {p0, v3, p2}, Landroidx/preference/PreferenceFragmentCompat$DividerDecoration;->shouldDrawDividerBelow(Landroid/view/View;Landroidx/recyclerview/widget/RecyclerView;)Z
move-result v4
if-eqz v4, :cond_1
invoke-virtual {v3}, Landroid/view/View;->getY()F
move-result v4
float-to-int v4, v4
invoke-virtual {v3}, Landroid/view/View;->getHeight()I
move-result v3
2019-12-06 03:29:40 +00:00
add-int/2addr v3, v4
2019-11-15 02:21:15 +00:00
2019-12-06 03:29:40 +00:00
iget-object v4, p0, Landroidx/preference/PreferenceFragmentCompat$DividerDecoration;->mDivider:Landroid/graphics/drawable/Drawable;
2019-11-15 02:21:15 +00:00
iget v5, p0, Landroidx/preference/PreferenceFragmentCompat$DividerDecoration;->mDividerHeight:I
2019-12-06 03:29:40 +00:00
add-int/2addr v5, v3
2019-11-15 02:21:15 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {v4, v1, v3, v0, v5}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V
2019-11-15 02:21:15 +00:00
iget-object v3, p0, Landroidx/preference/PreferenceFragmentCompat$DividerDecoration;->mDivider:Landroid/graphics/drawable/Drawable;
invoke-virtual {v3, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V
:cond_1
add-int/lit8 v2, v2, 0x1
goto :goto_0
:cond_2
return-void
.end method
.method public setAllowDividerAfterLastItem(Z)V
.locals 0
iput-boolean p1, p0, Landroidx/preference/PreferenceFragmentCompat$DividerDecoration;->mAllowDividerAfterLastItem:Z
return-void
.end method
.method public setDivider(Landroid/graphics/drawable/Drawable;)V
.locals 1
if-eqz p1, :cond_0
invoke-virtual {p1}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I
move-result v0
iput v0, p0, Landroidx/preference/PreferenceFragmentCompat$DividerDecoration;->mDividerHeight:I
goto :goto_0
:cond_0
const/4 v0, 0x0
iput v0, p0, Landroidx/preference/PreferenceFragmentCompat$DividerDecoration;->mDividerHeight:I
:goto_0
iput-object p1, p0, Landroidx/preference/PreferenceFragmentCompat$DividerDecoration;->mDivider:Landroid/graphics/drawable/Drawable;
iget-object p1, p0, Landroidx/preference/PreferenceFragmentCompat$DividerDecoration;->this$0:Landroidx/preference/PreferenceFragmentCompat;
iget-object p1, p1, Landroidx/preference/PreferenceFragmentCompat;->mList:Landroidx/recyclerview/widget/RecyclerView;
invoke-virtual {p1}, Landroidx/recyclerview/widget/RecyclerView;->invalidateItemDecorations()V
return-void
.end method
.method public setDividerHeight(I)V
.locals 0
iput p1, p0, Landroidx/preference/PreferenceFragmentCompat$DividerDecoration;->mDividerHeight:I
iget-object p1, p0, Landroidx/preference/PreferenceFragmentCompat$DividerDecoration;->this$0:Landroidx/preference/PreferenceFragmentCompat;
iget-object p1, p1, Landroidx/preference/PreferenceFragmentCompat;->mList:Landroidx/recyclerview/widget/RecyclerView;
invoke-virtual {p1}, Landroidx/recyclerview/widget/RecyclerView;->invalidateItemDecorations()V
return-void
.end method