How to create curved scroll bar in android wear 2.0?

android wear 2.0

I use WearableRecyclerView to create a curved layout, but the default scrollbar is still vertical. Is there a way to create a curved scroll bar, such as a launcher for Android 2.0?

+6
source share
3 answers

API has been renamed to CurvedChildLayoutManager

Therefore use

val layoutManager = CurvedChildLayoutManager(this)
recyclerView.layoutManager = layoutManager

PS: as for the topic issue, you don’t need to app:layout_boxjust use android:scrollbars="vertical"onWearableRecyclerView

https://developer.android.com/reference/android/support/wearable/view/CurvedChildLayoutManager.html

+2
source

use boxinsetlayout

// android.support.wearable.view.BoxInsetLayout

: layout_box = " | | "

...

android.support.wearable.view.BoxInsetLayout >

wearableRecyclerView do CircularChildLayoutManager mChildLayoutManager = new CircularChildLayoutManager(mContext); .

mRecyclerView.setLayoutManager(mChildLayoutManager);

.

+1

, . Wear 2.0.

- , , - match_parent .

+1

Source: https://habr.com/ru/post/1016583/


All Articles