Offset 3, 213 lines modifiedOffset 3, 244 lines modified
3 .source·"CarUiSwitchPreference.java"3 .source·"CarUiSwitchPreference.java"
  
4 #·interfaces4 #·interfaces
5 .implements·Lcom/android/car/ui/preference/DisabledPreferenceCallback;5 .implements·Lcom/android/car/ui/preference/DisabledPreferenceCallback;
  
  
6 #·instance·fields6 #·instance·fields
7 .field·private·mBackground:Landroid/graphics/drawable/Drawable;7 .field·private·mRestrictedClickListener:Ljava/util/function/Consumer;
 8 ····.annotation·system·Ldalvik/annotation/Signature;
 9 ········value·=·{
 10 ············"Ljava/util/function/Consumer<",
 11 ············"Landroidx/preference/Preference;",
 12 ············">;"
 13 ········}
 14 ····.end·annotation
 15 .end·field
  
 16 .field·private·mUxRestricted:Z
8 .field·private·mContext:Landroid/content/Context; 
  
9 .field·private·mMessageToShowWhenDisabledPreferenceClicked:Ljava/lang/String; 
  
10 .field·private·mPreference:Landroid/view/View; 
  
11 .field·private·mShouldShowRippleOnDisabledPreference:Z 
  
  
12 #·direct·methods17 #·direct·methods
13 .method·public·constructor·<init>(Landroid/content/Context;)V18 .method·public·constructor·<init>(Landroid/content/Context;)V
14 ····.locals·119 ····.locals·0
  
15 ····.line·6320 ····.line·59
16 ····invoke-direct·{p0,·p1},·Landroidx/preference/SwitchPreference;-><init>(Landroid/content/Context;)V21 ····invoke-direct·{p0,·p1},·Landroidx/preference/SwitchPreference;-><init>(Landroid/content/Context;)V
  
17 ····const/4·v0,·0x022 ····const/4·p1,·0x0
  
18 ····.line·6423 ····.line·40
 24 ····iput-boolean·p1,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mUxRestricted:Z
  
 25 ····const/4·p1,·0x0
  
 26 ····.line·60
19 ····invoke-direct·{p0,·p1,·v0},·Lcom/android/car/ui/preference/CarUiSwitchPreference;->init(Landroid/content/Context;Landroid/util/AttributeSet;)V27 ····invoke-direct·{p0,·p1},·Lcom/android/car/ui/preference/CarUiSwitchPreference;->init(Landroid/util/AttributeSet;)V
  
20 ····return-void28 ····return-void
21 .end·method29 .end·method
  
22 .method·public·constructor·<init>(Landroid/content/Context;Landroid/util/AttributeSet;)V30 .method·public·constructor·<init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
23 ····.locals·031 ····.locals·0
  
24 ····.line·5832 ····.line·54
25 ····invoke-direct·{p0,·p1,·p2},·Landroidx/preference/SwitchPreference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V33 ····invoke-direct·{p0,·p1,·p2},·Landroidx/preference/SwitchPreference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
  
 34 ····const/4·p1,·0x0
  
 35 ····.line·40
 36 ····iput-boolean·p1,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mUxRestricted:Z
  
26 ····.line·5937 ····.line·55
27 ····invoke-direct·{p0,·p1,·p2},·Lcom/android/car/ui/preference/CarUiSwitchPreference;->init(Landroid/content/Context;Landroid/util/AttributeSet;)V38 ····invoke-direct·{p0,·p2},·Lcom/android/car/ui/preference/CarUiSwitchPreference;->init(Landroid/util/AttributeSet;)V
  
28 ····return-void39 ····return-void
29 .end·method40 .end·method
  
30 .method·public·constructor·<init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V41 .method·public·constructor·<init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
31 ····.locals·042 ····.locals·0
  
32 ····.line·5343 ····.line·49
33 ····invoke-direct·{p0,·p1,·p2,·p3},·Landroidx/preference/SwitchPreference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V44 ····invoke-direct·{p0,·p1,·p2,·p3},·Landroidx/preference/SwitchPreference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
  
 45 ····const/4·p1,·0x0
  
