These are chat archives for Arasthel/SwissKnife

5th
Apr 2015
Jorge Martin Espinosa
@Arasthel
Apr 05 2015 08:52
Hi guys
Did any of you get started with those AST Transformations?
I think the "@Extra" annotation is quite interesting @c0nnector , and it should be really easy to do compared to other stuff like "@Parcelable", etc.
Karol Kowalski
@OrdonTeam
Apr 05 2015 11:11
Hi guys.
First of all I have not tried swissknife dsl methods yet. We had to fix 64k method problem and I will be thinking about it soon.
With my friend I tried to write two annotations:
@InjectConentView and @InjectSwissKnife to get rid of empty onCreate method completely. We were finishing this but we found bug in groovy when calling super.protectedMethod.
Jorge Martin Espinosa
@Arasthel
Apr 05 2015 11:13
It sucks when you come across some groovy bug
But why do you say that it's empty? Do you modify your view somewhere else?
Karol Kowalski
@OrdonTeam
Apr 05 2015 11:35
I have onCreate method only with
contentView = R.layout.layout
SwissKnife.inject(this)
So with using this two annotation I could remove it completely.
Jorge Martin Espinosa
@Arasthel
Apr 05 2015 11:39
You want to add that to simple classes that don't need any view initialization as happens with listview or viewpager, isn't it?
Jorge Martin Espinosa
@Arasthel
Apr 05 2015 11:49
Well, if everything's fine, I have the @Extra annotation working
I'll upload it in a few hours after some tests
Karol Kowalski
@OrdonTeam
Apr 05 2015 11:53
Yes, just for simple classes. I was also thinking to write @InjectSwissKnife for exetend View classes so you don't have to override all constructors.
Jorge Martin Espinosa
@Arasthel
Apr 05 2015 11:55
I think it's a good idea
We have 4 constructors now
At this rate when Android 8 comes out someday we'll have another pair :smile:
Karol Kowalski
@OrdonTeam
Apr 05 2015 11:59
Do you know @InheritConstructor? It solve this problem when you don't have any logic in them.
Jorge Martin Espinosa
@Arasthel
Apr 05 2015 12:00
Yeah, I know, but most times when you do a custom View you have to handle some custom attrs
That is, if you want it to be customizable via xml
And you have to call from 3 of those constructors to an aux method - or worse, put the logic on the constructors themselves
Karol Kowalski
@OrdonTeam
Apr 05 2015 12:11
It would be wonderful to have something like @PostConstruct on method but it still doesn't solve problem with passing attribute.
Arthur
@ArthurSav
Apr 05 2015 14:53
Unfortunatelly got too caught up with work, so i didn’t work on the @Extra annotation. Glad to hear you made it @Arasthel , will be super useful in my upcoming project
Jorge Martin Espinosa
@Arasthel
Apr 05 2015 14:55
Glad to hear it
It works fine, at least everything I tested, as it uses @SaveInstance methods to read from bundle
Arthur
@ArthurSav
Apr 05 2015 14:57
Let me know when you update it, will test it
Jorge Martin Espinosa
@Arasthel
Apr 05 2015 14:57
Ok :smile:
Jorge Martin Espinosa
@Arasthel
Apr 05 2015 15:56
1.2.3 is already uploaded, but it could take some time to propagate through maven repos