Live chat improvements and fixes

This commit is contained in:
Kelvin 2023-11-23 16:35:13 +01:00
parent ee3761c780
commit 2530c6eb58
4 changed files with 20 additions and 6 deletions

View file

@ -308,13 +308,21 @@ class LiveChatOverlay : LinearLayout {
}
};
}
private var _dedupHackfix = "";
fun addDonation(donation: LiveEventDonation) {
val uniqueIdentifier = "${donation.name}${donation.amount}${donation.message}";
if(donation.hasExpired()) {
Logger.i(TAG, "Donation that is already expired: [${donation.amount}]" + donation.name + ":" + donation.message + " EXPIRE: ${donation.expire}");
return;
}
else if(_dedupHackfix == uniqueIdentifier) {
Logger.i(TAG, "Donation duplicate found, ignoring");
return;
}
else
Logger.i(TAG, "Donation Added: [${donation.amount}]" + donation.name + ":" + donation.message + " EXPIRE: ${donation.expire}");
_dedupHackfix = uniqueIdentifier;
val view = LiveChatDonationPill(context, donation);
view.setOnClickListener {
showDonation(donation);

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#2A2A2A" />
<corners android:radius="500dp" />
<size android:height="20dp" />
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" />
</shape>

View file

@ -9,7 +9,7 @@
android:paddingStart="7dp"
android:paddingEnd="12dp"
android:layout_marginEnd="5dp"
android:background="@drawable/background_pill"
android:background="@drawable/background_donation"
android:orientation="vertical"
android:id="@+id/root">
@ -24,7 +24,7 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginRight="5dp"
android:layout_marginLeft="5dp"
android:layout_marginLeft="0dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/placeholder_profile" />
@ -32,7 +32,7 @@
android:id="@+id/donation_amount"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_marginLeft="3dp"
app:layout_constraintLeft_toRightOf="@id/donation_author_image"
app:layout_constraintTop_toTopOf="parent"
android:textColor="@color/white"

View file

@ -46,10 +46,9 @@
app:layout_constraintLeft_toRightOf="@id/ic_viewers"
tools:text="1536 viewers"/>
<ScrollView
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="35dp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent">
@ -61,7 +60,7 @@
android:layout_height="match_parent">
</LinearLayout>
</ScrollView>
</HorizontalScrollView>
<ImageView
android:id="@+id/button_close"