use of android.app.Fragment in project WordPress-Android by wordpress-mobile.
the class ReaderPostListActivity method showListFragmentForBlog.
/*
* show fragment containing list of latest posts in a specific blog
*/
private void showListFragmentForBlog(long blogId) {
if (isFinishing()) {
return;
}
Fragment fragment = ReaderPostListFragment.newInstanceForBlog(blogId);
getFragmentManager().beginTransaction().replace(R.id.fragment_container, fragment, getString(R.string.fragment_tag_reader_post_list)).commit();
String title = ReaderBlogTable.getBlogName(blogId);
if (title.isEmpty()) {
title = getString(R.string.reader_title_blog_preview);
}
setTitle(title);
}
use of android.app.Fragment in project WordPress-Android by wordpress-mobile.
the class NumberPickerDialog method onDismiss.
@Override
public void onDismiss(DialogInterface dialog) {
Fragment target = getTargetFragment();
if (target != null) {
target.onActivityResult(getTargetRequestCode(), Activity.RESULT_OK, getResultIntent());
}
super.onDismiss(dialog);
}
use of android.app.Fragment in project Rosie by Karumi.
the class MainActivity method initializeViewPager.
private void initializeViewPager() {
adapter = new FragmentAdapter(getFragmentManager());
viewPager.setAdapter(adapter);
Fragment charactersFragment = new CharactersFragment();
Fragment comicsFragment = new ComicSeriesFragment();
adapter.addFragment(charactersFragment, getString(R.string.characters_page_title));
adapter.addFragment(comicsFragment, getString(R.string.comic_series_page_title));
adapter.notifyDataSetChanged();
pagerTabView.setupWithViewPager(viewPager);
}
use of android.app.Fragment in project android-app by spark.
the class CoreListActivity method panelOpened.
private void panelOpened() {
Fragment tinkerFrag = Ui.findFrag(this, R.id.tinker_container);
if (tinkerFrag == null) {
log.v("Tinker fragment is null");
}
if (slidingLayout.isSlideable()) {
Ui.findFrag(this, R.id.core_list).setHasOptionsMenu(true);
if (tinkerFrag != null) {
tinkerFrag.setHasOptionsMenu(false);
}
} else {
Ui.findFrag(this, R.id.core_list).setHasOptionsMenu(true);
if (tinkerFrag != null) {
tinkerFrag.setHasOptionsMenu(true);
}
}
actionBar.setHomeButtonEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(false);
setCustomActionBarTitle(getString(R.string.app_name_lower));
}
use of android.app.Fragment in project android-app by spark.
the class CoreListActivity method panelClosed.
private void panelClosed() {
Ui.findFrag(this, R.id.core_list).setHasOptionsMenu(false);
Fragment tinkerFrag = Ui.findFrag(this, R.id.tinker_container);
if (tinkerFrag != null) {
tinkerFrag.setHasOptionsMenu(true);
}
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
if (selectedItemId != null) {
Device selectedDevice = DeviceState.getDeviceById(selectedItemId);
if (selectedDevice != null && truthy(selectedDevice.name)) {
setCustomActionBarTitle(selectedDevice.name);
} else {
setCustomActionBarTitle(getString(R.string._unnamed_core_));
}
} else {
log.wtf("Selected item is null?");
}
}
Aggregations