mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 02:15:35 +03:00
add qr code option to home screen menu (#7177)
This commit is contained in:
parent
7d2cbf5263
commit
6da6f6a7f4
2 changed files with 14 additions and 1 deletions
|
@ -84,6 +84,7 @@ import im.vector.app.features.spaces.SpaceSettingsMenuBottomSheet
|
|||
import im.vector.app.features.spaces.invite.SpaceInviteBottomSheet
|
||||
import im.vector.app.features.spaces.share.ShareSpaceBottomSheet
|
||||
import im.vector.app.features.themes.ThemeUtils
|
||||
import im.vector.app.features.usercode.UserCodeActivity
|
||||
import im.vector.app.features.workers.signout.ServerBackupStatusViewModel
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
|
@ -634,10 +635,18 @@ class HomeActivity :
|
|||
launchInviteFriends()
|
||||
true
|
||||
}
|
||||
R.id.menu_home_qr -> {
|
||||
launchQrCode()
|
||||
true
|
||||
}
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
|
||||
private fun launchQrCode() {
|
||||
startActivity(UserCodeActivity.newIntent(this, sharedActionViewModel.session.myUserId))
|
||||
}
|
||||
|
||||
private fun launchInviteFriends() {
|
||||
activeSessionHolder.getSafeActiveSession()?.permalinkService()?.createPermalink(sharedActionViewModel.session.myUserId)?.let { permalink ->
|
||||
analyticsTracker.screen(MobileScreen(screenName = MobileScreen.ScreenName.InviteFriends))
|
||||
|
|
|
@ -12,6 +12,11 @@
|
|||
android:title="@string/invite_friends"
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_home_qr"
|
||||
android:title="@string/add_by_qr_code"
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_home_suggestion"
|
||||
android:icon="@drawable/ic_material_bug_report"
|
||||
|
@ -42,5 +47,4 @@
|
|||
android:title="@string/home_filter_placeholder_home"
|
||||
app:iconTint="?vctr_content_secondary"
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
</menu>
|
||||
|
|
Loading…
Reference in a new issue