| | | |
Offset 3, 213 lines modified | Offset 3, 244 lines modified |
3 | .source·"CarUiSwitchPreference.java" | 3 | .source·"CarUiSwitchPreference.java" |
| |
4 | #·interfaces | 4 | #·interfaces |
5 | .implements·Lcom/android/car/ui/preference/DisabledPreferenceCallback; | 5 | .implements·Lcom/android/car/ui/preference/DisabledPreferenceCallback; |
| |
| |
6 | #·instance·fields | 6 | #·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·methods | 17 | #·direct·methods |
13 | .method·public·constructor·<init>(Landroid/content/Context;)V | 18 | .method·public·constructor·<init>(Landroid/content/Context;)V |
14 | ····.locals·1 | 19 | ····.locals·0 |
| |
15 | ····.line·63 | 20 | ····.line·59 |
16 | ····invoke-direct·{p0,·p1},·Landroidx/preference/SwitchPreference;-><init>(Landroid/content/Context;)V | 21 | ····invoke-direct·{p0,·p1},·Landroidx/preference/SwitchPreference;-><init>(Landroid/content/Context;)V |
| |
17 | ····const/4·v0,·0x0 | 22 | ····const/4·p1,·0x0 |
| |
18 | ····.line·64 | 23 | ····.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;)V | 27 | ····invoke-direct·{p0,·p1},·Lcom/android/car/ui/preference/CarUiSwitchPreference;->init(Landroid/util/AttributeSet;)V |
| |
20 | ····return-void | 28 | ····return-void |
21 | .end·method | 29 | .end·method |
| |
22 | .method·public·constructor·<init>(Landroid/content/Context;Landroid/util/AttributeSet;)V | 30 | .method·public·constructor·<init>(Landroid/content/Context;Landroid/util/AttributeSet;)V |
23 | ····.locals·0 | 31 | ····.locals·0 |
| |
24 | ····.line·58 | 32 | ····.line·54 |
25 | ····invoke-direct·{p0,·p1,·p2},·Landroidx/preference/SwitchPreference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V | 33 | ····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·59 | 37 | ····.line·55 |
27 | ····invoke-direct·{p0,·p1,·p2},·Lcom/android/car/ui/preference/CarUiSwitchPreference;->init(Landroid/content/Context;Landroid/util/AttributeSet;)V | 38 | ····invoke-direct·{p0,·p2},·Lcom/android/car/ui/preference/CarUiSwitchPreference;->init(Landroid/util/AttributeSet;)V |
| |
28 | ····return-void | 39 | ····return-void |
29 | .end·method | 40 | .end·method |
| |
30 | .method·public·constructor·<init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V | 41 | .method·public·constructor·<init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V |
31 | ····.locals·0 | 42 | ····.locals·0 |
| |
32 | ····.line·53 | 43 | ····.line·49 |
33 | ····invoke-direct·{p0,·p1,·p2,·p3},·Landroidx/preference/SwitchPreference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V | 44 | ····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·54 | 46 | ····.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;)V | 49 | ····invoke-direct·{p0,·p2},·Lcom/android/car/ui/preference/CarUiSwitchPreference;->init(Landroid/util/AttributeSet;)V |
| |
36 | ····return-void | 50 | ····return-void |
37 | .end·method | 51 | .end·method |
| |
38 | .method·public·constructor·<init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V | 52 | .method·public·constructor·<init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V |
39 | ····.locals·0 | 53 | ····.locals·0 |
| |
40 | ····.line·48 | 54 | ····.line·44 |
41 | ····invoke-direct·{p0,·p1,·p2,·p3,·p4},·Landroidx/preference/SwitchPreference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V | 55 | ····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·49 | 57 | ····.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;)V | 60 | ····invoke-direct·{p0,·p2},·Lcom/android/car/ui/preference/CarUiSwitchPreference;->init(Landroid/util/AttributeSet;)V |
| |
44 | ····return-void | 61 | ····return-void |
45 | .end·method | 62 | .end·method |
| |
46 | .method·private·init(Landroid/content/Context;Landroid/util/AttributeSet;)V | 63 | .method·private·init(Landroid/util/AttributeSet;)V |
47 | ····.locals·1 | 64 | ····.locals·2 |
| |
48 | ····.line·68 | |
49 | ····iput-object·p1,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mContext:Landroid/content/Context; | |
| |
50 | ····.line·69 | 65 | ····.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·p1 | 67 | ····move-result-object·v0 |
| |
53 | ····sget-object·v0,·Lcom/android/car/ui/R$styleable;->CarUiPreference:[I | 68 | ····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·p1 | 70 | ····move-result-object·p1 |
| |
56 | ····.line·71 | 71 | ····.line·65 |
57 | ····sget·p2,·Lcom/android/car/ui/R$styleable;->CarUiPreference_showRippleOnDisabledPreference:I | 72 | ····sget·v0,·Lcom/android/car/ui/R$styleable;->CarUiPreference_car_ui_ux_restricted:I |
| |
58 | ····const/4·v0,·0x0 | 73 | ····const/4·v1,·0x0 |
| |
59 | ····invoke-virtual·{p1,·p2,·v0},·Landroid/content/res/TypedArray;->getBoolean(IZ)Z | 74 | ····invoke-virtual·{p1,·v0,·v1},·Landroid/content/res/TypedArray;->getBoolean(IZ)Z |
| |
60 | ····move-result·p2 | 75 | ····move-result·v0 |
| |
61 | ····iput-boolean·p2,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mShouldShowRippleOnDisabledPreference:Z | 76 | ····iput-boolean·v0,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mUxRestricted:Z |
| |
62 | ····.line·73 | 77 | ····.line·66 |
63 | ····invoke-virtual·{p1},·Landroid/content/res/TypedArray;->recycle()V | 78 | ····invoke-virtual·{p1},·Landroid/content/res/TypedArray;->recycle()V |
| |
64 | ····return-void | 79 | ····return-void |
65 | .end·method | 80 | .end·method |
| |
| |
66 | #·virtual·methods | 81 | #·virtual·methods |
67 | .method·public·onBindViewHolder(Landroidx/preference/PreferenceViewHolder;)V | 82 | .method·public·getOnClickWhileRestrictedListener()Ljava/util/function/Consumer; |
68 | ····.locals·3 | 83 | ····.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·78 | 92 | ····.line·109 |
70 | ····invoke-super·{p0,·p1},·Landroidx/preference/SwitchPreference;->onBindViewHolder(Landroidx/preference/PreferenceViewHolder;)V | 93 | ····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·80 | 98 | ····.line·98 |
75 | ····invoke-virtual·{p0},·Landroidx/preference/Preference;->isEnabled()Z | 99 | ····iget-boolean·v0,·p0,·Lcom/android/car/ui/preference/CarUiSwitchPreference;->mUxRestricted:Z |
| |
76 | ····move-result·v0 | 100 | ····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:Z | 106 | ····.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·p1 | 109 | ····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-void | 111 | ····return-void |
84 | .end·method | 112 | .end·method |
| |
85 | .method·public·performClick()V | 113 | .method·public·performClick()V |
86 | ····.locals·3 | 114 | ····.locals·1 |
| |
87 | ····.line·91 | 115 | ····.line·79 |
88 | ····invoke-virtual·{p0},·Landroidx/preference/Preference;->isEnabled()Z | 116 | ····invoke-virtual·{p0},·Landroidx/preference/Preference;->isEnabled()Z |
| |
89 | ····move-result·v0 | 117 | ····move-result·v0 |
| |
90 | ····if-eqz·v0,·:cond_0 | 118 | ····if-nez·v0,·:cond_0 |
| |
91 | ····.line·92 | |
92 | ····invoke-super·{p0},·Landroidx/preference/Preference;->performClick()V | 119 | ····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_1 | 121 | ····if-eqz·v0,·:cond_1 |
| |
98 | ····.line·94 | |
99 | ····invoke-virtual·{v0},·Ljava/lang/String;->isEmpty()Z | 122 | ····:cond_0 |
| 123 | ····invoke-virtual·{p0},·Lcom/android/car/ui/preference/CarUiSwitchPreference;->isUxRestricted()Z |
| |
100 | ····move-result·v0 | 124 | ····move-result·v0 |
| |
101 | ····if-nez·v0,·:cond_1 | 125 | ····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,·0x1 | 126 | ····.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·v0 | 129 | ····.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_1 | 133 | ····:cond_1 |
| 134 | ····invoke-super·{p0},·Landroidx/preference/Preference;->performClick()V |
| |
| 135 | ····:cond_2 |
111 | ····:goto_0 | 136 | ····:goto_0 |
112 | ····return-void | 137 | ····return-void |
113 | .end·method | 138 | .end·method |
| |
114 | .method·public·setMessageToShowWhenDisabledPreferenceClicked(Ljava/lang/String;)V | 139 | .method·public·setOnClickWhileRestrictedListener(Ljava/util/function/Consumer;)V |
115 | ····.locals·0 | 140 | ····.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·112 | 149 | ····.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-void | 151 | ····return-void |
119 | .end·method | 152 | .end·method |
| |
120 | .method·public·setShouldShowRippleOnDisabledPreference(Z)V | 153 | .method·public·setUxRestricted(Z)V |
121 | ····.locals·3 | 154 | ····.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:Z | 156 | ····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;)V | 160 | ····.line·92 |
| 161 | ····invoke-virtual·{p0},·Landroidx/preference/Preference;->notifyChanged()V |
| |
| 162 | ····:cond_0 |
131 | ····return-void | 163 | ····return-void |
132 | .end·method | 164 | .end·method |