Search in sources :

Example 1 with MapCalibrationFragment

use of com.peterlaurence.trekadvisor.menu.mapcalibration.MapCalibrationFragment in project TrekAdvisor by peterLaurence.

the class MainActivity method showMapCalibrationFragment.

private void showMapCalibrationFragment() {
    /* Remove single-usage fragments */
    removeSingleUsageFragments();
    /* Hide other fragments */
    FragmentTransaction hideTransaction = fragmentManager.beginTransaction();
    hideOtherFragments(hideTransaction, MAP_CALIBRATION_FRAGMENT_TAG);
    hideTransaction.commit();
    FragmentTransaction transaction = fragmentManager.beginTransaction();
    Fragment mapCalibrationFragment = createMapCalibrationFragment(transaction);
    transaction.show(mapCalibrationFragment);
    /* Manually manage the back action*/
    mBackFragmentTag = MAP_SETTINGS_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)

Example 2 with MapCalibrationFragment

use of com.peterlaurence.trekadvisor.menu.mapcalibration.MapCalibrationFragment in project TrekAdvisor by peterLaurence.

the class MainActivity method removeSingleUsageFragments.

private void removeSingleUsageFragments() {
    FragmentTransaction transaction = fragmentManager.beginTransaction();
    /* Remove the calibration fragment */
    Fragment mapCalibrationFragment = fragmentManager.findFragmentByTag(MAP_CALIBRATION_FRAGMENT_TAG);
    if (mapCalibrationFragment != null) {
        transaction.remove(mapCalibrationFragment);
    }
    /* Remove the fragment for tracks management */
    Fragment tracksManageFragment = fragmentManager.findFragmentByTag(TRACKS_MANAGE_FRAGMENT_TAG);
    if (tracksManageFragment != null) {
        transaction.remove(tracksManageFragment);
    }
    /* Remove the fragment for marker management */
    Fragment markerManageFragment = fragmentManager.findFragmentByTag(MARKER_MANAGE_FRAGMENT_TAG);
    if (markerManageFragment != null) {
        transaction.remove(markerManageFragment);
    }
    /* Remove the map-import fragment */
    Fragment mapImportFragment = fragmentManager.findFragmentByTag(MAP_IMPORT_FRAGMENT_TAG);
    if (mapImportFragment != null) {
        transaction.remove(mapImportFragment);
    }
    /* Remove the map-settings fragment */
    Fragment mapSettingsFragment = fragmentManager.findFragmentByTag(MAP_SETTINGS_FRAGMENT_TAG);
    if (mapSettingsFragment != null) {
        transaction.remove(mapSettingsFragment);
    }
    /* Remove the record fragment */
    Fragment recordFragment = fragmentManager.findFragmentByTag(RECORD_FRAGMENT_TAG);
    if (recordFragment != null) {
        transaction.remove(recordFragment);
    }
    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)

Example 3 with MapCalibrationFragment

use of com.peterlaurence.trekadvisor.menu.mapcalibration.MapCalibrationFragment in project TrekAdvisor by peterLaurence.

the class MainActivity method createMapImportFragment.

private Fragment createMapImportFragment(FragmentTransaction transaction) {
    Fragment mapCalibrationFragment = new MapImportFragment();
    transaction.add(R.id.content_frame, mapCalibrationFragment, MAP_IMPORT_FRAGMENT_TAG);
    return mapCalibrationFragment;
}
Also used : MapImportFragment(com.peterlaurence.trekadvisor.menu.mapimport.MapImportFragment) 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 4 with MapCalibrationFragment

use of com.peterlaurence.trekadvisor.menu.mapcalibration.MapCalibrationFragment in project TrekAdvisor by peterLaurence.

the class MainActivity method createMapCalibrationFragment.

private Fragment createMapCalibrationFragment(FragmentTransaction transaction) {
    Fragment mapCalibrationFragment = new MapCalibrationFragment();
    transaction.add(R.id.content_frame, mapCalibrationFragment, MAP_CALIBRATION_FRAGMENT_TAG);
    return mapCalibrationFragment;
}
Also used : MapCalibrationFragment(com.peterlaurence.trekadvisor.menu.mapcalibration.MapCalibrationFragment) 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)4 MapCalibrationFragment (com.peterlaurence.trekadvisor.menu.mapcalibration.MapCalibrationFragment)4 MapImportFragment (com.peterlaurence.trekadvisor.menu.mapimport.MapImportFragment)4 MapListFragment (com.peterlaurence.trekadvisor.menu.maplist.MapListFragment)4 MapSettingsFragment (com.peterlaurence.trekadvisor.menu.maplist.MapSettingsFragment)4 MapViewFragment (com.peterlaurence.trekadvisor.menu.mapview.MapViewFragment)4 MarkerManageFragment (com.peterlaurence.trekadvisor.menu.mapview.components.markermanage.MarkerManageFragment)4 TracksManageFragment (com.peterlaurence.trekadvisor.menu.mapview.components.tracksmanage.TracksManageFragment)4 RecordFragment (com.peterlaurence.trekadvisor.menu.record.RecordFragment)4 FragmentTransaction (android.app.FragmentTransaction)2