alpha 0.0.2
authorpk910 <philipp@pk910.de>
Sat, 27 Feb 2016 15:40:39 +0000 (16:40 +0100)
committerpk910 <philipp@pk910.de>
Sat, 27 Feb 2016 18:05:57 +0000 (19:05 +0100)
72 files changed:
app/build.gradle
app/src/main/AndroidManifest.xml
app/src/main/java/de/dhbwloe/campusapp/CampusApp.java
app/src/main/java/de/dhbwloe/campusapp/CampusAppContext.java
app/src/main/java/de/dhbwloe/campusapp/SettingsActivity.java [deleted file]
app/src/main/java/de/dhbwloe/campusapp/Tools.java
app/src/main/java/de/dhbwloe/campusapp/database/NewsDatabaseHelper.java
app/src/main/java/de/dhbwloe/campusapp/fragments/AppSearch.java
app/src/main/java/de/dhbwloe/campusapp/fragments/AppSearchDhbw.java
app/src/main/java/de/dhbwloe/campusapp/fragments/AppSearchInternal.java
app/src/main/java/de/dhbwloe/campusapp/fragments/AppSearchStuv.java
app/src/main/java/de/dhbwloe/campusapp/fragments/Dashboard.java
app/src/main/java/de/dhbwloe/campusapp/fragments/DashboardMensa.java
app/src/main/java/de/dhbwloe/campusapp/fragments/DashboardVorlesungsplan.java
app/src/main/java/de/dhbwloe/campusapp/fragments/FirstRun.java
app/src/main/java/de/dhbwloe/campusapp/fragments/Impressum.java
app/src/main/java/de/dhbwloe/campusapp/fragments/Mensa.java
app/src/main/java/de/dhbwloe/campusapp/fragments/MensaCard.java
app/src/main/java/de/dhbwloe/campusapp/fragments/MensaTagesplan.java
app/src/main/java/de/dhbwloe/campusapp/fragments/News.java
app/src/main/java/de/dhbwloe/campusapp/fragments/NewsListAdapter.java [new file with mode: 0644]
app/src/main/java/de/dhbwloe/campusapp/fragments/NewsListItem.java [new file with mode: 0644]
app/src/main/java/de/dhbwloe/campusapp/fragments/Settings.java [new file with mode: 0644]
app/src/main/java/de/dhbwloe/campusapp/fragments/Vorlesungsplan.java
app/src/main/java/de/dhbwloe/campusapp/fragments/VorlesungsplanGroupsListItem.java
app/src/main/java/de/dhbwloe/campusapp/fragments/VorlesungsplanUpcomingCourseListItem.java
app/src/main/java/de/dhbwloe/campusapp/fragments/VorlesungsplanUpcomingDayListItem.java
app/src/main/java/de/dhbwloe/campusapp/fragments/WifiSettings.java
app/src/main/java/de/dhbwloe/campusapp/mensaplan/MensaplanManager.java
app/src/main/java/de/dhbwloe/campusapp/search/SearchIndices.java
app/src/main/java/de/dhbwloe/campusapp/wifi/WifiNetworkSettings.java
app/src/main/res/drawable-hdpi/ic_announcement_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable-hdpi/ic_dashboard_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable-hdpi/ic_event_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable-hdpi/ic_local_dining_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable-hdpi/ic_wifi_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable-mdpi/ic_announcement_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable-mdpi/ic_dashboard_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable-mdpi/ic_event_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable-mdpi/ic_local_dining_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable-mdpi/ic_wifi_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable-xhdpi/ic_announcement_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable-xhdpi/ic_dashboard_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable-xhdpi/ic_event_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable-xhdpi/ic_local_dining_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable-xhdpi/ic_wifi_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable-xxhdpi/ic_announcement_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable-xxhdpi/ic_dashboard_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable-xxhdpi/ic_event_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable-xxhdpi/ic_local_dining_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable-xxhdpi/ic_wifi_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable-xxxhdpi/ic_announcement_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable-xxxhdpi/ic_dashboard_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable-xxxhdpi/ic_event_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable-xxxhdpi/ic_local_dining_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable-xxxhdpi/ic_wifi_black_24dp.png [new file with mode: 0644]
app/src/main/res/drawable/news_toggle_background.xml [new file with mode: 0644]
app/src/main/res/layout-land/fragment_dashboard.xml
app/src/main/res/layout/fragment_appsearch_list.xml
app/src/main/res/layout/fragment_dashboard.xml
app/src/main/res/layout/fragment_first_run.xml
app/src/main/res/layout/fragment_impressum.xml
app/src/main/res/layout/fragment_news.xml
app/src/main/res/layout/fragment_news_item.xml [new file with mode: 0644]
app/src/main/res/layout/fragment_settings.xml [new file with mode: 0644]
app/src/main/res/menu/activity_campus_app_drawer.xml
app/src/main/res/values/colors.xml
app/src/main/res/values/strings.xml
app/src/main/res/xml/pref_data_sync.xml [deleted file]
app/src/main/res/xml/pref_general.xml [deleted file]
app/src/main/res/xml/pref_headers.xml [deleted file]
app/src/main/res/xml/pref_notification.xml [deleted file]

