Мой список не прокручивается, когда я использую цифровую корону
Это то, что я делаю;
<androidx.wear.widget.WearableRecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/wrv_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
/>
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.wrv_demo);
WearableRecyclerView wrv = findViewById(R.id.wrv_container);
wrv.setLayoutManager(new WearableLinearLayoutManager(this));
wrv.setAdapter(new DemoAdapter());
wrv.setHasFixedSize(true);
wrv.setCircularScrollingGestureEnabled(true);
wrv.setEdgeItemsCenteringEnabled(true);
wrv.setOnGenericMotionListener(new View.OnGenericMotionListener() {
@Override
public boolean onGenericMotion(View view, MotionEvent motionEvent) {
return false;
}
});
wrv.setBezelFraction(0.5f);
wrv.setScrollDegreesPerScreen(90);
}
private static class ViewHolder extends RecyclerView.ViewHolder {
TextView mView;
ViewHolder(TextView itemView) {
super(itemView);
mView = itemView;
}
}
private static class DemoAdapter extends WearableRecyclerView.Adapter<ViewHolder> {
private static final int ITEM_COUNT = 100;
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
TextView view = new TextView(parent.getContext());
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
holder.mView.setText("Holder at position " + position);
holder.mView.setTag(position);
}
@Override
public int getItemCount() {
return ITEM_COUNT;
}
}
}