Fix for reversed null check. Better setCurrentTab logic and placement.

pull/14/head
Tim Su 14 years ago
parent 425f658c29
commit cbb2519139

@ -403,16 +403,12 @@ public final class TaskEditFragment extends Fragment implements
editNotes.loadViewForTaskID(idParam);
}
if (editNotes.numberOfComments() == 0) {
setCurrentTab(TAB_VIEW_MORE);
} else {
editNotes.addListener(this);
Handler refreshHandler = new Handler();
refreshHandler.postDelayed(refreshActivity, 1000);
}
editNotes.addListener(this);
}
if(hasTitle) {
if(webServices == null) {
webServices = new WebServicesView(getActivity());
@ -444,6 +440,10 @@ public final class TaskEditFragment extends Fragment implements
commentsBar.setVisibility(View.VISIBLE);
moreSection.setVisibility(View.GONE);
moreTab.setVisibility(View.VISIBLE);
if(editNotes != null && editNotes.numberOfComments() == 0)
setCurrentTab(TAB_VIEW_MORE);
} else {
moreSection.setVisibility(View.VISIBLE);
commentsBar.setVisibility(View.GONE);
@ -462,7 +462,7 @@ public final class TaskEditFragment extends Fragment implements
}
private void setCurrentTab(int position) {
if(mIndicator != null)
if(mIndicator == null)
return;
mIndicator.setCurrentItem(position);

Loading…
Cancel
Save