-
Notifications
You must be signed in to change notification settings - Fork 739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FTUE - Account created screen #5158
Changes from 9 commits
9b12f29
8212b7e
023b323
3a961e0
d186de7
6687e2c
c64004f
8983bfa
e0f99e3
3f9e7a7
06f2ca1
182dc2a
4975406
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Starts the FTUE account personalisation flow by adding an account created screen behind a feature flag |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright (c) 2021 New Vector Ltd | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package im.vector.app.features.onboarding.ftueauth | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import im.vector.app.R | ||
import im.vector.app.core.di.ActiveSessionHolder | ||
import im.vector.app.databinding.FragmentFtueAccountCreatedBinding | ||
import im.vector.app.features.onboarding.OnboardingAction | ||
import javax.inject.Inject | ||
|
||
class FtueAuthAccountCreatedFragment @Inject constructor( | ||
private val activeSessionHolder: ActiveSessionHolder | ||
) : AbstractFtueAuthFragment<FragmentFtueAccountCreatedBinding>() { | ||
|
||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentFtueAccountCreatedBinding { | ||
return FragmentFtueAccountCreatedBinding.inflate(inflater, container, false) | ||
} | ||
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
setupViews() | ||
} | ||
|
||
private fun setupViews() { | ||
views.accountCreatedSubtitle.text = getString(R.string.ftue_account_created_subtitle, activeSessionHolder.getActiveSession().myUserId) | ||
views.accountCreatedPersonalize.setOnClickListener { viewModel.handle(OnboardingAction.PersonalizeProfile) } | ||
views.accountCreatedTakeMeHome.setOnClickListener { viewModel.handle(OnboardingAction.TakeMeHome) } | ||
} | ||
|
||
override fun resetViewModel() { | ||
// Nothing to do | ||
} | ||
|
||
override fun onBackPressed(toolbarButton: Boolean): Boolean { | ||
viewModel.handle(OnboardingAction.TakeMeHome) | ||
return false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you should return There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah great catch! 4975406 |
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need that? It's ok but feels a bit useless when there is really no other code involved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I wasn't sure about this as well, sounds like I should use
OnboardingAction.PostViewEvent
which acts as a proxy to post events directly to theViewModel.viewEvents
observerThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3f9e7a7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!