After this talk, using plain old Java for Android development will no longer be good enough for you. You have been warned. Presented by Dino Kovač from Infinum.
14. private List<FilterTagListView> tagGroupViews() {
List<FilterTagListView> filterTagListViews = new ArrayList<>();
for (int i = 0; i < filterContainer.getChildCount(); i++) {
View view = filterContainer.getChildAt(i);
if (view instanceof FilterTagListView) {
filterTagListViews.add((FilterTagListView) view);
}
}
return filterTagListViews;
}
15. private fun tagGroupViews(): List<FilterTagListView> {
return (0..filterContainer.childCount - 1)
.map { i -> filterContainer.getChildAt(i) }
.filter { childView -> childView is FilterTagListView }
.map { it as FilterTagListView }
}
16. /**
* finds view group which contains given tag and marks tag selected within that group
*/
public void addSelectedTag(CoupeTag tag) {
FilterTagListView view = null;
List<FilterTagListView> tagGroupViews = tagGroupViews();
for (FilterTagListView tagGroupView : tagGroupViews) {
if (tagGroupView.getFilter().getTitle().equals(tag.getFilter().getTitle())) {
view = tagGroupView;
break;
}
}
if (view != null) {
view.setTagSelection(tag.getTitle());
if (filtersSelectedListener != null) {
filtersSelectedListener.onSelected(getSelectedTags());
}
}
}
17. /**
* finds view group which contains given tag and marks tag selected within that group
*/
fun addSelectedTag(tag: CoupeTag) {
val view = tagGroupViews().firstOrNull { view ->
view.filter.title == tag.filter.title
}
view?.let {
view.setTagSelection(tag.title)
filterSelectedListener?.onSelected(getSelectedTags()?.toList())
}
}
31. I think it is fair to say that "open design" is slower
and less predictable than "closed design”.
However, the end result is significantly better, and
therefore the tradeoff is worth it.
- CHRIS LATTNER, APPLE
33. Kotlin is interesting: works well with Java, more
concise. JetBrains has done a nice job supporting
this on android. But no plans to officially support
anything new.
- ANWAR, ANDROIDENGTEAM
34. I don’t think we have any plans to break what
already works there, but we don’t have plans to
have a second, idiomatic-Kotlin version of the
whole framework API surface area either.
- ADAM, ANDROIDENGTEAM
35. We don’t have any plans to move to a new
language. Java has a lot of advantages to it and the
versions 8, 9, and 10 have some pretty interesting
stuff for developers.
- ANWAR, ANDROIDENGTEAM
36. CONCLUSION
• Kotlin can help you be more productive
• Kotlin is here to stay
• Be aware of the risks!