diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 6ec636c..5e716d0 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -32,16 +32,19 @@
+ android:launchMode="singleTop" />
+ android:noHistory="true" />
+
\ No newline at end of file
diff --git a/app/src/main/java/com/uam/wmi/findmytutor/activity/SettingsActivity.java b/app/src/main/java/com/uam/wmi/findmytutor/activity/SettingsActivity.java
index c96bd42..13b75a1 100644
--- a/app/src/main/java/com/uam/wmi/findmytutor/activity/SettingsActivity.java
+++ b/app/src/main/java/com/uam/wmi/findmytutor/activity/SettingsActivity.java
@@ -1,5 +1,6 @@
package com.uam.wmi.findmytutor.activity;
+import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
@@ -43,6 +44,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
}
});
}
+
}
@Override
diff --git a/app/src/main/java/com/uam/wmi/findmytutor/activity/SharingActivity.java b/app/src/main/java/com/uam/wmi/findmytutor/activity/SharingActivity.java
new file mode 100644
index 0000000..625359d
--- /dev/null
+++ b/app/src/main/java/com/uam/wmi/findmytutor/activity/SharingActivity.java
@@ -0,0 +1,134 @@
+package com.uam.wmi.findmytutor.activity;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.os.Build;
+import android.os.Bundle;
+import android.preference.EditTextPreference;
+import android.preference.ListPreference;
+import android.preference.Preference;
+import android.preference.PreferenceFragment;
+import android.preference.PreferenceManager;
+import android.view.MenuItem;
+import com.uam.wmi.findmytutor.R;
+
+
+public class SharingActivity extends AppCompatPreferenceActivity {
+ //rivate static final String TAG = SettingsActivity.class.getSimpleName();
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ //getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+
+ // load settings fragment
+ getFragmentManager().beginTransaction().replace(android.R.id.content, new MainPreferenceFragment()).commit();
+ }
+
+ public static class MainPreferenceFragment extends PreferenceFragment {
+ @Override
+ public void onCreate(final Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ addPreferencesFromResource(R.xml.pref_sharing);
+ //setListPreferenceData("key_description",getActivity());
+ // feedback preference click listener
+/* Preference myPref = findPreference(getString(R.string.key_send_feedback));
+ myPref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
+ public boolean onPreferenceClick(Preference preference) {
+ sendFeedback(getActivity());
+ return true;
+ }
+ });*/
+ }
+ protected ListPreference setListPreferenceData(String lp_name, Activity mActivity) {
+ ListPreference lp = (ListPreference) findPreference(lp_name);
+
+ CharSequence[] entries = { "One", "Two", "Three" };
+ CharSequence[] entryValues = { "1", "2", "3" };
+ if(lp == null)
+ lp = new ListPreference(mActivity);
+ lp.setEntries(entries);
+ lp.setDefaultValue("1");
+ lp.setEntryValues(entryValues);
+ lp.setTitle("Number Of blahs");
+ lp.setSummary(lp.getEntry());
+ lp.setDialogTitle("Number of Blah objects");
+ lp.setKey(lp_name);
+ return lp;
+ }
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ if (item.getItemId() == android.R.id.home) {
+ onBackPressed();
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
+ private static void bindPreferenceSummaryToValue(Preference preference) {
+ preference.setOnPreferenceChangeListener(sBindPreferenceSummaryToValueListener);
+
+ sBindPreferenceSummaryToValueListener.onPreferenceChange(preference,
+ PreferenceManager
+ .getDefaultSharedPreferences(preference.getContext())
+ .getString(preference.getKey(), ""));
+ }
+
+ /**
+ * 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 newValue) {
+ String stringValue = newValue.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 EditTextPreference) {
+ if (preference.getKey().equals("key_gallery_name")) {
+ // update the changed gallery name to summary filed
+ preference.setSummary(stringValue);
+ }
+ } else {
+ preference.setSummary(stringValue);
+ }
+ return true;
+ }
+ };
+
+ /**
+ * Email client intent to send support mail
+ * Appends the necessary device information to email body
+ * useful when providing support
+ */
+ public static void sendFeedback(Context context) {
+ String body = null;
+ try {
+ body = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
+ body = "\n\n-----------------------------\nPlease don't remove this information\n Device OS: Android \n Device OS version: " +
+ Build.VERSION.RELEASE + "\n App Version: " + body + "\n Device Brand: " + Build.BRAND +
+ "\n Device Model: " + Build.MODEL + "\n Device Manufacturer: " + Build.MANUFACTURER;
+ } catch (PackageManager.NameNotFoundException e) {
+ }
+ Intent intent = new Intent(Intent.ACTION_SEND);
+ intent.setType("message/rfc822");
+ intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"team@findmytutor.com"});
+ intent.putExtra(Intent.EXTRA_SUBJECT, "Query from android app");
+ intent.putExtra(Intent.EXTRA_TEXT, body);
+ context.startActivity(Intent.createChooser(intent, context.getString(R.string.choose_email_client)));
+ }
+}
diff --git a/app/src/main/java/com/uam/wmi/findmytutor/activity/StartupActivity.java b/app/src/main/java/com/uam/wmi/findmytutor/activity/StartupActivity.java
index 1839d37..66dc07d 100644
--- a/app/src/main/java/com/uam/wmi/findmytutor/activity/StartupActivity.java
+++ b/app/src/main/java/com/uam/wmi/findmytutor/activity/StartupActivity.java
@@ -13,7 +13,7 @@ public class StartupActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
//uncomment for testin settings activity and comment the rest of onCreate body
- startActivity(new Intent(this, SettingsActivity.class));
+ startActivity(new Intent(this, SharingActivity.class));
/* if (isLoggedIn()){
Intent startupIntent = new Intent(this, MainActivity.class);
diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml
index c843678..6383218 100644
--- a/app/src/main/res/layout/activity_login.xml
+++ b/app/src/main/res/layout/activity_login.xml
@@ -67,7 +67,7 @@
diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml
index 392f881..5a62888 100644
--- a/app/src/main/res/values-pl/strings.xml
+++ b/app/src/main/res/values-pl/strings.xml
@@ -7,7 +7,11 @@
Hasło jest zbyt krótkie
Nieprawidłowy mail
To pole jest wymagane
+
+
+
+ Udostępnianie
Udostępnianie lokalizacji
Poziom udostępniania
Obecność
diff --git a/app/src/main/res/values/array.xml b/app/src/main/res/values/array.xml
index 5d3ce73..53655a8 100644
--- a/app/src/main/res/values/array.xml
+++ b/app/src/main/res/values/array.xml
@@ -50,12 +50,12 @@
- 1
- 2
-
- - @string/description_awaiting
- - @string/description_notdisturb
- - @string/description_onholidays
+
+ - @string/description_available
+ - @string/description_busy
+ - @string/description_consultation
-
+
- 0
- 1
- 2
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index c000d31..d6e0c35 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -39,22 +39,41 @@
White List
Settings
+
+
+
+
+ Sharing
+
+
+
+ Sharing
+
Location sharing
Sharing level
Only presence
Approximated
- Precise
+ Exact
Location level
key_location_level
- Status
- Do not disturb
- Awaiting for students
- On Holidays
+ Choose status
+ Status
+ Busy
+ Available
+ Consultation
+ Add custom status
+
+
+
Descrition
key_description
+
+ Manual location
+ Add custom location
+
General
key_notifications_enabled
Enable notifications
@@ -78,4 +97,77 @@
http://findmytutor.projektstudencki.pl/terms-of-service/
Version
Choose email client
+ Settings
+
+
+
+
+ General
+
+ Enable social recommendations
+ Recommendations for people to contact
+ based on your message history
+
+
+ Display name
+ John Smith
+
+ Add friends to messages
+
+ - Always
+ - When possible
+ - Never
+
+
+ - 1
+ - 0
+ - -1
+
+
+
+ Data & sync
+
+ Sync frequency
+
+ - 15 minutes
+ - 30 minutes
+ - 1 hour
+ - 3 hours
+ - 6 hours
+ - Never
+
+
+ - 15
+ - 30
+ - 60
+ - 180
+ - 360
+ - -1
+
+
+
+ - Entry 1
+ - Entry 2
+ - Entry 3
+
+
+
+ - 1
+ - 2
+ - 3
+
+
+
+
+ System sync settings
+
+
+ Notifications
+
+ New message notifications
+
+ Ringtone
+ Silent
+
+ Vibrate
diff --git a/app/src/main/res/xml/pref_main.xml b/app/src/main/res/xml/pref_main.xml
index e73fc95..0c13e23 100644
--- a/app/src/main/res/xml/pref_main.xml
+++ b/app/src/main/res/xml/pref_main.xml
@@ -1,26 +1,12 @@
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/xml/pref_sharing.xml b/app/src/main/res/xml/pref_sharing.xml
new file mode 100644
index 0000000..cc0ab6b
--- /dev/null
+++ b/app/src/main/res/xml/pref_sharing.xml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file