mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-20 12:49:02 +00:00
open party chat from notification view
This commit is contained in:
parent
6820ffcc66
commit
1a0df90180
3 changed files with 13 additions and 4 deletions
|
|
@ -41,6 +41,10 @@
|
|||
<action
|
||||
android:id="@+id/openQuestDetail"
|
||||
app:destination="@id/questDetailFragment" />
|
||||
<argument
|
||||
android:name="tabToOpen"
|
||||
app:argType="integer"
|
||||
android:defaultValue="0"/>
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/questDetailFragment"
|
||||
|
|
|
|||
|
|
@ -83,9 +83,13 @@ class PartyFragment : BaseMainFragment() {
|
|||
viewPager?.currentItem = 0
|
||||
|
||||
setViewPagerAdapter()
|
||||
|
||||
setFragments()
|
||||
|
||||
arguments?.let {
|
||||
val args = PartyFragmentArgs.fromBundle(it)
|
||||
viewPager?.currentItem = args.tabToOpen
|
||||
}
|
||||
|
||||
this.tutorialStepIdentifier = "party"
|
||||
this.tutorialText = getString(R.string.tutorial_party)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,14 +63,13 @@ open class NotificationsViewModel : BaseViewModel() {
|
|||
* Custom notification types created by this class (from user data).
|
||||
* Will be combined with the notifications coming from server.
|
||||
*/
|
||||
private val customNotifications: BehaviorSubject<List<Notification>>
|
||||
private val customNotifications: BehaviorSubject<List<Notification>> = BehaviorSubject.create()
|
||||
|
||||
override fun inject(component: UserComponent) {
|
||||
component.inject(this)
|
||||
}
|
||||
|
||||
init {
|
||||
customNotifications = BehaviorSubject.create()
|
||||
customNotifications.onNext(emptyList())
|
||||
|
||||
disposable.add(userRepository.getUser()
|
||||
|
|
@ -248,7 +247,9 @@ open class NotificationsViewModel : BaseViewModel() {
|
|||
private fun clickNewChatMessage(notification: Notification, navController: MainNavigationController) {
|
||||
val data = notification.data as? NewChatMessageData
|
||||
if (isPartyMessage(data)) {
|
||||
navController.navigate(R.id.partyFragment)
|
||||
val bundle = Bundle()
|
||||
bundle.putString("groupID", data?.group?.id)
|
||||
navController.navigate(R.id.partyFragment, bundle)
|
||||
} else {
|
||||
val bundle = Bundle()
|
||||
bundle.putString("groupID", data?.group?.id)
|
||||
|
|
|
|||
Loading…
Reference in a new issue