Offset 3, 289 lines modifiedOffset 3, 302 lines modified
3 .source·"CarUiPreference.java"3 .source·"CarUiPreference.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; 
  
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:Z7 .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
  
12 .field·private·mShowChevron:Z16 .field·private·mShowChevron:Z
  
 17 .field·private·mUxRestricted:Z
  
  
13 #·direct·methods18 #·direct·methods
14 .method·public·constructor·<init>(Landroid/content/Context;)V19 .method·public·constructor·<init>(Landroid/content/Context;)V
15 ····.locals·120 ····.locals·1
  
16 ····const/4·v0,·0x021 ····const/4·v0,·0x0
  
17 ····.line·6222 ····.line·57
18 ····invoke-direct·{p0,·p1,·v0},·Lcom/android/car/ui/preference/CarUiPreference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V23 ····invoke-direct·{p0,·p1,·v0},·Lcom/android/car/ui/preference/CarUiPreference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
  
19 ····return-void24 ····return-void
20 .end·method25 .end·method
  
21 .method·public·constructor·<init>(Landroid/content/Context;Landroid/util/AttributeSet;)V26 .method·public·constructor·<init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
22 ····.locals·127 ····.locals·1
  
23 ····.line·5828 ····.line·53
24 ····sget·v0,·Lcom/android/car/ui/R$attr;->carUiPreferenceStyle:I29 ····sget·v0,·Lcom/android/car/ui/R$attr;->carUiPreferenceStyle:I
  
25 ····invoke-direct·{p0,·p1,·p2,·v0},·Lcom/android/car/ui/preference/CarUiPreference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V30 ····invoke-direct·{p0,·p1,·p2,·v0},·Lcom/android/car/ui/preference/CarUiPreference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
  
26 ····return-void31 ····return-void
27 .end·method32 .end·method
  
28 .method·public·constructor·<init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V33 .method·public·constructor·<init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
29 ····.locals·134 ····.locals·1
  
30 ····.line·5435 ····.line·49
31 ····sget·v0,·Lcom/android/car/ui/R$style;->Preference_CarUi_Preference:I36 ····sget·v0,·Lcom/android/car/ui/R$style;->Preference_CarUi_Preference:I
  
32 ····invoke-direct·{p0,·p1,·p2,·p3,·v0},·Lcom/android/car/ui/preference/CarUiPreference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V37 ····invoke-direct·{p0,·p1,·p2,·p3,·v0},·Lcom/android/car/ui/preference/CarUiPreference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V
  
33 ····return-void38 ····return-void
34 .end·method39 .end·method
  
35 .method·public·constructor·<init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V40 .method·public·constructor·<init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V
36 ····.locals·041 ····.locals·0
  
37 ····.line·4942 ····.line·44
38 ····invoke-direct·{p0,·p1,·p2,·p3,·p4},·Landroidx/preference/Preference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V43 ····invoke-direct·{p0,·p1,·p2,·p3,·p4},·Landroidx/preference/Preference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V
  
 44 ····const/4·p1,·0x0
39 ····.line·50 
40 ····invoke-virtual·{p0,·p1,·p2,·p3,·p4},·Lcom/android/car/ui/preference/CarUiPreference;->init(Landroid/content/Context;Landroid/util/AttributeSet;II)V 
  
41 ····return-void 
42 .end·method45 ····.line·40
 46 ····iput-boolean·p1,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mUxRestricted:Z
  
 47 ····.line·45
 48 ····invoke-direct·{p0,·p2,·p3,·p4},·Lcom/android/car/ui/preference/CarUiPreference;->init(Landroid/util/AttributeSet;II)V
  
 49 ····return-void
 50 .end·method
43 #·virtual·methods 
44 .method·public·init(Landroid/content/Context;Landroid/util/AttributeSet;II)V 
45 ····.locals·1 
  
46 ····.line·66 
47 ····iput-object·p1,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mContext:Landroid/content/Context;51 .method·private·init(Landroid/util/AttributeSet;II)V
 52 ····.locals·2
  
48 ····.line·6853 ····.line·61
49 ····invoke-virtual·{p0},·Landroidx/preference/Preference;->getContext()Landroid/content/Context;54 ····invoke-virtual·{p0},·Landroidx/preference/Preference;->getContext()Landroid/content/Context;
  
50 ····move-result-object·p155 ····move-result-object·v0
  
