Skip to content

Commit

Permalink
Main Activity Attendance
Browse files Browse the repository at this point in the history
#2
- settings expanded by usuid, firebase user's uid saved by login to
preferences
- to use for logined user reports
  • Loading branch information
eurosecom committed Sep 7, 2017
1 parent 1410976 commit ff71197
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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);
}
}

Expand All @@ -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, "");
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/xml/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
android:summary="@string/usname_summary"
android:title="@string/usname_title" />

<EditTextPreference
android:key="usuid"
android:enabled="false"
android:summary="@string/usuid_summary"
android:title="@string/usuid_title" />

<EditTextPreference
android:key="ustype"
android:enabled="false"
Expand Down

0 comments on commit ff71197

Please sign in to comment.