Skip to content
This repository has been archived by the owner. It is now read-only.

Added a simple LoginViewModel #41

Merged
merged 10 commits into from
Oct 20, 2015
Merged

Added a simple LoginViewModel #41

merged 10 commits into from
Oct 20, 2015

Conversation

Dexyon
Copy link
Contributor

@Dexyon Dexyon commented Jul 7, 2015

Added a simple LoginViewModel to use with the LoginActivity which used the MvxCompatActivity. This way we can use all our new components in our example.
This is great documentation and allows us to do some regression testing when changing stuff or implementing new features.

…ort into develop

Conflicts:
	Cirrious.MvvmCross.Droid.Support.Fragging/Cirrious.MvvmCross.Droid.Support.Fragging.csproj
	Cirrious.MvvmCross.Droid.Support.RecyclerView/Cirrious.MvvmCross.Droid.Support.RecyclerView.csproj
…t into develop

Conflicts:
	Samples/Example.Droid/Resources/Resource.designer.cs
@martijn00
Copy link
Contributor

The main problem with this change is that you use a new activity to show login. Currently the CachingFragment implementation is limited that you first need to show some ViewModel that is connected to the Hosting Activity to show other fragments.

To work around that it is possible to just use 1 Activity and for everything else use Fragments. The real solution would be to change the code of the FragmentsPresenter to allow to navigate to the correct ViewModel directly.

Let's say you start the app, depending on if you are already logged in you want to show the LoginViewModel, or the NewsViewModel(let's imagine a news app). It doesn't make sense then that you need to show MainViewModel first in order to show the NewsViewmodel.

My guess would be we need to turn the registering of fragments around. When we call ShowViewModel we should search for if it is a fragment, and if it is so, we should search for it's parent. I was thinking that could be done by adding an attribute to fragments containing it's parent.

@Cheesebaron
Copy link
Member

@martijn00 I think we should create a new issue discussing it there...

…t into develop

Conflicts:
	Samples/Example.Core/Example.Core.csproj
	Samples/Example.Droid/Example.Droid.csproj
	Samples/Example.Droid/Resources/Resource.designer.cs
@martijn00
Copy link
Contributor

I am going to move the example to the samples repo: https://github.com/MvvmCross/MvvmCross-Samples

I think we could improve this example project with things like this. Could you open a new PR there after i moved the sample?

@martijn00 martijn00 closed this Sep 7, 2015
@vvolkgang
Copy link
Contributor

@martijn00 I think we should pull this, the sample should be improved in order to be used as a testing playground and this (given you don't clean the Activities backstack), will show the bug stated in #94.

@martijn00
Copy link
Contributor

@vvolkgang Ok, no problem with me. I think we should keep this sample here anyway so we can use it for testing changes.

@martijn00 martijn00 reopened this Oct 19, 2015
@martijn00
Copy link
Contributor

@Dexyon could you pull in the lasted changes so this can be merged?

@vvolkgang
Copy link
Contributor

@martijn00 yes, that was my point actually, improving the sample so we can use it as a testing playground and implementation example for all the features.

@Dexyon
Copy link
Contributor Author

Dexyon commented Oct 19, 2015

@martijn00 I will spend some time on it later this week. The introduction of the TvOS libraries is waiting for Xamarin to bring in TvOS library support. Will spend some time on it

@martijn00 martijn00 mentioned this pull request Oct 20, 2015
@martijn00 martijn00 merged commit 9c4fa81 into MvvmCross:master Oct 20, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants