1 of 10

Annotations

By Moro

2 of 10

Daniel-San, I saw your PR. Why are you not using Annotations?

Where?

3 of 10

Daniel-San, I tried to pass 123, I got a RuntimeException.

How you can improve that?

I don’t know.

How?

4 of 10

Daniel-San, please use Annotations.

5 of 10

Just add @DrawableRes in your argument. It will help other workmates.

6 of 10

Daniel-San, there are many other Annotations like that to signalize Strings, Colors, Ids

Nice!

7 of 10

If we don’t have an annotation, and we need?

Daniel-San, time to create your own annotation.

8 of 10

Daniel-San, create your annotation:

You can create other kinds of annotations such as using @IntDef, @StringDef, …

9 of 10

Daniel-San, let’s test:

10 of 10

By Moro