Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Create a curved scrollbar in android wear 2.0?

android wear 2.0

I am using WearableRecyclerView to create a curved layout,but the default scrollbar is still vertical.Is there a way to create a curved scrollbar like android wear 2.0 launcher?

like image 254
fang jack Avatar asked Apr 17 '17 07:04

fang jack


2 Answers

Actually, the scrollbars are circular for any scrollable View that takes up the whole screen. It's a framework feature for Wear 2.0.

If the scrollbars are still vertical, make sure your View really does fill up the whole screen - set it to match_parent and as a top level root View.

like image 142
Aga Madurska Avatar answered Nov 20 '22 02:11

Aga Madurska


use boxinsetlayout

// android.support.wearable.view.BoxInsetLayout

app:layout_box="left|bottom|right"

...Your list View and other contents

android.support.wearable.view.BoxInsetLayout>

and if you are using wearableRecyclerView do CircularChildLayoutManager mChildLayoutManager = new CircularChildLayoutManager(mContext); and set this as layout manager for your recycler view.

mRecyclerView.setLayoutManager(mChildLayoutManager);

This may solve for you.

like image 1
Apurv Mahesh Avatar answered Nov 20 '22 02:11

Apurv Mahesh