Added README.txt and GPL Header to Source Files
[DHBWCampusApp.git] / app / src / main / java / de / dhbwloe / campusapp / fragments / MensaCard.java
index e465d7271bb66f6990d143c3489cfc6564bb16ed..a19ca37a96322093309611a1bf23a2a7bfcba5ea 100644 (file)
@@ -1,5 +1,19 @@
+/* MensaCard.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.content.Context;
 import android.net.Uri;
 import android.os.Bundle;
@@ -26,24 +40,11 @@ import de.dhbwloe.campusapp.search.SearchIndices;
 public class MensaCard extends CampusAppFragment {
     private View view;
 
-    /* implement this for search results ;) */
-    public static SearchIndices[] GetSearchIndices() {
-        return new SearchIndices[] {
-                new SearchIndices("MensaCard", true) {{
-                    setUpdateTime(1);
-                    setTarget("#MensaCard");
-                    setTitle("Mensakarte auslesen");
-                    setDescription("Mensakarte Kontostand");
-                    addKeyWord("mensa, kantine, essen, mittagessen, mensaplan, karte, ausweis, geld, kontostand, euro");
-                }},
-        };
-    }
-
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container,
                              Bundle savedInstanceState) {
         view = inflater.inflate(R.layout.fragment_mensa_card, container, false);
-        AppContext.setTitle("Mensa Guthaben");
+        AppContext.setTitle(AppContext.getResString(R.string.mensacard_title));
 
         Bundle args = getArguments();
         if(args != null && args.containsKey("balance")) {
@@ -56,8 +57,8 @@ public class MensaCard extends CampusAppFragment {
     public void showNfcCardData(Bundle bundle) {
         TextView cardDataView = (TextView)view.findViewById(R.id.balanceTxt);
         double balance = bundle.getDouble("balance");
-        DecimalFormat df = new DecimalFormat("#,###.00");
-        cardDataView.setText(df.format(balance)+" €");
+        DecimalFormat df = new DecimalFormat(AppContext.getResString(R.string.mensaformat_price));
+        cardDataView.setText(df.format(balance));
     }
 
 }