Added README.txt and GPL Header to Source Files
[DHBWCampusApp.git] / app / src / main / java / de / dhbwloe / campusapp / fragments / Mensa.java
index 2d641de6d28bb1bb7bf88cd6f38eeeea48730fd9..daa7427225a5a7a81e25a679ddde75f149444bd1 100644 (file)
@@ -1,6 +1,19 @@
+/* Mensa.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 <http://www.gnu.org/licenses/>.
+ */
 package de.dhbwloe.campusapp.fragments;
-
-
 import android.os.Bundle;
 import android.support.design.widget.TabLayout;
 import android.support.v4.app.Fragment;
@@ -21,6 +34,7 @@ import java.util.List;
 
 import de.dhbwloe.campusapp.CampusAppFragment;
 import de.dhbwloe.campusapp.R;
+import de.dhbwloe.campusapp.Tools;
 import de.dhbwloe.campusapp.search.SearchIndices;
 
 /**
@@ -33,9 +47,9 @@ public class Mensa extends CampusAppFragment {
                 new SearchIndices("Mensa", true) {{
                     setUpdateTime(1);
                     setTarget("#Mensa");
-                    setTitle("Mensa");
-                    setDescription("Aktuelle Mensapläne");
-                    addKeyWord("mensa, kantine, essen, mittagessen, mensaplan, plan, hunger, mittag");
+                    setTitle(R.string.search_mensa_title);
+                    setDescription(R.string.search_mensa_description);
+                    addKeyWord(R.string.search_mensa_keywords);
                 }},
         };
     }
@@ -59,7 +73,7 @@ public class Mensa extends CampusAppFragment {
             }
         }
 
-        AppContext.setTitle("Mensa Speiseplan");
+        AppContext.setTitle(AppContext.getResString(R.string.mensa_title));
 
         /*
         toolbar = (Toolbar) view.findViewById(R.id.toolbar);
@@ -85,7 +99,6 @@ public class Mensa extends CampusAppFragment {
         if(viewDate < now)
             now = viewDate;
 
-        int weekdayResIds[] = new int[] { R.string.week_monday_short, R.string.week_tuesday_short, R.string.week_wednesday_short, R.string.week_thursday_short, R.string.week_friday_short, R.string.week_saturday_short, R.string.week_sunday_short };
         Calendar cal = Calendar.getInstance();
         cal.setTime(new Date(now * 1000));
         cal.set(Calendar.HOUR_OF_DAY, 0);
@@ -133,7 +146,7 @@ public class Mensa extends CampusAppFragment {
             }
             lastWeekday = weekday;
 
-            title = AppContext.getResString(weekdayResIds[weekday]);
+            title = Tools.getWeekdayString(date, false);
             bundle.putLong("date", date);
             adapter.addFragment(bundle, title);
         }