apkfuckery/com.discord/smali/androidx/preference/PreferenceFragment$ScrollToPreferenceObserver.smali
2019-11-15 03:21:15 +01:00

137 lines
4.6 KiB
Smali

.class Landroidx/preference/PreferenceFragment$ScrollToPreferenceObserver;
.super Landroidx/recyclerview/widget/RecyclerView$AdapterDataObserver;
.source "PreferenceFragment.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Landroidx/preference/PreferenceFragment;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x8
name = "ScrollToPreferenceObserver"
.end annotation
# instance fields
.field private final mAdapter:Landroidx/recyclerview/widget/RecyclerView$Adapter;
.field private final mKey:Ljava/lang/String;
.field private final mList:Landroidx/recyclerview/widget/RecyclerView;
.field private final mPreference:Landroidx/preference/Preference;
# direct methods
.method constructor <init>(Landroidx/recyclerview/widget/RecyclerView$Adapter;Landroidx/recyclerview/widget/RecyclerView;Landroidx/preference/Preference;Ljava/lang/String;)V
.locals 0
invoke-direct {p0}, Landroidx/recyclerview/widget/RecyclerView$AdapterDataObserver;-><init>()V
iput-object p1, p0, Landroidx/preference/PreferenceFragment$ScrollToPreferenceObserver;->mAdapter:Landroidx/recyclerview/widget/RecyclerView$Adapter;
iput-object p2, p0, Landroidx/preference/PreferenceFragment$ScrollToPreferenceObserver;->mList:Landroidx/recyclerview/widget/RecyclerView;
iput-object p3, p0, Landroidx/preference/PreferenceFragment$ScrollToPreferenceObserver;->mPreference:Landroidx/preference/Preference;
iput-object p4, p0, Landroidx/preference/PreferenceFragment$ScrollToPreferenceObserver;->mKey:Ljava/lang/String;
return-void
.end method
.method private scrollToPreference()V
.locals 2
iget-object v0, p0, Landroidx/preference/PreferenceFragment$ScrollToPreferenceObserver;->mAdapter:Landroidx/recyclerview/widget/RecyclerView$Adapter;
invoke-virtual {v0, p0}, Landroidx/recyclerview/widget/RecyclerView$Adapter;->unregisterAdapterDataObserver(Landroidx/recyclerview/widget/RecyclerView$AdapterDataObserver;)V
iget-object v0, p0, Landroidx/preference/PreferenceFragment$ScrollToPreferenceObserver;->mPreference:Landroidx/preference/Preference;
if-eqz v0, :cond_0
iget-object v1, p0, Landroidx/preference/PreferenceFragment$ScrollToPreferenceObserver;->mAdapter:Landroidx/recyclerview/widget/RecyclerView$Adapter;
check-cast v1, Landroidx/preference/PreferenceGroup$PreferencePositionCallback;
invoke-interface {v1, v0}, Landroidx/preference/PreferenceGroup$PreferencePositionCallback;->getPreferenceAdapterPosition(Landroidx/preference/Preference;)I
move-result v0
goto :goto_0
:cond_0
iget-object v0, p0, Landroidx/preference/PreferenceFragment$ScrollToPreferenceObserver;->mAdapter:Landroidx/recyclerview/widget/RecyclerView$Adapter;
check-cast v0, Landroidx/preference/PreferenceGroup$PreferencePositionCallback;
iget-object v1, p0, Landroidx/preference/PreferenceFragment$ScrollToPreferenceObserver;->mKey:Ljava/lang/String;
invoke-interface {v0, v1}, Landroidx/preference/PreferenceGroup$PreferencePositionCallback;->getPreferenceAdapterPosition(Ljava/lang/String;)I
move-result v0
:goto_0
const/4 v1, -0x1
if-eq v0, v1, :cond_1
iget-object v1, p0, Landroidx/preference/PreferenceFragment$ScrollToPreferenceObserver;->mList:Landroidx/recyclerview/widget/RecyclerView;
invoke-virtual {v1, v0}, Landroidx/recyclerview/widget/RecyclerView;->scrollToPosition(I)V
:cond_1
return-void
.end method
# virtual methods
.method public onChanged()V
.locals 0
invoke-direct {p0}, Landroidx/preference/PreferenceFragment$ScrollToPreferenceObserver;->scrollToPreference()V
return-void
.end method
.method public onItemRangeChanged(II)V
.locals 0
invoke-direct {p0}, Landroidx/preference/PreferenceFragment$ScrollToPreferenceObserver;->scrollToPreference()V
return-void
.end method
.method public onItemRangeChanged(IILjava/lang/Object;)V
.locals 0
invoke-direct {p0}, Landroidx/preference/PreferenceFragment$ScrollToPreferenceObserver;->scrollToPreference()V
return-void
.end method
.method public onItemRangeInserted(II)V
.locals 0
invoke-direct {p0}, Landroidx/preference/PreferenceFragment$ScrollToPreferenceObserver;->scrollToPreference()V
return-void
.end method
.method public onItemRangeMoved(III)V
.locals 0
invoke-direct {p0}, Landroidx/preference/PreferenceFragment$ScrollToPreferenceObserver;->scrollToPreference()V
return-void
.end method
.method public onItemRangeRemoved(II)V
.locals 0
invoke-direct {p0}, Landroidx/preference/PreferenceFragment$ScrollToPreferenceObserver;->scrollToPreference()V
return-void
.end method