But first things first.
Tickets
If you buy a ticket in advance, you can take it for 230 pounds + VAT. The final price was about 700 pounds, including VAT. Quite expensive when compared with tickets to Russian conferences, but on average for Europe this is an adequate price. The flight will cost about 30 thousand rubles, but there is an opportunity to save money, since Victory is flying there now, and you can buy a ticket for about 6000 rubles one way.
Accommodation
We lived in a 15-minute walk from the venue. Hotel average, about 150 pounds per day. In fact, if you are not too demanding, then you can live in a hostel in the city center for 20 pounds a day.
In terms of organization, the conference was at a fairly high level. I liked the playground itself: a spacious hall for communication and moral relaxation, comfortable audiences in which reports were read. In the lobby there were many stands of various companies where you could take a pair of pens and t-shirts. In the evening of the first day, the organizers organized a party. There were free drinks and music, we went for a walk around London.
The schedule, in my opinion, was drawn up very well, since at any time there were interesting reports. In addition, workshops were constantly held.
But from the level of reports I expected more. Many of them were without any practical component, for example, just a description of some API or functionality. The level of reports at Moscow conferences is at least not lower. There were some pretty strong and relevant speeches. Next, I will write about those that seemed to me the most interesting.
First, a lot of attention is now being paid to the problem of assembly speed. This is especially true for Dagger and ButterKnife, as they use the annotation processor and kapt. Square presented a solution in which Dagger and ButterKnife implementations work on reflection instead of code generation. This slightly reduces the speed of the runtime application, but it saves time on compile time, and within the dev-builds it is quite justified, since for the latest Pixel and Samsung models this is barely perceptible work.
@NonNull @UiThread public static Unbinder bind(@NonNull Object target, @NonNull View source) { List<Unbinder> unbinders = new ArrayList<>(); Class<?> targetClass = target.getClass(); if ((targetClass.getModifiers() & PRIVATE) != 0) { throw new IllegalArgumentException(targetClass.getName() + " must not be private."); } while (true) { for (Field field : targetClass.getDeclaredFields()) { int unbinderStartingSize = unbinders.size(); Unbinder unbinder; unbinder = parseBindView(target, field, source); if (unbinder != null) unbinders.add(unbinder); unbinder = parseBindViews(target, field, source); if (unbinder != null) unbinders.add(unbinder); unbinder = parseBindDrawable(target, field, source); if (unbinder != null) unbinders.add(unbinder); unbinder = parseBindString(target, field, source); if (unbinder != null) unbinders.add(unbinder); ... } for (Method method : targetClass.getDeclaredMethods()) { Unbinder unbinder; unbinder = parseOnCheckedChanged(target, method, source); if (unbinder != null) unbinders.add(unbinder); unbinder = parseOnClick(target, method, source); if (unbinder != null) unbinders.add(unbinder); ... } targetClass = targetClass.getSuperclass(); } return new CompositeUnbinder(unbinders); }
A library for ButterKnife can be found at this link. The version for Dagger is around here .
Secondly, sometimes it becomes necessary to inject dependencies into custom views that are declared in XML. Previously, you had to inject them through set-methods and throw them through classes from the outside, for example, in a presenter, when he attaches to the view. Now there is a convenient way to do this: dependencies can be prokidyd through the constructor immediately after the required parameters, and the custom LayoutInfater can create a twist with these complex constructors.
How it looks in code:
public final class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); MainComponent component = DaggerMainActivity_MainComponent.create(); InflationInjectFactory factory = component.getInjectFactory(); getLayoutInflater().setFactory(factory); setContentView(R.layout.main_activity); GalleryPresenter presenter = component.getGalleryPresenter(); GalleryView view = findViewById(R.id.gallery); presenter.attach(view); } @Component(modules = ViewModule.class) interface MainComponent { InflationInjectFactory getInjectFactory(); GalleryPresenter getGalleryPresenter(); } }
GalleryView is written in xml.
public final class GalleryView extends LinearLayout { private final ViewUpdater mViewUpdater; @InflationInject public GalleryView(@Assisted Context context, @Assisted AttributeSet attrs, ViewUpdater viewUpdater) { super(context, attrs); mViewUpdater = viewUpdater; } }
Thirdly, in Square, they approached in their own way the problem that AutoValue solves, namely the creation of factories for classes with heavy designers. Only this solution is maximally integrated into the Dagger logic.
Usage example:
public final class UserPresenter { private final LoadUserInteractor mLoadUserInteractor; private final String mUserId; @AssistedInject UserPresenter(@Assisted LoadUserInteractor loadUserInteractor, @Exclamation String userid) { mLoadUserInteractor = loadUserInteractor; mUserId = userid; } @AssistedInject.Factory public interface Factory { UserPresenter create(String greeting); } ... }
public final class UserActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main_view); UserPresenter.Factory factory = DaggerUserActivity_ UserComponent.create().getUserPresenterFctory(); UserPresenter presenter = factory.create(getIntent().getStringExtra("user_id")); presenter.attach(); ... } @Component(modules = UserModule.class) interface UserComponent { UserPresenter.Factory getUserPresenterFctory(); } }
I liked how easy these implementations look like. I also advise to view .
Undoubtedly, I learned something interesting for myself from the reports of the conference, talked with colleagues from different companies, which is a great advantage of an international conference, and it is for the sake of networking that you should go for them. As a bonus, this time was a visit to London. If we talk about reports, it is easier to watch them online or attend one of the many Russian conferences.
Source: https://habr.com/ru/post/428562/
All Articles