index f86b286cac9ae9dce02b3b72458ca7c1f5754708..fbca0062ec856987d4fe82dfadf482715745a7e6 100644 (file)
@@ -68,4 +68,5 @@ dependencies {
 
 
 
+
 
index 4923c3b21460f57ec4d22dad91dd8654547025fd..54385a9476b9c96af0008528bd2052ad21ab7e5f 100644 (file)
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
-        <activity
-            android:name=".SettingsActivity"
-            android:label="@string/title_activity_settings"
-            android:parentActivityName=".CampusApp">
-            <meta-data
-                android:name="android.support.PARENT_ACTIVITY"
-                android:value="de.dhbwloe.campusapp.CampusApp" />
-        </activity>
     </application>
 
 </manifest>
index 15ae6dcbf70953fa34154e87808d9418082ae6da..719d8297de7f21498f58eac011adf7bf844441f5 100644 (file)
@@ -152,8 +152,10 @@ public class CampusApp extends FragmentActivity {
                         AppContext.getNavigationManager().navigatePage("News");
                         break;
                     case R.id.nav_settings:
-                        Intent settings = new Intent(AppContext.getMainActivity(), SettingsActivity.class);
-                        AppContext.getMainActivity().startActivity(settings);
+                        AppContext.getNavigationManager().navigatePage("Settings");
+                        break;
+                    case R.id.nav_wifi:
+                        AppContext.getNavigationManager().navigatePage("WifiSettings");
                         break;
                     case R.id.nav_impressum:
                         AppContext.getNavigationManager().navigatePage("Impressum");
index 11d3999154ca7e7a2a60512830c9f7bbff99a3f1..e4f0e494b9343019ff66d89f82b0cc4b9a226b12 100644 (file)
@@ -16,6 +16,7 @@ import de.dhbwloe.campusapp.fragments.Mensa;
 import de.dhbwloe.campusapp.fragments.MensaCard;
 import de.dhbwloe.campusapp.fragments.News;
 import de.dhbwloe.campusapp.fragments.PopupFragment;
+import de.dhbwloe.campusapp.fragments.Settings;
 import de.dhbwloe.campusapp.fragments.SplashScreen;
 import de.dhbwloe.campusapp.fragments.Vorlesungsplan;
 import de.dhbwloe.campusapp.fragments.WebBrowser;
@@ -56,6 +57,7 @@ public class CampusAppContext {
             new AppPage("News", News.class),
             new AppPage("WifiSettings", WifiSettings.class),
             new AppPage("FirstRun", FirstRun.class),
+            new AppPage("Settings", Settings.class),
             new AppPage("Impressum", Impressum.class),
             new AppPage("WebBrowser", WebBrowser.class),
             new AppPage("WebBrowserPopup", WebBrowser.class, 3)
@@ -166,6 +168,11 @@ public class CampusAppContext {
         return oContextVariables;
     }
 
+    public String getResString(int id, Object... arguments) {
+        String format = getResString(id);
+        String res = String.format(format, arguments);
+        return res;
+    }
     public String getResString(int id) {
         String str = oMainActivity.getResources().getString(id);
         return str;
diff --git a/app/src/main/java/de/dhbwloe/campusapp/SettingsActivity.java b/app/src/main/java/de/dhbwloe/campusapp/SettingsActivity.java
deleted file mode 100644 (file)
index 86aedcc..0000000
+++ /dev/null
@@ -1,267 +0,0 @@
-package de.dhbwloe.campusapp;
-
-
-import android.annotation.TargetApi;
-import android.content.Context;
-import android.content.Intent;
-import android.content.res.Configuration;
-import android.media.Ringtone;
-import android.media.RingtoneManager;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Bundle;
-import android.preference.ListPreference;
-import android.preference.Preference;
-import android.preference.PreferenceActivity;
-import android.support.v7.app.ActionBar;
-import android.preference.PreferenceFragment;
-import android.preference.PreferenceManager;
-import android.preference.RingtonePreference;
-import android.text.TextUtils;
-import android.view.MenuItem;
-import android.support.v4.app.NavUtils;
-
-import java.util.List;
-
-/**
- * A {@link PreferenceActivity} that presents a set of application settings. On
- * handset devices, settings are presented as a single list. On tablets,
- * settings are split by category, with category headers shown to the left of
- * the list of settings.
- * <p/>
- * See <a href="http://developer.android.com/design/patterns/settings.html">
- * Android Design: Settings</a> for design guidelines and the <a
- * href="http://developer.android.com/guide/topics/ui/settings.html">Settings
- * API Guide</a> for more information on developing a Settings UI.
- */
-public class SettingsActivity extends AppCompatPreferenceActivity {
-    /**
-     * A preference value change listener that updates the preference's summary
-     * to reflect its new value.
-     */
-    private static Preference.OnPreferenceChangeListener sBindPreferenceSummaryToValueListener = new Preference.OnPreferenceChangeListener() {
-        @Override
-        public boolean onPreferenceChange(Preference preference, Object value) {
-            String stringValue = value.toString();
-
-            if (preference instanceof ListPreference) {
-                // For list preferences, look up the correct display value in
-                // the preference's 'entries' list.
-                ListPreference listPreference = (ListPreference) preference;
-                int index = listPreference.findIndexOfValue(stringValue);
-
-                // Set the summary to reflect the new value.
-                preference.setSummary(
-                        index >= 0
-                                ? listPreference.getEntries()[index]
-                                : null);
-
-            } else if (preference instanceof RingtonePreference) {
-                // For ringtone preferences, look up the correct display value
-                // using RingtoneManager.
-                if (TextUtils.isEmpty(stringValue)) {
-                    // Empty values correspond to 'silent' (no ringtone).
-                    preference.setSummary(R.string.pref_ringtone_silent);
-
-                } else {
-                    Ringtone ringtone = RingtoneManager.getRingtone(
-                            preference.getContext(), Uri.parse(stringValue));
-
-                    if (ringtone == null) {
-                        // Clear the summary if there was a lookup error.
-                        preference.setSummary(null);
-                    } else {
-                        // Set the summary to reflect the new ringtone display
-                        // name.
-                        String name = ringtone.getTitle(preference.getContext());
-                        preference.setSummary(name);
-                    }
-                }
-
-            } else {
-                // For all other preferences, set the summary to the value's
-                // simple string representation.
-                preference.setSummary(stringValue);
-            }
-            return true;
-        }
-    };
-
-    /**
-     * Helper method to determine if the device has an extra-large screen. For
-     * example, 10" tablets are extra-large.
-     */
-    private static boolean isXLargeTablet(Context context) {
-        return (context.getResources().getConfiguration().screenLayout
-                & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
-    }
-
-    /**
-     * Binds a preference's summary to its value. More specifically, when the
-     * preference's value is changed, its summary (line of text below the
-     * preference title) is updated to reflect the value. The summary is also
-     * immediately updated upon calling this method. The exact display format is
-     * dependent on the type of preference.
-     *
-     * @see #sBindPreferenceSummaryToValueListener
-     */
-    private static void bindPreferenceSummaryToValue(Preference preference) {
-        // Set the listener to watch for value changes.
-        preference.setOnPreferenceChangeListener(sBindPreferenceSummaryToValueListener);
-
-        // Trigger the listener immediately with the preference's
-        // current value.
-        sBindPreferenceSummaryToValueListener.onPreferenceChange(preference,
-                PreferenceManager
-                        .getDefaultSharedPreferences(preference.getContext())
-                        .getString(preference.getKey(), ""));
-    }
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setupActionBar();
-    }
-
-    /**
-     * Set up the {@link android.app.ActionBar}, if the API is available.
-     */
-    private void setupActionBar() {
-        ActionBar actionBar = getSupportActionBar();
-        if (actionBar != null) {
-            // Show the Up button in the action bar.
-            actionBar.setDisplayHomeAsUpEnabled(true);
-        }
-    }
-
-    @Override
-    public boolean onMenuItemSelected(int featureId, MenuItem item) {
-        int id = item.getItemId();
-        if (id == android.R.id.home) {
-            if (!super.onMenuItemSelected(featureId, item)) {
-                NavUtils.navigateUpFromSameTask(this);
-            }
-            return true;
-        }
-        return super.onMenuItemSelected(featureId, item);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public boolean onIsMultiPane() {
-        return isXLargeTablet(this);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    @TargetApi(Build.VERSION_CODES.HONEYCOMB)
-    public void onBuildHeaders(List<Header> target) {
-        loadHeadersFromResource(R.xml.pref_headers, target);
-    }
-
-    /**
-     * This method stops fragment injection in malicious applications.
-     * Make sure to deny any unknown fragments here.
-     */
-    protected boolean isValidFragment(String fragmentName) {
-        return PreferenceFragment.class.getName().equals(fragmentName)
-                || GeneralPreferenceFragment.class.getName().equals(fragmentName)
-                || DataSyncPreferenceFragment.class.getName().equals(fragmentName)
-                || NotificationPreferenceFragment.class.getName().equals(fragmentName);
-    }
-
-    /**
-     * This fragment shows general preferences only. It is used when the
-     * activity is showing a two-pane settings UI.
-     */
-    @TargetApi(Build.VERSION_CODES.HONEYCOMB)
-    public static class GeneralPreferenceFragment extends PreferenceFragment {
-        @Override
-        public void onCreate(Bundle savedInstanceState) {
-            super.onCreate(savedInstanceState);
-            addPreferencesFromResource(R.xml.pref_general);
-            setHasOptionsMenu(true);
-
-            // Bind the summaries of EditText/List/Dialog/Ringtone preferences
-            // to their values. When their values change, their summaries are
-            // updated to reflect the new value, per the Android Design
-            // guidelines.
-            bindPreferenceSummaryToValue(findPreference("example_text"));
-            bindPreferenceSummaryToValue(findPreference("example_list"));
-        }
-
-        @Override
-        public boolean onOptionsItemSelected(MenuItem item) {
-            int id = item.getItemId();
-            if (id == android.R.id.home) {
-                startActivity(new Intent(getActivity(), SettingsActivity.class));
-                return true;
-            }
-            return super.onOptionsItemSelected(item);
-        }
-    }
-
-    /**
-     * This fragment shows notification preferences only. It is used when the
-     * activity is showing a two-pane settings UI.
-     */
-    @TargetApi(Build.VERSION_CODES.HONEYCOMB)
-    public static class NotificationPreferenceFragment extends PreferenceFragment {
-        @Override
-        public void onCreate(Bundle savedInstanceState) {
-            super.onCreate(savedInstanceState);
-            addPreferencesFromResource(R.xml.pref_notification);
-            setHasOptionsMenu(true);
-
-            // Bind the summaries of EditText/List/Dialog/Ringtone preferences
-            // to their values. When their values change, their summaries are
-            // updated to reflect the new value, per the Android Design
-            // guidelines.
-            bindPreferenceSummaryToValue(findPreference("notifications_new_message_ringtone"));
-        }
-
-        @Override
-        public boolean onOptionsItemSelected(MenuItem item) {
-            int id = item.getItemId();
-            if (id == android.R.id.home) {
-                startActivity(new Intent(getActivity(), SettingsActivity.class));
-                return true;
-            }
-            return super.onOptionsItemSelected(item);
-        }
-    }
-
-    /**
-     * This fragment shows data and sync preferences only. It is used when the
-     * activity is showing a two-pane settings UI.
-     */
-    @TargetApi(Build.VERSION_CODES.HONEYCOMB)
-    public static class DataSyncPreferenceFragment extends PreferenceFragment {
-        @Override
-        public void onCreate(Bundle savedInstanceState) {
-            super.onCreate(savedInstanceState);
-            addPreferencesFromResource(R.xml.pref_data_sync);
-            setHasOptionsMenu(true);
-
-            // Bind the summaries of EditText/List/Dialog/Ringtone preferences
-            // to their values. When their values change, their summaries are
-            // updated to reflect the new value, per the Android Design
-            // guidelines.
-            bindPreferenceSummaryToValue(findPreference("sync_frequency"));
-        }
-
-        @Override
-        public boolean onOptionsItemSelected(MenuItem item) {
-            int id = item.getItemId();
-            if (id == android.R.id.home) {
-                startActivity(new Intent(getActivity(), SettingsActivity.class));
-                return true;
-            }
-            return super.onOptionsItemSelected(item);
-        }
-    }
-}
index 168446e9e96363da36f36acd0a2c13e299595266..5829802fc08f71fee4ba165a815c2e9fa143c182 100644 (file)
@@ -6,6 +6,8 @@ import android.widget.AdapterView;
 
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
+import java.util.Calendar;
+import java.util.Date;
 
 import javax.crypto.Cipher;
 import javax.crypto.spec.SecretKeySpec;
@@ -70,4 +72,29 @@ public class Tools {
         }
     }
 
+    public static String getWeekdayString(long date) {
+        return getWeekdayString(date, true);
+    }
+
+    public static String getWeekdayString(long date, boolean fullString) {
+        return getWeekdayString(new Date(date * 1000), fullString);
+    }
+
+    public static String getWeekdayString(Date date) {
+        return getWeekdayString(date, true);
+    }
+
+    public static String getWeekdayString(Date date, boolean fullString) {
+        int weekdayResIds[];
+        if(fullString)
+            weekdayResIds = new int[] { R.string.week_sunday, R.string.week_monday, R.string.week_tuesday, R.string.week_wednesday, R.string.week_thursday, R.string.week_friday, R.string.week_saturday };
+        else
+            weekdayResIds = new int[] { R.string.week_sunday_short, 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 };
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(date);
+        int dow = cal.get(Calendar.DAY_OF_WEEK);
+        int weekdayResId = weekdayResIds[dow-1];
+        return CampusAppContext.getInstance().getResString(weekdayResId);
+    }
+
 }
index e71066dd2f8c2eaa2b01ef72373ab950343288a1..f80aaacf307c935969f6dae62fe4916c087336a4 100644 (file)
@@ -77,8 +77,8 @@ public class NewsDatabaseHelper {
     public NewsItem[] getNewsItems(String source, long timeFrom, long timeTo) {
         String[] whereArgs = new String[] {
                 source,
-                Long.toString(timeFrom),
-                Long.toString(timeTo)
+                Long.toString(timeTo),
+                Long.toString(timeFrom)
         };
         Cursor resultSet = database.rawQuery("SELECT Id, Source, Time, UniqueId, ChkSum, Title, Summary, Content, Link, Categories FROM News WHERE Source = ? AND Time >= ? AND Time <= ?", whereArgs);
         ArrayList<NewsItem> results = new ArrayList<NewsItem>();
index 3ca9e022f562a8555b4c8772c1ac38b93102812d..10041e348946c757931652513d4385a9e952b62d 100644 (file)
@@ -62,7 +62,7 @@ public class AppSearch extends CampusAppFragment {
             AppContext = CampusAppContext.getInstance();
         oFragmentView = inflater.inflate(R.layout.fragment_appsearch, container, false);
 
-        AppContext.setTitle("Search: " + sSearchQuery);
+        AppContext.setTitle(AppContext.getResString(R.string.appsearch_title, sSearchQuery));
 
         ViewPager viewPager = (ViewPager) oFragmentView.findViewById(R.id.viewpager);
         setupViewPager(viewPager);
@@ -84,19 +84,19 @@ public class AppSearch extends CampusAppFragment {
             CampusAppFragment fragment;
             Bundle args = new Bundle();
             args.putString("query", sSearchQuery);
-            Log.i("AppSearch", "New result instances: "+sSearchQuery);
+            Log.i("AppSearch", "New result instances: " + sSearchQuery);
 
             fragment = new AppSearchInternal();
             fragment.setArguments(args);
-            adapter.addFragment("Campus App", fragment);
+            adapter.addFragment(AppContext.getResString(R.string.appsearch_inapp), fragment);
 
             fragment = new AppSearchDhbw();
             fragment.setArguments(args);
-            adapter.addFragment("DHBW Suche", fragment);
+            adapter.addFragment(AppContext.getResString(R.string.appsearch_indhbw), fragment);
 
             fragment = new AppSearchStuv();
             fragment.setArguments(args);
-            adapter.addFragment("Stuv Suche", fragment);
+            adapter.addFragment(AppContext.getResString(R.string.appsearch_instuv), fragment);
         }
 
         viewPager.setAdapter(adapter);
index 3159aca6cbcd56fe97a51e8d164f6622111e4595..7956c1f44ec594be1f6d0291c01f813c5a755fa8 100644 (file)
@@ -9,6 +9,7 @@ import android.view.View;
 import android.view.ViewGroup;
 import android.widget.AdapterView;
 import android.widget.ListView;
+import android.widget.ProgressBar;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -30,6 +31,7 @@ public class AppSearchDhbw extends CampusAppFragment implements AppSearchProvide
     private AppSearchListAdapter appSearchAdapter;
     private DhbwSearchHelper seachHelper;
     private ArrayList<AppSearchListItem> searchResultItems = new ArrayList<AppSearchListItem>();
+    private ProgressBar progressBar;
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
@@ -96,6 +98,8 @@ public class AppSearchDhbw extends CampusAppFragment implements AppSearchProvide
         if(bQueryExecuted && !reset)
             return;
         bQueryExecuted = true;
+        progressBar = (ProgressBar) oFragmentView.findViewById(R.id.searchProgress);
+        progressBar.setVisibility(View.VISIBLE);
 
         searchResultItems.clear();
 
@@ -107,6 +111,7 @@ public class AppSearchDhbw extends CampusAppFragment implements AppSearchProvide
                 Log.i("SearchDhbw", "Success: "+results.size());
                 for(AppSearchListItem result : results)
                     searchResultItems.add(result);
+                progressBar.setVisibility(View.GONE);
                 if(appSearchAdapter != null)
                     appSearchAdapter.notifyDataSetChanged();
                 else
@@ -116,6 +121,7 @@ public class AppSearchDhbw extends CampusAppFragment implements AppSearchProvide
             @Override
             public void onSearchFailed(String error) {
                 Log.i("SearchDhbw", "Failed: " + error);
+                progressBar.setVisibility(View.GONE);
             }
         });
     }
index 2c10dbb85e1f01f7cded267f1f1559a7edd7b71f..ddc662e3e4597ec966277a5b6225051eac62b949 100644 (file)
@@ -9,6 +9,7 @@ import android.view.View;
 import android.view.ViewGroup;
 import android.widget.AdapterView;
 import android.widget.ListView;
+import android.widget.ProgressBar;
 import android.widget.TextView;
 
 import java.util.ArrayList;
index 3aad66beb6d2e8846bf29bf73f532753dcaf5281..b1e6f83426007599254c13f16fd3dc2e02a09543 100644 (file)
@@ -9,6 +9,7 @@ import android.view.View;
 import android.view.ViewGroup;
 import android.widget.AdapterView;
 import android.widget.ListView;
+import android.widget.ProgressBar;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -32,6 +33,7 @@ public class AppSearchStuv extends CampusAppFragment implements AppSearchProvide
     private AppSearchListAdapter appSearchAdapter;
     private StuvSearchHelper seachHelper;
     private ArrayList<AppSearchListItem> searchResultItems = new ArrayList<AppSearchListItem>();
+    private ProgressBar progressBar;
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
@@ -94,6 +96,8 @@ public class AppSearchStuv extends CampusAppFragment implements AppSearchProvide
         if(bQueryExecuted && !reset)
             return;
         bQueryExecuted = true;
+        progressBar = (ProgressBar) oFragmentView.findViewById(R.id.searchProgress);
+        progressBar.setVisibility(View.VISIBLE);
 
         searchResultItems.clear();
 
@@ -105,6 +109,7 @@ public class AppSearchStuv extends CampusAppFragment implements AppSearchProvide
                 Log.i("SearchStuv", "Success: "+results.size());
                 for(AppSearchListItem result : results)
                     searchResultItems.add(result);
+                progressBar.setVisibility(View.GONE);
                 if(appSearchAdapter != null)
                     appSearchAdapter.notifyDataSetChanged();
             }
@@ -112,6 +117,7 @@ public class AppSearchStuv extends CampusAppFragment implements AppSearchProvide
             @Override
             public void onSearchFailed(String error) {
                 Log.i("SearchDhbw", "Failed: " + error);
+                progressBar.setVisibility(View.GONE);
             }
         });
 
index 79d1f657bbaf21199cc3b8d84ac026f36f8d2b52..574a4a786dee0f3d5feeeffa16742ad749113085 100644 (file)
@@ -10,6 +10,7 @@ import android.view.InflateException;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.ImageView;
 
 import de.dhbwloe.campusapp.R;
 import de.dhbwloe.campusapp.search.SearchIndices;
@@ -22,9 +23,9 @@ public class Dashboard extends CampusAppFragment {
                 new SearchIndices("Dashboard", true) {{
                     setUpdateTime(1);
                     setTarget("#Dashboard");
-                    setTitle("Dashboard");
-                    setDescription("Dashboard der App :)");
-                    addKeyWord("home, dashboard, start, übersicht, overview");
+                    setTitle(R.string.search_dashboard_title);
+                    setDescription(R.string.search_dashboard_description);
+                    addKeyWord(R.string.search_dashboard_keywords);
                 }},
         };
     }
