WearableRecyclerView上的弯曲滚动条

时间:2018-05-23 19:05:37

标签: android wear-os

我试图在WearableRecyclerView上显示弯曲的滚动条,但它不起作用,这就是我所拥有的:

在主要活动中我有这个:

    <android.support.wear.widget.drawer.WearableDrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <FrameLayout
        android:id="@+id/homeContainer"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

</android.support.wear.widget.drawer.WearableDrawerLayout>

我用一个看起来像这样的片段替换homeContainer:

<?xml version="1.0" encoding="utf-8"?>
<android.support.wear.widget.SwipeDismissFrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".fragments.ScheduleFragment"
    android:background="@color/black"
    android:verticalScrollbarPosition="right">

    <android.support.wear.widget.WearableRecyclerView
        android:id="@+id/vesselsWRV"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:scrollbars="vertical"/>

</android.support.wear.widget.SwipeDismissFrameLayout>

我需要片段可以滑动,这就是为什么wearablerecycler被包裹在swipedismiss内部的原因。回收商的行如下所示:

<android.support.wear.widget.BoxInsetLayout
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <android.support.v7.widget.CardView
        android:id="@+id/terminalRow"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:cardBackgroundColor="@color/cardview_dark_background"
        app:cardCornerRadius="5dp"
        app:boxedEdges="left|right">

        <android.support.constraint.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <ImageView
                android:id="@+id/vesselPicture"
                android:layout_width="60dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="8dp"
                android:layout_marginTop="8dp"
                android:src="@drawable/vessel"
                android:tint="@color/white"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

        </android.support.constraint.ConstraintLayout>

    </android.support.v7.widget.CardView>

</android.support.wear.widget.BoxInsetLayout>

一切正常:我可以滑动片段,列表装箱,滚动条位于屏幕的右边缘,但它不会弯曲。我很感激这方面的任何帮助。

Screenshot of the list with the scrollbar

0 个答案:

没有答案