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

Loading…
Cancel
Save