mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-29 14:38:45 +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.invite.SpaceInviteBottomSheet
|
||||||
import im.vector.app.features.spaces.share.ShareSpaceBottomSheet
|
import im.vector.app.features.spaces.share.ShareSpaceBottomSheet
|
||||||
import im.vector.app.features.themes.ThemeUtils
|
import im.vector.app.features.themes.ThemeUtils
|
||||||
|
import im.vector.app.features.usercode.UserCodeActivity
|
||||||
import im.vector.app.features.workers.signout.ServerBackupStatusViewModel
|
import im.vector.app.features.workers.signout.ServerBackupStatusViewModel
|
||||||
import kotlinx.coroutines.flow.launchIn
|
import kotlinx.coroutines.flow.launchIn
|
||||||
import kotlinx.coroutines.flow.onEach
|
import kotlinx.coroutines.flow.onEach
|
||||||
|
@ -634,10 +635,18 @@ class HomeActivity :
|
||||||
launchInviteFriends()
|
launchInviteFriends()
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
R.id.menu_home_qr -> {
|
||||||
|
launchQrCode()
|
||||||
|
true
|
||||||
|
}
|
||||||
else -> false
|
else -> false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun launchQrCode() {
|
||||||
|
startActivity(UserCodeActivity.newIntent(this, sharedActionViewModel.session.myUserId))
|
||||||
|
}
|
||||||
|
|
||||||
private fun launchInviteFriends() {
|
private fun launchInviteFriends() {
|
||||||
activeSessionHolder.getSafeActiveSession()?.permalinkService()?.createPermalink(sharedActionViewModel.session.myUserId)?.let { permalink ->
|
activeSessionHolder.getSafeActiveSession()?.permalinkService()?.createPermalink(sharedActionViewModel.session.myUserId)?.let { permalink ->
|
||||||
analyticsTracker.screen(MobileScreen(screenName = MobileScreen.ScreenName.InviteFriends))
|
analyticsTracker.screen(MobileScreen(screenName = MobileScreen.ScreenName.InviteFriends))
|
||||||
|
|
|
@ -12,6 +12,11 @@
|
||||||
android:title="@string/invite_friends"
|
android:title="@string/invite_friends"
|
||||||
app:showAsAction="never" />
|
app:showAsAction="never" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/menu_home_qr"
|
||||||
|
android:title="@string/add_by_qr_code"
|
||||||
|
app:showAsAction="never" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/menu_home_suggestion"
|
android:id="@+id/menu_home_suggestion"
|
||||||
android:icon="@drawable/ic_material_bug_report"
|
android:icon="@drawable/ic_material_bug_report"
|
||||||
|
@ -42,5 +47,4 @@
|
||||||
android:title="@string/home_filter_placeholder_home"
|
android:title="@string/home_filter_placeholder_home"
|
||||||
app:iconTint="?vctr_content_secondary"
|
app:iconTint="?vctr_content_secondary"
|
||||||
app:showAsAction="ifRoom" />
|
app:showAsAction="ifRoom" />
|
||||||
|
|
||||||
</menu>
|
</menu>
|
||||||
|
|
Loading…
Reference in a new issue