Interface RefreshKernel
-
- All Implemented Interfaces:
public interface RefreshKernelCore refresh layout interface. Opens APIs for complex Headers or Footers.
-
-
Method Summary
Modifier and Type Method Description abstract RefreshLayoutgetRefreshLayout()abstract RefreshContentgetRefreshContent()abstract RefreshKernelsetState(RefreshState state)abstract RefreshKernelstartTwoLevel(boolean open)Start two-level refresh. abstract RefreshKernelfinishTwoLevel()Finish and close two-level refresh. abstract RefreshKernelmoveSpinner(int spinner, boolean isDragging)Translate the view to a specified position. abstract ValueAnimatoranimSpinner(int endSpinner)Execute animation to move the view to a specified position. abstract RefreshKernelrequestDrawBackgroundFor(RefreshComponent internal, int backgroundColor)Specify a background to draw for the Header or Footer during pull. abstract RefreshKernelrequestNeedTouchEventFor(RefreshComponent internal, boolean request)Request touch events. abstract RefreshKernelrequestDefaultTranslationContentFor(RefreshComponent internal, boolean translation)Set default content translation behavior. abstract RefreshKernelrequestRemeasureHeightFor(RefreshComponent internal)Re-measure headerHeight or footerHeight. abstract RefreshKernelrequestFloorDuration(int duration)Set the two-level rebound duration. abstract RefreshKernelrequestFloorBottomPullUpToCloseRate(float rate)Set the height ratio for closing the two-level floor by swiping up from the bottom. -
-
Method Detail
-
getRefreshLayout
abstract RefreshLayout getRefreshLayout()
-
getRefreshContent
abstract RefreshContent getRefreshContent()
-
setState
abstract RefreshKernel setState(RefreshState state)
-
startTwoLevel
abstract RefreshKernel startTwoLevel(boolean open)
Start two-level refresh.
- Parameters:
open- Whether to expand- Returns:
RefreshKernel
-
finishTwoLevel
abstract RefreshKernel finishTwoLevel()
Finish and close two-level refresh.
- Returns:
RefreshKernel
-
moveSpinner
abstract RefreshKernel moveSpinner(int spinner, boolean isDragging)
Translate the view to a specified position. moveSpinner is named after Google's official androidx.swiperefreshlayout.widget.SwipeRefreshLayout
- Parameters:
spinner- Position (px)isDragging- true if finger is dragging, false if rebound animation is playing- Returns:
RefreshKernel
-
animSpinner
abstract ValueAnimator animSpinner(int endSpinner)
Execute animation to move the view to a specified position. moveSpinner is named after Google's official androidx.swiperefreshlayout.widget.SwipeRefreshLayout
- Parameters:
endSpinner- Target end position (px)- Returns:
ValueAnimator null if no animation was executed
-
requestDrawBackgroundFor
abstract RefreshKernel requestDrawBackgroundFor(RefreshComponent internal, int backgroundColor)
Specify a background to draw for the Header or Footer during pull.
- Parameters:
internal- Pass this when called from Header or FooterbackgroundColor- Background color- Returns:
RefreshKernel
-
requestNeedTouchEventFor
abstract RefreshKernel requestNeedTouchEventFor(RefreshComponent internal, boolean request)
Request touch events.
- Parameters:
internal- Pass this when called from Header or Footerrequest- Whether to request touch events- Returns:
RefreshKernel
-
requestDefaultTranslationContentFor
abstract RefreshKernel requestDefaultTranslationContentFor(RefreshComponent internal, boolean translation)
Set default content translation behavior.
- Parameters:
internal- Pass this when called from Header or Footertranslation- Whether to translate- Returns:
RefreshKernel
-
requestRemeasureHeightFor
abstract RefreshKernel requestRemeasureHeightFor(RefreshComponent internal)
Re-measure headerHeight or footerHeight. Requires height to be WRAP_CONTENT.
- Parameters:
internal- Pass this when called from Header or Footer- Returns:
RefreshKernel
-
requestFloorDuration
abstract RefreshKernel requestFloorDuration(int duration)
Set the two-level rebound duration.
- Parameters:
duration- Two-level rebound duration- Returns:
RefreshKernel
-
requestFloorBottomPullUpToCloseRate
abstract RefreshKernel requestFloorBottomPullUpToCloseRate(float rate)
Set the height ratio for closing the two-level floor by swiping up from the bottom.
- Returns:
RefreshKernel
-
-
-
-