mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
Merge branch 'dev' into feature/compose-cleanup
This commit is contained in:
commit
ef5fd14829
File diff suppressed because it is too large
Load Diff
@ -15,7 +15,7 @@ geoname_id,locale_code,continent_code,continent_name,country_iso_code,country_na
|
|||||||
226074,en,AF,Africa,UG,Uganda,0
|
226074,en,AF,Africa,UG,Uganda,0
|
||||||
239880,en,AF,Africa,CF,"Central African Republic",0
|
239880,en,AF,Africa,CF,"Central African Republic",0
|
||||||
241170,en,AF,Africa,SC,Seychelles,0
|
241170,en,AF,Africa,SC,Seychelles,0
|
||||||
248816,en,AS,Asia,JO,"Hashemite Kingdom of Jordan",0
|
248816,en,AS,Asia,JO,Jordan,0
|
||||||
272103,en,AS,Asia,LB,Lebanon,0
|
272103,en,AS,Asia,LB,Lebanon,0
|
||||||
285570,en,AS,Asia,KW,Kuwait,0
|
285570,en,AS,Asia,KW,Kuwait,0
|
||||||
286963,en,AS,Asia,OM,Oman,0
|
286963,en,AS,Asia,OM,Oman,0
|
||||||
@ -23,7 +23,7 @@ geoname_id,locale_code,continent_code,continent_name,country_iso_code,country_na
|
|||||||
290291,en,AS,Asia,BH,Bahrain,0
|
290291,en,AS,Asia,BH,Bahrain,0
|
||||||
290557,en,AS,Asia,AE,"United Arab Emirates",0
|
290557,en,AS,Asia,AE,"United Arab Emirates",0
|
||||||
294640,en,AS,Asia,IL,Israel,0
|
294640,en,AS,Asia,IL,Israel,0
|
||||||
298795,en,AS,Asia,TR,Turkey,0
|
298795,en,AS,Asia,TR,Türkiye,0
|
||||||
337996,en,AF,Africa,ET,Ethiopia,0
|
337996,en,AF,Africa,ET,Ethiopia,0
|
||||||
338010,en,AF,Africa,ER,Eritrea,0
|
338010,en,AF,Africa,ER,Eritrea,0
|
||||||
357994,en,AF,Africa,EG,Egypt,0
|
357994,en,AF,Africa,EG,Egypt,0
|
||||||
@ -33,13 +33,13 @@ geoname_id,locale_code,continent_code,continent_name,country_iso_code,country_na
|
|||||||
453733,en,EU,Europe,EE,Estonia,1
|
453733,en,EU,Europe,EE,Estonia,1
|
||||||
458258,en,EU,Europe,LV,Latvia,1
|
458258,en,EU,Europe,LV,Latvia,1
|
||||||
587116,en,AS,Asia,AZ,Azerbaijan,0
|
587116,en,AS,Asia,AZ,Azerbaijan,0
|
||||||
597427,en,EU,Europe,LT,"Republic of Lithuania",1
|
597427,en,EU,Europe,LT,Lithuania,1
|
||||||
607072,en,EU,Europe,SJ,"Svalbard and Jan Mayen",0
|
607072,en,EU,Europe,SJ,"Svalbard and Jan Mayen",0
|
||||||
614540,en,AS,Asia,GE,Georgia,0
|
614540,en,AS,Asia,GE,Georgia,0
|
||||||
617790,en,EU,Europe,MD,"Republic of Moldova",0
|
617790,en,EU,Europe,MD,Moldova,0
|
||||||
630336,en,EU,Europe,BY,Belarus,0
|
630336,en,EU,Europe,BY,Belarus,0
|
||||||
660013,en,EU,Europe,FI,Finland,1
|
660013,en,EU,Europe,FI,Finland,1
|
||||||
661882,en,EU,Europe,AX,"Åland",1
|
661882,en,EU,Europe,AX,"Åland Islands",1
|
||||||
690791,en,EU,Europe,UA,Ukraine,0
|
690791,en,EU,Europe,UA,Ukraine,0
|
||||||
718075,en,EU,Europe,MK,"North Macedonia",0
|
718075,en,EU,Europe,MK,"North Macedonia",0
|
||||||
719819,en,EU,Europe,HU,Hungary,1
|
719819,en,EU,Europe,HU,Hungary,1
|
||||||
@ -77,8 +77,8 @@ geoname_id,locale_code,continent_code,continent_name,country_iso_code,country_na
|
|||||||
1522867,en,AS,Asia,KZ,Kazakhstan,0
|
1522867,en,AS,Asia,KZ,Kazakhstan,0
|
||||||
1527747,en,AS,Asia,KG,Kyrgyzstan,0
|
1527747,en,AS,Asia,KG,Kyrgyzstan,0
|
||||||
1546748,en,AN,Antarctica,TF,"French Southern Territories",0
|
1546748,en,AN,Antarctica,TF,"French Southern Territories",0
|
||||||
1547314,en,AN,Antarctica,HM,"Heard Island and McDonald Islands",0
|
1547314,en,AN,Antarctica,HM,"Heard and McDonald Islands",0
|
||||||
1547376,en,AS,Asia,CC,"Cocos [Keeling] Islands",0
|
1547376,en,AS,Asia,CC,"Cocos (Keeling) Islands",0
|
||||||
1559582,en,OC,Oceania,PW,Palau,0
|
1559582,en,OC,Oceania,PW,Palau,0
|
||||||
1562822,en,AS,Asia,VN,Vietnam,0
|
1562822,en,AS,Asia,VN,Vietnam,0
|
||||||
1605651,en,AS,Asia,TH,Thailand,0
|
1605651,en,AS,Asia,TH,Thailand,0
|
||||||
@ -97,7 +97,7 @@ geoname_id,locale_code,continent_code,continent_name,country_iso_code,country_na
|
|||||||
1873107,en,AS,Asia,KP,"North Korea",0
|
1873107,en,AS,Asia,KP,"North Korea",0
|
||||||
1880251,en,AS,Asia,SG,Singapore,0
|
1880251,en,AS,Asia,SG,Singapore,0
|
||||||
1899402,en,OC,Oceania,CK,"Cook Islands",0
|
1899402,en,OC,Oceania,CK,"Cook Islands",0
|
||||||
1966436,en,OC,Oceania,TL,"East Timor",0
|
1966436,en,OC,Oceania,TL,Timor-Leste,0
|
||||||
2017370,en,EU,Europe,RU,Russia,0
|
2017370,en,EU,Europe,RU,Russia,0
|
||||||
2029969,en,AS,Asia,MN,Mongolia,0
|
2029969,en,AS,Asia,MN,Mongolia,0
|
||||||
2077456,en,OC,Oceania,AU,Australia,0
|
2077456,en,OC,Oceania,AU,Australia,0
|
||||||
@ -131,7 +131,7 @@ geoname_id,locale_code,continent_code,continent_name,country_iso_code,country_na
|
|||||||
2400553,en,AF,Africa,GA,Gabon,0
|
2400553,en,AF,Africa,GA,Gabon,0
|
||||||
2403846,en,AF,Africa,SL,"Sierra Leone",0
|
2403846,en,AF,Africa,SL,"Sierra Leone",0
|
||||||
2410758,en,AF,Africa,ST,"São Tomé and Príncipe",0
|
2410758,en,AF,Africa,ST,"São Tomé and Príncipe",0
|
||||||
2411586,en,EU,Europe,GI,Gibraltar,1
|
2411586,en,EU,Europe,GI,Gibraltar,0
|
||||||
2413451,en,AF,Africa,GM,Gambia,0
|
2413451,en,AF,Africa,GM,Gambia,0
|
||||||
2420477,en,AF,Africa,GN,Guinea,0
|
2420477,en,AF,Africa,GN,Guinea,0
|
||||||
2434508,en,AF,Africa,TD,Chad,0
|
2434508,en,AF,Africa,TD,Chad,0
|
||||||
@ -146,10 +146,10 @@ geoname_id,locale_code,continent_code,continent_name,country_iso_code,country_na
|
|||||||
2622320,en,EU,Europe,FO,"Faroe Islands",0
|
2622320,en,EU,Europe,FO,"Faroe Islands",0
|
||||||
2623032,en,EU,Europe,DK,Denmark,1
|
2623032,en,EU,Europe,DK,Denmark,1
|
||||||
2629691,en,EU,Europe,IS,Iceland,0
|
2629691,en,EU,Europe,IS,Iceland,0
|
||||||
2635167,en,EU,Europe,GB,"United Kingdom",1
|
2635167,en,EU,Europe,GB,"United Kingdom",0
|
||||||
2658434,en,EU,Europe,CH,Switzerland,0
|
2658434,en,EU,Europe,CH,Switzerland,0
|
||||||
2661886,en,EU,Europe,SE,Sweden,1
|
2661886,en,EU,Europe,SE,Sweden,1
|
||||||
2750405,en,EU,Europe,NL,Netherlands,1
|
2750405,en,EU,Europe,NL,"The Netherlands",1
|
||||||
2782113,en,EU,Europe,AT,Austria,1
|
2782113,en,EU,Europe,AT,Austria,1
|
||||||
2802361,en,EU,Europe,BE,Belgium,1
|
2802361,en,EU,Europe,BE,Belgium,1
|
||||||
2921044,en,EU,Europe,DE,Germany,1
|
2921044,en,EU,Europe,DE,Germany,1
|
||||||
@ -203,7 +203,7 @@ geoname_id,locale_code,continent_code,continent_name,country_iso_code,country_na
|
|||||||
3576916,en,NA,"North America",TC,"Turks and Caicos Islands",0
|
3576916,en,NA,"North America",TC,"Turks and Caicos Islands",0
|
||||||
3577279,en,NA,"North America",AW,Aruba,0
|
3577279,en,NA,"North America",AW,Aruba,0
|
||||||
3577718,en,NA,"North America",VG,"British Virgin Islands",0
|
3577718,en,NA,"North America",VG,"British Virgin Islands",0
|
||||||
3577815,en,NA,"North America",VC,"Saint Vincent and the Grenadines",0
|
3577815,en,NA,"North America",VC,"St Vincent and Grenadines",0
|
||||||
3578097,en,NA,"North America",MS,Montserrat,0
|
3578097,en,NA,"North America",MS,Montserrat,0
|
||||||
3578421,en,NA,"North America",MF,"Saint Martin",1
|
3578421,en,NA,"North America",MF,"Saint Martin",1
|
||||||
3578476,en,NA,"North America",BL,"Saint Barthélemy",0
|
3578476,en,NA,"North America",BL,"Saint Barthélemy",0
|
||||||
@ -238,7 +238,7 @@ geoname_id,locale_code,continent_code,continent_name,country_iso_code,country_na
|
|||||||
4043988,en,OC,Oceania,GU,Guam,0
|
4043988,en,OC,Oceania,GU,Guam,0
|
||||||
4566966,en,NA,"North America",PR,"Puerto Rico",0
|
4566966,en,NA,"North America",PR,"Puerto Rico",0
|
||||||
4796775,en,NA,"North America",VI,"U.S. Virgin Islands",0
|
4796775,en,NA,"North America",VI,"U.S. Virgin Islands",0
|
||||||
5854968,en,OC,Oceania,UM,"U.S. Minor Outlying Islands",0
|
5854968,en,OC,Oceania,UM,"U.S. Outlying Islands",0
|
||||||
5880801,en,OC,Oceania,AS,"American Samoa",0
|
5880801,en,OC,Oceania,AS,"American Samoa",0
|
||||||
6251999,en,NA,"North America",CA,Canada,0
|
6251999,en,NA,"North America",CA,Canada,0
|
||||||
6252001,en,NA,"North America",US,"United States",0
|
6252001,en,NA,"North America",US,"United States",0
|
||||||
|
|
@ -33,6 +33,8 @@ import network.loki.messenger.databinding.ActivityWebrtcBinding
|
|||||||
import org.apache.commons.lang3.time.DurationFormatUtils
|
import org.apache.commons.lang3.time.DurationFormatUtils
|
||||||
import org.session.libsession.avatars.ProfileContactPhoto
|
import org.session.libsession.avatars.ProfileContactPhoto
|
||||||
import org.session.libsession.messaging.contacts.Contact
|
import org.session.libsession.messaging.contacts.Contact
|
||||||
|
import org.session.libsession.utilities.TextSecurePreferences
|
||||||
|
import org.session.libsession.utilities.truncateIdForDisplay
|
||||||
import org.session.libsignal.utilities.Log
|
import org.session.libsignal.utilities.Log
|
||||||
import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity
|
import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity
|
||||||
import org.thoughtcrime.securesms.dependencies.DatabaseComponent
|
import org.thoughtcrime.securesms.dependencies.DatabaseComponent
|
||||||
@ -200,6 +202,16 @@ class WebRtcCallActivity : PassphraseRequiredActionBarActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
clipFloatingInsets()
|
clipFloatingInsets()
|
||||||
|
|
||||||
|
// set up the user avatar
|
||||||
|
TextSecurePreferences.getLocalNumber(this)?.let{
|
||||||
|
val username = TextSecurePreferences.getProfileName(this) ?: truncateIdForDisplay(it)
|
||||||
|
binding.userAvatar.apply {
|
||||||
|
publicKey = it
|
||||||
|
displayName = username
|
||||||
|
update()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -254,8 +266,10 @@ class WebRtcCallActivity : PassphraseRequiredActionBarActivity() {
|
|||||||
else -> 0f
|
else -> 0f
|
||||||
}
|
}
|
||||||
|
|
||||||
remoteRecipient.animate().cancel()
|
userAvatar.animate().cancel()
|
||||||
remoteRecipient.animate().rotation(rotation).start()
|
userAvatar.animate().rotation(rotation).start()
|
||||||
|
contactAvatar.animate().cancel()
|
||||||
|
contactAvatar.animate().rotation(rotation).start()
|
||||||
|
|
||||||
speakerPhoneButton.animate().cancel()
|
speakerPhoneButton.animate().cancel()
|
||||||
speakerPhoneButton.animate().rotation(rotation).start()
|
speakerPhoneButton.animate().rotation(rotation).start()
|
||||||
@ -328,44 +342,20 @@ class WebRtcCallActivity : PassphraseRequiredActionBarActivity() {
|
|||||||
|
|
||||||
launch {
|
launch {
|
||||||
viewModel.recipient.collect { latestRecipient ->
|
viewModel.recipient.collect { latestRecipient ->
|
||||||
|
binding.contactAvatar.recycle()
|
||||||
|
|
||||||
if (latestRecipient.recipient != null) {
|
if (latestRecipient.recipient != null) {
|
||||||
val publicKey = latestRecipient.recipient.address.serialize()
|
val contactPublicKey = latestRecipient.recipient.address.serialize()
|
||||||
val displayName = getUserDisplayName(publicKey)
|
val contactDisplayName = getUserDisplayName(contactPublicKey)
|
||||||
supportActionBar?.title = displayName
|
supportActionBar?.title = contactDisplayName
|
||||||
val signalProfilePicture = latestRecipient.recipient.contactPhoto
|
binding.remoteRecipientName.text = contactDisplayName
|
||||||
val avatar = (signalProfilePicture as? ProfileContactPhoto)?.avatarObject
|
|
||||||
val sizeInPX =
|
// sort out the contact's avatar
|
||||||
resources.getDimensionPixelSize(R.dimen.extra_large_profile_picture_size)
|
binding.contactAvatar.apply {
|
||||||
binding.remoteRecipientName.text = displayName
|
publicKey = contactPublicKey
|
||||||
if (signalProfilePicture != null && avatar != "0" && avatar != "") {
|
displayName = contactDisplayName
|
||||||
glide.clear(binding.remoteRecipient)
|
update()
|
||||||
glide.load(signalProfilePicture)
|
|
||||||
.diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
|
|
||||||
.circleCrop()
|
|
||||||
.error(
|
|
||||||
AvatarPlaceholderGenerator.generate(
|
|
||||||
this@WebRtcCallActivity,
|
|
||||||
sizeInPX,
|
|
||||||
publicKey,
|
|
||||||
displayName
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.into(binding.remoteRecipient)
|
|
||||||
} else {
|
|
||||||
glide.clear(binding.remoteRecipient)
|
|
||||||
glide.load(
|
|
||||||
AvatarPlaceholderGenerator.generate(
|
|
||||||
this@WebRtcCallActivity,
|
|
||||||
sizeInPX,
|
|
||||||
publicKey,
|
|
||||||
displayName
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.diskCacheStrategy(DiskCacheStrategy.ALL).circleCrop()
|
|
||||||
.into(binding.remoteRecipient)
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
glide.clear(binding.remoteRecipient)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -400,22 +390,16 @@ class WebRtcCallActivity : PassphraseRequiredActionBarActivity() {
|
|||||||
binding.floatingRenderer.removeAllViews()
|
binding.floatingRenderer.removeAllViews()
|
||||||
binding.fullscreenRenderer.removeAllViews()
|
binding.fullscreenRenderer.removeAllViews()
|
||||||
|
|
||||||
// the floating video inset (empty or not) should be shown
|
|
||||||
// the moment we have either of the video streams
|
|
||||||
val showFloatingContainer = state.userVideoEnabled || state.remoteVideoEnabled
|
|
||||||
binding.floatingRendererContainer.isVisible = showFloatingContainer
|
|
||||||
binding.swapViewIcon.isVisible = showFloatingContainer
|
|
||||||
|
|
||||||
// handle fullscreen video window
|
// handle fullscreen video window
|
||||||
if(state.showFullscreenVideo()){
|
if(state.showFullscreenVideo()){
|
||||||
viewModel.fullscreenRenderer?.let { surfaceView ->
|
viewModel.fullscreenRenderer?.let { surfaceView ->
|
||||||
binding.fullscreenRenderer.addView(surfaceView)
|
binding.fullscreenRenderer.addView(surfaceView)
|
||||||
binding.fullscreenRenderer.isVisible = true
|
binding.fullscreenRenderer.isVisible = true
|
||||||
binding.remoteRecipient.isVisible = false
|
hideAvatar()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
binding.fullscreenRenderer.isVisible = false
|
binding.fullscreenRenderer.isVisible = false
|
||||||
binding.remoteRecipient.isVisible = true
|
showAvatar(state.swapped)
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle floating video window
|
// handle floating video window
|
||||||
@ -429,6 +413,15 @@ class WebRtcCallActivity : PassphraseRequiredActionBarActivity() {
|
|||||||
binding.floatingRenderer.isVisible = false
|
binding.floatingRenderer.isVisible = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// the floating video inset (empty or not) should be shown
|
||||||
|
// the moment we have either of the video streams
|
||||||
|
val showFloatingContainer = state.userVideoEnabled || state.remoteVideoEnabled
|
||||||
|
binding.floatingRendererContainer.isVisible = showFloatingContainer
|
||||||
|
binding.swapViewIcon.isVisible = showFloatingContainer
|
||||||
|
|
||||||
|
// make sure to default to the contact's avatar if the floating container is not visible
|
||||||
|
if (!showFloatingContainer) showAvatar(false)
|
||||||
|
|
||||||
// handle buttons
|
// handle buttons
|
||||||
binding.enableCameraButton.isSelected = state.userVideoEnabled
|
binding.enableCameraButton.isSelected = state.userVideoEnabled
|
||||||
}
|
}
|
||||||
@ -436,6 +429,20 @@ class WebRtcCallActivity : PassphraseRequiredActionBarActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shows the avatar image.
|
||||||
|
* If @showUserAvatar is true, the user's avatar is shown, otherwise the contact's avatar is shown.
|
||||||
|
*/
|
||||||
|
private fun showAvatar(showUserAvatar: Boolean) {
|
||||||
|
binding.userAvatar.isVisible = showUserAvatar
|
||||||
|
binding.contactAvatar.isVisible = !showUserAvatar
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun hideAvatar() {
|
||||||
|
binding.userAvatar.isVisible = false
|
||||||
|
binding.contactAvatar.isVisible = false
|
||||||
|
}
|
||||||
|
|
||||||
private fun getUserDisplayName(publicKey: String): String {
|
private fun getUserDisplayName(publicKey: String): String {
|
||||||
val contact =
|
val contact =
|
||||||
DatabaseComponent.get(this).sessionContactDatabase().getContactWithAccountID(publicKey)
|
DatabaseComponent.get(this).sessionContactDatabase().getContactWithAccountID(publicKey)
|
||||||
|
@ -36,7 +36,6 @@ class ProfilePictureView @JvmOverloads constructor(
|
|||||||
var displayName: String? = null
|
var displayName: String? = null
|
||||||
var additionalPublicKey: String? = null
|
var additionalPublicKey: String? = null
|
||||||
var additionalDisplayName: String? = null
|
var additionalDisplayName: String? = null
|
||||||
var isLarge = false
|
|
||||||
|
|
||||||
private val profilePicturesCache = mutableMapOf<View, Recipient>()
|
private val profilePicturesCache = mutableMapOf<View, Recipient>()
|
||||||
private val unknownRecipientDrawable by lazy { ResourceContactPhoto(R.drawable.ic_profile_default)
|
private val unknownRecipientDrawable by lazy { ResourceContactPhoto(R.drawable.ic_profile_default)
|
||||||
@ -96,29 +95,25 @@ class ProfilePictureView @JvmOverloads constructor(
|
|||||||
fun update() {
|
fun update() {
|
||||||
val publicKey = publicKey ?: return Log.w(TAG, "Could not find public key to update profile picture")
|
val publicKey = publicKey ?: return Log.w(TAG, "Could not find public key to update profile picture")
|
||||||
val additionalPublicKey = additionalPublicKey
|
val additionalPublicKey = additionalPublicKey
|
||||||
|
// if we have a multi avatar setup
|
||||||
if (additionalPublicKey != null) {
|
if (additionalPublicKey != null) {
|
||||||
setProfilePictureIfNeeded(binding.doubleModeImageView1, publicKey, displayName)
|
setProfilePictureIfNeeded(binding.doubleModeImageView1, publicKey, displayName)
|
||||||
setProfilePictureIfNeeded(binding.doubleModeImageView2, additionalPublicKey, additionalDisplayName)
|
setProfilePictureIfNeeded(binding.doubleModeImageView2, additionalPublicKey, additionalDisplayName)
|
||||||
binding.doubleModeImageViewContainer.visibility = View.VISIBLE
|
binding.doubleModeImageViewContainer.visibility = View.VISIBLE
|
||||||
} else {
|
|
||||||
|
// clear single image
|
||||||
|
glide.clear(binding.singleModeImageView)
|
||||||
|
binding.singleModeImageView.visibility = View.INVISIBLE
|
||||||
|
} else { // single image mode
|
||||||
|
setProfilePictureIfNeeded(binding.singleModeImageView, publicKey, displayName)
|
||||||
|
binding.singleModeImageView.visibility = View.VISIBLE
|
||||||
|
|
||||||
|
// clear multi image
|
||||||
glide.clear(binding.doubleModeImageView1)
|
glide.clear(binding.doubleModeImageView1)
|
||||||
glide.clear(binding.doubleModeImageView2)
|
glide.clear(binding.doubleModeImageView2)
|
||||||
binding.doubleModeImageViewContainer.visibility = View.INVISIBLE
|
binding.doubleModeImageViewContainer.visibility = View.INVISIBLE
|
||||||
}
|
}
|
||||||
if (additionalPublicKey == null && !isLarge) {
|
|
||||||
setProfilePictureIfNeeded(binding.singleModeImageView, publicKey, displayName)
|
|
||||||
binding.singleModeImageView.visibility = View.VISIBLE
|
|
||||||
} else {
|
|
||||||
glide.clear(binding.singleModeImageView)
|
|
||||||
binding.singleModeImageView.visibility = View.INVISIBLE
|
|
||||||
}
|
|
||||||
if (additionalPublicKey == null && isLarge) {
|
|
||||||
setProfilePictureIfNeeded(binding.largeSingleModeImageView, publicKey, displayName)
|
|
||||||
binding.largeSingleModeImageView.visibility = View.VISIBLE
|
|
||||||
} else {
|
|
||||||
glide.clear(binding.largeSingleModeImageView)
|
|
||||||
binding.largeSingleModeImageView.visibility = View.INVISIBLE
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setProfilePictureIfNeeded(imageView: ImageView, publicKey: String, displayName: String?) {
|
private fun setProfilePictureIfNeeded(imageView: ImageView, publicKey: String, displayName: String?) {
|
||||||
|
@ -56,7 +56,6 @@ class UserDetailsBottomSheet: BottomSheetDialogFragment() {
|
|||||||
val threadRecipient = threadDb.getRecipientForThreadId(threadID) ?: return dismiss()
|
val threadRecipient = threadDb.getRecipientForThreadId(threadID) ?: return dismiss()
|
||||||
with(binding) {
|
with(binding) {
|
||||||
profilePictureView.publicKey = publicKey
|
profilePictureView.publicKey = publicKey
|
||||||
profilePictureView.isLarge = true
|
|
||||||
profilePictureView.update(recipient)
|
profilePictureView.update(recipient)
|
||||||
nameTextViewContainer.visibility = View.VISIBLE
|
nameTextViewContainer.visibility = View.VISIBLE
|
||||||
nameTextViewContainer.setOnClickListener {
|
nameTextViewContainer.setOnClickListener {
|
||||||
|
@ -145,7 +145,6 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
|
|||||||
view.apply {
|
view.apply {
|
||||||
publicKey = hexEncodedPublicKey
|
publicKey = hexEncodedPublicKey
|
||||||
displayName = getDisplayName()
|
displayName = getDisplayName()
|
||||||
isLarge = true
|
|
||||||
update()
|
update()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ class IP2Country private constructor(private val context: Context) {
|
|||||||
|
|
||||||
val bestMatchCountry = comps.lastOrNull { it.key <= Ipv4Int(ip) }?.let { (_, code) ->
|
val bestMatchCountry = comps.lastOrNull { it.key <= Ipv4Int(ip) }?.let { (_, code) ->
|
||||||
if (code != null) {
|
if (code != null) {
|
||||||
countryToNames[code] + " [" + ip + "]"
|
countryToNames[code]
|
||||||
} else {
|
} else {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,7 @@ import org.webrtc.SurfaceViewRenderer
|
|||||||
import java.nio.ByteBuffer
|
import java.nio.ByteBuffer
|
||||||
import java.util.ArrayDeque
|
import java.util.ArrayDeque
|
||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
|
import kotlin.math.abs
|
||||||
import org.thoughtcrime.securesms.webrtc.data.State as CallState
|
import org.thoughtcrime.securesms.webrtc.data.State as CallState
|
||||||
|
|
||||||
class CallManager(
|
class CallManager(
|
||||||
@ -718,7 +719,7 @@ class CallManager(
|
|||||||
|
|
||||||
// apply the rotation to the streams
|
// apply the rotation to the streams
|
||||||
peerConnection?.setDeviceRotation(rotation)
|
peerConnection?.setDeviceRotation(rotation)
|
||||||
remoteRotationSink?.rotation = rotation
|
remoteRotationSink?.rotation = abs(rotation) // abs as we never need the remote video to be inverted
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleWiredHeadsetChanged(present: Boolean) {
|
fun handleWiredHeadsetChanged(present: Boolean) {
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape
|
<shape
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:shape="rectangle">
|
android:shape="oval">
|
||||||
|
|
||||||
<solid android:color="@color/profile_picture_background" />
|
<solid android:color="@color/profile_picture_background" />
|
||||||
|
|
||||||
<corners android:radius="40dp" />
|
|
||||||
</shape>
|
</shape>
|
@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<shape
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:shape="rectangle">
|
|
||||||
|
|
||||||
<solid android:color="@color/profile_picture_background" />
|
|
||||||
|
|
||||||
<corners android:radius="23dp" />
|
|
||||||
</shape>
|
|
@ -23,8 +23,20 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"/>
|
android:layout_gravity="center"/>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
<ImageView
|
|
||||||
android:id="@+id/remote_recipient"
|
<org.thoughtcrime.securesms.components.ProfilePictureView
|
||||||
|
android:id="@+id/userAvatar"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/fullscreen_renderer_container"
|
||||||
|
app:layout_constraintEnd_toEndOf="@id/fullscreen_renderer_container"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/fullscreen_renderer_container"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/fullscreen_renderer_container"
|
||||||
|
app:layout_constraintVertical_bias="0.4"
|
||||||
|
android:layout_width="@dimen/extra_large_profile_picture_size"
|
||||||
|
android:layout_height="@dimen/extra_large_profile_picture_size"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
<org.thoughtcrime.securesms.components.ProfilePictureView
|
||||||
|
android:id="@+id/contactAvatar"
|
||||||
app:layout_constraintStart_toStartOf="@id/fullscreen_renderer_container"
|
app:layout_constraintStart_toStartOf="@id/fullscreen_renderer_container"
|
||||||
app:layout_constraintEnd_toEndOf="@id/fullscreen_renderer_container"
|
app:layout_constraintEnd_toEndOf="@id/fullscreen_renderer_container"
|
||||||
app:layout_constraintTop_toTopOf="@id/fullscreen_renderer_container"
|
app:layout_constraintTop_toTopOf="@id/fullscreen_renderer_container"
|
||||||
@ -71,9 +83,9 @@
|
|||||||
android:foregroundGravity="center"
|
android:foregroundGravity="center"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:SpinKit_Color="@color/core_white"
|
app:SpinKit_Color="@color/core_white"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/remote_recipient"
|
app:layout_constraintEnd_toEndOf="@+id/contactAvatar"
|
||||||
app:layout_constraintStart_toStartOf="@+id/remote_recipient"
|
app:layout_constraintStart_toStartOf="@+id/contactAvatar"
|
||||||
app:layout_constraintTop_toBottomOf="@id/remote_recipient"
|
app:layout_constraintTop_toBottomOf="@id/contactAvatar"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -27,17 +27,11 @@
|
|||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:id="@+id/singleModeImageView"
|
android:id="@+id/singleModeImageView"
|
||||||
android:layout_width="@dimen/medium_profile_picture_size"
|
|
||||||
android:layout_height="@dimen/medium_profile_picture_size"
|
|
||||||
android:background="@drawable/profile_picture_view_medium_background" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/largeSingleModeImageView"
|
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:layout_width="@dimen/large_profile_picture_size"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/large_profile_picture_size"
|
android:layout_height="match_parent"
|
||||||
android:background="@drawable/profile_picture_view_large_background" />
|
android:adjustViewBounds="true"
|
||||||
|
android:background="@drawable/profile_picture_view_background" />
|
||||||
|
|
||||||
</merge>
|
</merge>
|
@ -198,7 +198,7 @@ object OpenGroupApi {
|
|||||||
@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy::class)
|
@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy::class)
|
||||||
data class Message(
|
data class Message(
|
||||||
val id : Long = 0,
|
val id : Long = 0,
|
||||||
val accountId: String = "",
|
val sessionId: String = "",
|
||||||
val posted: Double = 0.0,
|
val posted: Double = 0.0,
|
||||||
val edited: Long = 0,
|
val edited: Long = 0,
|
||||||
val seqno: Long = 0,
|
val seqno: Long = 0,
|
||||||
|
@ -222,7 +222,7 @@ class OpenGroupPoller(private val server: String, private val executorService: S
|
|||||||
handleNewMessages(server, roomToken, additions.map {
|
handleNewMessages(server, roomToken, additions.map {
|
||||||
OpenGroupMessage(
|
OpenGroupMessage(
|
||||||
serverID = it.id,
|
serverID = it.id,
|
||||||
sender = it.accountId,
|
sender = it.sessionId,
|
||||||
sentTimestamp = (it.posted * 1000).toLong(),
|
sentTimestamp = (it.posted * 1000).toLong(),
|
||||||
base64EncodedData = it.data,
|
base64EncodedData = it.data,
|
||||||
base64EncodedSignature = it.signature,
|
base64EncodedSignature = it.signature,
|
||||||
|
Loading…
Reference in New Issue
Block a user