mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-04-20 03:24:50 +00:00
Merge branch 'master' of gitlab.futo.org:videostreaming/grayjay
This commit is contained in:
commit
fa2f8c3447
4 changed files with 20 additions and 6 deletions
|
@ -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);
|
||||
|
|
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: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"
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Reference in a new issue