фильтры текстового обзора в android - PullRequest
0 голосов
/ 20 марта 2020

Привет в приведенном ниже коде, я создал 4 textview. Я отображаю в Rickler представление, которое хочет отфильтровать, если они выбраны, все хотят отобразить все данные. Предположим, если они выбраны неполные, хотят отобразить неполный список.

xml:

<LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_gravity="center"
            android:gravity="center"
            android:paddingTop="10dp"
            android:id="@+id/luminary_controll">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/all"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:text="All"
                    android:textColor="@color/black"
                    android:textSize="18sp"
                    android:layout_marginBottom="1dp"/>



            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/incomplete"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:padding="5dp"
                    android:textColor="@color/black"
                    android:text="Incomplete"
                    android:textSize="18sp"
                    android:layout_marginBottom="1dp"/>
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/date_wise"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:textColor="@color/black"
                    android:text="Today"
                    android:padding="2dp"
                    android:textSize="18sp"
                    android:layout_marginBottom="1dp"/>
            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/week_wise"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:textColor="@color/black"
                    android:text="WeekWise"
                    android:padding="2dp"
                    android:textSize="18sp"
                    android:layout_marginBottom="1dp"/>
            </LinearLayout>

ниже кода, если статус равен неполному, когда пользователь касается неполного текстового представления, которое хочет отображать только неполные данные

При касании текстового представления как Реализация ниже может помочь мне java:

            PreferenceManagerTask.getInstance(requireContext()).setMultipleData(subject, taskType, assigned, scheduleDate, location, opportunityNo, status, outcome);
        }
       taskModel = new TaskModel(subject, taskType, assigned, scheduleDate, location, opportunityNo, status, " " + outcome + " ", createdtime, modifiedtime, activitytype, modifiedby, remark,parent_id);
        listTask.add(taskModel);
        recyclerViewTask.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
        recyclerViewTask.setAdapter(taskAdapter);
        taskAdapter.notifyDataSetChanged();
            final String finalStatus = status;
            if (finalStatus.equals("In Complete")) {
                incomplete.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.tabs1));
                all.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.White));
                listTask.add(taskModel);
                recyclerViewTask.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
                recyclerViewTask.setAdapter(taskAdapter);
                taskAdapter.notifyDataSetChanged();

            }
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...