Merge branch 'approximated-localizations' of s416084/find-my-tutor-android into develop
This commit is contained in:
commit
f4ea4a4378
@ -276,14 +276,12 @@ public abstract class BaseActivity
|
||||
|
||||
RxSearchObservable.fromView(searchView)
|
||||
.map(String::toLowerCase)
|
||||
.filter(t -> !t.trim().isEmpty())
|
||||
.debounce(300, TimeUnit.MILLISECONDS)
|
||||
.distinctUntilChanged()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(this::executeSearch);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -182,12 +182,10 @@ public class LoginActivity extends AppCompatActivity {
|
||||
Claim userId = jwt.getClaim("nameid");
|
||||
Claim role = jwt.getClaim("http://schemas.microsoft.com/ws/2008/06/identity/claims/role");
|
||||
|
||||
if(Objects.requireNonNull(role.asString()).equals("Student")){
|
||||
PrefUtils.storeIsTutor(getApplicationContext(), false);
|
||||
if(!Objects.requireNonNull(role.asString()).equals("Student")){
|
||||
PrefUtils.storeIsTutor(getApplicationContext(), true);
|
||||
}
|
||||
|
||||
Log.e("LOGOWANIE",role.asString());
|
||||
|
||||
|
||||
PrefUtils.storeIsLoggedIn(getApplicationContext(), true);
|
||||
PrefUtils.storeApiKey(getApplicationContext(), token);
|
||||
PrefUtils.storeUserId(getApplicationContext(), userId.asString());
|
||||
|
@ -595,7 +595,7 @@ public class MapActivity extends BaseActivity
|
||||
|
||||
private void getUserFromApi(String userNameToSearch) {
|
||||
disposable.add(
|
||||
userService.apiUsersGet()
|
||||
userService.getAllTutors()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.map(tutors -> Stream.of(tutors).filter(t ->
|
||||
|
@ -9,7 +9,6 @@ import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.widget.DefaultItemAnimator;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@ -170,7 +169,7 @@ public class UsersListFragment extends Fragment {
|
||||
|
||||
private void fetchAllTutors() {
|
||||
disposable.add(
|
||||
userService.apiUsersGet()
|
||||
userService.getAllTutors()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.map(tutors -> {
|
||||
|
@ -27,6 +27,9 @@ public interface UserService {
|
||||
@GET("api/users")
|
||||
Single <List<User>> apiUsersGet();
|
||||
|
||||
@GET("api/users/tutors")
|
||||
Single <List<User>> getAllTutors();
|
||||
|
||||
@POST("api/users")
|
||||
Completable createUser(@Body User user);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user