redesigned sharing tab, hooked to the backend, minor language upgrades, added status switch handling to the background task #41
@ -275,14 +275,12 @@ public abstract class BaseActivity
|
|||||||
|
|
||||||
RxSearchObservable.fromView(searchView)
|
RxSearchObservable.fromView(searchView)
|
||||||
.map(String::toLowerCase)
|
.map(String::toLowerCase)
|
||||||
.filter(t -> !t.trim().isEmpty())
|
|
||||||
.debounce(300, TimeUnit.MILLISECONDS)
|
.debounce(300, TimeUnit.MILLISECONDS)
|
||||||
.distinctUntilChanged()
|
.distinctUntilChanged()
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(this::executeSearch);
|
.subscribe(this::executeSearch);
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -582,7 +582,7 @@ public class MapActivity extends BaseActivity
|
|||||||
|
|
||||||
private void getUserFromApi(String userNameToSearch) {
|
private void getUserFromApi(String userNameToSearch) {
|
||||||
disposable.add(
|
disposable.add(
|
||||||
userService.apiUsersGet()
|
userService.getAllTutors()
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.map(tutors -> Stream.of(tutors).filter(t ->
|
.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.DefaultItemAnimator;
|
||||||
import android.support.v7.widget.LinearLayoutManager;
|
import android.support.v7.widget.LinearLayoutManager;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@ -170,7 +169,7 @@ public class UsersListFragment extends Fragment {
|
|||||||
|
|
||||||
private void fetchAllTutors() {
|
private void fetchAllTutors() {
|
||||||
disposable.add(
|
disposable.add(
|
||||||
userService.apiUsersGet()
|
userService.getAllTutors()
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.map(tutors -> {
|
.map(tutors -> {
|
||||||
|
@ -27,6 +27,9 @@ public interface UserService {
|
|||||||
@GET("api/users")
|
@GET("api/users")
|
||||||
Single <List<User>> apiUsersGet();
|
Single <List<User>> apiUsersGet();
|
||||||
|
|
||||||
|
@GET("api/users/tutors")
|
||||||
|
Single <List<User>> getAllTutors();
|
||||||
|
|
||||||
@POST("api/users")
|
@POST("api/users")
|
||||||
Completable createUser(@Body User user);
|
Completable createUser(@Body User user);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user