From cbb25191393270db61298eab6ec9dc10f1d946f4 Mon Sep 17 00:00:00 2001 From: Tim Su Date: Wed, 8 Feb 2012 18:15:51 -0800 Subject: [PATCH] Fix for reversed null check. Better setCurrentTab logic and placement. --- .../astrid/activity/TaskEditFragment.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java b/astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java index 100f86df6..9d1a59368 100755 --- a/astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java +++ b/astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java @@ -403,14 +403,10 @@ public final class TaskEditFragment extends Fragment implements editNotes.loadViewForTaskID(idParam); } - if (editNotes.numberOfComments() == 0) { - setCurrentTab(TAB_VIEW_MORE); - } else { - Handler refreshHandler = new Handler(); - refreshHandler.postDelayed(refreshActivity, 1000); - } - editNotes.addListener(this); + + Handler refreshHandler = new Handler(); + refreshHandler.postDelayed(refreshActivity, 1000); } if(hasTitle) { @@ -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);