@@ -33,8 +34,6 @@ public class Dashboard extends CampusAppFragment {
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-
-        AppContext.getDatabaseManager().setRuntimeCache("CourseName", "tif13a");
     }
 
     @Override
@@ -50,7 +49,7 @@ public class Dashboard extends CampusAppFragment {
             view = inflater.inflate(R.layout.fragment_dashboard, container, false);
         } catch (InflateException e) {
         }
-        AppContext.setTitle("Dashboard");
+        AppContext.setTitle(AppContext.getResString(R.string.dashboard_title));
 
         String kursTag = AppContext.getDatabaseManager().getRuntimeCache("CourseName");
         if(kursTag == null || kursTag.isEmpty()) {
@@ -58,6 +57,23 @@ public class Dashboard extends CampusAppFragment {
             timetable.setVisibility(View.GONE);
         }
 
+        ImageView image;
+        image = (ImageView)view.findViewById(R.id.timetable_image);
+        image.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                AppContext.getNavigationManager().navigatePage("Vorlesungsplan");
+            }
+        });
+
+        image = (ImageView)view.findViewById(R.id.mensa_image);
+        image.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                AppContext.getNavigationManager().navigatePage("Mensa");
+            }
+        });
+
         return view;
     }
 }
index 2d473a54a88c58254bde4bae59fdf8db18b2408d..ccc2589de39d9e6f7c4b650f02223d5252341565 100644 (file)
@@ -17,6 +17,7 @@ import java.util.Date;
 import de.dhbwloe.campusapp.CampusAppContext;
 import de.dhbwloe.campusapp.CampusAppFragment;
 import de.dhbwloe.campusapp.R;
+import de.dhbwloe.campusapp.Tools;
 import de.dhbwloe.campusapp.mensaplan.MensaTagesplan;
 
 /**
@@ -90,13 +91,11 @@ public class DashboardMensa extends CampusAppFragment {
         else if(now < date + (86400*2))
             datetext = AppContext.getResString(R.string.dashboard_calendar_tomorrow);
         else {
-            int weekdayResIds[] = new int[] { R.string.week_sunday, R.string.week_monday, R.string.week_tuesday, R.string.week_wednesday, R.string.week_thursday, R.string.week_friday, R.string.week_saturday };
-            Calendar cal = Calendar.getInstance();
-            cal.setTime(new Date(date * 1000));
-            int dow = cal.get(Calendar.DAY_OF_WEEK);
-            SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM");
+            Date dateObj = new Date(date * 1000);
+            String dayStr = Tools.getWeekdayString(dateObj);
+            SimpleDateFormat dateFormat = new SimpleDateFormat(AppContext.getResString(R.string.timeformat_dashboard_mensa));
 
-            datetext = AppContext.getResString(weekdayResIds[dow]) + ", " + dateFormat.format(cal.getTime());
+            datetext = dayStr + ", " + dateFormat.format(dateObj);
         }
         return datetext;
     }
index e67b364abc7cc9663cd69aa04b36233250c75285..bb0105d35a1c20f524d1d574b043dbea555ba8ae 100644 (file)
@@ -140,7 +140,7 @@ public class DashboardVorlesungsplan extends CampusAppFragment {
         Date date;
         TextView leftCol, rightCol = null;
         RelativeLayout.LayoutParams params;
-        SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm");
+        SimpleDateFormat dateFormat = new SimpleDateFormat(AppContext.getResString(R.string.timeformat_dashboard_vorlesungsplan_time));
         int firstLeftColId = 0;
 
         if(events.size() > 0) {
@@ -208,13 +208,10 @@ public class DashboardVorlesungsplan extends CampusAppFragment {
         else if(date1DayId == tomorrowDayId)
             datetext = AppContext.getResString(R.string.dashboard_calendar_tomorrow);
         else {
-            int weekdayResIds[] = new int[] { R.string.week_sunday, R.string.week_monday, R.string.week_tuesday, R.string.week_wednesday, R.string.week_thursday, R.string.week_friday, R.string.week_saturday };
-            Calendar cal = Calendar.getInstance();
-            cal.setTime(eventDate);
-            int dow = cal.get(Calendar.DAY_OF_WEEK);
-            SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM");
+            String dayStr = Tools.getWeekdayString(eventDate);
+            SimpleDateFormat dateFormat = new SimpleDateFormat(AppContext.getResString(R.string.timeformat_dashboard_vorlesungsplan_date));
 
-            datetext = AppContext.getResString(weekdayResIds[dow]) + ", " + dateFormat.format(eventDate);
+            datetext = dayStr + ", " + dateFormat.format(eventDate);
         }
         return datetext;
     }
index b84a9abb23c417e77f2548a30922a1c043d57b16..ac67163623ce719735f0f39b160a5394189d2f52 100644 (file)
@@ -7,6 +7,7 @@ import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.Button;
+import android.widget.EditText;
 
 import de.dhbwloe.campusapp.CampusAppFragment;
 import de.dhbwloe.campusapp.R;
@@ -15,23 +16,48 @@ import de.dhbwloe.campusapp.R;
  * A simple {@link Fragment} subclass.
  */
 public class FirstRun extends CampusAppFragment {
+    private View view;
 
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container,
                              Bundle savedInstanceState) {
-        View view = inflater.inflate(R.layout.fragment_first_run, container, false);
+        view = inflater.inflate(R.layout.fragment_first_run, container, false);
         AppContext.setTitle("Campus App");
+        final FirstRun that = this;
 
         Button startAppBtn = (Button)view.findViewById(R.id.startAppBtn);
         startAppBtn.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
-                AppContext.getDatabaseManager().setRuntimeCache("AppStartCounter", "1");
-                AppContext.getNavigationManager().navigatePage("SplashScreen", null, false);
+                that.startApp();
+            }
+        });
+
+        Button courseSendBtn = (Button)view.findViewById(R.id.courseSubmitBtn);
+        courseSendBtn.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if(that.setCourse())
+                    that.startApp();
             }
         });
 
         return view;
     }
 
+    private void startApp() {
+        AppContext.getDatabaseManager().setRuntimeCache("AppStartCounter", "1");
+        AppContext.getNavigationManager().navigatePage("SplashScreen", null, false);
+    }
+
+    private boolean setCourse() {
+        EditText courseInput = (EditText)view.findViewById(R.id.courseInput);
+        String courseName = courseInput.getText().toString();
+        if(courseName.length() <= 3)
+            return false;
+
+        AppContext.getDatabaseManager().setRuntimeCache("CourseName", courseName);
+        return true;
+    }
+
 }
index a888f2abb29e798fa815da12cce8659ce2c5e78d..66e09b33c2a8ad1f13738ea1300ebaf8bb720d0c 100644 (file)
@@ -7,6 +7,7 @@ import android.support.v4.app.FragmentActivity;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.TextView;
 
 import de.dhbwloe.campusapp.CampusAppFragment;
 import de.dhbwloe.campusapp.R;
@@ -22,9 +23,9 @@ public class Impressum extends CampusAppFragment {
                 new SearchIndices("Impressum", true) {{
                     setUpdateTime(1);
                     setTarget("#Impressum");
-                    setTitle("Impressum");
-                    setDescription("Impressum der App");
-                    addKeyWord("impressum, kontakt, autor, author, contact, imprint");
+                    setTitle(R.string.search_impressum_title);
+                    setDescription(R.string.search_impressum_description);
+                    addKeyWord(R.string.search_impressum_keywords);
                 }},
         };
     }
@@ -33,7 +34,17 @@ public class Impressum extends CampusAppFragment {
     public View onCreateView(LayoutInflater inflater, ViewGroup container,
                              Bundle savedInstanceState) {
         View view = inflater.inflate(R.layout.fragment_impressum, container, false);
-        AppContext.setTitle("Impressum");
+        AppContext.setTitle(AppContext.getResString(R.string.impressum_title));
+
+        TextView urlView = (TextView) view.findViewById(R.id.sourceUrl);
+        urlView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Bundle args = new Bundle();
+                args.putString("url", "http://dev.pk910.de/DHBWCampusApp");
+                AppContext.getNavigationManager().navigatePage("WebBrowser", args, false);
+            }
+        });
 
         return view;
     }
index 2d641de6d28bb1bb7bf88cd6f38eeeea48730fd9..3f911a2b0f55c63a166354d1d58f17a37d1e6eb2 100644 (file)
@@ -21,6 +21,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 +34,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 +60,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 +86,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 +133,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);
         }
index e465d7271bb66f6990d143c3489cfc6564bb16ed..93b91321879244419d637d4770c47e9598331337 100644 (file)
@@ -26,24 +26,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")) {
index 0a6f53ce55705d4c2ceee6b9e736ae71dd9b706c..7216738b9058bb2bc30891b36f4765f630fda3e9 100644 (file)
@@ -37,8 +37,8 @@ public class MensaTagesplan extends CampusAppFragment {
             setActiveOnLoad = true;
             return;
         }
