kopia lustrzana https://github.com/ryukoposting/Signal-Android
Do not allow BadgeImageView to control its own visibility.
rodzic
fb0b1af056
commit
997f6ef534
|
@ -31,7 +31,7 @@ class BadgeImageView @JvmOverloads constructor(
|
||||||
fun setBadgeFromRecipient(recipient: Recipient?) {
|
fun setBadgeFromRecipient(recipient: Recipient?) {
|
||||||
getGlideRequests()?.let {
|
getGlideRequests()?.let {
|
||||||
setBadgeFromRecipient(recipient, it)
|
setBadgeFromRecipient(recipient, it)
|
||||||
}
|
} ?: setImageDrawable(null)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setBadgeFromRecipient(recipient: Recipient?, glideRequests: GlideRequests) {
|
fun setBadgeFromRecipient(recipient: Recipient?, glideRequests: GlideRequests) {
|
||||||
|
@ -45,12 +45,10 @@ class BadgeImageView @JvmOverloads constructor(
|
||||||
fun setBadge(badge: Badge?) {
|
fun setBadge(badge: Badge?) {
|
||||||
getGlideRequests()?.let {
|
getGlideRequests()?.let {
|
||||||
setBadge(badge, it)
|
setBadge(badge, it)
|
||||||
}
|
} ?: setImageDrawable(null)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setBadge(badge: Badge?, glideRequests: GlideRequests) {
|
fun setBadge(badge: Badge?, glideRequests: GlideRequests) {
|
||||||
visible = badge != null
|
|
||||||
|
|
||||||
if (badge != null) {
|
if (badge != null) {
|
||||||
glideRequests
|
glideRequests
|
||||||
.load(badge)
|
.load(badge)
|
||||||
|
@ -60,6 +58,7 @@ class BadgeImageView @JvmOverloads constructor(
|
||||||
} else {
|
} else {
|
||||||
glideRequests
|
glideRequests
|
||||||
.clear(this)
|
.clear(this)
|
||||||
|
setImageDrawable(null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,11 +26,9 @@
|
||||||
android:layout_marginStart="40dp"
|
android:layout_marginStart="40dp"
|
||||||
android:layout_marginTop="40dp"
|
android:layout_marginTop="40dp"
|
||||||
android:contentDescription="@string/ImageView__badge"
|
android:contentDescription="@string/ImageView__badge"
|
||||||
android:visibility="gone"
|
|
||||||
app:badge_size="medium"
|
app:badge_size="medium"
|
||||||
app:layout_constraintStart_toStartOf="@id/icon"
|
app:layout_constraintStart_toStartOf="@id/icon"
|
||||||
app:layout_constraintTop_toTopOf="@id/icon"
|
app:layout_constraintTop_toTopOf="@id/icon" />
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
android:layout_marginStart="20dp"
|
android:layout_marginStart="20dp"
|
||||||
android:layout_marginTop="22dp"
|
android:layout_marginTop="22dp"
|
||||||
android:contentDescription="@string/ImageView__badge"
|
android:contentDescription="@string/ImageView__badge"
|
||||||
android:visibility="gone"
|
|
||||||
app:badge_size="medium"
|
app:badge_size="medium"
|
||||||
app:layout_constraintStart_toStartOf="@id/contact_photo_image"
|
app:layout_constraintStart_toStartOf="@id/contact_photo_image"
|
||||||
app:layout_constraintTop_toTopOf="@id/contact_photo_image"
|
app:layout_constraintTop_toTopOf="@id/contact_photo_image"
|
||||||
|
|
|
@ -23,11 +23,9 @@
|
||||||
android:layout_marginStart="47dp"
|
android:layout_marginStart="47dp"
|
||||||
android:layout_marginTop="48dp"
|
android:layout_marginTop="48dp"
|
||||||
android:contentDescription="@string/ImageView__badge"
|
android:contentDescription="@string/ImageView__badge"
|
||||||
android:visibility="gone"
|
|
||||||
app:badge_size="large"
|
app:badge_size="large"
|
||||||
app:layout_constraintStart_toStartOf="@id/message_request_avatar"
|
app:layout_constraintStart_toStartOf="@id/message_request_avatar"
|
||||||
app:layout_constraintTop_toTopOf="@id/message_request_avatar"
|
app:layout_constraintTop_toTopOf="@id/message_request_avatar" />
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/message_request_avatar_tap_to_view"
|
android:id="@+id/message_request_avatar_tap_to_view"
|
||||||
|
|
|
@ -62,8 +62,7 @@
|
||||||
android:layout_marginStart="14dp"
|
android:layout_marginStart="14dp"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:badge_size="small"
|
app:badge_size="small" />
|
||||||
tools:background="@color/red" />
|
|
||||||
|
|
||||||
<org.thoughtcrime.securesms.conversation.ConversationItemBodyBubble
|
<org.thoughtcrime.securesms.conversation.ConversationItemBodyBubble
|
||||||
android:id="@+id/body_bubble"
|
android:id="@+id/body_bubble"
|
||||||
|
|
|
@ -62,8 +62,7 @@
|
||||||
android:layout_marginStart="14dp"
|
android:layout_marginStart="14dp"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:badge_size="small"
|
app:badge_size="small" />
|
||||||
tools:background="@color/red" />
|
|
||||||
|
|
||||||
<org.thoughtcrime.securesms.conversation.ConversationItemBodyBubble
|
<org.thoughtcrime.securesms.conversation.ConversationItemBodyBubble
|
||||||
android:id="@+id/body_bubble"
|
android:id="@+id/body_bubble"
|
||||||
|
|
|
@ -181,10 +181,8 @@
|
||||||
android:layout_marginStart="26dp"
|
android:layout_marginStart="26dp"
|
||||||
android:layout_marginTop="26dp"
|
android:layout_marginTop="26dp"
|
||||||
android:contentDescription="@string/ImageView__badge"
|
android:contentDescription="@string/ImageView__badge"
|
||||||
android:visibility="gone"
|
|
||||||
app:badge_size="medium"
|
app:badge_size="medium"
|
||||||
app:layout_constraintStart_toStartOf="@id/conversation_list_item_avatar"
|
app:layout_constraintStart_toStartOf="@id/conversation_list_item_avatar"
|
||||||
app:layout_constraintTop_toTopOf="@id/conversation_list_item_avatar"
|
app:layout_constraintTop_toTopOf="@id/conversation_list_item_avatar" />
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
</org.thoughtcrime.securesms.conversationlist.ConversationListItem>
|
</org.thoughtcrime.securesms.conversationlist.ConversationListItem>
|
||||||
|
|
|
@ -28,10 +28,8 @@
|
||||||
android:layout_marginStart="47dp"
|
android:layout_marginStart="47dp"
|
||||||
android:layout_marginTop="48dp"
|
android:layout_marginTop="48dp"
|
||||||
android:contentDescription="@string/ImageView__badge"
|
android:contentDescription="@string/ImageView__badge"
|
||||||
android:visibility="gone"
|
|
||||||
app:badge_size="large"
|
app:badge_size="large"
|
||||||
app:layout_constraintStart_toStartOf="@id/bio_preference_avatar"
|
app:layout_constraintStart_toStartOf="@id/bio_preference_avatar"
|
||||||
app:layout_constraintTop_toTopOf="@id/bio_preference_avatar"
|
app:layout_constraintTop_toTopOf="@id/bio_preference_avatar" />
|
||||||
tools:visibility="visible" />
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
|
@ -38,9 +38,7 @@
|
||||||
android:layout_marginStart="22dp"
|
android:layout_marginStart="22dp"
|
||||||
android:layout_marginTop="22dp"
|
android:layout_marginTop="22dp"
|
||||||
android:contentDescription="@string/ImageView__badge"
|
android:contentDescription="@string/ImageView__badge"
|
||||||
android:visibility="gone"
|
app:badge_size="small" />
|
||||||
app:badge_size="small"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
|
@ -26,11 +26,9 @@
|
||||||
android:layout_marginStart="20dp"
|
android:layout_marginStart="20dp"
|
||||||
android:layout_marginTop="22dp"
|
android:layout_marginTop="22dp"
|
||||||
android:contentDescription="@string/ImageView__badge"
|
android:contentDescription="@string/ImageView__badge"
|
||||||
android:visibility="gone"
|
|
||||||
app:badge_size="medium"
|
app:badge_size="medium"
|
||||||
app:layout_constraintStart_toStartOf="@id/recipient_avatar"
|
app:layout_constraintStart_toStartOf="@id/recipient_avatar"
|
||||||
app:layout_constraintTop_toTopOf="@id/recipient_avatar"
|
app:layout_constraintTop_toTopOf="@id/recipient_avatar" />
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatCheckBox
|
<androidx.appcompat.widget.AppCompatCheckBox
|
||||||
android:id="@+id/recipient_selected"
|
android:id="@+id/recipient_selected"
|
||||||
|
|
|
@ -37,11 +37,9 @@
|
||||||
android:layout_marginStart="20dp"
|
android:layout_marginStart="20dp"
|
||||||
android:layout_marginTop="22dp"
|
android:layout_marginTop="22dp"
|
||||||
android:contentDescription="@string/ImageView__badge"
|
android:contentDescription="@string/ImageView__badge"
|
||||||
android:visibility="gone"
|
|
||||||
app:badge_size="medium"
|
app:badge_size="medium"
|
||||||
app:layout_constraintStart_toStartOf="@id/message_details_recipient_avatar"
|
app:layout_constraintStart_toStartOf="@id/message_details_recipient_avatar"
|
||||||
app:layout_constraintTop_toTopOf="@id/message_details_recipient_avatar"
|
app:layout_constraintTop_toTopOf="@id/message_details_recipient_avatar" />
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<org.thoughtcrime.securesms.components.FromTextView
|
<org.thoughtcrime.securesms.components.FromTextView
|
||||||
android:id="@+id/message_details_recipient_name"
|
android:id="@+id/message_details_recipient_name"
|
||||||
|
|
|
@ -28,11 +28,9 @@
|
||||||
android:layout_marginStart="47dp"
|
android:layout_marginStart="47dp"
|
||||||
android:layout_marginTop="48dp"
|
android:layout_marginTop="48dp"
|
||||||
android:contentDescription="@string/ImageView__badge"
|
android:contentDescription="@string/ImageView__badge"
|
||||||
android:visibility="gone"
|
|
||||||
app:badge_size="large"
|
app:badge_size="large"
|
||||||
app:layout_constraintStart_toStartOf="@id/rbs_recipient_avatar"
|
app:layout_constraintStart_toStartOf="@id/rbs_recipient_avatar"
|
||||||
app:layout_constraintTop_toTopOf="@id/rbs_recipient_avatar"
|
app:layout_constraintTop_toTopOf="@id/rbs_recipient_avatar" />
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/rbs_admin_action_busy"
|
android:id="@+id/rbs_admin_action_busy"
|
||||||
|
|
Ładowanie…
Reference in New Issue