improve preview card when there is no author or description (#4872)
Remove the bottom space on vertical layout, center text vertically on horizontal layout. Make sure the image on the horizontal layout is at least square. Before / After: <img src="https://github.com/user-attachments/assets/a2399c50-c878-413f-bb65-a45b2c0af90c" width="280"/> <img src="https://github.com/user-attachments/assets/8b83a1d9-3991-4f9c-981f-2a50354b6727" width="280"/>
This commit is contained in:
parent
9e597800c9
commit
fd7d966148
2 changed files with 9 additions and 3 deletions
|
|
@ -1158,7 +1158,7 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder {
|
|||
providerName = Uri.parse(card.getUrl()).getHost();
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(providerName) && card.getPublishedAt() != null) {
|
||||
if (TextUtils.isEmpty(providerName)) {
|
||||
cardMetadata.setVisibility(View.GONE);
|
||||
} else {
|
||||
cardMetadata.setVisibility(View.VISIBLE);
|
||||
|
|
@ -1183,7 +1183,12 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder {
|
|||
}
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(cardAuthorName)) {
|
||||
final boolean hasNoAuthorName = TextUtils.isEmpty(cardAuthorName);
|
||||
|
||||
if (hasNoAuthorName && TextUtils.isEmpty(card.getDescription())) {
|
||||
cardAuthor.setVisibility(View.GONE);
|
||||
cardAuthorButton.setVisibility(View.GONE);
|
||||
} else if (hasNoAuthorName) {
|
||||
cardAuthor.setVisibility(View.VISIBLE);
|
||||
cardAuthor.setText(card.getDescription());
|
||||
cardAuthorButton.setVisibility(View.GONE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue