@AlexandrMa

Почему долго загружается фрагмент?

Товаров 300.
Проблема с нижним RecyclerView. Когда его скрываешь, фрагмент мгновенно открывается. Видимо полностью загружается весь список.
Наверное, я ошибся с высотой какого-то контейнера. Подскажите, где проблема?

<FrameLayout 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"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    tools:context=".FragmentCategory">

    <androidx.core.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            tools:ignore="UselessParent">

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/category_filter"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/products"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

        </LinearLayout>
    </androidx.core.widget.NestedScrollView>

</FrameLayout>


recyclerView = view.findViewById(R.id.products);
recyclerView.setLayoutManager(new GridLayoutManager(getContext(), 2));
productAdapter = new ProductAdapter(view.getContext(), productList);
recyclerView.setNestedScrollingEnabled(false);
recyclerView.setAdapter(productAdapter);
  • Вопрос задан
  • 85 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы