@@ -40,7 +40,6 @@ internal class `-ViewPumpLayoutInflater`(
40
40
setUpLayoutFactories(cloned)
41
41
}
42
42
43
-
44
43
/* *
45
44
* We use this for internal cloning to be a little more efficient with memory.
46
45
*/
@@ -147,7 +146,7 @@ internal class `-ViewPumpLayoutInflater`(
147
146
view : View ,
148
147
name : String ,
149
148
context : Context ,
150
- attrs : AttributeSet
149
+ attrs : AttributeSet ?
151
150
): View ? {
152
151
return viewPump
153
152
.inflate(
@@ -169,7 +168,7 @@ internal class `-ViewPumpLayoutInflater`(
169
168
* BUT only for none CustomViews.
170
169
*/
171
170
@Throws(ClassNotFoundException ::class )
172
- override fun onCreateView (parent : View ? , name : String , attrs : AttributeSet ): View ? {
171
+ override fun onCreateView (parent : View ? , name : String , attrs : AttributeSet ? ): View ? {
173
172
return viewPump
174
173
.inflate(
175
174
InflateRequest (
@@ -189,7 +188,7 @@ internal class `-ViewPumpLayoutInflater`(
189
188
* Basically if this method doesn't inflate the View nothing probably will.
190
189
*/
191
190
@Throws(ClassNotFoundException ::class )
192
- override fun onCreateView (name : String , attrs : AttributeSet ): View ? {
191
+ override fun onCreateView (name : String , attrs : AttributeSet ? ): View ? {
193
192
return viewPump
194
193
.inflate(
195
194
InflateRequest (
@@ -284,7 +283,7 @@ internal class `-ViewPumpLayoutInflater`(
284
283
parent : View ? ,
285
284
name : String ,
286
285
context : Context ,
287
- attrs : AttributeSet
286
+ attrs : AttributeSet ?
288
287
): View ? {
289
288
return inflater.createCustomViewInternal(view, name, context, attrs)
290
289
}
@@ -296,7 +295,7 @@ internal class `-ViewPumpLayoutInflater`(
296
295
297
296
override fun onCreateView (
298
297
parent : View ? , name : String , context : Context ,
299
- attrs : AttributeSet
298
+ attrs : AttributeSet ?
300
299
): View ? {
301
300
return inflater.superOnCreateView(parent, name, attrs)
302
301
}
@@ -310,7 +309,7 @@ internal class `-ViewPumpLayoutInflater`(
310
309
parent : View ? ,
311
310
name : String ,
312
311
context : Context ,
313
- attrs : AttributeSet
312
+ attrs : AttributeSet ?
314
313
): View ? {
315
314
// This mimics the {@code PhoneLayoutInflater} in the way it tries to inflate the base
316
315
// classes, if this fails its pretty certain the app will fail at this point.
@@ -367,9 +366,9 @@ internal class `-ViewPumpLayoutInflater`(
367
366
parent : View ? ,
368
367
name : String ,
369
368
context : Context ,
370
- attrs : AttributeSet
369
+ attrs : AttributeSet ?
371
370
): View ? {
372
- return factory.onCreateView(name, context, attrs)
371
+ return attrs?. let { factory.onCreateView(name, context, it) }
373
372
}
374
373
}
375
374
@@ -414,9 +413,9 @@ internal class `-ViewPumpLayoutInflater`(
414
413
parent : View ? ,
415
414
name : String ,
416
415
context : Context ,
417
- attrs : AttributeSet
416
+ attrs : AttributeSet ?
418
417
): View ? {
419
- return factory2.onCreateView(parent, name, context, attrs)
418
+ return attrs?. let { factory2.onCreateView(parent, name, context, it) }
420
419
}
421
420
}
422
421
@@ -460,10 +459,10 @@ internal class `-ViewPumpLayoutInflater`(
460
459
parent : View ? ,
461
460
name : String ,
462
461
context : Context ,
463
- attrs : AttributeSet
462
+ attrs : AttributeSet ?
464
463
): View ? {
465
464
return inflater.createCustomViewInternal(
466
- factory2.onCreateView(parent, name, context, attrs), name, context, attrs
465
+ factory2.onCreateView(parent, name, context, checkNotNull( attrs) { " Should never happen! " } ), name, context, attrs
467
466
)
468
467
}
469
468
}
0 commit comments