Don't show TaskEditActivity title header for premium users--takes up too much space

pull/14/head
Sam Bosley 12 years ago
parent 6c862a4eff
commit 9c5b2a459c

@ -13,6 +13,7 @@ import android.widget.TextView;
import com.timsu.astrid.R;
import com.todoroo.andlib.utility.AndroidUtilities;
import com.todoroo.astrid.actfm.sync.ActFmPreferenceService;
import com.todoroo.astrid.service.ThemeService;
public class TaskEditActivity extends AstridActivity {
@ -36,8 +37,13 @@ public class TaskEditActivity extends AstridActivity {
public void updateTitle(boolean isNewTask) {
ActionBar actionBar = getSupportActionBar();
if (actionBar != null)
((TextView) actionBar.getCustomView().findViewById(R.id.title)).setText(isNewTask ? R.string.TEA_new_task : R.string.TAd_contextEditTask);
if (actionBar != null) {
TextView title = ((TextView) actionBar.getCustomView().findViewById(R.id.title));
if (ActFmPreferenceService.isPremiumUser())
title.setText(""); //$NON-NLS-1$
else
title.setText(isNewTask ? R.string.TEA_new_task : R.string.TAd_contextEditTask);
}
}
/* (non-Javadoc)

@ -748,13 +748,13 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
if (model.getValue(Task.TITLE).length() == 0) {
StatisticsService.reportEvent(StatisticsConstants.CREATE_TASK);
setIsNewTask(true);
// set deletion date until task gets a title
model.setValue(Task.DELETION_DATE, DateUtilities.now());
} else {
StatisticsService.reportEvent(StatisticsConstants.EDIT_TASK);
}
setIsNewTask(model.getValue(Task.TITLE).length() == 0);
if (model == null) {
exceptionService.reportError("task-edit-no-task",
@ -776,11 +776,9 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
private void setIsNewTask(boolean isNewTask) {
this.isNewTask = isNewTask;
if (isNewTask) {
Activity activity = getActivity();
if (activity instanceof TaskEditActivity) {
((TaskEditActivity) activity).updateTitle(isNewTask);
}
Activity activity = getActivity();
if (activity instanceof TaskEditActivity) {
((TaskEditActivity) activity).updateTitle(isNewTask);
}
}

Loading…
Cancel
Save