-        SimpleDateFormat titleDateFormater = new SimpleDateFormat("dd.MM.yyyy");
-        AppContext.setTitle("Mensa: " + titleDateFormater.format(viewPlanDate));
+        SimpleDateFormat titleDateFormater = new SimpleDateFormat(AppContext.getResString(R.string.timeformat_mensa_titledate));
+        AppContext.setTitle(AppContext.getResString(R.string.mensa_dayplan_title, titleDateFormater.format(viewPlanDate)));
     }
 
     private void setupPlanDate() {
index 6a48b68fec5b538cb422855f81ae4ca20c255229..5efb4f7b429c4e68cbdaa00d305e400c461bceaf 100644 (file)
@@ -7,10 +7,21 @@ import android.support.v4.app.FragmentActivity;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.ListView;
+
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.ArrayList;
 
 import de.dhbwloe.campusapp.CampusAppFragment;
 import de.dhbwloe.campusapp.R;
+import de.dhbwloe.campusapp.news.NewsItem;
 import de.dhbwloe.campusapp.search.SearchIndices;
+import de.dhbwloe.campusapp.vorlesungen.CourseEvent;
 
 /**
  * A simple {@link Fragment} subclass.
@@ -22,21 +33,106 @@ public class News extends CampusAppFragment {
                 new SearchIndices("News", true) {{
                     setUpdateTime(1);
                     setTarget("#News");
-                    setTitle("News");
-                    setDescription("News der DHBW & Stuv");
-                    addKeyWord("news, dhbw, stuv, termin, termine");
+                    setTitle(R.string.search_news_title);
+                    setDescription(R.string.search_news_description);
+                    addKeyWord(R.string.search_news_keywords);
                 }},
         };
     }
 
+    private View view;
+    private NewsListAdapter listAdapter;
+    private ArrayList<NewsListItem> newsListItems = new ArrayList<NewsListItem>();
+
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container,
                              Bundle savedInstanceState) {
-        View view = inflater.inflate(R.layout.fragment_news, container, false);
-        AppContext.setTitle("News");
+        view = inflater.inflate(R.layout.fragment_news, container, false);
+        AppContext.setTitle(AppContext.getResString(R.string.news_title));
+
+        ListView newsItemsList = (ListView) view.findViewById(R.id.newsListView);
+        listAdapter = new NewsListAdapter(view.getContext(), R.layout.fragment_news_item, newsListItems);
+        newsItemsList.setAdapter(listAdapter);
+
+        CompoundButton.OnCheckedChangeListener changeListener = new CompoundButton.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+                refreshNewsItems();
+            }
+        };
+        ((CheckBox) view.findViewById(R.id.showDhbwNews)).setOnCheckedChangeListener(changeListener);
+        ((CheckBox) view.findViewById(R.id.showStuvNews)).setOnCheckedChangeListener(changeListener);
+        ((CheckBox) view.findViewById(R.id.showStuvEvents)).setOnCheckedChangeListener(changeListener);
 
+        newsItemsList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+            @Override
+            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+                NewsListItem item = newsListItems.get(position);
+                if (item == null)
+                    return;
+
+                String link = item.getLink();
+                if(link != null) {
+                    Bundle args = new Bundle();
+                    args.putString("url", link);
+                    AppContext.getNavigationManager().navigatePage("WebBrowser", args, false);
+                }
+            }
+        });
 
         return view;
     }
 
+    @Override
+    public void onResume() {
+        super.onResume();
+        refreshNewsItems();
+    }
+
+    private void refreshNewsItems() {
+        newsListItems.clear();
+
+        CheckBox showDhbwNewsChkbok = (CheckBox) view.findViewById(R.id.showDhbwNews);
+        CheckBox showStuvNewsChkbok = (CheckBox) view.findViewById(R.id.showStuvNews);
+        CheckBox showStuvEventsChkbok = (CheckBox) view.findViewById(R.id.showStuvEvents);
+
+        if(showDhbwNewsChkbok.isChecked()) {
+            loadNewsSource("DHBW", true);
+        }
+        if(showStuvNewsChkbok.isChecked()) {
+            loadNewsSource("STUV", false);
+        }
+        if(showStuvEventsChkbok.isChecked()) {
+            loadEventsSource("STUV", false);
+        }
+
+        Collections.sort(newsListItems, new Comparator<NewsListItem>() {
+            @Override
+            public int compare(NewsListItem item2, NewsListItem item1) {
+                long now = (new Date()).getTime()/1000;
+                return (int) (item2.getTimeDifference(now) - item1.getTimeDifference(now));
+            }
+        });
+        listAdapter.notifyDataSetChanged();
+    }
+
+    private void loadNewsSource(String sourceName, boolean isDhbw) {
+        long now = (new Date()).getTime() / 1000;
+
+        NewsItem[] news = AppContext.getDatabaseManager().getNewsItems(sourceName, now, now - (86400 * 30 * 6)); // load 6 month
+        for(NewsItem cnews : news) {
+            NewsListItem listItem = new NewsListItem(cnews, isDhbw);
+            newsListItems.add(listItem);
+        }
+    }
+
+    private void loadEventsSource(String sourceName, boolean isDhbw) {
+        long now = (new Date()).getTime() / 1000;
+
+        CourseEvent[] events = AppContext.getDatabaseManager().getCourseCalendarTimetable(sourceName, now, 30 * 6); // load 6 month
+        for(CourseEvent event : events) {
+            NewsListItem listItem = new NewsListItem(event, isDhbw);
+            newsListItems.add(listItem);
+        }
+    }
 }
diff --git a/app/src/main/java/de/dhbwloe/campusapp/fragments/NewsListAdapter.java b/app/src/main/java/de/dhbwloe/campusapp/fragments/NewsListAdapter.java
new file mode 100644 (file)
index 0000000..6de086e
--- /dev/null
@@ -0,0 +1,75 @@
+package de.dhbwloe.campusapp.fragments;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import java.util.ArrayList;
+
+import de.dhbwloe.campusapp.R;
+
+/**
+ * Created by pk910 on 27.02.2016.
+ */
+public class NewsListAdapter  extends ArrayAdapter<NewsListItem> {
+    private Context context;
+    private int layoutResourceId;
+    private ArrayList<NewsListItem> data = new ArrayList<NewsListItem>();
+
+    public NewsListAdapter(Context context, int layoutResourceId, ArrayList<NewsListItem> data) {
+        super(context, layoutResourceId, data);
+        this.layoutResourceId = layoutResourceId;
+        this.context = context;
+        this.data = data;
+    }
+
+    @Override
+    public View getView(int position, View convertView, ViewGroup parent) {
+        View row = convertView;
+        RecordHolder holder = null;
+
+        if (row == null) {
+            LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+            row = inflater.inflate(layoutResourceId, parent, false);
+
+            holder = new RecordHolder(row);
+            row.setTag(holder);
+        } else {
+            holder = (RecordHolder) row.getTag();
+        }
+
+        final NewsListAdapter that = this;
+        final NewsListItem item = data.get(position);
+
+        holder.newsTitle.setText(item.getFormatedDate() + ": " + item.getTitle());
+        holder.newsDescription.setText(item.getDescription());
+        if(item.isDhbwNews()) {
+            holder.newsDhbwLogo.setVisibility(View.VISIBLE);
+            holder.newsStuvLogo.setVisibility(View.GONE);
+        } else {
+            holder.newsDhbwLogo.setVisibility(View.GONE);
+            holder.newsStuvLogo.setVisibility(View.VISIBLE);
+        }
+
+        return row;
+    }
+
+    static class RecordHolder {
+        TextView newsTitle;
+        TextView newsDescription;
+        ImageView newsDhbwLogo;
+        ImageView newsStuvLogo;
+
+        public RecordHolder(View view) {
+            this.newsTitle = (TextView) view.findViewById(R.id.newsTitleView);
+            this.newsDescription = (TextView) view.findViewById(R.id.newsDescriptionView);
+
+            newsDhbwLogo = (ImageView) view.findViewById(R.id.dhbwLogo);
+            newsStuvLogo = (ImageView) view.findViewById(R.id.stuvLogo);
+        }
+    }
+}
diff --git a/app/src/main/java/de/dhbwloe/campusapp/fragments/NewsListItem.java b/app/src/main/java/de/dhbwloe/campusapp/fragments/NewsListItem.java
new file mode 100644 (file)
index 0000000..e0da6c4
--- /dev/null
@@ -0,0 +1,69 @@
+package de.dhbwloe.campusapp.fragments;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import de.dhbwloe.campusapp.CampusAppContext;
+import de.dhbwloe.campusapp.R;
+import de.dhbwloe.campusapp.news.NewsItem;
+import de.dhbwloe.campusapp.vorlesungen.CourseEvent;
+
+/**
+ * Created by pk910 on 27.02.2016.
+ */
+public class NewsListItem {
+    private String sNewsTitle;
+    private String sNewsDescription;
+    private String sNewsLink;
+    private long lNewsDate;
+    private boolean bIsDhbwNews;
+    private boolean bIsEvent;
+
+    public NewsListItem(NewsItem newsItem, boolean isDhbwNews) {
+        sNewsTitle = newsItem.getTitle();
+        sNewsDescription = newsItem.getSummary();
+        sNewsLink = newsItem.getLink();
+        lNewsDate = newsItem.getTime();
+        bIsDhbwNews = isDhbwNews;
+        bIsEvent = false;
+    }
+
+    public NewsListItem(CourseEvent newsEvent, boolean isDhbwEvent) {
+        sNewsTitle = newsEvent.getEventTitle();
+        sNewsDescription = newsEvent.getEventLocation();
+        sNewsLink = null;
+        lNewsDate = newsEvent.getEventFrom();
+        bIsDhbwNews = isDhbwEvent;
+        bIsEvent = true;
+    }
+
+    public long getTimeDifference(long now) {
+        return Math.abs(now - lNewsDate);
+    }
+
+    public String getTitle() {
+        return sNewsTitle;
+    }
+
+    public String getDescription() {
+        return sNewsDescription;
+    }
+
+    public boolean isDhbwNews() {
+        return bIsDhbwNews;
+    }
+
+    public String getFormatedDate() {
+        String dateFormat;
+        if(bIsEvent)
+            dateFormat = CampusAppContext.getInstance().getResString(R.string.timeformat_news_event);
+        else
+            dateFormat = CampusAppContext.getInstance().getResString(R.string.timeformat_news_news);
+        SimpleDateFormat format = new SimpleDateFormat(dateFormat);
+        return format.format(new Date(lNewsDate * 1000));
+    }
+
+    public String getLink() {
+        return sNewsLink;
+    }
+}
diff --git a/app/src/main/java/de/dhbwloe/campusapp/fragments/Settings.java b/app/src/main/java/de/dhbwloe/campusapp/fragments/Settings.java
new file mode 100644 (file)
index 0000000..85a4442
--- /dev/null
@@ -0,0 +1,31 @@
+package de.dhbwloe.campusapp.fragments;
+
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import de.dhbwloe.campusapp.CampusAppFragment;
+import de.dhbwloe.campusapp.R;
+
+/**
+ * A simple {@link Fragment} subclass.
+ */
+public class Settings extends CampusAppFragment {
+
+
+    public Settings() {
+        // Required empty public constructor
+    }
+
+
+    @Override
+    public View onCreateView(LayoutInflater inflater, ViewGroup container,
+                             Bundle savedInstanceState) {
+        // Inflate the layout for this fragment
+        return inflater.inflate(R.layout.fragment_settings, container, false);
+    }
+
+}
index 6428e632c009c8493e258decd4fdffdb4e3733b7..d4b8bb692e892aa8eee8b79b397d8cb51352268c 100644 (file)
@@ -35,16 +35,16 @@ public class Vorlesungsplan extends CampusAppFragment {
                 new SearchIndices("Vorlesungsplan", true) {{
                     setUpdateTime(1);
                     setTarget("#Vorlesungsplan");
-                    setTitle("Vorlesungsplan");
-                    setDescription("Vorlesungsplan dienes Kurses");
-                    addKeyWord("vorlesung, vorlesungen, plan, vorlesungsplan, stundenplan, termin, termine, kursplan, blockplan, block, zeit, zeiten");
+                    setTitle(R.string.search_vorlesungsplan_title);
+                    setDescription(R.string.search_vorlesungsplan_description);
+                    addKeyWord(R.string.search_vorlesungsplan_keywords);
                 }},
                 new SearchIndices("Vorlesungsplan", true) {{
                     setUpdateTime(1);
                     setTarget("#Vorlesungsplan#view=exams");
-                    setTitle("Vorlesungsplan");
-                    setDescription("Klausurübersicht dienes Kurses");
-                    addKeyWord("klausuren, prüfungen, exams, termine, zeitpunkt, plan, ergebnisse");
+                    setTitle(R.string.search_vorlesungsplan_klausur_title);
+                    setDescription(R.string.search_vorlesungsplan_klausur_description);
+                    addKeyWord(R.string.search_vorlesungsplan_klausur_keywords);
                 }},
         };
     }
