Add support for received call link previews.

This commit is contained in:
Alex Hart
2023-09-07 12:36:21 -03:00
parent b19aedd17c
commit 266adf788c
4 changed files with 20 additions and 3 deletions

View File

@@ -7,12 +7,16 @@ package org.thoughtcrime.securesms.calls.links
import android.content.Context
import android.util.AttributeSet
import android.view.View
import androidx.annotation.ColorRes
import androidx.appcompat.widget.LinearLayoutCompat
import androidx.core.content.ContextCompat
import com.google.android.material.button.MaterialButton
import org.thoughtcrime.securesms.R
/**
* ConversationItem action button for joining a call link.
*/
class CallLinkJoinButton @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null
@@ -22,10 +26,19 @@ class CallLinkJoinButton @JvmOverloads constructor(
inflate(context, R.layout.call_link_join_button, this)
}
private val joinStroke: View = findViewById(R.id.join_stroke)
private val joinButton: MaterialButton = findViewById(R.id.join_button)
fun setTextColor(@ColorRes textColorResId: Int) {
joinButton.setTextColor(ContextCompat.getColor(context, textColorResId))
val color = ContextCompat.getColor(context, textColorResId)
joinButton.setTextColor(color)
}
fun setStrokeColor(@ColorRes strokeColorResId: Int) {
val color = ContextCompat.getColor(context, strokeColorResId)
joinStroke.setBackgroundColor(color)
}
fun setJoinClickListener(onClickListener: OnClickListener) {