Fix showing/hiding of preview cards in timeline posts that are collapsed for length. (#1796)

Also properly places the preview card after the "collapse for length" button.
main
Levi Bard 5 years ago committed by Alibek Omarov
parent f69e837cb3
commit e4caff2ff0
  1. 6
      app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java
  2. 4
      app/src/main/res/layout/item_status.xml

@ -1019,7 +1019,11 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder {
} }
protected void setupCard(StatusViewData.Concrete status, CardViewMode cardViewMode) { protected void setupCard(StatusViewData.Concrete status, CardViewMode cardViewMode) {
if (cardViewMode != CardViewMode.NONE && status.getAttachments().size() == 0 && status.getCard() != null && !TextUtils.isEmpty(status.getCard().getUrl())) { if (cardViewMode != CardViewMode.NONE &&
status.getAttachments().size() == 0 &&
status.getCard() != null &&
!TextUtils.isEmpty(status.getCard().getUrl()) &&
!status.isCollapsed()) {
final Card card = status.getCard(); final Card card = status.getCard();
cardView.setVisibility(View.VISIBLE); cardView.setVisibility(View.VISIBLE);
cardTitle.setText(card.getTitle()); cardTitle.setText(card.getTitle());

@ -182,7 +182,7 @@
android:minHeight="80dp" android:minHeight="80dp"
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintStart_toStartOf="@id/status_display_name" app:layout_constraintStart_toStartOf="@id/status_display_name"
app:layout_constraintTop_toBottomOf="@+id/status_content" app:layout_constraintTop_toBottomOf="@+id/button_toggle_content"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
tools:visibility="gone"> tools:visibility="gone">
@ -256,7 +256,7 @@
android:textSize="?attr/status_text_medium" android:textSize="?attr/status_text_medium"
android:visibility="gone" android:visibility="gone"
app:layout_constraintStart_toStartOf="@id/status_display_name" app:layout_constraintStart_toStartOf="@id/status_display_name"
app:layout_constraintTop_toBottomOf="@id/status_card_view" app:layout_constraintTop_toBottomOf="@id/status_content"
tools:text="@string/status_content_show_less" tools:text="@string/status_content_show_less"
tools:visibility="visible" /> tools:visibility="visible" />

Loading…
Cancel
Save