no misleading values but summary mising on fragment reload
This commit is contained in:
parent
5a8ec2d9fc
commit
f8abf61553
@ -21,6 +21,7 @@ import com.auth0.android.jwt.JWT;
|
||||
import com.jakewharton.retrofit2.adapter.rxjava2.HttpException;
|
||||
import com.uam.wmi.findmytutor.R;
|
||||
import com.uam.wmi.findmytutor.model.JwtToken;
|
||||
import com.uam.wmi.findmytutor.model.LdapUser;
|
||||
import com.uam.wmi.findmytutor.model.User;
|
||||
import com.uam.wmi.findmytutor.model.ValidateUser;
|
||||
import com.uam.wmi.findmytutor.network.ApiClient;
|
||||
@ -148,8 +149,10 @@ public class LoginActivity extends AppCompatActivity {
|
||||
|
||||
private void loginProcess(String email, String password) {
|
||||
ValidateUser user = new ValidateUser(email, password);
|
||||
|
||||
disposable.add(ldapService.validate(user)
|
||||
LdapUser fakeUser = new LdapUser(email, password,"wmi","tutor",email,"Fałszywy",email);
|
||||
// disposable.add(ldapService.fakeValidate(fakeUser)
|
||||
// disposable.add(ldapService.validate(user)
|
||||
disposable.add(ldapService.fakeValidate(fakeUser)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(this::handleResponse, this::handleError));
|
||||
|
@ -66,7 +66,7 @@ public class SharingFragment extends PreferenceFragment {
|
||||
@Override
|
||||
public void onSuccess(List<String> strings) {
|
||||
String[] statusesArray = strings.toArray(new String[strings.size()]);
|
||||
setListPreferenceData(statusList.getKey(), statusesArray,strings.size() -1);
|
||||
setListPreferenceData(statusList.getKey(), statusesArray,null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -120,7 +120,6 @@ public class SharingFragment extends PreferenceFragment {
|
||||
manualLocationButton = (RightButtonPreference) findPreference("manual_location_button");
|
||||
manualStatus = findPreference("key_manual_status");
|
||||
statusList = (ListPreference) findPreference("key_status_value");
|
||||
|
||||
statusesService = ApiClient.getClient(getApplicationContext()).create(PredefinedStatusesService.class);
|
||||
disposable = new CompositeDisposable();
|
||||
getStatuses(disposable);
|
||||
@ -128,6 +127,10 @@ public class SharingFragment extends PreferenceFragment {
|
||||
if (PrefUtils.getLocationLevel(getApplicationContext()).equals("manual")) {
|
||||
getLocations(disposable);
|
||||
}
|
||||
Log.d("SHAR TAB", (String) statusList.getSummary());
|
||||
Log.d("SHAR TAB",( String) manualLocationList.getSummary());
|
||||
// Log.d("SHAR TAB","dupa");
|
||||
|
||||
|
||||
locationLevelMapping = new HashMap<Integer, String>();
|
||||
locationLevelMapping.put(0, SharingLevel.PRESENCE.toString());
|
||||
|
@ -26,8 +26,6 @@
|
||||
android:title="@string/title_location_level" />
|
||||
<ListPreference
|
||||
android:key="key_manual_location_value"
|
||||
android:entries="@array/manual_location_entries"
|
||||
android:entryValues="@array/manual_location_values"
|
||||
android:summary="%s"
|
||||
android:title="@string/title_list_manual_location" />
|
||||
<com.uam.wmi.findmytutor.utils.RightButtonPreference
|
||||
@ -45,8 +43,6 @@
|
||||
<ListPreference
|
||||
android:defaultValue="1"
|
||||
android:key="@string/key_status_value"
|
||||
android:entries="@array/status_entries"
|
||||
android:entryValues="@array/status_values"
|
||||
android:summary="%s"
|
||||
android:title="@string/status_list_title" />
|
||||
<EditTextPreference
|
||||
|
Loading…
Reference in New Issue
Block a user