Search in sources :

Example 1 with MapListFragment

use of com.peterlaurence.trekadvisor.menu.maplist.MapListFragment in project TrekAdvisor by peterLaurence.

the class MainActivity method createMapListFragment.

private Fragment createMapListFragment(FragmentTransaction transaction) {
    Fragment mapListFragment = new MapListFragment();
    transaction.add(R.id.content_frame, mapListFragment, MAP_LIST_FRAGMENT_TAG);
    return mapListFragment;
}
Also used : MapListFragment(com.peterlaurence.trekadvisor.menu.maplist.MapListFragment) MapSettingsFragment(com.peterlaurence.trekadvisor.menu.maplist.MapSettingsFragment) MarkerManageFragment(com.peterlaurence.trekadvisor.menu.mapview.components.markermanage.MarkerManageFragment) MapCalibrationFragment(com.peterlaurence.trekadvisor.menu.mapcalibration.MapCalibrationFragment) TracksManageFragment(com.peterlaurence.trekadvisor.menu.mapview.components.tracksmanage.TracksManageFragment) MapViewFragment(com.peterlaurence.trekadvisor.menu.mapview.MapViewFragment) Fragment(android.app.Fragment) RecordFragment(com.peterlaurence.trekadvisor.menu.record.RecordFragment) MapListFragment(com.peterlaurence.trekadvisor.menu.maplist.MapListFragment) MapImportFragment(com.peterlaurence.trekadvisor.menu.mapimport.MapImportFragment)

Example 2 with MapListFragment

use of com.peterlaurence.trekadvisor.menu.maplist.MapListFragment in project TrekAdvisor by peterLaurence.

the class MainActivity method showMapListFragment.

private void showMapListFragment() {
    /* Remove single-usage fragments */
    removeSingleUsageFragments();
    /* Hide other fragments */
    FragmentTransaction hideTransaction = fragmentManager.beginTransaction();
    hideOtherFragments(hideTransaction, MAP_LIST_FRAGMENT_TAG);
    hideTransaction.commit();
    FragmentTransaction transaction = fragmentManager.beginTransaction();
    Fragment mapListFragment = fragmentManager.findFragmentByTag(MAP_LIST_FRAGMENT_TAG);
    /* Show the map list fragment if it exists */
    if (mapListFragment == null) {
        mapListFragment = createMapListFragment(transaction);
    }
    transaction.show(mapListFragment);
    /* Manually manage the back action*/
    mBackFragmentTag = MAP_FRAGMENT_TAG;
    transaction.commit();
}
Also used : FragmentTransaction(android.app.FragmentTransaction) MapSettingsFragment(com.peterlaurence.trekadvisor.menu.maplist.MapSettingsFragment) MarkerManageFragment(com.peterlaurence.trekadvisor.menu.mapview.components.markermanage.MarkerManageFragment) MapCalibrationFragment(com.peterlaurence.trekadvisor.menu.mapcalibration.MapCalibrationFragment) TracksManageFragment(com.peterlaurence.trekadvisor.menu.mapview.components.tracksmanage.TracksManageFragment) MapViewFragment(com.peterlaurence.trekadvisor.menu.mapview.MapViewFragment) Fragment(android.app.Fragment) RecordFragment(com.peterlaurence.trekadvisor.menu.record.RecordFragment) MapListFragment(com.peterlaurence.trekadvisor.menu.maplist.MapListFragment) MapImportFragment(com.peterlaurence.trekadvisor.menu.mapimport.MapImportFragment)

Aggregations

Fragment (android.app.Fragment)2 MapCalibrationFragment (com.peterlaurence.trekadvisor.menu.mapcalibration.MapCalibrationFragment)2 MapImportFragment (com.peterlaurence.trekadvisor.menu.mapimport.MapImportFragment)2 MapListFragment (com.peterlaurence.trekadvisor.menu.maplist.MapListFragment)2 MapSettingsFragment (com.peterlaurence.trekadvisor.menu.maplist.MapSettingsFragment)2 MapViewFragment (com.peterlaurence.trekadvisor.menu.mapview.MapViewFragment)2 MarkerManageFragment (com.peterlaurence.trekadvisor.menu.mapview.components.markermanage.MarkerManageFragment)2 TracksManageFragment (com.peterlaurence.trekadvisor.menu.mapview.components.tracksmanage.TracksManageFragment)2 RecordFragment (com.peterlaurence.trekadvisor.menu.record.RecordFragment)2 FragmentTransaction (android.app.FragmentTransaction)1