51 ····sget-object·v0,·Lcom/android/car/ui/R$styleable;->CarUiPreference:[I56 ····sget-object·v1,·Lcom/android/car/ui/R$styleable;->CarUiPreference:[I
  
52 ····invoke-virtual·{p1,·p2,·v0,·p3,·p4},·Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[III)Landroid/content/res/TypedArray;57 ····invoke-virtual·{v0,·p1,·v1,·p2,·p3},·Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[III)Landroid/content/res/TypedArray;
  
53 ····move-result-object·p158 ····move-result-object·p1
  
54 ····.line·7459 ····.line·67
55 ····sget·p2,·Lcom/android/car/ui/R$styleable;->CarUiPreference_showChevron:I60 ····sget·p2,·Lcom/android/car/ui/R$styleable;->CarUiPreference_showChevron:I
  
56 ····const/4·p3,·0x161 ····const/4·p3,·0x1
  
57 ····invoke-virtual·{p1,·p2,·p3},·Landroid/content/res/TypedArray;->getBoolean(IZ)Z62 ····invoke-virtual·{p1,·p2,·p3},·Landroid/content/res/TypedArray;->getBoolean(IZ)Z
  
58 ····move-result·p263 ····move-result·p2
  
59 ····iput-boolean·p2,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mShowChevron:Z64 ····iput-boolean·p2,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mShowChevron:Z
  
60 ····.line·7565 ····.line·68
61 ····sget·p2,·Lcom/android/car/ui/R$styleable;->CarUiPreference_showRippleOnDisabledPreference:I66 ····sget·p2,·Lcom/android/car/ui/R$styleable;->CarUiPreference_car_ui_ux_restricted:I
  
62 ····const/4·p3,·0x067 ····const/4·p3,·0x0
  
63 ····invoke-virtual·{p1,·p2,·p3},·Landroid/content/res/TypedArray;->getBoolean(IZ)Z68 ····invoke-virtual·{p1,·p2,·p3},·Landroid/content/res/TypedArray;->getBoolean(IZ)Z
  
64 ····move-result·p269 ····move-result·p2
  
65 ····iput-boolean·p2,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mShouldShowRippleOnDisabledPreference:Z70 ····iput-boolean·p2,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mUxRestricted:Z
  
66 ····.line·7871 ····.line·70
67 ····invoke-virtual·{p1},·Landroid/content/res/TypedArray;->recycle()V72 ····invoke-virtual·{p1},·Landroid/content/res/TypedArray;->recycle()V
  
68 ····return-void73 ····return-void
69 .end·method74 .end·method
  
  
 75 #·virtual·methods
 76 .method·public·getOnClickWhileRestrictedListener()Ljava/util/function/Consumer;
 77 ····.locals·1
 78 ····.annotation·system·Ldalvik/annotation/Signature;
 79 ········value·=·{
 80 ············"()",
 81 ············"Ljava/util/function/Consumer<",
 82 ············"Landroidx/preference/Preference;",
 83 ············">;"
 84 ········}
 85 ····.end·annotation
  
 86 ····.line·126
 87 ····iget-object·v0,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mRestrictedClickListener:Ljava/util/function/Consumer;
  
 88 ····return-object·v0
 89 .end·method
  
 90 .method·public·isUxRestricted()Z
 91 ····.locals·1
  
 92 ····.line·115
 93 ····iget-boolean·v0,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mUxRestricted:Z
  
 94 ····return·v0
 95 .end·method
  
70 .method·public·onAttached()V96 .method·public·onAttached()V
71 ····.locals·297 ····.locals·2
  
72 ····.line·9398 ····.line·82
73 ····invoke-super·{p0},·Landroidx/preference/Preference;->onAttached()V99 ····invoke-super·{p0},·Landroidx/preference/Preference;->onAttached()V
  
74 ····.line·95100 ····.line·84
75 ····iget-object·v0,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mContext:Landroid/content/Context;101 ····invoke-virtual·{p0},·Landroidx/preference/Preference;->getContext()Landroid/content/Context;
  
 102 ····move-result-object·v0
  
76 ····invoke-virtual·{v0},·Landroid/content/Context;->getResources()Landroid/content/res/Resources;103 ····invoke-virtual·{v0},·Landroid/content/Context;->getResources()Landroid/content/res/Resources;
  
77 ····move-result-object·v0104 ····move-result-object·v0
  
78 ····sget·v1,·Lcom/android/car/ui/R$bool;->car_ui_preference_show_chevron:I105 ····sget·v1,·Lcom/android/car/ui/R$bool;->car_ui_preference_show_chevron:I
  
79 ····invoke-virtual·{v0,·v1},·Landroid/content/res/Resources;->getBoolean(I)Z106 ····invoke-virtual·{v0,·v1},·Landroid/content/res/Resources;->getBoolean(I)Z
  
80 ····move-result·v0107 ····move-result·v0
  
81 ····if-eqz·v0,·:cond_2108 ····if-eqz·v0,·:cond_2
  
82 ····.line·98109 ····.line·87
83 ····iget-boolean·v0,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mShowChevron:Z110 ····iget-boolean·v0,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mShowChevron:Z
  
84 ····if-nez·v0,·:cond_0111 ····if-nez·v0,·:cond_0
  
85 ····goto·:goto_0112 ····goto·:goto_0
  
86 ····.line·102113 ····.line·91
87 ····:cond_0114 ····:cond_0
88 ····invoke-virtual·{p0},·Landroidx/preference/Preference;->getOnPreferenceClickListener()Landroidx/preference/Preference$OnPreferenceClickListener;115 ····invoke-virtual·{p0},·Landroidx/preference/Preference;->getOnPreferenceClickListener()Landroidx/preference/Preference$OnPreferenceClickListener;
  
89 ····move-result-object·v0116 ····move-result-object·v0
  
90 ····if-nez·v0,·:cond_1117 ····if-nez·v0,·:cond_1
  
91 ····invoke-virtual·{p0},·Landroidx/preference/Preference;->getIntent()Landroid/content/Intent;118 ····invoke-virtual·{p0},·Landroidx/preference/Preference;->getIntent()Landroid/content/Intent;
  
92 ····move-result-object·v0119 ····move-result-object·v0
  
93 ····if-nez·v0,·:cond_1120 ····if-nez·v0,·:cond_1
  
94 ····.line·103121 ····.line·92
95 ····invoke-virtual·{p0},·Landroidx/preference/Preference;->getFragment()Ljava/lang/String;122 ····invoke-virtual·{p0},·Landroidx/preference/Preference;->getFragment()Ljava/lang/String;
  
96 ····move-result-object·v0123 ····move-result-object·v0
  
97 ····if-eqz·v0,·:cond_2124 ····if-eqz·v0,·:cond_2
  
98 ····.line·104125 ····.line·93
99 ····:cond_1126 ····:cond_1
100 ····sget·v0,·Lcom/android/car/ui/R$layout;->car_ui_preference_chevron:I127 ····sget·v0,·Lcom/android/car/ui/R$layout;->car_ui_preference_chevron:I
  
101 ····invoke-virtual·{p0,·v0},·Landroidx/preference/Preference;->setWidgetLayoutResource(I)V128 ····invoke-virtual·{p0,·v0},·Landroidx/preference/Preference;->setWidgetLayoutResource(I)V
  
102 ····:cond_2129 ····:cond_2
103 ····:goto_0130 ····:goto_0
104 ····return-void131 ····return-void
105 .end·method132 .end·method
  
106 .method·public·onBindViewHolder(Landroidx/preference/PreferenceViewHolder;)V133 .method·public·onBindViewHolder(Landroidx/preference/PreferenceViewHolder;)V
107 ····.locals·3134 ····.locals·1
  
108 ····.line·84135 ····.line·75
109 ····invoke-super·{p0,·p1},·Landroidx/preference/Preference;->onBindViewHolder(Landroidx/preference/PreferenceViewHolder;)V136 ····invoke-super·{p0,·p1},·Landroidx/preference/Preference;->onBindViewHolder(Landroidx/preference/PreferenceViewHolder;)V
  
110 ····.line·85137 ····.line·77
111 ····invoke-virtual·{p0},·Landroidx/preference/Preference;->isEnabled()Z 
  
112 ····move-result·v0 
  
113 ····.line·86 
114 ····iget-object·p1,·p1,·Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->itemView:Landroid/view/View;138 ····iget-object·p1,·p1,·Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->itemView:Landroid/view/View;
  
 139 ····invoke-virtual·{p0},·Lcom/android/car/ui/preference/CarUiPreference;->isUxRestricted()Z
115 ····iput-object·p1,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mPreference:Landroid/view/View; 
  
116 ····.line·87 
117 ····iget-object·v1,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mBackground:Landroid/graphics/drawable/Drawable; 
  
118 ····iget-boolean·v2,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mShouldShowRippleOnDisabledPreference:Z 
  
 140 ····move-result·v0
119 ····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; 
  
120 ····move-result-object·p1 
  
121 ····iput-object·p1,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mBackground:Landroid/graphics/drawable/Drawable;141 ····invoke-static·{p1,·v0},·Lcom/android/car/ui/utils/ViewUtils;->makeAllViewsUxRestricted(Landroid/view/View;Z)V
  
122 ····return-void142 ····return-void
123 .end·method143 .end·method
  
124 .method·public·performClick()V144 .method·public·performClick()V
125 ····.locals·3145 ····.locals·1
  
126 ····.line·115146 ····.line·100
127 ····invoke-virtual·{p0},·Landroidx/preference/Preference;->isEnabled()Z147 ····invoke-virtual·{p0},·Landroidx/preference/Preference;->isEnabled()Z
  
128 ····move-result·v0148 ····move-result·v0
  
129 ····if-eqz·v0,·:cond_0149 ····if-nez·v0,·:cond_0
  
130 ····.line·116 
131 ····invoke-super·{p0},·Landroidx/preference/Preference;->performClick()V 
  
132 ····goto·:goto_0150 ····invoke-virtual·{p0},·Landroidx/preference/Preference;->isSelectable()Z
  
 151 ····move-result·v0
133 ····.line·117 
134 ····:cond_0 
135 ····iget-object·v0,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mMessageToShowWhenDisabledPreferenceClicked:Ljava/lang/String; 
  
136 ····if-eqz·v0,·:cond_1152 ····if-eqz·v0,·:cond_1
  
137 ····.line·118 
138 ····invoke-virtual·{v0},·Ljava/lang/String;->isEmpty()Z153 ····:cond_0
 154 ····invoke-virtual·{p0},·Lcom/android/car/ui/preference/CarUiPreference;->isUxRestricted()Z
  
139 ····move-result·v0155 ····move-result·v0
  
140 ····if-nez·v0,·:cond_1156 ····if-eqz·v0,·:cond_1
  
141 ····.line·119 
142 ····iget-object·v0,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mContext:Landroid/content/Context; 
  
143 ····iget-object·v1,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mMessageToShowWhenDisabledPreferenceClicked:Ljava/lang/String; 
  
144 ····const/4·v2,·0x1157 ····.line·101
 158 ····iget-object·v0,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mRestrictedClickListener:Ljava/util/function/Consumer;
  
145 ····invoke-static·{v0,·v1,·v2},·Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;159 ····if-eqz·v0,·:cond_2
  
146 ····move-result-object·v0160 ····.line·102
 161 ····invoke-interface·{v0,·p0},·Ljava/util/function/Consumer;->accept(Ljava/lang/Object;)V
  
 162 ····goto·:goto_0
147 ····.line·120 
148 ····invoke-virtual·{v0},·Landroid/widget/Toast;->show()V 
  
 163 ····.line·105
149 ····:cond_1164 ····:cond_1
 165 ····invoke-super·{p0},·Landroidx/preference/Preference;->performClick()V
  
 166 ····:cond_2
150 ····:goto_0167 ····:goto_0
151 ····return-void168 ····return-void
152 .end·method169 .end·method
  
153 .method·public·setMessageToShowWhenDisabledPreferenceClicked(Ljava/lang/String;)V170 .method·public·setOnClickWhileRestrictedListener(Ljava/util/function/Consumer;)V
154 ····.locals·0171 ····.locals·0
 172 ····.annotation·system·Ldalvik/annotation/Signature;
 173 ········value·=·{
 174 ············"(",
 175 ············"Ljava/util/function/Consumer<",
 176 ············"Landroidx/preference/Preference;",
 177 ············">;)V"
 178 ········}
 179 ····.end·annotation
  
155 ····.line·140180 ····.line·120
156 ····iput-object·p1,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mMessageToShowWhenDisabledPreferenceClicked:Ljava/lang/String;181 ····iput-object·p1,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mRestrictedClickListener:Ljava/util/function/Consumer;
  
157 ····return-void182 ····return-void
158 .end·method183 .end·method
  
159 .method·public·setShouldShowRippleOnDisabledPreference(Z)V184 .method·public·setShowChevron(Z)V
160 ····.locals·3185 ····.locals·0
  
161 ····.line·133 
162 ····iput-boolean·p1,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mShouldShowRippleOnDisabledPreference:Z 
  
163 ····.line·134 
164 ····invoke-virtual·{p0},·Landroidx/preference/Preference;->isEnabled()Z 
  
165 ····move-result·p1 
  
166 ····iget-boolean·v0,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mShouldShowRippleOnDisabledPreference:Z 
  
167 ····iget-object·v1,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mBackground:Landroid/graphics/drawable/Drawable; 
  
168 ····iget-object·v2,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mPreference:Landroid/view/View; 
  
169 ····invoke-static·{p1,·v0,·v1,·v2},·Lcom/android/car/ui/utils/CarUiUtils;->updateRippleStateOnDisabledPreference(ZZLandroid/graphics/drawable/Drawable;Landroid/view/View;)V186 ····.line·110
 187 ····iput-boolean·p1,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mShowChevron:Z
  
170 ····return-void188 ····return-void
171 .end·method189 .end·method
  
172 .method·public·setShowChevron(Z)V190 .method·public·setUxRestricted(Z)V
173 ····.locals·0191 ····.locals·0
  
 192 ····.line·131
 193 ····iput-boolean·p1,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mUxRestricted:Z
  
174 ····.line·125194 ····.line·132
175 ····iput-boolean·p1,·p0,·Lcom/android/car/ui/preference/CarUiPreference;->mShowChevron:Z195 ····invoke-virtual·{p0},·Landroidx/preference/Preference;->notifyChanged()V
  
176 ····return-void196 ····return-void
177 .end·method197 .end·method