mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-05-05 00:54:34 +02:00
Merge branch 'master' of gitlab.futo.org:videostreaming/grayjay
This commit is contained in:
commit
fa2f8c3447
@ -308,13 +308,21 @@ class LiveChatOverlay : LinearLayout {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
private var _dedupHackfix = "";
|
||||||
fun addDonation(donation: LiveEventDonation) {
|
fun addDonation(donation: LiveEventDonation) {
|
||||||
|
val uniqueIdentifier = "${donation.name}${donation.amount}${donation.message}";
|
||||||
if(donation.hasExpired()) {
|
if(donation.hasExpired()) {
|
||||||
Logger.i(TAG, "Donation that is already expired: [${donation.amount}]" + donation.name + ":" + donation.message + " EXPIRE: ${donation.expire}");
|
Logger.i(TAG, "Donation that is already expired: [${donation.amount}]" + donation.name + ":" + donation.message + " EXPIRE: ${donation.expire}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else if(_dedupHackfix == uniqueIdentifier) {
|
||||||
|
Logger.i(TAG, "Donation duplicate found, ignoring");
|
||||||
|
return;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
Logger.i(TAG, "Donation Added: [${donation.amount}]" + donation.name + ":" + donation.message + " EXPIRE: ${donation.expire}");
|
Logger.i(TAG, "Donation Added: [${donation.amount}]" + donation.name + ":" + donation.message + " EXPIRE: ${donation.expire}");
|
||||||
|
_dedupHackfix = uniqueIdentifier;
|
||||||
|
|
||||||
val view = LiveChatDonationPill(context, donation);
|
val view = LiveChatDonationPill(context, donation);
|
||||||
view.setOnClickListener {
|
view.setOnClickListener {
|
||||||
showDonation(donation);
|
showDonation(donation);
|
||||||
|
7
app/src/main/res/drawable/background_donation.xml
Normal file
7
app/src/main/res/drawable/background_donation.xml
Normal 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>
|
@ -9,7 +9,7 @@
|
|||||||
android:paddingStart="7dp"
|
android:paddingStart="7dp"
|
||||||
android:paddingEnd="12dp"
|
android:paddingEnd="12dp"
|
||||||
android:layout_marginEnd="5dp"
|
android:layout_marginEnd="5dp"
|
||||||
android:background="@drawable/background_pill"
|
android:background="@drawable/background_donation"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:id="@+id/root">
|
android:id="@+id/root">
|
||||||
|
|
||||||
@ -24,7 +24,7 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:layout_marginRight="5dp"
|
android:layout_marginRight="5dp"
|
||||||
android:layout_marginLeft="5dp"
|
android:layout_marginLeft="0dp"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
app:srcCompat="@drawable/placeholder_profile" />
|
app:srcCompat="@drawable/placeholder_profile" />
|
||||||
|
|
||||||
@ -32,7 +32,7 @@
|
|||||||
android:id="@+id/donation_amount"
|
android:id="@+id/donation_amount"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="5dp"
|
android:layout_marginLeft="3dp"
|
||||||
app:layout_constraintLeft_toRightOf="@id/donation_author_image"
|
app:layout_constraintLeft_toRightOf="@id/donation_author_image"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
|
@ -46,10 +46,9 @@
|
|||||||
app:layout_constraintLeft_toRightOf="@id/ic_viewers"
|
app:layout_constraintLeft_toRightOf="@id/ic_viewers"
|
||||||
tools:text="1536 viewers"/>
|
tools:text="1536 viewers"/>
|
||||||
|
|
||||||
<ScrollView
|
<HorizontalScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="35dp"
|
android:layout_height="35dp"
|
||||||
android:orientation="horizontal"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintRight_toRightOf="parent">
|
app:layout_constraintRight_toRightOf="parent">
|
||||||
@ -61,7 +60,7 @@
|
|||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</HorizontalScrollView>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/button_close"
|
android:id="@+id/button_close"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user