use of android.support.v4.app.FragmentManager in project Android-PanesLibrary by cricklet.
the class PhoneDelegate method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
if (findViewById(R.id.content_frame) == null)
setContentView(R.layout.phone_layout);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);
drawerToggle = new ActionBarDrawerToggle(getActivity(), drawer, R.drawable.ic_drawer, R.string.drawer_open, R.string.drawer_close) {
public void onDrawerClosed(View view) {
supportInvalidateOptionsMenu();
// creates call to onPrepareOptionsMenu()
}
public void onDrawerOpened(View drawerView) {
supportInvalidateOptionsMenu();
// creates call to onPrepareOptionsMenu()
}
};
drawer.setDrawerListener(drawerToggle);
FragmentManager fm = getSupportFragmentManager();
fm.addOnBackStackChangedListener(this);
}
use of android.support.v4.app.FragmentManager in project Android-PanesLibrary by cricklet.
the class TabletDelegate method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
if (findViewById(R.id.content_frame) == null) {
setContentView(R.layout.panes_layout);
} else {
View.inflate(getActivity(), R.layout.panes_layout, (ViewGroup) findViewById(R.id.content_frame));
}
panesLayout = (PanesLayout) findViewById(R.id.panes);
panesLayout.setOnIndexChangedListener(this);
if (savedInstanceState != null) {
int[] panesType = savedInstanceState.getIntArray("PanesLayout_panesType");
boolean[] panesFocused = savedInstanceState.getBooleanArray("PanesLayout_panesFocused");
int currentIndex = savedInstanceState.getInt("PanesLayout_currentIndex");
for (int i = 0; i < panesType.length; i++) {
panesLayout.addPane(panesType[i], panesFocused[i]);
}
panesLayout.setIndex(currentIndex);
}
if (savedInstanceState != null) {
FragmentManager fm = getSupportFragmentManager();
for (int index = 0; index < panesLayout.getNumPanes(); index++) {
int id = panesLayout.getPane(index).getInnerId();
Fragment f = fm.findFragmentById(id);
fragmentStack.add(f);
}
}
}
use of android.support.v4.app.FragmentManager in project barcodescanner by dm77.
the class FullScannerActivity method closeDialog.
public void closeDialog(String dialogName) {
FragmentManager fragmentManager = getSupportFragmentManager();
DialogFragment fragment = (DialogFragment) fragmentManager.findFragmentByTag(dialogName);
if (fragment != null) {
fragment.dismiss();
}
}
use of android.support.v4.app.FragmentManager in project barcodescanner by dm77.
the class FullScannerActivity method closeDialog.
public void closeDialog(String dialogName) {
FragmentManager fragmentManager = getSupportFragmentManager();
DialogFragment fragment = (DialogFragment) fragmentManager.findFragmentByTag(dialogName);
if (fragment != null) {
fragment.dismiss();
}
}
use of android.support.v4.app.FragmentManager in project FlexibleAdapter by davideas.
the class MainActivity method initializeFragment.
private void initializeFragment(Bundle savedInstanceState) {
if (savedInstanceState != null) {
mFragment = (AbstractFragment) getSupportFragmentManager().getFragment(savedInstanceState, STATE_ACTIVE_FRAGMENT);
}
if (mFragment == null) {
mFragment = FragmentOverall.newInstance(2);
}
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction().replace(R.id.recycler_view_container, mFragment).commit();
}
Aggregations