Added settings to show/hide orange border on avatars
This commit is contained in:
parent
ff13b2fd1f
commit
b1336464ad
6 changed files with 34 additions and 0 deletions
|
@ -25,6 +25,7 @@ import android.view.LayoutInflater
|
|||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import org.linphone.LinphoneApplication
|
||||
import org.linphone.R
|
||||
import org.linphone.databinding.ContactAvatarBigBinding
|
||||
import org.linphone.utils.AppUtils
|
||||
|
@ -67,5 +68,6 @@ class BigContactAvatarView : LinearLayout {
|
|||
binding.initials = initials
|
||||
binding.generatedAvatarVisibility = initials.isNotEmpty() && initials != "+"
|
||||
binding.imagePath = contact?.getContactPictureUri()
|
||||
binding.borderVisibility = LinphoneApplication.corePreferences.showBorderOnBigContactAvatar
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ import android.util.AttributeSet
|
|||
import android.view.LayoutInflater
|
||||
import android.widget.LinearLayout
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import org.linphone.LinphoneApplication.Companion.corePreferences
|
||||
import org.linphone.R
|
||||
import org.linphone.core.ChatRoomSecurityLevel
|
||||
import org.linphone.databinding.ContactAvatarBinding
|
||||
|
@ -63,6 +64,7 @@ class ContactAvatarView : LinearLayout {
|
|||
binding.groupChatAvatarVisibility = viewModel.showGroupChatAvatar
|
||||
|
||||
binding.imagePath = contact?.getContactThumbnailPictureUri()
|
||||
binding.borderVisibility = corePreferences.showBorderOnContactAvatar
|
||||
|
||||
binding.securityIcon = when (viewModel.securityLevel) {
|
||||
ChatRoomSecurityLevel.Safe -> R.drawable.security_2_indicator
|
||||
|
|
|
@ -240,6 +240,12 @@ class CorePreferences constructor(private val context: Context) {
|
|||
val contactOrganizationVisible: Boolean
|
||||
get() = config.getBool("app", "display_contact_organization", true)
|
||||
|
||||
val showBorderOnContactAvatar: Boolean
|
||||
get() = config.getBool("app", "show_border_on_contact_avatar", false)
|
||||
|
||||
val showBorderOnBigContactAvatar: Boolean
|
||||
get() = config.getBool("app", "show_border_on_big_contact_avatar", true)
|
||||
|
||||
val checkIfUpdateAvailableUrl: String?
|
||||
get() = config.getString("misc", "version_check_url_root", null)
|
||||
|
||||
|
|
|
@ -28,6 +28,9 @@
|
|||
<variable
|
||||
name="imagePath"
|
||||
type="android.net.Uri" />
|
||||
<variable
|
||||
name="borderVisibility"
|
||||
type="Boolean" />
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
|
@ -72,6 +75,15 @@
|
|||
android:contentDescription="@null"
|
||||
app:glideAvatar="@{imagePath}" />
|
||||
|
||||
<ImageView
|
||||
android:visibility="@{borderVisibility ? View.VISIBLE : View.GONE, default=gone}"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/avatar_border" />
|
||||
|
||||
<ImageView
|
||||
android:visibility="@{securityBadgeVisibility ? View.VISIBLE : View.GONE, default=gone}"
|
||||
android:contentDescription="@{securityContentDescription}"
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
<variable
|
||||
name="imagePath"
|
||||
type="android.net.Uri" />
|
||||
<variable
|
||||
name="borderVisibility"
|
||||
type="Boolean" />
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
|
@ -58,6 +61,7 @@
|
|||
app:glideAvatar="@{imagePath}" />
|
||||
|
||||
<ImageView
|
||||
android:visibility="@{borderVisibility ? View.VISIBLE : View.GONE}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentLeft="true"
|
||||
|
|
|
@ -53,6 +53,14 @@
|
|||
android:src="@drawable/avatar"
|
||||
glideAvatarFallback="@{viewModel.defaultAccountAvatar}" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:adjustViewBounds="true"
|
||||
android:padding="10dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/avatar_border" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
|
|
Loading…
Reference in a new issue