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.view.View
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import androidx.databinding.DataBindingUtil
|
import androidx.databinding.DataBindingUtil
|
||||||
|
import org.linphone.LinphoneApplication
|
||||||
import org.linphone.R
|
import org.linphone.R
|
||||||
import org.linphone.databinding.ContactAvatarBigBinding
|
import org.linphone.databinding.ContactAvatarBigBinding
|
||||||
import org.linphone.utils.AppUtils
|
import org.linphone.utils.AppUtils
|
||||||
|
@ -67,5 +68,6 @@ class BigContactAvatarView : LinearLayout {
|
||||||
binding.initials = initials
|
binding.initials = initials
|
||||||
binding.generatedAvatarVisibility = initials.isNotEmpty() && initials != "+"
|
binding.generatedAvatarVisibility = initials.isNotEmpty() && initials != "+"
|
||||||
binding.imagePath = contact?.getContactPictureUri()
|
binding.imagePath = contact?.getContactPictureUri()
|
||||||
|
binding.borderVisibility = LinphoneApplication.corePreferences.showBorderOnBigContactAvatar
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ import android.util.AttributeSet
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import androidx.databinding.DataBindingUtil
|
import androidx.databinding.DataBindingUtil
|
||||||
|
import org.linphone.LinphoneApplication.Companion.corePreferences
|
||||||
import org.linphone.R
|
import org.linphone.R
|
||||||
import org.linphone.core.ChatRoomSecurityLevel
|
import org.linphone.core.ChatRoomSecurityLevel
|
||||||
import org.linphone.databinding.ContactAvatarBinding
|
import org.linphone.databinding.ContactAvatarBinding
|
||||||
|
@ -63,6 +64,7 @@ class ContactAvatarView : LinearLayout {
|
||||||
binding.groupChatAvatarVisibility = viewModel.showGroupChatAvatar
|
binding.groupChatAvatarVisibility = viewModel.showGroupChatAvatar
|
||||||
|
|
||||||
binding.imagePath = contact?.getContactThumbnailPictureUri()
|
binding.imagePath = contact?.getContactThumbnailPictureUri()
|
||||||
|
binding.borderVisibility = corePreferences.showBorderOnContactAvatar
|
||||||
|
|
||||||
binding.securityIcon = when (viewModel.securityLevel) {
|
binding.securityIcon = when (viewModel.securityLevel) {
|
||||||
ChatRoomSecurityLevel.Safe -> R.drawable.security_2_indicator
|
ChatRoomSecurityLevel.Safe -> R.drawable.security_2_indicator
|
||||||
|
|
|
@ -240,6 +240,12 @@ class CorePreferences constructor(private val context: Context) {
|
||||||
val contactOrganizationVisible: Boolean
|
val contactOrganizationVisible: Boolean
|
||||||
get() = config.getBool("app", "display_contact_organization", true)
|
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?
|
val checkIfUpdateAvailableUrl: String?
|
||||||
get() = config.getString("misc", "version_check_url_root", null)
|
get() = config.getString("misc", "version_check_url_root", null)
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,9 @@
|
||||||
<variable
|
<variable
|
||||||
name="imagePath"
|
name="imagePath"
|
||||||
type="android.net.Uri" />
|
type="android.net.Uri" />
|
||||||
|
<variable
|
||||||
|
name="borderVisibility"
|
||||||
|
type="Boolean" />
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
|
@ -72,6 +75,15 @@
|
||||||
android:contentDescription="@null"
|
android:contentDescription="@null"
|
||||||
app:glideAvatar="@{imagePath}" />
|
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
|
<ImageView
|
||||||
android:visibility="@{securityBadgeVisibility ? View.VISIBLE : View.GONE, default=gone}"
|
android:visibility="@{securityBadgeVisibility ? View.VISIBLE : View.GONE, default=gone}"
|
||||||
android:contentDescription="@{securityContentDescription}"
|
android:contentDescription="@{securityContentDescription}"
|
||||||
|
|
|
@ -13,6 +13,9 @@
|
||||||
<variable
|
<variable
|
||||||
name="imagePath"
|
name="imagePath"
|
||||||
type="android.net.Uri" />
|
type="android.net.Uri" />
|
||||||
|
<variable
|
||||||
|
name="borderVisibility"
|
||||||
|
type="Boolean" />
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
|
@ -58,6 +61,7 @@
|
||||||
app:glideAvatar="@{imagePath}" />
|
app:glideAvatar="@{imagePath}" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:visibility="@{borderVisibility ? View.VISIBLE : View.GONE}"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
|
|
|
@ -53,6 +53,14 @@
|
||||||
android:src="@drawable/avatar"
|
android:src="@drawable/avatar"
|
||||||
glideAvatarFallback="@{viewModel.defaultAccountAvatar}" />
|
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
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
Loading…
Reference in a new issue