Reorganization

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2017-11-28 03:47:53 +01:00
parent 6f641899f1
commit 003a5af33c
2 changed files with 15 additions and 20 deletions

View File

@ -131,6 +131,14 @@ public class CallsListController extends BaseController implements SearchView.On
userEntity = userUtils.getCurrentUser();
if (userEntity == null) {
if (getParentController() != null && getParentController().getRouter() != null) {
getParentController().getRouter().setRoot((RouterTransaction.with(new ServerSelectionController())
.pushChangeHandler(new HorizontalChangeHandler())
.popChangeHandler(new HorizontalChangeHandler())));
}
}
if (adapter == null) {
adapter = new FlexibleAdapter<>(callItems, getActivity(), false);
if (userEntity != null) {
@ -141,13 +149,6 @@ public class CallsListController extends BaseController implements SearchView.On
adapter.addListener(new OnItemClickListener());
prepareViews();
if (userEntity == null) {
if (getParentController() != null && getParentController().getRouter() != null) {
getParentController().getRouter().setRoot((RouterTransaction.with(new ServerSelectionController())
.pushChangeHandler(new HorizontalChangeHandler())
.popChangeHandler(new HorizontalChangeHandler())));
}
}
}
@Override

View File

@ -120,14 +120,6 @@ public class ContactsController extends BaseController implements SearchView.OnQ
NextcloudTalkApplication.getSharedApplication().getComponentApplication().inject(this);
userEntity = userUtils.getCurrentUser();
if (adapter == null) {
adapter = new FlexibleAdapter<>(contactItems, getActivity(), false);
if (userEntity != null) {
fetchData();
}
}
prepareViews();
if (userEntity == null) {
if (getParentController().getRouter() != null) {
@ -137,12 +129,14 @@ public class ContactsController extends BaseController implements SearchView.OnQ
}
}
}
@Override
protected void onAttach(@NonNull View view) {
super.onAttach(view);
if (adapter == null) {
adapter = new FlexibleAdapter<>(contactItems, getActivity(), false);
if (userEntity != null) {
fetchData();
}
}
prepareViews();
}
private void initSearchView() {