Comments (3)
Mentioned that in other commit.
"a) There is a need to customize "Tag" which is used to identify different fragment instances. Sometimes we do not have control on chosen Fragment tag. ViewPager is an example. (yes we can hack that, cause support viewpager gives "android:switcher" + viewpagerid + ":" + pageindex as tag - but it's just workaround, we gonna fall into this kind of problems over and over again)
Although I have provided overridable method in CachingActivities - GetFragmentTag(Fragment ..) it is useless.
The only way to differentiate same fragment type instances is to use some information provided by viewmodel (like some fragment title/id - information contained in viewmodel).
Problem is: ViewModel is not accesable on PostCreate. ViewModel is set during Fragment.OnViewCreated - too late."
As I've been fixing other issues - I am now sure that we can not use any information from ViewModel - it is not possible to make it works.
I have a pretty good idea in mind:
- lets make Register method in caching activites internal,
- Register method should allow to multiple calls with same parameters passed (let it do nothing in that case)
- if Fragment has MvxOwnedViewModel registration should be done automatically - we just need to find the best moment to do that - perhaps Fragment OnAttach ?
from mvvmcross-androidsupport.
oh and the by the way - registration dictionary must be serialized on instance save, deserialized on activity postcreate
from mvvmcross-androidsupport.
oh that's not closed yet! please reopen the issue, I've just finished bug-fix which provides "auto-register". Gonna merge that tomorrow, when I wake up ;-)
from mvvmcross-androidsupport.
Related Issues (20)
- MvxCachingFragmentCompatActivity with a Non cached fragment
- Unable to find explicit activity class {packagename.schoolapp/schoolapp.droid.FragmentOne}; have you declared this activity in your AndroidManifest.xml? HOT 6
- MvxRecyclerView NullReferenceException when calling constructor HOT 2
- ShowFragment bug - if cache is empty - AddToBackStack flag does not work HOT 1
- AppCompat view switching seems to be reversed HOT 9
- Mvx WakefulBroadcastReceiver support
- Another backstack flag not respected bug
- Doubts about MvxCachingFragment...Adapter HOT 3
- No view model association found for candidate view Exception HOT 5
- The VM lifecycle methods aren't called when showing fragments hosted by distinct activities HOT 1
- Binding to vector drawable doesn't seem to work HOT 4
- Migrate to new support structure library structure HOT 2
- RecyclerView doesn't reflect move operation from an ObservableCollection HOT 11
- MvxPreferenceFragmentCompat inconsistent crashing HOT 1
- Rename Util project to Utils HOT 4
- No resource found that matches the given name (at 'MvxItemTemplate' HOT 4
- Vector on background HOT 1
- MvxFragment annotation can't be used in Android library project
- Close ViewModel Doesn't call OnFragmentPopped in Activity
- Error to inflate a dialog with MvxExpandableListView HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mvvmcross-androidsupport.