Browse Source

make media shares look better

renovate/org.robolectric-robolectric-4.x
Austin Huang 4 years ago
parent
commit
37663ced30
No known key found for this signature in database GPG Key ID: 84C23AA04587A91F
  1. 11
      app/src/main/java/awais/instagrabber/adapters/viewholder/directmessages/DirectItemMediaShareViewHolder.java
  2. 22
      app/src/main/res/layout/layout_dm_media_share.xml

11
app/src/main/java/awais/instagrabber/adapters/viewholder/directmessages/DirectItemMediaShareViewHolder.java

@ -65,7 +65,6 @@ public class DirectItemMediaShareViewHolder extends DirectItemViewHolder {
if (media == null) return;
itemView.post(() -> {
setupUser(media);
setupTitle(media);
setupCaption(media);
});
final int index;
@ -140,16 +139,6 @@ public class DirectItemMediaShareViewHolder extends DirectItemViewHolder {
}
}
private void setupTitle(@NonNull final Media media) {
final String title = media.getTitle();
if (!TextUtils.isEmpty(title)) {
binding.title.setVisibility(View.VISIBLE);
binding.title.setText(title);
} else {
binding.title.setVisibility(View.GONE);
}
}
private void setupUser(@NonNull final Media media) {
final User user = media.getUser();
if (user != null) {

22
app/src/main/res/layout/layout_dm_media_share.xml

@ -76,26 +76,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/title" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingStart="8dp"
android:paddingTop="8dp"
android:paddingEnd="8dp"
android:paddingBottom="0dp"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2"
android:textColor="@color/white"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@id/caption"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1"
app:layout_constraintVertical_chainStyle="packed"
tools:text="Title" />
app:layout_constraintTop_toTopOf="@id/caption" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/caption"
@ -107,6 +88,5 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/title"
tools:text="Caption Caption Caption Caption Caption Caption " />
</androidx.constraintlayout.widget.ConstraintLayout>
Loading…
Cancel
Save