@@ -53,7 +53,7 @@ public class Vorlesungsplan extends CampusAppFragment {
     public View onCreateView(LayoutInflater inflater, ViewGroup container,
                              Bundle savedInstanceState) {
         View view = inflater.inflate(R.layout.fragment_vorlesungsplan, container, false);
-        AppContext.setTitle("Vorlesungsplan");
+        AppContext.setTitle(AppContext.getResString(R.string.vorlesungsplan_title));
 
         ViewPager pager = (ViewPager) view.findViewById(R.id.viewpager);
         setupViewPager(pager);
index 01d6ee755eccb7cd7d9b78075814ae923d3ad1d8..73c5053c02ec451a95bd4559d6b985175ea62cf4 100644 (file)
@@ -3,6 +3,9 @@ package de.dhbwloe.campusapp.fragments;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
+import de.dhbwloe.campusapp.CampusAppContext;
+import de.dhbwloe.campusapp.R;
+
 /**
  * Created by pk910 on 20.02.2016.
  */
@@ -37,19 +40,25 @@ public class VorlesungsplanGroupsListItem {
     }
 
     public String getFirstEvent() {
-        SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy HH:mm");
+        if(firstEvent == 0)
+            return null;
+        SimpleDateFormat dateFormat = new SimpleDateFormat(CampusAppContext.getInstance().getResString(R.string.timeformat_vorlesungsplan_fulldate));
         Date date = new Date(firstEvent*1000);
         return dateFormat.format(date);
     }
 
     public String getLastEvent() {
-        SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy HH:mm");
+        if(lastEvent == 0)
+            return null;
+        SimpleDateFormat dateFormat = new SimpleDateFormat(CampusAppContext.getInstance().getResString(R.string.timeformat_vorlesungsplan_fulldate));
         Date date = new Date(lastEvent*1000);
         return dateFormat.format(date);
     }
 
     public String getNextEvent() {
-        SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy HH:mm");
+        if(nextEvent == 0)
+            return null;
+        SimpleDateFormat dateFormat = new SimpleDateFormat(CampusAppContext.getInstance().getResString(R.string.timeformat_vorlesungsplan_fulldate));
         Date date = new Date(nextEvent*1000);
         return dateFormat.format(date);
     }
@@ -57,7 +66,7 @@ public class VorlesungsplanGroupsListItem {
     public String getNextKlausurEvent() {
         if(nextKlausurEvent == 0)
             return null;
-        SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy HH:mm");
+        SimpleDateFormat dateFormat = new SimpleDateFormat(CampusAppContext.getInstance().getResString(R.string.timeformat_vorlesungsplan_fulldate));
         Date date = new Date(nextKlausurEvent*1000);
         return dateFormat.format(date);
     }
index e706e3f334068022a22e98ce1479fa7493f2f27b..6fc45f45227d8d834faa3751c4e9f7c929a8efe0 100644 (file)
@@ -24,7 +24,7 @@ public class VorlesungsplanUpcomingCourseListItem {
 
     public void updateContainerView(View view) {
 
-        SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm");
+        SimpleDateFormat dateFormat = new SimpleDateFormat(CampusAppContext.getInstance().getResString(R.string.timeformat_vorlesungsplan_time));
         TextView timeFrom = (TextView) view.findViewById(R.id.timeFrom);
         TextView timeTo = (TextView) view.findViewById(R.id.timeTo);
         TextView location = (TextView) view.findViewById(R.id.location);
index d8d1104b599132232b19317e8ab5d828fa1e420d..d9ced0c86b92c25c223ffe53f7004c389dfd3f07 100644 (file)
@@ -53,13 +53,13 @@ public class VorlesungsplanUpcomingDayListItem {
     }
 
     public String getFormatedDate() {
-        SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.");
+        SimpleDateFormat dateFormat = new SimpleDateFormat(CampusAppContext.getInstance().getResString(R.string.timeformat_vorlesungsplan_date));
         Date date = new Date(cardDate * 1000);
 
-        int weekdayResIds[] = new int[] { R.string.week_saturday, R.string.week_sunday, R.string.week_monday, R.string.week_tuesday, R.string.week_wednesday, R.string.week_thursday, R.string.week_friday };
+        int weekdayResIds[] = new int[] { R.string.week_sunday, R.string.week_monday, R.string.week_tuesday, R.string.week_wednesday, R.string.week_thursday, R.string.week_friday,  R.string.week_saturday };
         Calendar cal = Calendar.getInstance();
         cal.setTime(date);
-        int dow = cal.get(Calendar.DAY_OF_WEEK);
+        int dow = cal.get(Calendar.DAY_OF_WEEK)-1;
 
         return CampusAppContext.getInstance().getResString(weekdayResIds[dow]) + ", " + dateFormat.format(date);
     }
index 1ce70019a32a47e44d283259d6e0685076a9cee4..615d7badad4acf4424709fbe9d7cf748436f6ba4 100644 (file)
@@ -58,9 +58,9 @@ public class WifiSettings extends CampusAppFragment {
                 new SearchIndices("WifiSettings", true) {{
                     setUpdateTime(1);
                     setTarget("#WifiSettings");
-                    setTitle("Wifi Settings");
-                    setDescription("WLAN Konfiguration für dieses Gerät");
-                    addKeyWord("wlan, secure, dhbw-secure, wifi, w-lan, wireless, internet, netzwerk");
+                    setTitle(R.string.search_wifi_title);
+                    setDescription(R.string.search_wifi_description);
+                    addKeyWord(R.string.search_wifi_keywords);
                 }},
         };
     }
@@ -88,29 +88,31 @@ public class WifiSettings extends CampusAppFragment {
                     }
                 }
 
-                SupplicantState supl_state=((SupplicantState)intent.getParcelableExtra(WifiManager.EXTRA_NEW_STATE));
-                switch(supl_state){
-                    case ASSOCIATING:
-                        settings.isAssociating = true;
-                        settings.isAssociated = false;
-                        settings.isAuthenticated = false;
-                        settings.isDisconnected = false;
-                        break;
-                    case ASSOCIATED:
-                        settings.isAssociated = true;
-                        break;
-                    case COMPLETED:
-                        settings.isAuthenticated = true;
-                        break;
-                    case DISCONNECTED:
-                        settings.isAssociated = false;
-                        settings.isAssociating = false;
-                        settings.isDisconnected = true;
-                        break;
-                    default:
-                        break;
+                if(settings != null) {
+                    SupplicantState supl_state = ((SupplicantState) intent.getParcelableExtra(WifiManager.EXTRA_NEW_STATE));
+                    switch (supl_state) {
+                        case ASSOCIATING:
+                            settings.isAssociating = true;
+                            settings.isAssociated = false;
+                            settings.isAuthenticated = false;
+                            settings.isDisconnected = false;
+                            break;
+                        case ASSOCIATED:
+                            settings.isAssociated = true;
+                            break;
+                        case COMPLETED:
+                            settings.isAuthenticated = true;
+                            break;
+                        case DISCONNECTED:
+                            settings.isAssociated = false;
+                            settings.isAssociating = false;
+                            settings.isDisconnected = true;
+                            break;
+                        default:
+                            break;
+                    }
+                    updateWifiState();
                 }
-                updateWifiState();
             }
 
             NetworkInfo networkInfo = (NetworkInfo) intent.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO);
index 251c36cdf5557577950aff738a6c28c6ce6dea40..20ef99a50c76a21bca1485a4067e5c5eacc47bee 100644 (file)
@@ -64,7 +64,7 @@ public class MensaplanManager extends XmlRequestHelper {
         if (m.find()) {
             NumberFormat nf = NumberFormat.getInstance(Locale.GERMAN);
             try {
-                Number result =  nf.parse(m.group(1));
+                Number result = nf.parse(m.group(1));
                 return (int)(result.doubleValue()*100);
             } catch (ParseException e) {
                 return 0;
index fe1db98bb2d81a3adddf8d408ddcbbcef2e38d73..9b4cab5c65667be862449375059d6909c7e0cc14 100644 (file)
@@ -1,13 +1,16 @@
 package de.dhbwloe.campusapp.search;
 
+import java.util.ArrayList;
 import java.util.Date;
 
+import de.dhbwloe.campusapp.CampusAppContext;
+
 /**
  * Created by pk910 on 19.01.2016.
  */
 public class SearchIndices {
     private String keyname = null;
-    private StringBuffer keywordsBuffer = new StringBuffer();
+    private StringBuilder keywordsBuffer = new StringBuilder();
     protected boolean isStatic = false;
     protected String target = new String();
     protected String keywords = null;
@@ -31,6 +34,10 @@ public class SearchIndices {
         keywordsBuffer.append(words);
     }
 
+    public void addKeyWord(int words) {
+        addKeyWord(CampusAppContext.getInstance().getResString(words));
+    }
+
     public void setTarget(String target) {
         this.target = target;
     }
@@ -43,6 +50,14 @@ public class SearchIndices {
         this.title = title;
     }
 
+    public void setDescription(int description) {
+        this.description = CampusAppContext.getInstance().getResString(description);
+    }
+
+    public void setTitle(int title) {
+        this.title = CampusAppContext.getInstance().getResString(title);
+    }
+
     public void setUpdateTime(long updateTime) {
         this.updateTime = updateTime;
     }
index 3c1ba68509ac0d02e73314829168621042ece73e..96a561fec77d11204679350187d038c10e6a6101 100644 (file)
@@ -83,6 +83,7 @@ public class WifiNetworkSettings {
                 "uD3s1d70097Es++KwAg=\n" +
                 "-----END CERTIFICATE-----\n"));
 
+        /*
         presets.add((new WifiNetworkSettings("dhbw-802.1x", "dhbw-802.1x", WifiNetworkAuthenticationTypes.WIFI_AUTHTYPE_WPA_ENTERPRISE)).
                 setWpaEnterprise(
                         new int[]{WifiConfiguration.KeyMgmt.WPA_EAP, WifiConfiguration.KeyMgmt.IEEE8021X},
@@ -111,6 +112,7 @@ public class WifiNetworkSettings {
                 "xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU\n" +
                 "Cm26OWMohpLzGITY+9HPBVZkVw==\n" +
                 "-----END CERTIFICATE-----"));
+        */
 
         presets.add((new WifiNetworkSettings("eduroam", "eduroam", WifiNetworkAuthenticationTypes.WIFI_AUTHTYPE_WPA_ENTERPRISE)).
                 setWpaEnterprise(
diff --git a/app/src/main/res/drawable-hdpi/ic_announcement_black_24dp.png b/app/src/main/res/drawable-hdpi/ic_announcement_black_24dp.png
new file mode 100644 (file)
index 0000000..8353564
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_announcement_black_24dp.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_dashboard_black_24dp.png b/app/src/main/res/drawable-hdpi/ic_dashboard_black_24dp.png
new file mode 100644 (file)
index 0000000..b832916
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_dashboard_black_24dp.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_event_black_24dp.png b/app/src/main/res/drawable-hdpi/ic_event_black_24dp.png
new file mode 100644 (file)
index 0000000..0a71678
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_event_black_24dp.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_local_dining_black_24dp.png b/app/src/main/res/drawable-hdpi/ic_local_dining_black_24dp.png
new file mode 100644 (file)
index 0000000..c98123c
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_local_dining_black_24dp.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_wifi_black_24dp.png b/app/src/main/res/drawable-hdpi/ic_wifi_black_24dp.png
new file mode 100644 (file)
index 0000000..8a989e8
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_wifi_black_24dp.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_announcement_black_24dp.png b/app/src/main/res/drawable-mdpi/ic_announcement_black_24dp.png
new file mode 100644 (file)
index 0000000..4b2e82c
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_announcement_black_24dp.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_dashboard_black_24dp.png b/app/src/main/res/drawable-mdpi/ic_dashboard_black_24dp.png
new file mode 100644 (file)
index 0000000..c0cb862
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_dashboard_black_24dp.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_event_black_24dp.png b/app/src/main/res/drawable-mdpi/ic_event_black_24dp.png
new file mode 100644 (file)
index 0000000..c47f281
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_event_black_24dp.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_local_dining_black_24dp.png b/app/src/main/res/drawable-mdpi/ic_local_dining_black_24dp.png
new file mode 100644 (file)
index 0000000..f048dcf
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_local_dining_black_24dp.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_wifi_black_24dp.png b/app/src/main/res/drawable-mdpi/ic_wifi_black_24dp.png
new file mode 100644 (file)
index 0000000..c5bc88d
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_wifi_black_24dp.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_announcement_black_24dp.png b/app/src/main/res/drawable-xhdpi/ic_announcement_black_24dp.png
new file mode 100644 (file)
index 0000000..0d05bef
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_announcement_black_24dp.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_dashboard_black_24dp.png b/app/src/main/res/drawable-xhdpi/ic_dashboard_black_24dp.png
new file mode 100644 (file)
index 0000000..ba2911e
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_dashboard_black_24dp.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_event_black_24dp.png b/app/src/main/res/drawable-xhdpi/ic_event_black_24dp.png
new file mode 100644 (file)
index 0000000..4b3cefa
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_event_black_24dp.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_local_dining_black_24dp.png b/app/src/main/res/drawable-xhdpi/ic_local_dining_black_24dp.png
new file mode 100644 (file)
index 0000000..f5c20a7
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_local_dining_black_24dp.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_wifi_black_24dp.png b/app/src/main/res/drawable-xhdpi/ic_wifi_black_24dp.png
new file mode 100644 (file)
index 0000000..06f3975
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_wifi_black_24dp.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_announcement_black_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_announcement_black_24dp.png
new file mode 100644 (file)
index 0000000..b806076
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_announcement_black_24dp.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_dashboard_black_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_dashboard_black_24dp.png
new file mode 100644 (file)
index 0000000..ad14dfe
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_dashboard_black_24dp.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_event_black_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_event_black_24dp.png
new file mode 100644 (file)
index 0000000..2f5815d
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_event_black_24dp.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_local_dining_black_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_local_dining_black_24dp.png
new file mode 100644 (file)
index 0000000..5316cb7
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_local_dining_black_24dp.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_wifi_black_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_wifi_black_24dp.png
new file mode 100644 (file)
index 0000000..03d77fc
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_wifi_black_24dp.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/ic_announcement_black_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_announcement_black_24dp.png
new file mode 100644 (file)
index 0000000..dcec4d8
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_announcement_black_24dp.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/ic_dashboard_black_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_dashboard_black_24dp.png
new file mode 100644 (file)
index 0000000..8fad114
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_dashboard_black_24dp.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/ic_event_black_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_event_black_24dp.png
new file mode 100644 (file)
index 0000000..0458ac5
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_event_black_24dp.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/ic_local_dining_black_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_local_dining_black_24dp.png
new file mode 100644 (file)
index 0000000..7bcb121
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_local_dining_black_24dp.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/ic_wifi_black_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_wifi_black_24dp.png
new file mode 100644 (file)
index 0000000..7450747
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_wifi_black_24dp.png differ
diff --git a/app/src/main/res/drawable/news_toggle_background.xml b/app/src/main/res/drawable/news_toggle_background.xml
new file mode 100644 (file)
index 0000000..6bd2978
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_checked="false" android:color="@color/color_dhbw_lightgray"  />
+    <item android:state_checked="true" android:color="@color/color_dhbw_lightred"  />
+</selector>
\ No newline at end of file
index 994876f45dfcc6a9abe71326e0d3bb55a929f585..b23f1ea4298c42c1f63cf0cdaa5d45b17a01ae17 100644 (file)
@@ -33,7 +33,7 @@
                     <ImageView
                         android:layout_width="fill_parent"
                         android:layout_height="70dp"
-                        android:id="@+id/imageView4"
+                        android:id="@+id/timetable_image"
                         android:layout_alignParentTop="true"
                         android:layout_alignParentLeft="true"
                         android:layout_alignParentStart="true"
@@ -55,7 +55,7 @@
                         android:layout_width="match_parent"
                         android:layout_height="fill_parent"
                         android:name="de.dhbwloe.campusapp.fragments.DashboardVorlesungsplan"
-                        android:layout_below="@+id/imageView4"
+                        android:layout_below="@+id/timetable_image"
                         android:layout_alignParentLeft="true"
                         android:layout_alignParentStart="true"
                         android:id="@+id/fragment_timetable" />
@@ -76,7 +76,7 @@
                     <ImageView
                         android:layout_width="fill_parent"
                         android:layout_height="70dp"
-                        android:id="@+id/imageView5"
+                        android:id="@+id/mensa_image"
                         android:layout_alignParentTop="true"
                         android:layout_alignParentLeft="true"
                         android:layout_alignParentStart="true"
@@ -99,7 +99,7 @@
                         android:layout_height="fill_parent"
                         android:name="de.dhbwloe.campusapp.fragments.DashboardMensa"
                         android:id="@+id/fragment_mensa"
-                        android:layout_below="@+id/imageView5"
+                        android:layout_below="@+id/mensa_image"
                         android:layout_alignParentLeft="true"
                         android:layout_alignParentStart="true" />
 
index ee1c4334f04fa64c5e0c93c122627fa928574d41..3b191a0d8c1bf7783068c283a39093dbd06f8854 100644 (file)
@@ -1,4 +1,4 @@
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
         android:layout_height="wrap_content"
         android:id="@+id/searchResultItems"
         android:layout_gravity="bottom|left|right|top" />
-</LinearLayout>
+
+    <ProgressBar
+        style="?android:attr/progressBarStyleLarge"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:id="@+id/searchProgress"
+        android:layout_alignParentTop="true"
+        android:layout_centerHorizontal="true"
+        android:layout_marginTop="54dp"
+        android:visibility="gone" />
+</RelativeLayout>
index 4f0d324fcf71afc7eaa671bef418faac40ecd5ab..8c8ac467b0a20f7c4d78d38cbd644fe6415876fb 100644 (file)
@@ -22,7 +22,7 @@
             <ImageView
                 android:layout_width="fill_parent"
                 android:layout_height="70dp"
-                android:id="@+id/imageView4"
+                android:id="@+id/timetable_image"
                 android:layout_alignParentTop="true"
                 android:layout_alignParentLeft="true"
                 android:layout_alignParentStart="true"
@@ -44,7 +44,7 @@
                 android:layout_width="match_parent"
                 android:layout_height="fill_parent"
                 android:name="de.dhbwloe.campusapp.fragments.DashboardVorlesungsplan"
-                android:layout_below="@+id/imageView4"
+                android:layout_below="@+id/timetable_image"
                 android:layout_alignParentLeft="true"
                 android:layout_alignParentStart="true"
                 android:id="@+id/fragment_timetable"
@@ -67,7 +67,7 @@
             <ImageView
                 android:layout_width="fill_parent"
                 android:layout_height="70dp"
-                android:id="@+id/imageView5"
+                android:id="@+id/mensa_image"
                 android:layout_alignParentTop="true"
                 android:layout_alignParentLeft="true"
                 android:layout_alignParentStart="true"
@@ -90,7 +90,7 @@
                 android:layout_height="fill_parent"
                 android:name="de.dhbwloe.campusapp.fragments.DashboardMensa"
                 android:id="@+id/fragment_mensa"
-                android:layout_below="@+id/imageView5"
+                android:layout_below="@+id/mensa_image"
                 android:layout_alignParentLeft="true"
                 android:layout_alignParentStart="true"
                 tools:layout="@layout/fragment_dashboard_mensa_menu" />
index 8596249ac6139da54ae85aaa37654ce750994565..436457e07006d09ca8c1759c86364b05c3541571 100644 (file)
@@ -3,18 +3,80 @@
     android:orientation="vertical"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    tools:context="de.dhbwloe.campusapp.fragments.FirstRun">
+    tools:context="de.dhbwloe.campusapp.fragments.FirstRun"
+    android:padding="8dp">
 
-    <TextView
+    <RelativeLayout
         android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+
+        <TextView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:text="@string/firstrun_select_couse"
+            android:id="@+id/textView19" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/firstrun_select_couse_example"
+            android:id="@+id/textView20"
+            android:layout_below="@+id/textView19" />
+
+        <RelativeLayout
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerHorizontal="true"
+            android:layout_below="@+id/textView20">
+
+            <EditText
+                android:layout_width="150dp"
+                android:layout_height="wrap_content"
+                android:id="@+id/courseInput"
+                android:layout_gravity="center_horizontal"
+                android:layout_alignWithParentIfMissing="false" />
+
+            <Button
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/firstrun_course_ok_button"
+                android:id="@+id/courseSubmitBtn"
+                android:layout_toRightOf="@+id/courseInput" />
+        </RelativeLayout>
+
+    </RelativeLayout>
+
+    <TextView
+        android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:text="{FirstRun}" />
+        android:text="@string/firstrun_run_as_guest"
+        android:id="@+id/textView21"
+        android:layout_gravity="center_horizontal"
+        android:layout_marginTop="18dp" />
 
     <Button
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:text="Start App"
+        android:text="@string/firstrun_run_as_guest_button"
         android:id="@+id/startAppBtn"
         android:layout_gravity="center_horizontal" />
 
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/firstrun_settings_note"
+        android:id="@+id/textView22"
+        android:layout_gravity="center_horizontal"
+        android:layout_marginTop="18dp" />
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+        android:text="@string/firstrun_slow_note"
+        android:id="@+id/textView23"
+        android:layout_gravity="center_horizontal"
+        android:layout_marginTop="24dp"
+        android:textColor="@color/color_dhbw_lightgray" />
+
 </LinearLayout>
index 49216399928b1a8fe5e4c57d9f9359ecbaed7724..19408a55e9177ded850f904821028839100c7fc5 100644 (file)
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:orientation="vertical"
     tools:context="de.dhbwloe.campusapp.fragments.Impressum">
 
     <!-- TODO: Update blank fragment layout -->
-    <TextView
+
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="#000000">
+
+        <ImageView
+            android:layout_width="wrap_content"
+            android:layout_height="180dp"
+            android:id="@+id/imageView10"
+            android:src="@drawable/dhbw_campus" />
+
+        <ImageView
+            android:layout_width="wrap_content"
+            android:layout_height="80dp"
+            android:id="@+id/imageView9"
+            android:layout_gravity="center_horizontal"
+            android:src="@drawable/dhbw_logo"
+            android:scaleType="fitStart"
+            android:layout_marginLeft="8dp"
+            android:layout_marginTop="8dp" />
+    </RelativeLayout>
+
+    <RelativeLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:text="{Impressum}" />
+        android:layout_marginLeft="16dp"
+        android:layout_marginRight="16dp">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textAppearance="?android:attr/textAppearanceLarge"
+            android:text="@string/impressum_h1"
+            android:id="@+id/textView24"
+            android:layout_alignParentTop="true"
+            android:layout_centerHorizontal="true"
+            android:layout_marginTop="8dp" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/impressum_about"
+            android:id="@+id/textView25"
+            android:layout_below="@+id/textView24"
+            android:layout_alignParentLeft="true"
+            android:layout_alignParentStart="true"
+            android:layout_marginTop="8dp" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/impressum_author"
+            android:id="@+id/textView26"
+            android:layout_below="@+id/textView25"
+            android:layout_alignParentLeft="true"
+            android:layout_alignParentStart="true"
+            android:layout_marginTop="8dp" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="Philipp Kreil, Alexander Neumann, Kim Maier"
+            android:id="@+id/textView27"
+            android:layout_below="@+id/textView26"
+            android:layout_alignParentLeft="true"
+            android:layout_alignParentStart="true"
+            android:layout_marginLeft="26dp"
+            android:layout_marginStart="26dp"
+            android:layout_marginTop="8dp" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/impressum_source"
+            android:id="@+id/textView28"
+            android:layout_below="@+id/textView27"
+            android:layout_alignParentLeft="true"
+            android:layout_alignParentStart="true"
+            android:layout_marginTop="8dp" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="http://dev.pk910.de/DHBWCampusApp"
+            android:id="@+id/sourceUrl"
+            android:layout_below="@+id/textView28"
+            android:layout_alignLeft="@+id/textView27"
+            android:layout_alignStart="@+id/textView27"
+            android:textColor="#0000ff"
+            android:typeface="normal" />
+
+    </RelativeLayout>
 
-</FrameLayout>
+</LinearLayout>
index a4d4419cddba8172dce6928a8e83e36571cb38c2..a99cc88fdc9e02d4220a6ab24ec710558a6f1488 100644 (file)
@@ -1,13 +1,48 @@
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    tools:context="de.dhbwloe.campusapp.fragments.News">
+    tools:context="de.dhbwloe.campusapp.fragments.News"
+    android:orientation="vertical">
 
     <!-- TODO: Update blank fragment layout -->
-    <TextView
+
+    <LinearLayout
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:text="{News}" />
+        android:layout_height="30dp"
+        android:orientation="horizontal">
+
+        <CheckBox
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/news_toggle_dhbw"
+            android:id="@+id/showDhbwNews"
+            android:layout_marginLeft="8dp"
+            android:layout_marginRight="8dp"
+            android:checked="true" />
+
+        <CheckBox
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/news_toggle_stuv"
+            android:id="@+id/showStuvNews"
+            android:layout_marginLeft="8dp"
+            android:layout_marginRight="8dp"
+            android:checked="true" />
 
-</FrameLayout>
+        <CheckBox
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/news_toggle_stuv_events"
+            android:id="@+id/showStuvEvents"
+            android:layout_marginLeft="8dp"
+            android:layout_marginRight="8dp"
+            android:checked="true" />
+    </LinearLayout>
+
+    <ListView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:id="@+id/newsListView"
+        android:layout_gravity="center_horizontal" />
+</LinearLayout>
diff --git a/app/src/main/res/layout/fragment_news_item.xml b/app/src/main/res/layout/fragment_news_item.xml
new file mode 100644 (file)
index 0000000..6d743e6
--- /dev/null
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    xmlns:card_view="http://schemas.android.com/apk/res-auto"
+    android:orientation="vertical" android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
+        android:id="@+id/card_timetable"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_margin="8dp"
+        card_view:cardCornerRadius="5dp">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:paddingLeft="8dp"
+            android:paddingTop="4dp"
+            android:paddingRight="8dp"
+            android:paddingBottom="4dp"
+            android:orientation="horizontal"
+            android:id="@+id/newsItemLayout">
+
+            <RelativeLayout
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_weight="1">
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="{title}"
+                    android:id="@+id/newsTitleView" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="{description}"
+                    android:id="@+id/newsDescriptionView"
+                    android:layout_below="@+id/newsTitleView"
+                    android:layout_alignParentLeft="true"
+                    android:layout_alignParentStart="true" />
+            </RelativeLayout>
+
+            <RelativeLayout
+                android:layout_width="80dp"
+                android:layout_height="50dp"
+                android:layout_alignParentRight="true">
+
+                <ImageView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:id="@+id/dhbwLogo"
+                    android:src="@drawable/dhbw_logo"
+                    android:layout_alignParentTop="true"
+                    android:layout_alignParentLeft="true"
+                    android:layout_alignParentStart="true"
+                    android:scaleType="fitStart" />
+                <ImageView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:id="@+id/stuvLogo"
+                    android:src="@drawable/header_stuv"
+                    android:layout_alignParentTop="true"
+                    android:layout_alignParentLeft="true"
+                    android:layout_alignParentStart="true"
+                    android:scaleType="fitStart"
+                    android:visibility="visible" />
+
+            </RelativeLayout>
+
+        </LinearLayout>
+
+    </android.support.v7.widget.CardView>
+
+</LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_settings.xml b/app/src/main/res/layout/fragment_settings.xml
new file mode 100644 (file)
index 0000000..b193b50
--- /dev/null
@@ -0,0 +1,13 @@
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context="de.dhbwloe.campusapp.fragments.Settings">
+
+    <!-- TODO: Update blank fragment layout -->
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:text="@string/hello_blank_fragment" />
+
+</FrameLayout>
index 37e5d1ad2d9f4c4a1d33b59506cf6996e11dd711..ec25050a9f97e4c7ca2766e580af0259c8f208b6 100644 (file)
@@ -4,27 +4,31 @@
     <group android:checkableBehavior="single" android:title="Campus App">
         <item
             android:id="@+id/nav_dashboard"
-            android:icon="@drawable/ic_menu_camera"
+            android:icon="@drawable/ic_dashboard_black_24dp"
             android:title="Dashboard" />
         <item
             android:id="@+id/nav_vorlesungsplan"
-            android:icon="@drawable/ic_menu_gallery"
+            android:icon="@drawable/ic_event_black_24dp"
             android:title="Vorlesungsplan" />
         <item
             android:id="@+id/nav_mensa"
-            android:icon="@drawable/ic_menu_slideshow"
+            android:icon="@drawable/ic_local_dining_black_24dp"
             android:title="Mensa" />
         <item
             android:id="@+id/nav_news"
-            android:icon="@drawable/ic_menu_send"
+            android:icon="@drawable/ic_announcement_black_24dp"
             android:title="News" />
         <item
             android:id="@+id/nav_settings"
-            android:icon="@drawable/ic_menu_share"
+            android:icon="@android:drawable/ic_menu_preferences"
             android:title="Settings" />
+        <item
+            android:id="@+id/nav_wifi"
+            android:icon="@drawable/ic_wifi_black_24dp"
+            android:title="WLAN Konfigurieren" />
         <item
             android:id="@+id/nav_impressum"
-            android:icon="@drawable/ic_menu_send"
+            android:icon="@drawable/ic_info_black_24dp"
             android:title="Impressum" />
     </group>
 
index 8f539c416468c49eb2b4c743361c81fcc3431b6c..27b94936edd4c314b50f9cf4f902433ec294f060 100644 (file)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-    <color name="colorPrimary">#3F51B5</color>
-    <color name="colorPrimaryDark">#303F9F</color>
-    <color name="colorAccent">#FF4081</color>
+    <color name="colorPrimary">#E3001B</color>
+    <color name="colorPrimaryDark">#8D0011</color>
+    <color name="colorAccent">#7E878E</color>
 
     <color name="color_dhbw_darkred">#8D0011</color>
     <color name="color_dhbw_lightred">#E3001B</color>
index 1557a8bd87416068278d95d953911e344c98125d..523a4cd54a50fe3038aecaf2bef62bb21bbb7cf5 100644 (file)
     <string name="week_saturday_short">Sa</string>
     <string name="week_sunday_short">So</string>
 
-
+    <string name="timeformat_dashboard_mensa">dd.MM.</string>
+    <string name="timeformat_dashboard_vorlesungsplan_time">HH:mm</string>
+    <string name="timeformat_dashboard_vorlesungsplan_date">dd.MM.</string>
+    <string name="timeformat_mensa_titledate">dd.MM.yyyy</string>
+    <string name="timeformat_vorlesungsplan_fulldate">dd.MM.yyyy HH:mm</string>
+    <string name="timeformat_vorlesungsplan_time">HH:mm</string>
+    <string name="timeformat_vorlesungsplan_date">dd.MM.</string>
+    <string name="timeformat_news_event">dd.MM.yyy HH:mm</string>
+    <string name="timeformat_news_news">dd.MM.yyy</string>
+
+    <string name="appsearch_title">Search: %s</string>
+    <string name="appsearch_inapp">Campus App</string>
+    <string name="appsearch_indhbw">DHBW Suche</string>
+    <string name="appsearch_instuv">Stuv Suche</string>
+
+    <string name="search_dashboard_title">Dashboard</string>
+    <string name="search_dashboard_description">Dashboard der App :)</string>
+    <string name="search_dashboard_keywords">home, dashboard, start, übersicht, overview</string>
+    <string name="search_impressum_title">Impressum</string>
+    <string name="search_impressum_description">Impressum der App</string>
+    <string name="search_impressum_keywords">impressum, kontakt, autor, author, contact, imprint</string>
+    <string name="search_mensa_title">Mensa</string>
+    <string name="search_mensa_description">Aktuelle Mensapläne</string>
+    <string name="search_mensa_keywords">mensa, kantine, essen, mittagessen, mensaplan, plan, hunger, mittag</string>
+    <string name="search_news_title">News</string>
+    <string name="search_news_description">News der DHBW &amp; Stuv</string>
+    <string name="search_news_keywords">news, dhbw, stuv, termin, termine</string>
+    <string name="search_vorlesungsplan_title">Vorlesungsplan</string>
+    <string name="search_vorlesungsplan_description">Vorlesungsplan dienes Kurses</string>
+    <string name="search_vorlesungsplan_keywords">vorlesung, vorlesungen, plan, vorlesungsplan, stundenplan, termin, termine, kursplan, blockplan, block, zeit, zeiten</string>
+    <string name="search_vorlesungsplan_klausur_title">Vorlesungsplan</string>
+    <string name="search_vorlesungsplan_klausur_description">Klausurübersicht dienes Kurses</string>
+    <string name="search_vorlesungsplan_klausur_keywords">klausuren, prüfungen, exams, termine, zeitpunkt, plan, ergebnisse</string>
+    <string name="search_wifi_title">Wifi Settings</string>
+    <string name="search_wifi_description">WLAN Konfiguration für dieses Gerät</string>
+    <string name="search_wifi_keywords">wlan, secure, dhbw-secure, wifi, w-lan, wireless, internet, netzwerk</string>
+
+    <string name="dashboard_title">Dashboard</string>
+    <string name="dashboard_mensa_title">Mensaplan</string>
     <string name="dashboard_calendar_title">Vorlesungsplan</string>
     <string name="dashboard_calendar_today">Heute</string>
     <string name="dashboard_calendar_tomorrow">Morgen</string>
 
     <string name="dashboard_calendar_klausur">Klausur: </string>
 
+    <string name="mensa_title">Mensa Speiseplan</string>
+    <string name="mensa_dayplan_title">Speiseplan: %s</string>
     <string name="mensa_weekend">Hoch die Hände, Wochenende!</string>
+    <string name="mensacard_title">Mensa Guthaben</string>
+    <string name="mensacard_guthaben">Dein Guthaben:</string>
 
+    <string name="vorlesungsplan_title">Vorlesungsplan</string>
     <string name="vorlesungsplan_upcoming">Nächste Kurse</string>
     <string name="vorlesungsplan_groups">Kursübersicht</string>
     <string name="vorlesungsplan_exams">Klausurübersicht</string>
+    <string name="vorlesungsplan_show_old_courses">Vergangene Vorlesungen anzeigen</string>
+    <string name="vorlesungsplan_groups_nextevent">Nächste Vorlesung:</string>
+    <string name="vorlesungsplan_groups_lastevent">Letzte Vorlesung:</string>
+    <string name="vorlesungsplan_groups_nonext">- keine -</string>
+    <string name="vorlesungsplan_groups_noklausur">- keine -</string>
+    <string name="vorlesungsplan_groups_klausur">Klausur:</string>
+    <string name="vorlesungsplan_groups_praesi">Präsentation:</string>
+
+    <string name="impressum_title">Impressum</string>
+    <string name="impressum_h1">Campus App</string>
+    <string name="impressum_about">Diese App wurde im Rahmen der Vorlesung \n\'Entwicklung mobiler Apps\' erstellt.</string>
+    <string name="impressum_author">Entwickelt von:</string>
+    <string name="impressum_source">Sourcecode:</string>
+
+    <string name="news_title">News</string>
+    <string name="news_toggle_dhbw">DHBW News</string>
+    <string name="news_toggle_stuv">STUV News</string>
+    <string name="news_toggle_stuv_events">STUV Events</string>
+    <string name="news_followlink">mehr...</string>
+
+    <string name="firstrun_select_couse">Bitte tippe deine Kursbezeichnung ein:</string>
+    <string name="firstrun_select_couse_example">(Beispiel: tif13a, win14a, wwi15b)</string>
+    <string name="firstrun_course_ok_button">Ok</string>
+    <string name="firstrun_run_as_guest">Alternativ kannst du die App auch als Gast starten. Jedoch stehen im Gastmodus nicht alle Funktionen zur verfügung.</string>
+    <string name="firstrun_run_as_guest_button">Als Gast starten</string>
+    <string name="firstrun_settings_note">Du kannst deine Kursbezeichnung jederzeit in den App Einstellungen nachtragen oder verändern.</string>
+    <string name="firstrun_slow_note">Aufgrund der unglaublichen Geschwindigkeit der DHBW Infrastruktur kann der erste Start der App einen kurzen Moment dauern.</string>
+
+    <string name="wifisettings_psk_caption">PSK:</string>
+    <string name="wifisettings_insecure_network">Achtung: Dieses Netzwerk ist potentiell unsicher!</string>
 
     <string name="wifisettings_about_wifi">Die DHBW Lörrach bietet den Studenten verschiedene Möglichkeiten Geräte mit dem W-LAN zu verbinden. Mithilfe dieser App kannst du dein Gerät dazu konfigurieren sich unter berücksichtigung sicherheitsrelevanter Überprüfungen mit dem dhbw-secure Netzwerk zu verbinden.</string>
     <string name="wifisettings_ssid_caption">SSID:</string>
 
 
     <!-- Strings related to Settings -->
-
-    <!-- Example General settings -->
-    <string name="pref_header_general">General</string>
-
-    <string name="pref_title_social_recommendations">Enable social recommendations</string>
-    <string name="pref_description_social_recommendations">Recommendations for people to contact
-        based on your message history
-    </string>
-
-    <string name="pref_title_display_name">Display name</string>
-    <string name="pref_default_display_name">John Smith</string>
-
-    <string name="pref_title_add_friends_to_messages">Add friends to messages</string>
-    <string-array name="pref_example_list_titles">
-        <item>Always</item>
-        <item>When possible</item>
-        <item>Never</item>
+    <string name="pref_kurs">Kursbezeichnung (z.B. tif13a)</string>
+    <string name="pref_mensa_role">Arbeitsposition</string>
+    <string-array name="pref_mensa_role_titles">
+        <item>Student</item>
+        <item>Mitarbeiter</item>
+        <item>Schüler</item>
+        <item>Gast</item>
     </string-array>
-    <string-array name="pref_example_list_values">
-        <item>1</item>
+    <string-array name="pref_mensa_role_values">
         <item>0</item>
-        <item>-1</item>
-    </string-array>
-
-    <!-- Example settings for Data & Sync -->
-    <string name="pref_header_data_sync">Data &amp; sync</string>
-
-    <string name="pref_title_sync_frequency">Sync frequency</string>
-    <string-array name="pref_sync_frequency_titles">
-        <item>15 minutes</item>
-        <item>30 minutes</item>
-        <item>1 hour</item>
-        <item>3 hours</item>
-        <item>6 hours</item>
-        <item>Never</item>
-    </string-array>
-    <string-array name="pref_sync_frequency_values">
-        <item>15</item>
-        <item>30</item>
-        <item>60</item>
-        <item>180</item>
-        <item>360</item>
-        <item>-1</item>
+        <item>1</item>
+        <item>2</item>
+        <item>3</item>
     </string-array>
 
-    <string name="pref_title_system_sync_settings">System sync settings</string>
-
-    <!-- Example settings for Notifications -->
-    <string name="pref_header_notifications">Notifications</string>
-
-    <string name="pref_title_new_message_notifications">New message notifications</string>
-
-    <string name="pref_title_ringtone">Ringtone</string>
-    <string name="pref_ringtone_silent">Silent</string>
-
-    <string name="pref_title_vibrate">Vibrate</string>
 
     <!-- TODO: Remove or change this placeholder text -->
     <string name="hello_blank_fragment">Hello blank fragment</string>
-    <string name="mensacard_guthaben">Dein Guthaben:</string>
-    <string name="wifisettings_psk_caption">PSK:</string>
-    <string name="wifisettings_insecure_network">Achtung: Dieses Netzwerk ist potentiell unsicher!</string>
-    <string name="dashboard_mensa_title">Mensaplan</string>
-    <string name="vorlesungsplan_show_old_courses">Vergangene Vorlesungen anzeigen</string>
-    <string name="vorlesungsplan_groups_nextevent">Nächste Vorlesung:</string>
-    <string name="vorlesungsplan_groups_lastevent">Letzte Vorlesung:</string>
-    <string name="vorlesungsplan_groups_nonext">- keine -</string>
-    <string name="vorlesungsplan_groups_noklausur">- keine -</string>
-    <string name="vorlesungsplan_groups_klausur">Klausur:</string>
-    <string name="vorlesungsplan_groups_praesi">Präsentation:</string>
+
 </resources>
diff --git a/app/src/main/res/xml/pref_data_sync.xml b/app/src/main/res/xml/pref_data_sync.xml
deleted file mode 100644 (file)
index 6bd9192..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <!-- NOTE: Hide buttons to simplify the UI. Users can touch outside the dialog to
-         dismiss it. -->
-    <!-- NOTE: ListPreference's summary should be set to its value by the activity code. -->
-    <ListPreference
-        android:defaultValue="180"
-        android:entries="@array/pref_sync_frequency_titles"
-        android:entryValues="@array/pref_sync_frequency_values"
-        android:key="sync_frequency"
-        android:negativeButtonText="@null"
-        android:positiveButtonText="@null"
-        android:title="@string/pref_title_sync_frequency" />
-
-    <!-- This preference simply launches an intent when selected. Use this UI sparingly, per
-         design guidelines. -->
-    <Preference android:title="@string/pref_title_system_sync_settings">
-        <intent android:action="android.settings.SYNC_SETTINGS" />
-    </Preference>
-
-</PreferenceScreen>
diff --git a/app/src/main/res/xml/pref_general.xml b/app/src/main/res/xml/pref_general.xml
deleted file mode 100644 (file)
index 36569d6..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <SwitchPreference
-        android:defaultValue="true"
-        android:key="example_switch"
-        android:summary="@string/pref_description_social_recommendations"
-        android:title="@string/pref_title_social_recommendations" />
-
-    <!-- NOTE: EditTextPreference accepts EditText attributes. -->
-    <!-- NOTE: EditTextPreference's summary should be set to its value by the activity code. -->
-    <EditTextPreference
-        android:capitalize="words"
-        android:defaultValue="@string/pref_default_display_name"
-        android:inputType="textCapWords"
-        android:key="example_text"
-        android:maxLines="1"
-        android:selectAllOnFocus="true"
-        android:singleLine="true"
-        android:title="@string/pref_title_display_name" />
-
-    <!-- NOTE: Hide buttons to simplify the UI. Users can touch outside the dialog to
-         dismiss it. -->
-    <!-- NOTE: ListPreference's summary should be set to its value by the activity code. -->
-    <ListPreference
-        android:defaultValue="-1"
-        android:entries="@array/pref_example_list_titles"
-        android:entryValues="@array/pref_example_list_values"
-        android:key="example_list"
-        android:negativeButtonText="@null"
-        android:positiveButtonText="@null"
-        android:title="@string/pref_title_add_friends_to_messages" />
-
-</PreferenceScreen>
diff --git a/app/src/main/res/xml/pref_headers.xml b/app/src/main/res/xml/pref_headers.xml
deleted file mode 100644 (file)
index 367d096..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <!-- These settings headers are only used on tablets. -->
-
-    <header
-        android:fragment="de.dhbwloe.campusapp.SettingsActivity$GeneralPreferenceFragment"
-        android:icon="@drawable/ic_info_black_24dp"
-        android:title="@string/pref_header_general" />
-
-    <header
-        android:fragment="de.dhbwloe.campusapp.SettingsActivity$NotificationPreferenceFragment"
-        android:icon="@drawable/ic_notifications_black_24dp"
-        android:title="@string/pref_header_notifications" />
-
-    <header
-        android:fragment="de.dhbwloe.campusapp.SettingsActivity$DataSyncPreferenceFragment"
-        android:icon="@drawable/ic_sync_black_24dp"
-        android:title="@string/pref_header_data_sync" />
-
-</preference-headers>
diff --git a/app/src/main/res/xml/pref_notification.xml b/app/src/main/res/xml/pref_notification.xml
deleted file mode 100644 (file)
index e5a319e..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <!-- A 'parent' preference, which enables/disables child preferences (below)
-         when checked/unchecked. -->
-    <SwitchPreference
-        android:defaultValue="true"
-        android:key="notifications_new_message"
-        android:title="@string/pref_title_new_message_notifications" />
-
-    <!-- Allows the user to choose a ringtone in the 'notification' category. -->
-    <!-- NOTE: This preference will be enabled only when the checkbox above is checked. -->
-    <!-- NOTE: RingtonePreference's summary should be set to its value by the activity code. -->
-    <RingtonePreference
-        android:defaultValue="content://settings/system/notification_sound"
-        android:dependency="notifications_new_message"
-        android:key="notifications_new_message_ringtone"
-        android:ringtoneType="notification"
-        android:title="@string/pref_title_ringtone" />
-
-    <!-- NOTE: This preference will be enabled only when the checkbox above is checked. -->
-    <SwitchPreference
-        android:defaultValue="true"
-        android:dependency="notifications_new_message"
-        android:key="notifications_new_message_vibrate"
-        android:title="@string/pref_title_vibrate" />
-
-</PreferenceScreen>