Fixed the setTitle-stuff not showing anything. Now it updates the old header and the actionbar-title.

pull/14/head
Arne Jans 13 years ago
parent 27010eb6cd
commit 660618f7a0

@ -199,7 +199,7 @@ public class FilterListActivity extends ExpandableListFragment {
public void onClick(View v) {
Intent intent = TagsPlugin.newTagDialog(getActivity());
startActivity(intent);
AndroidUtilities.callApiMethod(5, FilterListActivity.this, "overridePendingTransition",
AndroidUtilities.callApiMethod(5, getActivity(), "overridePendingTransition",
new Class<?>[] { Integer.TYPE, Integer.TYPE },
R.anim.slide_left_in, R.anim.slide_left_out);
}

@ -2,6 +2,7 @@ package com.todoroo.astrid.activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.widget.TextView;
import com.timsu.astrid.R;
import com.todoroo.astrid.service.ThemeService;
@ -24,4 +25,14 @@ public class FilterListWrapperActivity extends AstridWrapperActivity {
mMultipleFragments = true;
}
}
@Override
public void setTitle(CharSequence title) {
Fragment frag = (Fragment) getSupportFragmentManager()
.findFragmentById(R.id.tasklist_fragment);
if (frag != null && frag.isInLayout())
((TextView)frag.getView().findViewById(R.id.listLabel)).setText(title);
// update the actionbar-title
getSupportActionBar().setTitle(title);
}
}

@ -354,15 +354,15 @@ public class TaskListActivity extends ListFragment implements OnScrollListener,
isFilter = true;
} else {
filter = CoreFilterExposer.buildInboxFilter(getResources());
//getView().findViewById(R.id.headerLogo).setVisibility(View.VISIBLE);
//getView().findViewById(R.id.listLabel).setVisibility(View.GONE);
// getView().findViewById(R.id.headerLogo).setVisibility(View.VISIBLE);
// getView().findViewById(R.id.listLabel).setVisibility(View.GONE);
isFilter = false;
}
setUpTaskList();
// FIXME put this into the wrapper activity
// if(Constants.DEBUG)
// setTitle("[D] " + filter.title); //$NON-NLS-1$
if(Constants.DEBUG)
getActivity().setTitle("[D] " + filter.title); //$NON-NLS-1$
contextMenuExtensionLoader.loadInNewThread(getActivity());
}
@ -843,12 +843,6 @@ public class TaskListActivity extends ListFragment implements OnScrollListener,
getActivity().sendOrderedBroadcast(broadcastIntent, AstridApiConstants.PERMISSION_READ);
}
// FIXME: put this into the wrapper-activity eventually
// @Override
// public void setTitle(CharSequence title) {
// ((TextView)findViewById(R.id.listLabel)).setText(title);
// }
/**
* Fill in the Task List with current items
* @param withCustomId force task with given custom id to be part of list
@ -859,8 +853,7 @@ public class TaskListActivity extends ListFragment implements OnScrollListener,
sqlQueryTemplate.set(SortHelper.adjustQueryForFlagsAndSort(filter.sqlQuery,
sortFlags, sortSort));
// FIXME: put this into the wrapper-activity eventually
// setTitle(filter.title);
getActivity().setTitle(filter.title);
// perform query
TodorooCursor<Task> currentCursor = taskService.fetchFiltered(

@ -2,6 +2,7 @@ package com.todoroo.astrid.activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.widget.TextView;
import com.timsu.astrid.R;
import com.todoroo.astrid.service.ThemeService;
@ -23,4 +24,14 @@ public class TaskListWrapperActivity extends AstridWrapperActivity {
mMultipleFragments = true;
}
}
@Override
public void setTitle(CharSequence title) {
Fragment frag = (Fragment) getSupportFragmentManager()
.findFragmentById(R.id.tasklist_fragment);
if (frag != null && frag.isInLayout())
((TextView)frag.getView().findViewById(R.id.listLabel)).setText(title);
// update the actionbar-title
getSupportActionBar().setTitle(title);
}
}

Loading…
Cancel
Save