From 144d11528e08ab27e9634d282a9ae44ca7622912 Mon Sep 17 00:00:00 2001 From: "marcin.jedynski" Date: Mon, 26 Nov 2018 10:53:46 +0100 Subject: [PATCH] fixed == to equals in sharfrag switched to fakevalidate --- .../com/uam/wmi/findmytutor/activity/LoginActivity.java | 7 ++++--- .../com/uam/wmi/findmytutor/activity/SharingFragment.java | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/uam/wmi/findmytutor/activity/LoginActivity.java b/app/src/main/java/com/uam/wmi/findmytutor/activity/LoginActivity.java index 912598a..10792f0 100644 --- a/app/src/main/java/com/uam/wmi/findmytutor/activity/LoginActivity.java +++ b/app/src/main/java/com/uam/wmi/findmytutor/activity/LoginActivity.java @@ -153,9 +153,10 @@ public class LoginActivity extends AppCompatActivity { private void loginProcess(String email, String password) { - ValidateUser user = new ValidateUser(email, password); - - disposable.add(ldapService.validate(user) +// ValidateUser user = new ValidateUser(email, password); + LdapUser fakeuser = new LdapUser(email,password,"wmi","tutor","szalonoki","moody",email); +// disposable.add(ldapService.validate(user) + disposable.add(ldapService.fakeValidate(fakeuser) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(this::handleResponse, this::handleError)); diff --git a/app/src/main/java/com/uam/wmi/findmytutor/activity/SharingFragment.java b/app/src/main/java/com/uam/wmi/findmytutor/activity/SharingFragment.java index e08ad48..6771146 100644 --- a/app/src/main/java/com/uam/wmi/findmytutor/activity/SharingFragment.java +++ b/app/src/main/java/com/uam/wmi/findmytutor/activity/SharingFragment.java @@ -121,7 +121,7 @@ public class SharingFragment extends PreferenceFragment { /** Sharing level list **/ locationMode.setOnPreferenceChangeListener((preference, newValue) -> { PrefUtils.storeLocationMode(getApplicationContext(),locationLevelMapping.get(Integer.parseInt((String) newValue))); - if(PrefUtils.getLocationLevel(getApplicationContext()) == "manual"){ + if(PrefUtils.getLocationLevel(getApplicationContext()).equals("manual") ){ preferenceCategory.addPreference(manualLocationList); preferenceCategory.addPreference(manualLocationButton); @@ -140,6 +140,8 @@ public class SharingFragment extends PreferenceFragment { /** Custom manual location list change listener **/ manualLocationList.setOnPreferenceChangeListener((preference, newValue) -> { ListPreference lp = (ListPreference) preference; + CharSequence [] entries = lp.getEntries(); +// PrefUtils.putManualLocation(getApplicationContext(),(String) entries[Integer.parseInt((String) newValue)]); //ToDo handle manual location change return true;