List of usage examples for android.support.v4.app ActionBar setTitle
public abstract void setTitle(int resId);
From source file:mobisocial.bento.ebento.ui.EditActivity.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); boolean bNewEventMode = true; // Check if this activity launched from internal activity or not if (getIntent().hasExtra(EXTRA_EDIT)) { bNewEventMode = false;/*from w w w. jav a 2s . c om*/ } setContentView(R.layout.activity_edit); FragmentManager fm = getSupportFragmentManager(); mEditFragment = (EditFragment) fm.findFragmentById(R.id.fragment_edit); final ActionBar actionBar = getSupportActionBar(); // set defaults for logo & home up actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setDisplayUseLogoEnabled(true); actionBar.setTitle(bNewEventMode ? R.string.label_create_event : R.string.label_edit_event); }
From source file:uk.ac.hutton.ics.buntata.fragment.NodeFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { /* Get parameters */ Bundle args = getArguments();/* w ww .j a v a2s .c o m*/ datasourceId = args.getInt(PARAM_DATASOURCE_ID, -1); int parentId = args.getInt(PARAM_PARENT_ID, -1); NodeManager nodeManager = new NodeManager(getActivity(), datasourceId); /* Get the parent node */ BuntataNodeAdvanced parent = nodeManager.getById(parentId); BuntataDatasource datasource = new DatasourceManager(getActivity(), datasourceId).getById(datasourceId); /* Inflate the layout */ View view = inflater.inflate(R.layout.fragment_node, container, false); unbinder = ButterKnife.bind(this, view); recyclerView.setHasFixedSize(true); String title = getString(R.string.app_name); int parentMediaId = -1; /* If we don't have a parent, get all roots */ if (parent == null) { originalList = nodeManager.getAllRoots(); } /* Else get all the children of the parent */ else { BuntataMediaAdvanced m = parent.getFirstImage(); if (m != null) parentMediaId = m.getId(); originalList = nodeManager.getForParent(parentId); if (datasource.isShowKeyName()) title = parent.getName(); } /* Set the name of the parent (if available) to the tool bar */ ActionBar toolbar = ((AppCompatActivity) getActivity()).getSupportActionBar(); if (toolbar != null) toolbar.setTitle(title); /* Set the data to the adapter */ adapter = new NodeAdapter(getActivity(), recyclerView, datasourceId, parentMediaId, originalList) { @Override public void onNodeClicked(View animationRoot, View title, BuntataMediaAdvanced medium, BuntataNodeAdvanced node) { ((MainActivity) getActivity()).onFragmentChange(animationRoot, title, datasourceId, node.getId(), medium != null ? medium.getId() : -1); } }; recyclerView.setAdapter(adapter); updateItemDecorator(); return view; }
From source file:mobisocial.bento.todo.ui.TodoListActivity.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mLaunchedFromBentoList = getIntent().hasExtra(EXTRA_LAUNCHED_FROM_BENTO_LIST); if (!mLaunchedFromBentoList) { // create Musubi Instance InitialHelper initHelper = new InitialHelper(this, mInitCompleteListener); Musubi musubi = initHelper.initMusubiInstance(); if (musubi == null) { return; }/*from w ww.j a va 2s .com*/ } setContentView(R.layout.activity_todo_list); final ActionBar actionBar = getSupportActionBar(); // set defaults for logo & home up actionBar.setDisplayHomeAsUpEnabled(true); // bad know-how for enabling home clickable on ICS. actionBar.setDisplayHomeAsUpEnabled(mLaunchedFromBentoList); actionBar.setDisplayUseLogoEnabled(false); if (mLaunchedFromBentoList) { actionBar.setTitle(mManager.getBentoListItem().bento.name.toString()); } FragmentManager fm = getSupportFragmentManager(); mTodoListFragment = (TodoListFragment) fm.findFragmentById(R.id.fragment_todo_list); mManager.addListener(mStateUpdatedListener); // loading if (!mLaunchedFromBentoList) { mTodoListFragment.setProgressBarVisible(true); } }