From ff7119773f88e4c7fcb03d092a3435b3833fcdd9 Mon Sep 17 00:00:00 2001 From: eurosecom Date: Thu, 7 Sep 2017 21:18:16 +0200 Subject: [PATCH] Main Activity Attendance #2 - settings expanded by usuid, firebase user's uid saved by login to preferences - to use for logined user reports --- .../main/java/com/eusecom/attendance/SettingsActivity.java | 6 ++++++ app/src/main/res/xml/settings.xml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/app/src/main/java/com/eusecom/attendance/SettingsActivity.java b/app/src/main/java/com/eusecom/attendance/SettingsActivity.java index 1dd9ce5..c7bc4cb 100644 --- a/app/src/main/java/com/eusecom/attendance/SettingsActivity.java +++ b/app/src/main/java/com/eusecom/attendance/SettingsActivity.java @@ -13,6 +13,7 @@ public class SettingsActivity extends android.preference.PreferenceActivity { public static final String SERVER_NAME = "servername"; public static final String USER_PSW = "userpsw"; public static final String USER_NAME = "username"; + public static final String USER_UID = "usuid"; public static final String FIR = "fir"; public static final String USER_TYPE = "ustype"; public static final String USER_ICO = "usico"; @@ -40,6 +41,7 @@ protected void onPostCreate(Bundle savedInstanceState) { findPreference("usadmin").setEnabled(true); findPreference("usosc").setEnabled(true); findPreference("usico").setEnabled(true); + findPreference("usuid").setEnabled(true); } } @@ -61,6 +63,10 @@ public static String getUme(Context ctx){ public static String getUserName(Context ctx){ return PreferenceManager.getDefaultSharedPreferences(ctx).getString(USER_NAME, ""); } + + public static String getUserUid(Context ctx){ + return PreferenceManager.getDefaultSharedPreferences(ctx).getString(USER_UID, ""); + } public static String getUserPsw(Context ctx){ return PreferenceManager.getDefaultSharedPreferences(ctx).getString(USER_PSW, ""); diff --git a/app/src/main/res/xml/settings.xml b/app/src/main/res/xml/settings.xml index 3f04e89..712ed09 100644 --- a/app/src/main/res/xml/settings.xml +++ b/app/src/main/res/xml/settings.xml @@ -24,6 +24,12 @@ android:summary="@string/usname_summary" android:title="@string/usname_title" /> + +