Lombok for Android

I would like to get all the functions provided by lombok. I am tired of writing a lot of template code, and I would like to know if there is a port of Lombes on Android? Or at least the equivalent? Something that allows me to use annotation instead of a template as follows:

TextView tv = (TextView) findViewById(R.id.my_textview); 
+4
source share
3 answers

As far as I know, you can use Lombok in Android code. If this is not the case, write a bug report. I must say, we do not have much documentation on how to set it up. However, we have an active mailing list if you need help. Disclosure: I am one of the developers of Lombok.

+7
source

Alternatively, see Android Annotations .

+6
source

I got the impression that Lombok was just creating Java, so what did you try? (I don’t, but just curious). However, if you get rid of the findViewById template type, you can take a look at RoboGuice . He does a lot more, but one of the subtleties that she adds is changing something like:

 TextView tv = (TextView) findViewById(R.id.my_textview); 

in

 @InjectView(R.id.my_textview) TextView tv; 
+2
source

Source: https://habr.com/ru/post/1390108/


All Articles