34 ····.line·5446 ····.line·40
 47 ····iput-boolean·p1,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mUxRestricted:Z
  
 48 ····.line·50
35 ····invoke-direct·{p0,·p1,·p2},·Lcom/android/car/ui/preference/CarUiSwitchPreference;->init(Landroid/content/Context;Landroid/util/AttributeSet;)V49 ····invoke-direct·{p0,·p2},·Lcom/android/car/ui/preference/CarUiSwitchPreference;->init(Landroid/util/AttributeSet;)V
  
36 ····return-void50 ····return-void
37 .end·method51 .end·method
  
38 .method·public·constructor·<init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V52 .method·public·constructor·<init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V
39 ····.locals·053 ····.locals·0
  
40 ····.line·4854 ····.line·44
41 ····invoke-direct·{p0,·p1,·p2,·p3,·p4},·Landroidx/preference/SwitchPreference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V55 ····invoke-direct·{p0,·p1,·p2,·p3,·p4},·Landroidx/preference/SwitchPreference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V
  
 56 ····const/4·p1,·0x0
  
42 ····.line·4957 ····.line·40
 58 ····iput-boolean·p1,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mUxRestricted:Z
  
 59 ····.line·45
43 ····invoke-direct·{p0,·p1,·p2},·Lcom/android/car/ui/preference/CarUiSwitchPreference;->init(Landroid/content/Context;Landroid/util/AttributeSet;)V60 ····invoke-direct·{p0,·p2},·Lcom/android/car/ui/preference/CarUiSwitchPreference;->init(Landroid/util/AttributeSet;)V
  
44 ····return-void61 ····return-void
45 .end·method62 .end·method
  
46 .method·private·init(Landroid/content/Context;Landroid/util/AttributeSet;)V63 .method·private·init(Landroid/util/AttributeSet;)V
47 ····.locals·164 ····.locals·2
  
48 ····.line·68 
49 ····iput-object·p1,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mContext:Landroid/content/Context; 
  
50 ····.line·6965 ····.line·64
51 ····invoke-virtual·{p0},·Landroidx/preference/Preference;->getContext()Landroid/content/Context;66 ····invoke-virtual·{p0},·Landroidx/preference/Preference;->getContext()Landroid/content/Context;
  
52 ····move-result-object·p167 ····move-result-object·v0
  
