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