Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 25 08:58
    wmailn commented #1937
  • Jan 08 03:47
    whj33 opened #2301
  • Jan 04 14:15
    BlueCobold closed #2300
  • Jan 04 14:15
    BlueCobold commented #2300
  • Jan 04 14:07
    WonderCsabo commented #2300
  • Jan 04 09:14
    BlueCobold opened #2300
  • Dec 22 2020 17:11
    NoaD commented #2299
  • Dec 22 2020 16:58
    NoaD edited #2299
  • Dec 22 2020 16:57
    NoaD opened #2299
  • Dec 19 2020 08:26
    WonderCsabo commented #2248
  • Dec 19 2020 08:26
    WonderCsabo commented #2248
  • Dec 17 2020 17:42
    krischik commented #2248
  • Dec 17 2020 15:18
    WonderCsabo commented #2283
  • Dec 17 2020 15:18
    WonderCsabo commented #2283
  • Dec 17 2020 15:13
    WonderCsabo commented #2248
  • Dec 17 2020 15:13
    WonderCsabo commented #2248
  • Dec 17 2020 15:12
    WonderCsabo closed #2298
  • Dec 17 2020 15:12
    WonderCsabo commented #2298
  • Dec 17 2020 15:11
    WonderCsabo commented #2248
  • Dec 17 2020 14:53
    krischik edited #2298
Kay-Uwe Janssen
@dodgex
for your processor
Adrián Rivero
@smaugho
Yeap, though it is hard for devs.. cause basically the AfterInject is called before the block after the "super.onCreate", and then the viewModels are not injected
that causes "confusion" :)
Maybe AA should in fact call AfterInject method, for the activities only, after the "super.onCreate".. I don't think that this method should be called as well before the onCreate
Kay-Uwe Janssen
@dodgex
you could do an @AfterViewModel ;)
the problem is
we can hardly change this
not without a 5.0 release an breaking changes
Adrián Rivero
@smaugho
yes, I understand.. cause' apps out there could start crashing :)
Kay-Uwe Janssen
@dodgex
yes
Adrián Rivero
@smaugho
ok.. I think I will try to figure out why Android really requires that this ViewModelProviders creates the ViewModel after the onCreate, I'm not sure if there is some reason for it.. Ok ok, I'll see if I could find some solution to that in a different way.. Maybe providing a custom factory could be solved
Kay-Uwe Janssen
@dodgex
I'd love to do a full rewrite of AA and how it does some of it's stuff. but to be honest it is way to much work. especially considering that i'm currently not doing any android dev and even my company where we (our 1-man mobile team) used to use AA is no longer using it as we are shifting to react native to support ios
Adrián Rivero
@smaugho
I understand.. BTW, I saw you interested in Lombok, or well, at least saw you letting some comments there :)
Kay-Uwe Janssen
@dodgex
yeah
used in some projects in the past (including my old android app^^)
but only private projects
Adrián Rivero
@smaugho
Using similar "techniques", AA could change a lot in fact.... But not sure of how much work it really will take
Kay-Uwe Janssen
@dodgex
i'd not use such technologies
i'd check the transform apis google provides for android builds
Adrián Rivero
@smaugho
mmm.. have to check that
Kay-Uwe Janssen
@dodgex
but i think it also is pretty complex
i recently tried to read up on kotlin compiler plugins. but that shit is pretty complex with working partly on byte code level for added/generated code
Adrián Rivero
@smaugho
:)
Kay-Uwe Janssen
@dodgex
and its damn hard to find (recent) docs or samples
Adrián Rivero
@smaugho
BTW, I mentioned something above that I could try to do on my company.. I have several devs under my management.. I've seriously been thinking in start instructing one to let him contributing to AA, plugins or whatever is need it.. we need it in our company anyway.
I already started once, but he was too stressed with this "type of programming" :sweat_smile: ... Well, I think I'll give it another shot in near future..
Kay-Uwe Janssen
@dodgex
yeah
that annotation processing and code generation stuff is not that easy :D
i think just compiler stuff (like GWT) is more complex :D
okay, there might be much more in between. ;)
Adrián Rivero
@smaugho
Yeap.. well, I've get till "Java Tree" level, not deeper
but you can do pretty cool thing with the Java Trees API
Kay-Uwe Janssen
@dodgex
Tree api?
you mean stuff like TreeSet?
Adrián Rivero
@smaugho
No no, Trees API, you applies a Scanner over an Element, and you can get all the code under a method for instance
And do stuff there
Kay-Uwe Janssen
@dodgex
ah okay
Adrián Rivero
@smaugho
Compiler Tree API I think. In fact, it can solve issues in AA :), like being able to inject the classes like it is in the code, since you can get all the Imports
that is tricky in the current implementation
Kay-Uwe Janssen
@dodgex
yeha
Adrián Rivero
@smaugho
but it would make AA dependent on that API, which I'm not sure is that good
Kay-Uwe Janssen
@dodgex
i assume it is not good :D
it is com.sun so it should be avoided if possible :D
Adrián Rivero
@smaugho
 protected void onCreate(@Nullable Bundle savedInstanceState) {
        mFragments.attachHost(null /*parent*/);

        super.onCreate(savedInstanceState);

        NonConfigurationInstances nc =
                (NonConfigurationInstances) getLastNonConfigurationInstance();
        if (nc != null) {
            mViewModelStore = nc.viewModelStore;   //HERE IS THE ISSUE
        }
I found in Android code why the ViewModelProvider should be called after the super.onCreate the mViewModelStore is the issue

it is com.sun so it should be avoided if possible :D

Yeap

Kay-Uwe Janssen
@dodgex
this is androidx/support-lib Activity?
Adrián Rivero
@smaugho
no, it is the normal support one, not AndroidX
Kay-Uwe Janssen
@dodgex
well recent support lib should be the same as androidx