У меня есть схема размещения ограничений для моего вида переработчика. Я скрываю и показываю это, основываясь на значении базы данных, из моего адаптера утилитного просмотра. Он работает, но проблема в том, что после просмотра все равно остается занятое пространство. Ниже мой xml файл
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:id="@+id/books_layout" // show-hide based on this id
android:layout_height="wrap_content">
<ImageView
android:id="@+id/imgAvator"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:text=""
android:textSize="16dp"
app:layout_constraintStart_toEndOf="@+id/imgAvator"
app:layout_constraintTop_toBottomOf="@+id/tvDriverNme" />
<TextView
android:id="@+id/tvD"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="2dp"
android:text=""
android:textColor="#050505"
android:textSize="18dp"
app:layout_constraintStart_toEndOf="@+id/imgAvator"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvR"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginEnd="5dp"
android:layout_marginRight="5dp"
android:text=""
android:textColor="#FF9800"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvB"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="21dp"
android:text=""
android:textColor="#050505"
android:textSize="16dp"
android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@+id/tvTk"
app:layout_constraintTop_toBottomOf="@+id/tvRatings" />
<TextView
android:id="@+id/tvReg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="45dp"
android:layout_marginEnd="5dp"
android:layout_marginRight="5dp"
android:background="@drawable/strike_through"
android:text=""
android:textColor="#707676"
android:textSize="16dp"
app:layout_constraintEnd_toStartOf="@+id/tvBidAmt"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
Я показываю / скрываюсь с кодом ниже из моей привязки данных
if (status.equals("1")) {
books_layout.setVisibility(View.GONE);
}
else{
books_layout.setVisibility(View.VISIBLE);
}
Ниже мой текущий вид, который демонстрирует занятое пространство в середине после представление пропало. Я не знаю, как решить эту проблему