53 ····sget-object·v0,·Lcom/android/car/ui/R$styleable;->CarUiPreference:[I68 ····sget-object·v1,·Lcom/android/car/ui/R$styleable;->CarUiPreference:[I
  
54 ····invoke-virtual·{p1,·p2,·v0},·Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;69 ····invoke-virtual·{v0,·p1,·v1},·Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;
  
55 ····move-result-object·p170 ····move-result-object·p1
  
56 ····.line·7171 ····.line·65
57 ····sget·p2,·Lcom/android/car/ui/R$styleable;->CarUiPreference_showRippleOnDisabledPreference:I72 ····sget·v0,·Lcom/android/car/ui/R$styleable;->CarUiPreference_car_ui_ux_restricted:I
  
58 ····const/4·v0,·0x073 ····const/4·v1,·0x0
  
59 ····invoke-virtual·{p1,·p2,·v0},·Landroid/content/res/TypedArray;->getBoolean(IZ)Z74 ····invoke-virtual·{p1,·v0,·v1},·Landroid/content/res/TypedArray;->getBoolean(IZ)Z
  
60 ····move-result·p275 ····move-result·v0
  
61 ····iput-boolean·p2,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mShouldShowRippleOnDisabledPreference:Z76 ····iput-boolean·v0,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mUxRestricted:Z
  
62 ····.line·7377 ····.line·66
63 ····invoke-virtual·{p1},·Landroid/content/res/TypedArray;->recycle()V78 ····invoke-virtual·{p1},·Landroid/content/res/TypedArray;->recycle()V
  
64 ····return-void79 ····return-void
65 .end·method80 .end·method
  
  
66 #·virtual·methods81 #·virtual·methods
67 .method·public·onBindViewHolder(Landroidx/preference/PreferenceViewHolder;)V82 .method·public·getOnClickWhileRestrictedListener()Ljava/util/function/Consumer;
68 ····.locals·383 ····.locals·1
 84 ····.annotation·system·Ldalvik/annotation/Signature;
 85 ········value·=·{
 86 ············"()",
 87 ············"Ljava/util/function/Consumer<",
 88 ············"Landroidx/preference/Preference;",
 89 ············">;"
 90 ········}
 91 ····.end·annotation
  
69 ····.line·7892 ····.line·109
70 ····invoke-super·{p0,·p1},·Landroidx/preference/SwitchPreference;->onBindViewHolder(Landroidx/preference/PreferenceViewHolder;)V93 ····iget-object·v0,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mRestrictedClickListener:Ljava/util/function/Consumer;
  
71 ····.line·79 
72 ····iget-object·v0,·p1,·Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->itemView:Landroid/view/View;94 ····return-object·v0
 95 .end·method
  
73 ····iput-object·v0,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mPreference:Landroid/view/View;96 .method·public·isUxRestricted()Z
 97 ····.locals·1
  
74 ····.line·8098 ····.line·98
75 ····invoke-virtual·{p0},·Landroidx/preference/Preference;->isEnabled()Z99 ····iget-boolean·v0,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mUxRestricted:Z
  
76 ····move-result·v0100 ····return·v0
 101 .end·method
  
77 ····iget-object·p1,·p1,·Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->itemView:Landroid/view/View;102 .method·public·onBindViewHolder(Landroidx/preference/PreferenceViewHolder;)V
 103 ····.locals·1
  
78 ····iget-object·v1,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mBackground:Landroid/graphics/drawable/Drawable;104 ····.line·71
 105 ····invoke-super·{p0,·p1},·Landroidx/preference/SwitchPreference;->onBindViewHolder(Landroidx/preference/PreferenceViewHolder;)V
  
79 ····iget-boolean·v2,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mShouldShowRippleOnDisabledPreference:Z106 ····.line·73
 107 ····iget-object·p1,·p1,·Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->itemView:Landroid/view/View;
  
80 ····invoke-static·{v0,·p1,·v1,·v2},·Lcom/android/car/ui/utils/CarUiUtils;->setPreferenceViewEnabled(ZLandroid/view/View;Landroid/graphics/drawable/Drawable;Z)Landroid/graphics/drawable/Drawable;108 ····invoke-virtual·{p0},·Lcom/android/car/ui/preference/CarUiSwitchPreference;->isUxRestricted()Z
  
81 ····move-result-object·p1109 ····move-result·v0
  
82 ····iput-object·p1,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mBackground:Landroid/graphics/drawable/Drawable;110 ····invoke-static·{p1,·v0},·Lcom/android/car/ui/utils/ViewUtils;->makeAllViewsUxRestricted(Landroid/view/View;Z)V
  
83 ····return-void111 ····return-void
84 .end·method112 .end·method
  
85 .method·public·performClick()V113 .method·public·performClick()V
86 ····.locals·3114 ····.locals·1
  
87 ····.line·91115 ····.line·79
88 ····invoke-virtual·{p0},·Landroidx/preference/Preference;->isEnabled()Z116 ····invoke-virtual·{p0},·Landroidx/preference/Preference;->isEnabled()Z
  
89 ····move-result·v0117 ····move-result·v0
  
90 ····if-eqz·v0,·:cond_0118 ····if-nez·v0,·:cond_0
  
91 ····.line·92 
92 ····invoke-super·{p0},·Landroidx/preference/Preference;->performClick()V119 ····invoke-virtual·{p0},·Landroidx/preference/Preference;->isSelectable()Z
  
93 ····goto·:goto_0 
  
 120 ····move-result·v0
94 ····.line·93 
95 ····:cond_0 
96 ····iget-object·v0,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mMessageToShowWhenDisabledPreferenceClicked:Ljava/lang/String; 
  
97 ····if-eqz·v0,·:cond_1121 ····if-eqz·v0,·:cond_1
  
98 ····.line·94 
99 ····invoke-virtual·{v0},·Ljava/lang/String;->isEmpty()Z122 ····:cond_0
 123 ····invoke-virtual·{p0},·Lcom/android/car/ui/preference/CarUiSwitchPreference;->isUxRestricted()Z
  
100 ····move-result·v0124 ····move-result·v0
  
101 ····if-nez·v0,·:cond_1125 ····if-eqz·v0,·:cond_1
  
102 ····.line·95 
103 ····iget-object·v0,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mContext:Landroid/content/Context; 
  
104 ····iget-object·v1,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mMessageToShowWhenDisabledPreferenceClicked:Ljava/lang/String; 
  
105 ····const/4·v2,·0x1126 ····.line·80
 127 ····iget-object·v0,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mRestrictedClickListener:Ljava/util/function/Consumer;
  
106 ····invoke-static·{v0,·v1,·v2},·Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;128 ····if-eqz·v0,·:cond_2
  
107 ····move-result-object·v0129 ····.line·81
 130 ····invoke-interface·{v0,·p0},·Ljava/util/function/Consumer;->accept(Ljava/lang/Object;)V
  
 131 ····goto·:goto_0
108 ····.line·96 
109 ····invoke-virtual·{v0},·Landroid/widget/Toast;->show()V 
  
 132 ····.line·84
110 ····:cond_1133 ····:cond_1
 134 ····invoke-super·{p0},·Landroidx/preference/Preference;->performClick()V
  
 135 ····:cond_2
111 ····:goto_0136 ····:goto_0
112 ····return-void137 ····return-void
113 .end·method138 .end·method
  
114 .method·public·setMessageToShowWhenDisabledPreferenceClicked(Ljava/lang/String;)V139 .method·public·setOnClickWhileRestrictedListener(Ljava/util/function/Consumer;)V
115 ····.locals·0140 ····.locals·0
 141 ····.annotation·system·Ldalvik/annotation/Signature;
 142 ········value·=·{
 143 ············"(",
 144 ············"Ljava/util/function/Consumer<",
 145 ············"Landroidx/preference/Preference;",
 146 ············">;)V"
 147 ········}
 148 ····.end·annotation
  
116 ····.line·112149 ····.line·103
117 ····iput-object·p1,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mMessageToShowWhenDisabledPreferenceClicked:Ljava/lang/String;150 ····iput-object·p1,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mRestrictedClickListener:Ljava/util/function/Consumer;
  
118 ····return-void151 ····return-void
119 .end·method152 .end·method
  
120 .method·public·setShouldShowRippleOnDisabledPreference(Z)V153 .method·public·setUxRestricted(Z)V
121 ····.locals·3154 ····.locals·1
  
122 ····.line·105 
123 ····iput-boolean·p1,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mShouldShowRippleOnDisabledPreference:Z 
  
124 ····.line·106 
125 ····invoke-virtual·{p0},·Landroidx/preference/Preference;->isEnabled()Z 
  
126 ····move-result·p1 
  
 155 ····.line·90
127 ····iget-boolean·v0,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mShouldShowRippleOnDisabledPreference:Z156 ····iget-boolean·v0,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mUxRestricted:Z
  
128 ····iget-object·v1,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mBackground:Landroid/graphics/drawable/Drawable;157 ····if-eq·v0,·p1,·:cond_0
  
129 ····iget-object·v2,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mPreference:Landroid/view/View;158 ····.line·91
 159 ····iput-boolean·p1,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mUxRestricted:Z
  
130 ····invoke-static·{p1,·v0,·v1,·v2},·Lcom/android/car/ui/utils/CarUiUtils;->updateRippleStateOnDisabledPreference(ZZLandroid/graphics/drawable/Drawable;Landroid/view/View;)V160 ····.line·92
 161 ····invoke-virtual·{p0},·Landroidx/preference/Preference;->notifyChanged()V
  
 162 ····:cond_0
131 ····return-void163 ····return-void
132 .end·method164 .end·method