use of com.kickstarter.libs.qualifiers.RequiresActivityViewModel in project android-oss by kickstarter.
the class BaseActivity method assignViewModel.
private void assignViewModel(@Nullable final Bundle viewModelEnvelope) {
if (viewModel == null) {
final RequiresActivityViewModel annotation = getClass().getAnnotation(RequiresActivityViewModel.class);
final Class<ViewModelType> viewModelClass = annotation == null ? null : (Class<ViewModelType>) annotation.value();
if (viewModelClass != null) {
viewModel = ActivityViewModelManager.getInstance().fetch(this, viewModelClass, BundleUtils.maybeGetBundle(viewModelEnvelope, VIEW_MODEL_KEY));
}
}
}
Aggregations