Skip to content

RecyclerView

Yanndroid edited this page Feb 10, 2022 · 3 revisions

de.dlyt.yanndroid.oneui.view.RecyclerView

Samsung's RecyclerView, heavily used in their apps.

<de.dlyt.yanndroid.oneui.view.RecyclerView
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

Attributes and usage are the same as Google's RecyclerView.

Methods

Round the corners of the last item.

public void seslSetLastRoundedCorner(boolean enabled)

Fill the background at the bottom after the last item with the app background color.

public void seslSetFillBottomEnabled(boolean enabled)
public void seslSetFillBottomColor(int color)

Set keyboard ctrl key as pressed.

public void seslSetCtrlkeyPressed(boolean pressed)

Find the child view in the specified screen coordinates.

public View seslFindNearChildViewUnder(float var1, float var2)

Enable smooth scroll in Samsung OverScroller (only for Samsung devices with Android 8+)

public void seslSetSmoothScrollEnabled(boolean enabled)

Samsung also customized RecyclerView.ItemDecoration class by adding a call to onDispatchDraw method of the View. Overriding the seslOnDispatchDraw method lets you customize even more your list/grid view. You can find an example of it here.

FastScroller.

public void seslSetFastScrollerEnabled(boolean enabled)
public boolean seslIsFastScrollerEnabled()
public void seslSetFastScrollerEventListener(RecyclerView.SeslFastScrollerEventListener listener)
public void seslSetFastScrollerThreshold(float threshold)

Go To Top button.

public void seslSetGoToTopEnabled(boolean enabled)
public void seslSetGoToTopBottomPadding(int padding)
public int seslGetGoToTopBottomPadding()
public void seslSetOnGoToTopClickListener(RecyclerView.SeslOnGoToTopClickListener listener)
public void showGoToTop()

Show edge effect used when go to top is clicked with a custom delay (delayMillis).

public void seslShowGoToTopEdge(int delayMillis)

Index tip

requires SectionIndexer to be implemented in the adapter

public void seslSetIndexTipEnabled(boolean enabled)
public boolean seslIsIndexTipEnabled()

Update index tip position, can be called for ex. in onConfigurationChanged

public void seslUpdateIndexTipPosition()

IndexScrollView

<FrameLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <de.dlyt.yanndroid.oneui.view.RecyclerView
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <de.dlyt.yanndroid.oneui.view.IndexScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</FrameLayout>

Simple usage:

public void syncWithRecyclerView(RecyclerView recyclerView, List<String> itemNames, boolean useLetters)

SelectMode

"Scroll-select" items in a list, like all oneui apps.

Start selectMode (use this on long press item).

public void seslStartLongPressMultiSelection()

Listener. Will give you the position of the toggeled item in onItemSelected.

public void seslSetLongPressMultiSelectionListener(SeslLongPressMultiSelectionListener listener)
public final SeslLongPressMultiSelectionListener getLongPressMultiSelectionListener()

SPen

Switch between S Pen and finger touch slop.

public void seslSetPagingTouchSlopForStylus(boolean use)
public boolean seslIsPagingTouchSlopForStylusEnabled()

Enable scrolling with S Pen hovering.

public void seslSetHoverScrollEnabled(boolean enabled)

Set S Pen hover scrolling area top padding.

public void seslSetHoverTopPadding(int top)
public int seslGetHoverTopPadding()

Set S Pen hover scrolling area bottom padding.

public void seslSetHoverBottomPadding(int bottom)
public int seslGetHoverBottomPadding()
Clone this wiki locally