mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-12 10:23:49 +00:00
Fix QR code handler not running on UI thread
This commit is contained in:
parent
983b137cd6
commit
449a53ea32
@ -797,6 +797,7 @@ public class ConversationItem extends LinearLayout
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setContactPhoto(@NonNull Recipient recipient) {
|
private void setContactPhoto(@NonNull Recipient recipient) {
|
||||||
|
if (messageRecord == null) return;
|
||||||
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams)bodyBubble.getLayoutParams();
|
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams)bodyBubble.getLayoutParams();
|
||||||
int groupThreadMargin = (int)(getResources().getDimension(R.dimen.large_spacing) + getResources().getDimension(R.dimen.small_profile_picture_size));
|
int groupThreadMargin = (int)(getResources().getDimension(R.dimen.large_spacing) + getResources().getDimension(R.dimen.small_profile_picture_size));
|
||||||
int defaultMargin = 0;
|
int defaultMargin = 0;
|
||||||
|
@ -62,10 +62,9 @@ class JoinPublicChatActivity : PassphraseRequiredActionBarActivity(), ScanQRCode
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun joinPublicChatIfPossible(url: String) {
|
fun joinPublicChatIfPossible(url: String) {
|
||||||
runOnUiThread {
|
|
||||||
if (!Patterns.WEB_URL.matcher(url).matches() || !url.startsWith("https://")) {
|
if (!Patterns.WEB_URL.matcher(url).matches() || !url.startsWith("https://")) {
|
||||||
Toast.makeText(this, "Invalid URL", Toast.LENGTH_SHORT).show()
|
Toast.makeText(this, "Invalid URL", Toast.LENGTH_SHORT).show()
|
||||||
return@runOnUiThread
|
return
|
||||||
}
|
}
|
||||||
showLoader()
|
showLoader()
|
||||||
|
|
||||||
@ -79,7 +78,6 @@ class JoinPublicChatActivity : PassphraseRequiredActionBarActivity(), ScanQRCode
|
|||||||
Toast.makeText(this, "Couldn't join channel", Toast.LENGTH_SHORT).show()
|
Toast.makeText(this, "Couldn't join channel", Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// endregion
|
// endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,8 +52,10 @@ class ScanQRCodeWrapperFragment : Fragment(), ScanQRCodePlaceholderFragmentDeleg
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onQrDataFound(string: String) {
|
override fun onQrDataFound(string: String) {
|
||||||
|
activity?.runOnUiThread {
|
||||||
delegate?.handleQRCodeScanned(string)
|
delegate?.handleQRCodeScanned(string)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ScanQRCodeWrapperFragmentDelegate {
|
interface ScanQRCodeWrapperFragmentDelegate {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user