X-Git-Url: http://git.pk910.de/?p=DHBWCampusApp.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fde%2Fdhbwloe%2Fcampusapp%2FNavigationManager.java;h=ed339dd8a6b10cad42f64815ebf234ccd8de9f2b;hp=daa84eabf49d4cf158f53ededd30729b99ccae77;hb=48e758721a39298a85c69ecc7267f3daf6993e78;hpb=ec703feba2fdc5bdd0d00bf17c4566473ffd718f
diff --git a/app/src/main/java/de/dhbwloe/campusapp/NavigationManager.java b/app/src/main/java/de/dhbwloe/campusapp/NavigationManager.java
index daa84ea..ed339dd 100644
--- a/app/src/main/java/de/dhbwloe/campusapp/NavigationManager.java
+++ b/app/src/main/java/de/dhbwloe/campusapp/NavigationManager.java
@@ -1,3 +1,18 @@
+/* NavigationManager.java
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
package de.dhbwloe.campusapp;
import android.os.Bundle;
@@ -27,11 +42,19 @@ public class NavigationManager {
};
private CampusAppContext AppContext;
+
+ // Derzeitig angezeigtes Fragment
private NavPage oCurrentPage;
- private NavPage oParentPage;
private Fragment oCurrentFragment;
+
+ // Hintergrund Fragment (bei Popups)
+ private NavPage oParentPage;
private Fragment oParentFragment;
+
+ // Container ID
private int iFragmentContainerId;
+
+ // Alle registrierte Fragmente mit Name
private ArrayList lNavigationPages = new ArrayList();
public NavigationManager(CampusAppContext context, int fragmentContainer) {
@@ -79,12 +102,13 @@ public class NavigationManager {
}
public void navigatePage(String name, Bundle args, boolean history) {
-
+ // Suche Fragment
NavPage page = getPageByName(name);
if(page == null)
return;
Fragment fragment;
+ // Wenn das Fragment als Popup angeziegt werden soll, muss zunächst das Popup Fragment geladen werden.
if(page.fragmentType == 3) {
PopupFragment popupFragment = new PopupFragment();
if(args == null)
@@ -122,7 +146,7 @@ public class NavigationManager {
}
transaction.add(iFragmentContainerId, fragment);
}
- if (history)
+ if (history) // Hinzufügen zur App History (Zurück Button)
transaction.addToBackStack(null);
oCurrentPage = page;
@@ -174,6 +198,7 @@ public class NavigationManager {
}
public boolean closeDialog() {
+ // Popup schlieÃen
if(oCurrentPage != null && oCurrentPage.fragmentType == 3) {
PopupFragment fragment = (PopupFragment) oCurrentFragment;
boolean wasAdded = false;