| | | |
Offset 9, 64 lines modified | Offset 9, 69 lines modified |
9 | import·com.android.car.ui.R$id; | 9 | import·com.android.car.ui.R$id; |
10 | import·android.widget.FrameLayout$LayoutParams; | 10 | import·android.widget.FrameLayout$LayoutParams; |
11 | import·android.view.ViewGroup; | 11 | import·android.view.ViewGroup; |
12 | import·com.android.car.ui.R$layout; | 12 | import·com.android.car.ui.R$layout; |
13 | import·android.view.LayoutInflater; | 13 | import·android.view.LayoutInflater; |
14 | import·android.view.View$OnGenericMotionListener; | 14 | import·android.view.View$OnGenericMotionListener; |
15 | import·android.content.res.TypedArray; | 15 | import·android.content.res.TypedArray; |
16 | import·android.view.ViewTreeObserver$OnGlobalLayoutListener; | |
17 | import·com.android.car.ui.R$string; | 16 | import·com.android.car.ui.R$string; |
18 | import·androidx.recyclerview.widget.GridLayoutManager; | |
19 | import·androidx.recyclerview.widget.RecyclerView$LayoutManager; | |
20 | import·androidx.recyclerview.widget.LinearLayoutManager; | 17 | import·androidx.recyclerview.widget.LinearLayoutManager; |
21 | import·com.android.car.ui.recyclerview.decorations.linear.LinearOffsetItemDecoration; | 18 | import·com.android.car.ui.recyclerview.decorations.linear.LinearOffsetItemDecoration; |
22 | import·com.android.car.ui.recyclerview.decorations.linear.LinearDividerItemDecoration; | 19 | import·com.android.car.ui.recyclerview.decorations.linear.LinearDividerItemDecoration; |
23 | import·com.android.car.ui.R$drawable; | 20 | import·com.android.car.ui.R$drawable; |
24 | import·com.android.car.ui.R$dimen; | 21 | import·com.android.car.ui.R$dimen; |
25 | import·com.android.car.ui.R$bool; | 22 | import·com.android.car.ui.R$bool; |
26 | import·com.android.car.ui.R$style; | 23 | import·com.android.car.ui.R$style; |
27 | import·com.android.car.ui.R$styleable; | 24 | import·com.android.car.ui.R$styleable; |
28 | import·android.text.TextUtils; | 25 | import·android.text.TextUtils; |
29 | import·android.view.View; | 26 | import·android.view.View; |
30 | import·android.util.Log; | 27 | import·android.util.Log; |
| 28 | import·androidx.recyclerview.widget.GridLayoutManager; |
| 29 | import·androidx.recyclerview.widget.RecyclerView$LayoutManager; |
31 | import·android.view.MotionEvent; | 30 | import·android.view.MotionEvent; |
32 | import·com.android.car.ui.R$attr; | 31 | import·com.android.car.ui.R$attr; |
33 | import·android.util.AttributeSet; | 32 | import·android.util.AttributeSet; |
34 | import·android.content.Context; | 33 | import·android.content.Context; |
35 | import·com.android.car.ui.recyclerview.decorations.grid.GridOffsetItemDecoration; | 34 | import·android.view.ViewTreeObserver$OnGlobalLayoutListener; |
36 | import·com.android.car.ui.utils.CarUxRestrictionsUtil$OnUxRestrictionsChangedListener; | 35 | import·com.android.car.ui.utils.CarUxRestrictionsUtil$OnUxRestrictionsChangedListener; |
37 | import·androidx.recyclerview.widget.RecyclerView$ItemDecoration; | |
38 | import·com.android.car.ui.recyclerview.decorations.grid.GridDividerItemDecoration; | 36 | import·com.android.car.ui.recyclerview.decorations.grid.GridDividerItemDecoration; |
39 | import·android.graphics.Rect; | 37 | import·android.graphics.Rect; |
40 | import·android.widget.LinearLayout; | 38 | import·android.widget.LinearLayout; |
41 | import·com.android.car.ui.utils.CarUxRestrictionsUtil; | 39 | import·com.android.car.ui.utils.CarUxRestrictionsUtil; |
42 | import·com.android.car.ui.toolbar.Toolbar$OnHeightChangedListener; | 40 | import·androidx.recyclerview.widget.RecyclerView$ItemDecoration; |
| 41 | import·com.android.car.ui.recyclerview.decorations.grid.GridOffsetItemDecoration; |
43 | import·androidx.recyclerview.widget.RecyclerView; | 42 | import·androidx.recyclerview.widget.RecyclerView; |
| |
44 | public·final·class·CarUiRecyclerView·extends·RecyclerView·implements·Toolbar$OnHeightChangedListener | 43 | public·final·class·CarUiRecyclerView·extends·RecyclerView |
45 | { | 44 | { |
46 | ····private·static·final·String·TAG·=·"CarUiRecyclerView"; | 45 | ····private·static·final·String·TAG·=·"CarUiRecyclerView"; |
| 46 | ····private·int·mBottomOffset; |
| 47 | ····private·GridOffsetItemDecoration·mBottomOffsetItemDecorationGrid; |
| 48 | ····private·RecyclerView$ItemDecoration·mBottomOffsetItemDecorationLinear; |
47 | ····private·final·CarUxRestrictionsUtil·mCarUxRestrictionsUtil; | 49 | ····private·final·CarUxRestrictionsUtil·mCarUxRestrictionsUtil; |
48 | ····private·LinearLayout·mContainer; | 50 | ····private·LinearLayout·mContainer; |
49 | ····private·Rect·mContainerPadding; | 51 | ····private·Rect·mContainerPadding; |
50 | ····private·Rect·mContainerPaddingRelative; | 52 | ····private·Rect·mContainerPaddingRelative; |
51 | ····private·int·mContainerVisibility; | 53 | ····private·int·mContainerVisibility; |
52 | ····private·GridDividerItemDecoration·mDividerItemDecorationGrid; | 54 | ····private·GridDividerItemDecoration·mDividerItemDecorationGrid; |
53 | ····private·RecyclerView$ItemDecoration·mDividerItemDecorationLinear; | 55 | ····private·RecyclerView$ItemDecoration·mDividerItemDecorationLinear; |
| 56 | ····private·boolean·mEnableDividers; |
54 | ····private·boolean·mHasScrolledToTop; | 57 | ····private·boolean·mHasScrolledToTop; |
55 | ····private·int·mInitialTopPadding; | |
56 | ····private·boolean·mInstallingExtScrollBar; | 58 | ····private·boolean·mInstallingExtScrollBar; |
57 | ····private·final·CarUxRestrictionsUtil$OnUxRestrictionsChangedListener·mListener; | 59 | ····private·final·CarUxRestrictionsUtil$OnUxRestrictionsChangedListener·mListener; |
58 | ····private·int·mNumOfColumns; | 60 | ····private·int·mNumOfColumns; |
59 | ····private·GridOffsetItemDecoration·mOffsetItemDecoration; | 61 | ····private·ViewTreeObserver$OnGlobalLayoutListener·mOnGlobalLayoutListener; |
60 | ····private·ScrollBar·mScrollBar; | 62 | ····private·ScrollBar·mScrollBar; |
61 | ····private·String·mScrollBarClass; | 63 | ····private·String·mScrollBarClass; |
62 | ····private·boolean·mScrollBarEnabled; | 64 | ····private·boolean·mScrollBarEnabled; |
63 | ····private·int·mScrollBarPaddingBottom; | 65 | ····private·int·mScrollBarPaddingBottom; |
64 | ····private·int·mScrollBarPaddingTop; | 66 | ····private·int·mScrollBarPaddingTop; |
| 67 | ····private·int·mTopOffset; |
| 68 | ····private·GridOffsetItemDecoration·mTopOffsetItemDecorationGrid; |
| 69 | ····private·RecyclerView$ItemDecoration·mTopOffsetItemDecorationLinear; |
65 | ···· | 70 | ···· |
66 | ····public·CarUiRecyclerView(final·Context·context)·{ | 71 | ····public·CarUiRecyclerView(final·Context·context)·{ |
67 | ········this(context,·null); | 72 | ········this(context,·null); |
68 | ····} | 73 | ····} |
69 | ···· | 74 | ···· |
70 | ····public·CarUiRecyclerView(final·Context·context,·final·AttributeSet·set)·{ | 75 | ····public·CarUiRecyclerView(final·Context·context,·final·AttributeSet·set)·{ |
71 | ········this(context,·set,·R$attr.carUiRecyclerViewStyle); | 76 | ········this(context,·set,·R$attr.carUiRecyclerViewStyle); |
Offset 74, 18 lines modified | Offset 79, 43 lines modified |
74 | ···· | 79 | ···· |
75 | ····public·CarUiRecyclerView(final·Context·context,·final·AttributeSet·set,·final·int·n)·{ | 80 | ····public·CarUiRecyclerView(final·Context·context,·final·AttributeSet·set,·final·int·n)·{ |
76 | ········super(context,·set,·n); | 81 | ········super(context,·set,·n); |
77 | ········this.mListener·=·(CarUxRestrictionsUtil$OnUxRestrictionsChangedListener)new·CarUiRecyclerView$UxRestrictionChangedListener(this,·(CarUiRecyclerView$1)null); | 82 | ········this.mListener·=·(CarUxRestrictionsUtil$OnUxRestrictionsChangedListener)new·CarUiRecyclerView$UxRestrictionChangedListener(this,·(CarUiRecyclerView$1)null); |
78 | ········this.mHasScrolledToTop·=·false; | 83 | ········this.mHasScrolledToTop·=·false; |
79 | ········this.mInstallingExtScrollBar·=·false; | 84 | ········this.mInstallingExtScrollBar·=·false; |
80 | ········this.mContainerVisibility·=·0; | 85 | ········this.mContainerVisibility·=·0; |
| 86 | ········this.mOnGlobalLayoutListener·=·(ViewTreeObserver$OnGlobalLayoutListener)new·-$$Lambda$CarUiRecyclerView$3eUZiNtGC0P6eUf2wwX1zX53RVM(this); |
81 | ········this.mCarUxRestrictionsUtil·=·CarUxRestrictionsUtil.getInstance(context); | 87 | ········this.mCarUxRestrictionsUtil·=·CarUxRestrictionsUtil.getInstance(context); |
82 | ········this.init(context,·set,·n); | 88 | ········this.init(context,·set,·n); |
83 | ····} | 89 | ····} |
84 | ···· | 90 | ···· |
| 91 | ····private·void·addItemDecorations(final·RecyclerView$LayoutManager·recyclerView$LayoutManager)·{ |
| 92 | ········this.removeItemDecoration((RecyclerView$ItemDecoration)this.mDividerItemDecorationGrid); |
| 93 | ········this.removeItemDecoration((RecyclerView$ItemDecoration)this.mTopOffsetItemDecorationGrid); |
| 94 | ········this.removeItemDecoration((RecyclerView$ItemDecoration)this.mBottomOffsetItemDecorationGrid); |
| 95 | ········this.removeItemDecoration(this.mDividerItemDecorationLinear); |
| 96 | ········this.removeItemDecoration(this.mTopOffsetItemDecorationLinear); |
| 97 | ········this.removeItemDecoration(this.mBottomOffsetItemDecorationLinear); |
| 98 | ········if·(recyclerView$LayoutManager·instanceof·GridLayoutManager)·{ |
| 99 | ············if·(this.mEnableDividers)·{ |
| 100 | ················this.addItemDecoration((RecyclerView$ItemDecoration)this.mDividerItemDecorationGrid); |
| 101 | ············} |
| 102 | ············this.addItemDecoration((RecyclerView$ItemDecoration)this.mTopOffsetItemDecorationGrid); |
| 103 | ············this.addItemDecoration((RecyclerView$ItemDecoration)this.mBottomOffsetItemDecorationGrid); |
| 104 | ············this.setNumOfColumns(((GridLayoutManager)recyclerView$LayoutManager).getSpanCount()); |
| 105 | ········} |
| 106 | ········else·{ |
| 107 | ············if·(this.mEnableDividers)·{ |
| 108 | ················this.addItemDecoration(this.mDividerItemDecorationLinear); |
| 109 | ············} |
| 110 | ············this.addItemDecoration(this.mTopOffsetItemDecorationLinear); |
| 111 | ············this.addItemDecoration(this.mBottomOffsetItemDecorationLinear); |
| 112 | ········} |
| 113 | ····} |
| 114 | ···· |
85 | ····private·static·RuntimeException·andLog(final·String·s,·final·Throwable·t)·{ | 115 | ····private·static·RuntimeException·andLog(final·String·s,·final·Throwable·t)·{ |
86 | ········Log.e("CarUiRecyclerView",·s,·t); | 116 | ········Log.e("CarUiRecyclerView",·s,·t); |
87 | ········throw·new·RuntimeException(s,·t); | 117 | ········throw·new·RuntimeException(s,·t); |
88 | ····} | 118 | ····} |
89 | ···· | 119 | ···· |
90 | ····private·void·createScrollBarFromConfig(final·View·view)·{ | 120 | ····private·void·createScrollBarFromConfig(final·View·view)·{ |
91 | ········try·{ | 121 | ········try·{ |
Offset 113, 70 lines modified | Offset 143, 58 lines modified |
113 | ············sb2.append("Error·loading·scroll·bar·component:·"); | 143 | ············sb2.append("Error·loading·scroll·bar·component:·"); |
114 | ············sb2.append(this.mScrollBarClass); | 144 | ············sb2.append(this.mScrollBarClass); |
115 | ············final·Throwable·t2; | 145 | ············final·Throwable·t2; |
116 | ············throw·andLog(sb2.toString(),·t2); | 146 | ············throw·andLog(sb2.toString(),·t2); |
117 | ········} | 147 | ········} |
118 | ····} | 148 | ····} |
119 | ···· | 149 | ···· |
120 | ····private·void·init(final·Context·context,·final·AttributeSet·set,·int·n)·{ | 150 | ····private·void·init(final·Context·context,·final·AttributeSet·set,·int·mScrollBarPaddingBottom)·{ |
121 | ········this.initRotaryScroll(context,·set,·n); | 151 | ········this.initRotaryScroll(context,·set,·mScrollBarPaddingBottom); |
122 | ········this.setClipToPadding(false); | 152 | ········this.setClipToPadding(false); |
123 | ········final·TypedArray·obtainStyledAttributes·=·context.obtainStyledAttributes(set,·R$styleable.CarUiRecyclerView,·n,·R$style.Widget_CarUi_CarUiRecyclerView); | 153 | ········final·TypedArray·obtainStyledAttributes·=·context.obtainStyledAttributes(set,·R$styleable.CarUiRecyclerView,·mScrollBarPaddingBottom,·R$style.Widget_CarUi_CarUiRecyclerView); |
124 | ········n·=·(context.getResources().getBoolean(R$bool.car_ui_scrollbar_enable)·?·1·:·0); | 154 | ········mScrollBarPaddingBottom·=·(context.getResources().getBoolean(R$bool.car_ui_scrollbar_enable)·?·1·:·0); |
125 | ········this.mScrollBarEnabled·=·(n·!=·0); | 155 | ········this.mScrollBarEnabled·=·(mScrollBarPaddingBottom·!=·0); |
126 | ········n·=·context.getResources().getDimensionPixelSize(R$dimen.car_ui_scrollbar_padding_top); | 156 | ········mScrollBarPaddingBottom·=·context.getResources().getDimensionPixelSize(R$dimen.car_ui_scrollbar_padding_top); |
127 | ········this.mScrollBarPaddingTop·=·n; | 157 | ········this.mScrollBarPaddingTop·=·mScrollBarPaddingBottom; |
128 | ········n·=·context.getResources().getDimensionPixelSize(R$dimen.car_ui_scrollbar_padding_bottom); | 158 | ········mScrollBarPaddingBottom·=·context.getResources().getDimensionPixelSize(R$dimen.car_ui_scrollbar_padding_bottom); |
129 | ········this.mScrollBarPaddingBottom·=·n; | 159 | ········this.mScrollBarPaddingBottom·=·mScrollBarPaddingBottom; |
130 | ········n·=·R$styleable.CarUiRecyclerView_layoutStyle; | 160 | ········mScrollBarPaddingBottom·=·R$styleable.CarUiRecyclerView_layoutStyle; |
131 | ········n·=·obtainStyledAttributes.getInt(n,·0); | 161 | ········mScrollBarPaddingBottom·=·obtainStyledAttributes.getInt(mScrollBarPaddingBottom,·0); |
132 | ········this.mNumOfColumns·=·obtainStyledAttributes.getInt(R$styleable.CarUiRecyclerView_numOfColumns,·2); | 162 | ········this.mNumOfColumns·=·obtainStyledAttributes.getInt(R$styleable.CarUiRecyclerView_numOfColumns,·2); |
133 | ········final·boolean·boolean1·=·obtainStyledAttributes.getBoolean(R$styleable.CarUiRecyclerView_enableDivider,·false); | 163 | ········this.mEnableDividers·=·obtainStyledAttributes.getBoolean(R$styleable.CarUiRecyclerView_enableDivider,·false); |
134 | ········this.mDividerItemDecorationLinear·=·(RecyclerView$ItemDecoration)new·LinearDividerItemDecoration(context.getDrawable(R$drawable.car_ui_recyclerview_divider)); | 164 | ········this.mDividerItemDecorationLinear·=·(RecyclerView$ItemDecoration)new·LinearDividerItemDecoration(context.getDrawable(R$drawable.car_ui_recyclerview_divider)); |
135 | ········this.mDividerItemDecorationGrid·=·new·GridDividerItemDecoration(context.getDrawable(R$drawable.car_ui_divider),·context.getDrawable(R$drawable.car_ui_divider),·this.mNumOfColumns); | 165 | ········this.mDividerItemDecorationGrid·=·new·GridDividerItemDecoration(context.getDrawable(R$drawable.car_ui_divider),·context.getDrawable(R$drawable.car_ui_divider),·this.mNumOfColumns); |
136 | ········final·int·integer·=·obtainStyledAttributes.getInteger(R$styleable.CarUiRecyclerView_topOffset,·0); | 166 | ········this.mTopOffset·=·obtainStyledAttributes.getInteger(R$styleable.CarUiRecyclerView_topOffset,·0); |
137 | ········final·int·integer2·=·obtainStyledAttributes.getInteger(R$styleable.CarUiRecyclerView_bottomOffset,·0); | 167 | ········this.mBottomOffset·=·obtainStyledAttributes.getInteger(R$styleable.CarUiRecyclerView_bottomOffset,·0); |
| 168 | ········this.mTopOffsetItemDecorationLinear·=·(RecyclerView$ItemDecoration)new·LinearOffsetItemDecoration(this.mTopOffset,·0); |
| 169 | ········final·int·mBottomOffset·=·this.mBottomOffset; |
138 | ········final·boolean·b·=·true; | 170 | ········final·boolean·b·=·true; |
139 | ········if·(n·==·0)·{ | 171 | ········this.mBottomOffsetItemDecorationLinear·=·(RecyclerView$ItemDecoration)new·LinearOffsetItemDecoration(mBottomOffset,·(int)(b·?·1·:·0)); |
140 | ············if·(boolean1)·{ | 172 | ········this.mTopOffsetItemDecorationGrid·=·new·GridOffsetItemDecoration(this.mTopOffset,·this.mNumOfColumns,·0); |
141 | ················this.addItemDecoration(this.mDividerItemDecorationLinear); | 173 | ········this.mBottomOffsetItemDecorationGrid·=·new·GridOffsetItemDecoration(this.mBottomOffset,·this.mNumOfColumns,·(int)(b·?·1·:·0)); |
142 | ············} | 174 | ········if·(mScrollBarPaddingBottom·==·0)·{ |
143 | ············final·LinearOffsetItemDecoration·linearOffsetItemDecoration·=·new·LinearOffsetItemDecoration(integer,·0); | |
144 | ············final·LinearOffsetItemDecoration·linearOffsetItemDecoration2·=·new·LinearOffsetItemDecoration(integer2,·(int)(b·?·1·:·0)); | |
145 | ············this.addItemDecoration((RecyclerView$ItemDecoration)linearOffsetItemDecoration); | |
146 | ············this.addItemDecoration((RecyclerView$ItemDecoration)linearOffsetItemDecoration2); | |
147 | ············this.setLayoutManager((RecyclerView$LayoutManager)new·LinearLayoutManager(((ViewGroup)this).getContext())); | 175 | ············this.setLayoutManager((RecyclerView$LayoutManager)new·LinearLayoutManager(((ViewGroup)this).getContext())); |
148 | ········} | 176 | ········} |
149 | ········else·{ | 177 | ········else·{ |
150 | ············if·(boolean1)·{ | |
151 | ················this.addItemDecoration((RecyclerView$ItemDecoration)this.mDividerItemDecorationGrid); | |
152 | ············} | |
153 | ············this.mOffsetItemDecoration·=·new·GridOffsetItemDecoration(integer,·this.mNumOfColumns,·0); | |
154 | ············final·GridOffsetItemDecoration·gridOffsetItemDecoration·=·new·GridOffsetItemDecoration(integer2,·this.mNumOfColumns,·(int)(b·?·1·:·0)); | |
155 | ············this.addItemDecoration((RecyclerView$ItemDecoration)this.mOffsetItemDecoration); | |
156 | ············this.addItemDecoration((RecyclerView$ItemDecoration)gridOffsetItemDecoration); | |
157 | ············this.setLayoutManager((RecyclerView$LayoutManager)new·GridLayoutManager(((ViewGroup)this).getContext(),·this.mNumOfColumns)); | 178 | ············this.setLayoutManager((RecyclerView$LayoutManager)new·GridLayoutManager(((ViewGroup)this).getContext(),·this.mNumOfColumns)); |
158 | ············n·=·this.mNumOfColumns; | |
159 | ············this.setNumOfColumns(n); | |
160 | ········} | 179 | ········} |
161 | ········obtainStyledAttributes.recycle(); | 180 | ········obtainStyledAttributes.recycle(); |
162 | ········if·(!this.mScrollBarEnabled)·{ | 181 | ········if·(!this.mScrollBarEnabled)·{ |
163 | ············return; | 182 | ············return; |
164 | ········} | 183 | ········} |
165 | ········((ViewGroup)this).setVerticalScrollBarEnabled(false); | 184 | ········((ViewGroup)this).setVerticalScrollBarEnabled(false); |
166 | ········((ViewGroup)this).setHorizontalScrollBarEnabled(false); | 185 | ········((ViewGroup)this).setHorizontalScrollBarEnabled(false); |
167 | ········this.mScrollBarClass·=·context.getResources().getString(R$string.car_ui_scrollbar_component); | 186 | ········this.mScrollBarClass·=·context.getResources().getString(R$string.car_ui_scrollbar_component); |
168 | ········((ViewGroup)this).getViewTreeObserver().addOnGlobalLayoutListener((ViewTreeObserver$OnGlobalLayoutListener)new·-$$Lambda$CarUiRecyclerView$QvMxJGgsUlhlvsQUwFa8DAYyVNE(this)); | |
169 | ····} | 187 | ····} |
170 | ···· | 188 | ···· |
171 | ····private·void·initRotaryScroll(final·Context·context,·final·AttributeSet·set,·final·int·n)·{ | 189 | ····private·void·initRotaryScroll(final·Context·context,·final·AttributeSet·set,·final·int·n)·{ |
172 | ········final·CharSequence·contentDescription·=·((ViewGroup)this).getContentDescription(); | 190 | ········final·CharSequence·contentDescription·=·((ViewGroup)this).getContentDescription(); |
173 | ········String·contentDescription2·=·"android.rotary.VERTICALLY_SCROLLABLE"; | 191 | ········String·contentDescription2·=·"com.android.car.ui.utils.VERTICALLY_SCROLLABLE"; |
174 | ········final·int·focusable·=·1; | 192 | ········final·int·focusable·=·1; |
175 | ········final·String·s·=·"android.rotary.HORIZONTALLY_SCROLLABLE"; | 193 | ········final·String·s·=·"com.android.car.ui.utils.HORIZONTALLY_SCROLLABLE"; |
176 | ········if·(contentDescription·==·null)·{ | 194 | ········if·(contentDescription·==·null)·{ |
177 | ············if·(context.obtainStyledAttributes(set,·R$styleable.RecyclerView,·n,·0).getInt(R$styleable.RecyclerView_android_orientation,·focusable)·==·0)·{ | 195 | ············if·(context.obtainStyledAttributes(set,·R$styleable.RecyclerView,·n,·0).getInt(R$styleable.RecyclerView_android_orientation,·focusable)·==·0)·{ |
178 | ················contentDescription2·=·s; | 196 | ················contentDescription2·=·s; |
179 | ············} | 197 | ············} |
180 | ············((ViewGroup)this).setContentDescription((CharSequence)contentDescription2); | 198 | ············((ViewGroup)this).setContentDescription((CharSequence)contentDescription2); |
181 | ········} | 199 | ········} |
182 | ········else·if·(!s.contentEquals(contentDescription)·&&·!contentDescription2.contentEquals(contentDescription))·{ | 200 | ········else·if·(!s.contentEquals(contentDescription)·&&·!contentDescription2.contentEquals(contentDescription))·{ |
Offset 218, 33 lines modified | Offset 236, 28 lines modified |
218 | ········viewGroup.addView((View)this.mContainer,·indexOfChild); | 236 | ········viewGroup.addView((View)this.mContainer,·indexOfChild); |
219 | ········this.createScrollBarFromConfig(CarUiUtils.findViewByRefId((View)this.mContainer,·R$id.car_ui_scroll_bar)); | 237 | ········this.createScrollBarFromConfig(CarUiUtils.findViewByRefId((View)this.mContainer,·R$id.car_ui_scroll_bar)); |
220 | ····} | 238 | ····} |
221 | ···· | 239 | ···· |
222 | ····protected·void·onAttachedToWindow()·{ | 240 | ····protected·void·onAttachedToWindow()·{ |
223 | ········super.onAttachedToWindow(); | 241 | ········super.onAttachedToWindow(); |
224 | ········this.mCarUxRestrictionsUtil.register(this.mListener); | 242 | ········this.mCarUxRestrictionsUtil.register(this.mListener); |
| 243 | ········((ViewGroup)this).getViewTreeObserver().addOnGlobalLayoutListener(this.mOnGlobalLayoutListener); |
225 | ········if·(!this.mInstallingExtScrollBar)·{ | 244 | ········if·(!this.mInstallingExtScrollBar)·{ |
226 | ············if·(this.mScrollBarEnabled)·{ | 245 | ············if·(this.mScrollBarEnabled)·{ |
227 | ················this.mInstallingExtScrollBar·=·true; | 246 | ················this.mInstallingExtScrollBar·=·true; |
228 | ················this.installExternalScrollBar(); | 247 | ················this.installExternalScrollBar(); |
229 | ················this.mInstallingExtScrollBar·=·false; | 248 | ················this.mInstallingExtScrollBar·=·false; |
230 | ············} | 249 | ············} |
231 | ········} | 250 | ········} |
232 | ····} | 251 | ····} |
233 | ···· | 252 | ···· |
234 | ····protected·void·onDetachedFromWindow()·{ | 253 | ····protected·void·onDetachedFromWindow()·{ |
235 | ········super.onDetachedFromWindow(); | 254 | ········super.onDetachedFromWindow(); |
236 | ········this.mCarUxRestrictionsUtil.unregister(this.mListener); | 255 | ········this.mCarUxRestrictionsUtil.unregister(this.mListener); |
237 | ····} | 256 | ········((ViewGroup)this).getViewTreeObserver().removeOnGlobalLayoutListener(this.mOnGlobalLayoutListener); |
238 | ···· | |
239 | ····public·void·onHeightChanged(int·paddingEnd)·{ | |
240 | ········final·int·paddingStart·=·((ViewGroup)this).getPaddingStart(); | |
241 | ········final·int·n·=·this.mInitialTopPadding·+·paddingEnd; | |
242 | ········paddingEnd·=·((ViewGroup)this).getPaddingEnd(); | |
243 | ········this.setPaddingRelative(paddingStart,·n,·paddingEnd,·((ViewGroup)this).getPaddingBottom()); | |
244 | ····} | 257 | ····} |
245 | ···· | 258 | ···· |
246 | ····protected·void·onRestoreInstanceState(final·Parcelable·parcelable)·{ | 259 | ····protected·void·onRestoreInstanceState(final·Parcelable·parcelable)·{ |
247 | ········super.onRestoreInstanceState(parcelable); | 260 | ········super.onRestoreInstanceState(parcelable); |
248 | ········this.mHasScrolledToTop·=·true; | 261 | ········this.mHasScrolledToTop·=·true; |
249 | ····} | 262 | ····} |
250 | ···· | 263 | ···· |
Offset 260, 27 lines modified | Offset 273, 32 lines modified |
260 | ········if·(b)·{ | 273 | ········if·(b)·{ |
261 | ············this.addItemDecoration((RecyclerView$ItemDecoration)this.mDividerItemDecorationGrid); | 274 | ············this.addItemDecoration((RecyclerView$ItemDecoration)this.mDividerItemDecorationGrid); |
262 | ············return; | 275 | ············return; |
263 | ········} | 276 | ········} |
264 | ········this.removeItemDecoration((RecyclerView$ItemDecoration)this.mDividerItemDecorationGrid); | 277 | ········this.removeItemDecoration((RecyclerView$ItemDecoration)this.mDividerItemDecorationGrid); |
265 | ····} | 278 | ····} |
266 | ···· | 279 | ···· |
| 280 | ····public·void·setLayoutManager(final·RecyclerView$LayoutManager·layoutManager)·{ |
| 281 | ········this.addItemDecorations(layoutManager); |
| 282 | ········super.setLayoutManager(layoutManager); |
| 283 | ····} |
| 284 | ···· |
267 | ····public·void·setLinearDividerItemDecoration(final·boolean·b)·{ | 285 | ····public·void·setLinearDividerItemDecoration(final·boolean·b)·{ |
268 | ········if·(b)·{ | 286 | ········if·(b)·{ |
269 | ············this.addItemDecoration(this.mDividerItemDecorationLinear); | 287 | ············this.addItemDecoration(this.mDividerItemDecorationLinear); |
270 | ············return; | 288 | ············return; |
271 | ········} | 289 | ········} |
272 | ········this.removeItemDecoration(this.mDividerItemDecorationLinear); | 290 | ········this.removeItemDecoration(this.mDividerItemDecorationLinear); |
273 | ····} | 291 | ····} |
274 | ···· | 292 | ···· |
275 | ····public·void·setNumOfColumns(final·int·n)·{ | 293 | ····public·void·setNumOfColumns(final·int·n)·{ |
276 | ········this.mNumOfColumns·=·n; | 294 | ········this.mNumOfColumns·=·n; |
277 | ········final·GridOffsetItemDecoration·mOffsetItemDecoration·=·this.mOffsetItemDecoration; | 295 | ········final·GridOffsetItemDecoration·mTopOffsetItemDecorationGrid·=·this.mTopOffsetItemDecorationGrid; |
278 | ········if·(mOffsetItemDecoration·!=·null)·{ | 296 | ········if·(mTopOffsetItemDecorationGrid·!=·null)·{ |
279 | ············mOffsetItemDecoration.setNumOfColumns(n); | 297 | ············mTopOffsetItemDecorationGrid.setNumOfColumns(n); |
280 | ········} | 298 | ········} |
281 | ········final·GridDividerItemDecoration·mDividerItemDecorationGrid·=·this.mDividerItemDecorationGrid; | 299 | ········final·GridDividerItemDecoration·mDividerItemDecorationGrid·=·this.mDividerItemDecorationGrid; |
282 | ········if·(mDividerItemDecorationGrid·!=·null)·{ | 300 | ········if·(mDividerItemDecorationGrid·!=·null)·{ |
283 | ············mDividerItemDecorationGrid.setNumOfColumns(this.mNumOfColumns); | 301 | ············mDividerItemDecorationGrid.setNumOfColumns(this.mNumOfColumns); |
284 | ········} | 302 | ········} |
285 | ····} | 303 | ····} |
286 | ···· | 304 | ···· |