@@ -17,7 +17,6 @@ import android.view.animation.AnimationUtils
17
17
import android.view.animation.Interpolator
18
18
import androidx.annotation.IdRes
19
19
import androidx.core.content.ContextCompat
20
- import androidx.core.view.ViewCompat
21
20
import com.sothree.slidinguppanel.ViewDragHelper.Companion.create
22
21
import com.sothree.slidinguppanel.canvasSaveProxy.CanvasSaveProxy
23
22
import com.sothree.slidinguppanel.canvasSaveProxy.CanvasSaveProxyFactory
@@ -212,8 +211,7 @@ open class SlidingUpPanelLayout @JvmOverloads constructor(
212
211
PanelState .COLLAPSED -> smoothSlideTo(0f , 0 )
213
212
PanelState .EXPANDED -> smoothSlideTo(maxSlideOffset, 0 )
214
213
PanelState .HIDDEN -> {
215
- val newTop =
216
- computePanelTopPosition(0.0f ) + if (isSlidingUp) + panelHeight else - panelHeight
214
+ val newTop = computePanelTopPosition(0.0f ) + if (isSlidingUp) + panelHeight else - panelHeight
217
215
smoothSlideTo(computeSlideOffset(newTop), 0 )
218
216
}
219
217
@@ -329,61 +327,23 @@ open class SlidingUpPanelLayout @JvmOverloads constructor(
329
327
val ta = context.obtainStyledAttributes(attrs, R .styleable.SlidingUpPanelLayout )
330
328
var scrollerInterpolator: Interpolator ? = null
331
329
try {
332
- panelHeight = ta.getDimensionPixelSize(
333
- R .styleable.SlidingUpPanelLayout_umanoPanelHeight ,
334
- - 1
335
- )
336
- shadowHeight = ta.getDimensionPixelSize(
337
- R .styleable.SlidingUpPanelLayout_umanoShadowHeight ,
338
- - 1
339
- )
340
- parallaxOffset = ta.getDimensionPixelSize(
341
- R .styleable.SlidingUpPanelLayout_umanoParallaxOffset ,
342
- - 1
343
- )
344
- minFlingVelocity = ta.getInt(
345
- R .styleable.SlidingUpPanelLayout_umanoFlingVelocity ,
346
- DEFAULT_MIN_FLING_VELOCITY
347
- )
348
- coveredFadeColor = ta.getColor(
349
- R .styleable.SlidingUpPanelLayout_umanoFadeColor ,
350
- DEFAULT_FADE_COLOR
351
- )
352
- dragViewResId =
353
- ta.getResourceId(R .styleable.SlidingUpPanelLayout_umanoDragView , - 1 )
354
- scrollableViewResId =
355
- ta.getResourceId(R .styleable.SlidingUpPanelLayout_umanoScrollableView , - 1 )
356
- aboveShadowResId =
357
- ta.getResourceId(R .styleable.SlidingUpPanelLayout_umanoAboveShadowStyle , - 1 )
358
- belowShadowResId =
359
- ta.getResourceId(R .styleable.SlidingUpPanelLayout_umanoBelowShadowStyle , - 1 )
360
- overlayContent = ta.getBoolean(
361
- R .styleable.SlidingUpPanelLayout_umanoOverlay ,
362
- DEFAULT_OVERLAY_FLAG
363
- )
364
- clipPanel = ta.getBoolean(
365
- R .styleable.SlidingUpPanelLayout_umanoClipPanel ,
366
- DEFAULT_CLIP_PANEL_FLAG
367
- )
368
- anchorPoint = ta.getFloat(
369
- R .styleable.SlidingUpPanelLayout_umanoAnchorPoint ,
370
- DEFAULT_ANCHOR_POINT
371
- )
372
- maxSlideOffset = ta.getFloat(
373
- R .styleable.SlidingUpPanelLayout_umanoMaxSlidingOffset ,
374
- DEFAULT_MAX_SLIDING_OFFSET
375
- )
376
- slideState = PanelState .entries.toTypedArray()[ta.getInt(
377
- R .styleable.SlidingUpPanelLayout_umanoInitialState ,
378
- DEFAULT_SLIDE_STATE .ordinal
379
- )]
380
- val interpolatorResId = ta.getResourceId(
381
- R .styleable.SlidingUpPanelLayout_umanoScrollInterpolator ,
382
- - 1
383
- )
330
+ panelHeight = ta.getDimensionPixelSize(R .styleable.SlidingUpPanelLayout_umanoPanelHeight , - 1 )
331
+ shadowHeight = ta.getDimensionPixelSize(R .styleable.SlidingUpPanelLayout_umanoShadowHeight , - 1 )
332
+ parallaxOffset = ta.getDimensionPixelSize(R .styleable.SlidingUpPanelLayout_umanoParallaxOffset , - 1 )
333
+ minFlingVelocity = ta.getInt(R .styleable.SlidingUpPanelLayout_umanoFlingVelocity , DEFAULT_MIN_FLING_VELOCITY )
334
+ coveredFadeColor = ta.getColor(R .styleable.SlidingUpPanelLayout_umanoFadeColor , DEFAULT_FADE_COLOR )
335
+ dragViewResId = ta.getResourceId(R .styleable.SlidingUpPanelLayout_umanoDragView , - 1 )
336
+ scrollableViewResId = ta.getResourceId(R .styleable.SlidingUpPanelLayout_umanoScrollableView , - 1 )
337
+ aboveShadowResId = ta.getResourceId(R .styleable.SlidingUpPanelLayout_umanoAboveShadowStyle , - 1 )
338
+ belowShadowResId = ta.getResourceId(R .styleable.SlidingUpPanelLayout_umanoBelowShadowStyle , - 1 )
339
+ overlayContent = ta.getBoolean(R .styleable.SlidingUpPanelLayout_umanoOverlay , DEFAULT_OVERLAY_FLAG )
340
+ clipPanel = ta.getBoolean(R .styleable.SlidingUpPanelLayout_umanoClipPanel , DEFAULT_CLIP_PANEL_FLAG )
341
+ anchorPoint = ta.getFloat(R .styleable.SlidingUpPanelLayout_umanoAnchorPoint , DEFAULT_ANCHOR_POINT )
342
+ maxSlideOffset = ta.getFloat(R .styleable.SlidingUpPanelLayout_umanoMaxSlidingOffset , DEFAULT_MAX_SLIDING_OFFSET )
343
+ slideState = PanelState .entries.toTypedArray()[ta.getInt(R .styleable.SlidingUpPanelLayout_umanoInitialState , DEFAULT_SLIDE_STATE .ordinal)]
344
+ val interpolatorResId = ta.getResourceId(R .styleable.SlidingUpPanelLayout_umanoScrollInterpolator , - 1 )
384
345
if (interpolatorResId != - 1 ) {
385
- scrollerInterpolator =
386
- AnimationUtils .loadInterpolator(context, interpolatorResId)
346
+ scrollerInterpolator = AnimationUtils .loadInterpolator(context, interpolatorResId)
387
347
}
388
348
} finally {
389
349
ta.recycle()
0 commit comments