blacklist ready to test

This commit is contained in:
Domagalski 2018-12-30 21:14:10 +01:00
parent 84e6b95675
commit 87642c5d7a
13 changed files with 276 additions and 152 deletions

View File

@ -29,7 +29,7 @@
</value> </value>
</option> </option>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8 (1)" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">

View File

@ -1,6 +1,7 @@
package com.uam.wmi.findmytutor.activity; package com.uam.wmi.findmytutor.activity;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle; import android.os.Bundle;
import android.support.design.widget.CoordinatorLayout; import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.FloatingActionButton; import android.support.design.widget.FloatingActionButton;
@ -14,18 +15,28 @@ import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.WindowManager;
import android.widget.Button; import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.EditText; import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.Switch;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import android.widget.ToggleButton;
import com.jakewharton.retrofit2.adapter.rxjava2.HttpException; import com.jakewharton.retrofit2.adapter.rxjava2.HttpException;
import com.mapbox.geojson.Point; import com.mapbox.geojson.Point;
import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.geometry.LatLng;
import com.uam.wmi.findmytutor.R; import com.uam.wmi.findmytutor.R;
import com.uam.wmi.findmytutor.adapters.BlackListAdapter; import com.uam.wmi.findmytutor.adapters.BlackListAdapter;
import com.uam.wmi.findmytutor.model.IsUsingListBool;
import com.uam.wmi.findmytutor.model.PredefinedCoordViewModel; import com.uam.wmi.findmytutor.model.PredefinedCoordViewModel;
import com.uam.wmi.findmytutor.model.StudentIdModel; import com.uam.wmi.findmytutor.model.StudentIdModel;
import com.uam.wmi.findmytutor.model.User; import com.uam.wmi.findmytutor.model.User;
@ -40,7 +51,9 @@ import com.uam.wmi.findmytutor.utils.RestApiHelper;
import com.uam.wmi.findmytutor.utils.SharingLevel; import com.uam.wmi.findmytutor.utils.SharingLevel;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set;
import butterknife.BindView; import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
@ -54,18 +67,21 @@ public class BlackList extends AppCompatActivity {
private CompositeDisposable disposable = new CompositeDisposable(); private CompositeDisposable disposable = new CompositeDisposable();
private UserService userService; private UserService userService;
private boolean didFetched = false;
private String tutorId;
@BindView(R.id.recycler_view) @BindView(R.id.recycler_view)
RecyclerView recyclerView; RecyclerView recyclerView;
@BindView(R.id.black_list_empty_text_view) @BindView(R.id.black_list_empty_text_view)
TextView noNotesView; TextView noNotesView;
@BindView(R.id.switch_blacklist_toggle)
Switch aSwitch;
@BindView(R.id.add_to_black_list_fab) @BindView(R.id.add_to_black_list_fab)
FloatingActionButton addToBlackListFab; FloatingActionButton addToBlackListFab;
private BlackListAdapter mAdapter; private BlackListAdapter mAdapter;
private List<User> blacklistedUsers = new ArrayList<>(); private List<User> blacklistedUsers = new ArrayList<>();
private HashSet<String> blacklistedUsersIDs = new HashSet<>();
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@ -73,9 +89,11 @@ public class BlackList extends AppCompatActivity {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
setContentView(R.layout.activity_black_list); setContentView(R.layout.activity_black_list);
ButterKnife.bind(this); ButterKnife.bind(this);
aSwitch.setText(getString(R.string.blacklist) +" ON");
tutorId = PrefUtils.getUserId(getApplicationContext());
Toolbar toolbar = findViewById(R.id.toolbar); Toolbar toolbar = findViewById(R.id.toolbar);
toolbar.setTitle(getString(R.string.activity_title_home)); toolbar.setTitle(getString(R.string.activity_title_blacklist));
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
userService = ApiClient.getClient(getApplicationContext()) userService = ApiClient.getClient(getApplicationContext())
@ -101,31 +119,26 @@ public class BlackList extends AppCompatActivity {
@Override @Override
public void onLongClick(View view, int position) { public void onLongClick(View view, int position) {
} }
})); }));
addToBlackListFab.setOnClickListener(this::showFabDialog); addToBlackListFab.setOnClickListener(this::showFabDialog);
fetchBlackListedUsers(PrefUtils.getUserId(getApplicationContext())); fetchBlackListedUsersIDs(PrefUtils.getUserId(getApplicationContext()));
handleSwitch();
} }
private void fetchBlackListedUsers(String userId) { private void fetchBlackListedUsersIDs(String userId) {
disposable.add( disposable.add(
userService.getTutorBlacklistedByID(userId) userService.getTutorBlacklistedByID(userId)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribeWith(new DisposableSingleObserver<List<User>>() { .subscribeWith(new DisposableSingleObserver<List<String>>() {
@Override @Override
public void onSuccess(List<User> users) { public void onSuccess(List<String> users) {
blacklistedUsers.addAll(users); blacklistedUsersIDs.addAll(users);
didFetched = true;
mAdapter.notifyDataSetChanged(); fetchBlackListedUsers();
Log.e("BLACKLIST","fetch success");
Snackbar.make(getWindow().getDecorView().getRootView(), "fetch success", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
toggleEmptyNotes(); toggleEmptyNotes();
} }
@ -137,6 +150,33 @@ public class BlackList extends AppCompatActivity {
); );
} }
private void fetchBlackListedUsers() {
for (String GUID : blacklistedUsersIDs){
disposable.add(
userService.getUserById(GUID)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribeWith(new DisposableSingleObserver<User>() {
@Override
public void onSuccess(User user) {
blacklistedUsers.add(user);
Snackbar.make(getWindow().getDecorView().getRootView(), "user fetch OK! success", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
toggleEmptyNotes();
if (blacklistedUsers.size() == blacklistedUsersIDs.size()) {
mAdapter.notifyDataSetChanged();
}
}
@Override
public void onError(Throwable e) {
showError(e);
}
})
);
}
}
private void showFabDialog(View v){ private void showFabDialog(View v){
LayoutInflater layoutInflaterAndroid = LayoutInflater.from(getApplicationContext()); LayoutInflater layoutInflaterAndroid = LayoutInflater.from(getApplicationContext());
@ -150,6 +190,7 @@ public class BlackList extends AppCompatActivity {
.setNegativeButton(R.string.cancel, null); .setNegativeButton(R.string.cancel, null);
final AlertDialog alertDialog = alertDialogBuilderUserInput.create(); final AlertDialog alertDialog = alertDialogBuilderUserInput.create();
alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
EditText modalUserInput = view.findViewById(R.id.black_list_modal_input); EditText modalUserInput = view.findViewById(R.id.black_list_modal_input);
@ -164,10 +205,9 @@ public class BlackList extends AppCompatActivity {
String body = modalUserInput.getText().toString(); String body = modalUserInput.getText().toString();
if (TextUtils.isEmpty(body)) { if (TextUtils.isEmpty(body)) {
Toast.makeText(getApplicationContext(), "Co tu napisac?", Toast.LENGTH_SHORT).show(); Toast.makeText(getApplicationContext(), R.string.can_not_be_empty, Toast.LENGTH_SHORT).show();
modalUserInput.requestFocus(); modalUserInput.requestFocus();
} else { } else {
// send4Location(body, latLng);
sendUserToBlacklist(body); sendUserToBlacklist(body);
alertDialog.dismiss(); alertDialog.dismiss();
} }
@ -178,20 +218,18 @@ public class BlackList extends AppCompatActivity {
} }
private void sendUserToBlacklist(String body) { private void sendUserToBlacklist(String body) {
UserService userService = ApiClient.getClient(getApplicationContext()).create(UserService.class);
StudentIdModel studentIdModel = new StudentIdModel(body); StudentIdModel studentIdModel = new StudentIdModel(body);
Toast.makeText(getApplicationContext(), body, Toast.LENGTH_SHORT).show(); disposable.add(
//TODO subscribe Completable #how to do that? userService.addStudentToBlacklist(PrefUtils.getUserId(getApplicationContext()), studentIdModel)
// disposable.add( .subscribeOn(Schedulers.io())
// userService.addStudentToBlacklist(PrefUtils.getUserId(getApplicationContext()), studentIdModel) .observeOn(AndroidSchedulers.mainThread())
// .observeOn(AndroidSchedulers.mainThread()) .subscribe(()->{
// fetchBlackListedUsersIDs(PrefUtils.getUserId(getApplicationContext()));
// Toast.makeText(getApplicationContext(), R.string.user_added, Toast.LENGTH_SHORT).show();
// ); },this::showError)
);
} }
private void showError(Throwable e) { private void showError(Throwable e) {
String message; String message;
@ -201,14 +239,22 @@ public class BlackList extends AppCompatActivity {
} else { } else {
message = "Network Error !"; message = "Network Error !";
} }
Toast.makeText(getApplicationContext(), e.toString(), Toast.LENGTH_SHORT).show();
Snackbar.make(getWindow().getDecorView().getRootView(), message, Snackbar.LENGTH_LONG) Snackbar.make(getWindow().getDecorView().getRootView(), message, Snackbar.LENGTH_LONG)
.setAction("Action", null).show(); .setAction("Action", null).show();
} }
private void toggleEmptyNotes() { private void toggleEmptyNotes() {
if (blacklistedUsers.size() >= 0) {
if (didFetched && blacklistedUsers.size() == 0) {
noNotesView.setText(R.string.list_is_empty);
noNotesView.setVisibility(View.VISIBLE);
}else if (blacklistedUsers.size() > 0) {
noNotesView.setVisibility(View.GONE); noNotesView.setVisibility(View.GONE);
} else { } else {
noNotesView.setText(getString(R.string.loading));
noNotesView.setVisibility(View.VISIBLE); noNotesView.setVisibility(View.VISIBLE);
} }
} }
@ -222,7 +268,6 @@ public class BlackList extends AppCompatActivity {
@Override @Override
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
fetchBlackListedUsers(PrefUtils.getUserId(this));
} }
@Override @Override
@ -234,4 +279,57 @@ public class BlackList extends AppCompatActivity {
public void onStop() { public void onStop() {
super.onStop(); super.onStop();
} }
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_black_list, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId()==R.id.action_blacklist_info_popup){
int layoutID = R.layout.info_popup_blacklist;
View popupView = getLayoutInflater().inflate(layoutID,null);
PopupWindow popupWindow = new PopupWindow(popupView,
LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
// If the PopupWindow should be focusable
popupWindow.setFocusable(true);
// If you need the PopupWindow to dismiss when when touched outside
popupWindow.setBackgroundDrawable(new ColorDrawable());
// Get the View's(the one that was clicked in the Fragment) location
View anchorView= getWindow().getDecorView().findViewById(android.R.id.content);
popupWindow.showAtLocation(anchorView,Gravity.TOP|Gravity.END, 0, 0);
}
return super.onOptionsItemSelected(item);
}
private void handleSwitch(){
aSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> {
if (isChecked){
aSwitch.setText(getString(R.string.blacklist) + " "+ getString(R.string.on));
handleChangeRequest(true);
}else {
aSwitch.setText(getString(R.string.blacklist) + " "+getString(R.string.off));
handleChangeRequest(false);
}
});
}
private void handleChangeRequest(boolean value){
IsUsingListBool isUsingListBool = new IsUsingListBool();
isUsingListBool.setIsUsing(value);
disposable.add(
userService.setTutorBlacklist(tutorId, isUsingListBool)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(()->{
},this::showError)
);
}
} }

View File

@ -3,25 +3,44 @@ package com.uam.wmi.findmytutor.adapters;
import android.content.Context; import android.content.Context;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.design.widget.Snackbar;
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;
import android.widget.ImageButton;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
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.StudentIdModel;
import com.uam.wmi.findmytutor.model.User; import com.uam.wmi.findmytutor.model.User;
import com.uam.wmi.findmytutor.network.ApiClient;
import com.uam.wmi.findmytutor.service.UserService;
import com.uam.wmi.findmytutor.utils.PrefUtils;
import com.uam.wmi.findmytutor.utils.RestApiHelper;
import java.util.List; import java.util.List;
import butterknife.BindView; import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.schedulers.Schedulers;
import okhttp3.ResponseBody;
import static com.mapbox.mapboxsdk.Mapbox.getApplicationContext;
public class BlackListAdapter extends RecyclerView.Adapter<BlackListAdapter.MyViewHolder> { public class BlackListAdapter extends RecyclerView.Adapter<BlackListAdapter.MyViewHolder> {
private Context context; private Context context;
private List<User> tutorsList; private List<User> tutorsList;
private CompositeDisposable disposable = new CompositeDisposable();
private UserService userService;
public BlackListAdapter(Context context, List<User> tutors) { public BlackListAdapter(Context context, List<User> tutors) {
this.context = context; this.context = context;
@ -30,6 +49,8 @@ public class BlackListAdapter extends RecyclerView.Adapter<BlackListAdapter.MyVi
@NonNull @NonNull
@Override @Override
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
userService = ApiClient.getClient(getApplicationContext())
.create(UserService.class);
View itemView = LayoutInflater.from(parent.getContext()) View itemView = LayoutInflater.from(parent.getContext())
.inflate(R.layout.black_list_row, parent, false); .inflate(R.layout.black_list_row, parent, false);
@ -41,21 +62,36 @@ public class BlackListAdapter extends RecyclerView.Adapter<BlackListAdapter.MyVi
Drawable image = null; Drawable image = null;
User tutor = tutorsList.get(position); User tutor = tutorsList.get(position);
holder.firstName.setText(tutor.getFirstName()); holder.firstName.setText(tutor.getFirstName() + " " + tutor.getLastName());
holder.lastName.setText(tutor.getLastName()); holder.lastName.setText("Index: " + tutor.getLdapLogin() + " Email: " + tutor.getEmail());
//"s416196"
holder.imageButton.setOnClickListener(l ->{
StudentIdModel studentIdModel = new StudentIdModel(tutor.getLdapLogin());
String tutorId = PrefUtils.getUserId(getApplicationContext());
disposable.add(
userService.removeStudentFromBlacklist(tutorId, studentIdModel)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(()->{
Toast.makeText(getApplicationContext(), "User removed", Toast.LENGTH_SHORT).show();
tutorsList.remove(position);
notifyDataSetChanged();
},this::showError)
);
});
//
// if (tutor.isIsOnline()) {
// image = context.getResources().getDrawable(R.drawable.user_list_online);
// } else {
// image = context.getResources().getDrawable(R.drawable.user_list_offline);
// }
//
// if (!tutor.isIsActive()) {
// image = context.getResources().getDrawable(R.drawable.user_list_off);
// }
if (tutor.isIsOnline()) { // image.setBounds(0, 0, image.getIntrinsicWidth(), image.getIntrinsicHeight());
image = context.getResources().getDrawable(R.drawable.user_list_online); // holder.isOnline.setCompoundDrawables(image, null, null, null);
} else {
image = context.getResources().getDrawable(R.drawable.user_list_offline);
}
if (!tutor.isIsActive()) {
image = context.getResources().getDrawable(R.drawable.user_list_off);
}
image.setBounds(0, 0, image.getIntrinsicWidth(), image.getIntrinsicHeight());
holder.isOnline.setCompoundDrawables(image, null, null, null);
} }
@Override @Override
@ -71,8 +107,10 @@ public class BlackListAdapter extends RecyclerView.Adapter<BlackListAdapter.MyVi
@BindView(R.id.lastName) @BindView(R.id.lastName)
TextView lastName; TextView lastName;
@BindView(R.id.isOnline) // @BindView(R.id.isOnline)
TextView isOnline; // TextView isOnline;
@BindView(R.id.removeUserImageButton)
ImageButton imageButton;
MyViewHolder(View view) { MyViewHolder(View view) {
super(view); super(view);
@ -80,5 +118,17 @@ public class BlackListAdapter extends RecyclerView.Adapter<BlackListAdapter.MyVi
} }
} }
private void showError(Throwable e) {
String message;
if (e instanceof HttpException) {
ResponseBody responseBody = ((HttpException) e).response().errorBody();
message = RestApiHelper.getErrorMessage(responseBody);
} else {
message = "Network Error !";
}
Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();
}
} }

View File

@ -20,10 +20,11 @@ public class StudentIdModel extends BaseResponse{
/** /**
* *
* @param studentId * @param str
*/ */
public StudentIdModel(String studentId){ public StudentIdModel(String str){
this.studentId = studentId; // this.studentId = str;
this.ldapLogin = str;
} }
public StudentIdModel studentId(String studentId) { public StudentIdModel studentId(String studentId) {

View File

@ -15,6 +15,7 @@ import retrofit2.Response;
import retrofit2.http.Body; import retrofit2.http.Body;
import retrofit2.http.DELETE; import retrofit2.http.DELETE;
import retrofit2.http.GET; import retrofit2.http.GET;
import retrofit2.http.HTTP;
import retrofit2.http.POST; import retrofit2.http.POST;
import retrofit2.http.PUT; import retrofit2.http.PUT;
import retrofit2.http.Path; import retrofit2.http.Path;
@ -61,7 +62,7 @@ public interface UserService {
Completable setUserInActive(@Path("userID") String userID); Completable setUserInActive(@Path("userID") String userID);
@GET("api/users/blacklist/{tutorID}") @GET("api/users/blacklist/{tutorID}")
Single<List<User>> getTutorBlacklistedByID(@Path("tutorID") String tutorID); Single<List<String>> getTutorBlacklistedByID(@Path("tutorID") String tutorID);
@PUT("api/users/blacklist/{tutorID}") @PUT("api/users/blacklist/{tutorID}")
Completable setTutorBlacklist(@Path("tutorID") String tutorID, @Body IsUsingListBool isUsing); Completable setTutorBlacklist(@Path("tutorID") String tutorID, @Body IsUsingListBool isUsing);
@ -69,7 +70,8 @@ public interface UserService {
@POST("api/users/blacklist/{tutorID}") @POST("api/users/blacklist/{tutorID}")
Completable addStudentToBlacklist(@Path("tutorID") String tutorID, @Body StudentIdModel student); Completable addStudentToBlacklist(@Path("tutorID") String tutorID, @Body StudentIdModel student);
@DELETE("api/users/blacklist/{tutorID}") // @DELETE("api/users/blacklist/{tutorID}")
@HTTP(method = "DELETE", path = "api/users/blacklist/{tutorID}", hasBody = true)
Completable removeStudentFromBlacklist(@Path("tutorID") String tutorID, @Body StudentIdModel student); Completable removeStudentFromBlacklist(@Path("tutorID") String tutorID, @Body StudentIdModel student);
@GET("api/users/whitelist/{tutorID}") @GET("api/users/whitelist/{tutorID}")

View File

@ -6,7 +6,7 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
public class Const { public class Const {
public final static String BASE_URL = "https://s416084.projektstudencki.pl/master/"; public final static String BASE_URL = "https://s416084.projektstudencki.pl/develop/";
public final static Integer onlineBackgroundLocationInterval = 7000; public final static Integer onlineBackgroundLocationInterval = 7000;
public final static Integer offlineBackgroundLocationInterval = 36000; public final static Integer offlineBackgroundLocationInterval = 36000;
public final static Integer defaultMapZoom = 17; public final static Integer defaultMapZoom = 17;

View File

@ -5,6 +5,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
android:id="@+id/activity_blacklist_container"
tools:context=".activity.BlackList"> tools:context=".activity.BlackList">
<android.support.design.widget.AppBarLayout <android.support.design.widget.AppBarLayout
@ -39,16 +40,17 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:text="Block the niggas" android:text="Block the users"
android:textSize="15sp"/> android:textSize="15sp"/>
<TextView <Switch
android:id="@+id/tv_description" android:id="@+id/switch_blacklist_toggle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:thumbTextPadding="45dp"
android:textSize="20sp" android:checked="true"
android:text="Each nigga on dat list won't see you ugly AF ass, bitch"/> android:text="BLACKLIST TEXT SWITCH" />
</LinearLayout> </LinearLayout>
<android.support.v7.widget.Toolbar <android.support.v7.widget.Toolbar
@ -59,8 +61,6 @@
app:popupTheme="@style/AppTheme.PopupOverlay" app:popupTheme="@style/AppTheme.PopupOverlay"
/> />
</android.support.design.widget.CollapsingToolbarLayout> </android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout> </android.support.design.widget.AppBarLayout>
@ -68,25 +68,17 @@
<android.support.design.widget.FloatingActionButton <android.support.design.widget.FloatingActionButton
android:id="@+id/add_to_black_list_fab" android:id="@+id/add_to_black_list_fab"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/fab_margin" android:layout_margin="@dimen/fab_margin"
android:layout_marginTop="-322dp"
app:layout_anchor="@id/app_bar" app:layout_anchor="@id/app_bar"
app:layout_anchorGravity="bottom|end" app:layout_anchorGravity="bottom|end"
app:srcCompat="@drawable/abc_ic_clear_material" /> app:srcCompat="@android:drawable/ic_input_add"
app:useCompatPadding="true"
tools:srcCompat="@tools:sample/backgrounds/scenic" />
<!-- A RecyclerView with some commonly used attributes --> <!-- A RecyclerView with some commonly used attributes -->
<TextView
android:id="@+id/black_list_empty_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/margin_top_no_notes"
android:fontFamily="sans-serif-light"
android:text="@string/loading"
android:textColor="@color/msg_no_notes"
android:textSize="@dimen/msg_no_notes" />
</android.support.design.widget.CoordinatorLayout> </android.support.design.widget.CoordinatorLayout>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="90dp" android:layout_height="90dp"
android:clickable="true" android:clickable="true"
@ -34,16 +35,25 @@
android:textSize="15sp" /> android:textSize="15sp" />
<TextView <!--<TextView-->
android:id="@+id/isOnline" <!--android:id="@+id/isOnline"-->
android:layout_width="48dp" <!--android:layout_width="48dp"-->
android:layout_height="30dp" <!--android:layout_height="30dp"-->
android:layout_below="@+id/firstName" <!--android:layout_below="@+id/firstName"-->
android:layout_marginStart="7dp" <!--android:layout_marginStart="7dp"-->
android:layout_marginTop="-10dp" <!--android:layout_marginTop="-10dp"-->
android:layout_toEndOf="@+id/firstName" <!--android:layout_toEndOf="@+id/firstName"-->
android:textColor="@color/note_list_text" <!--android:textColor="@color/note_list_text"-->
android:textSize="@dimen/note_list_text" /> <!--android:textSize="@dimen/note_list_text" />-->
<ImageButton
android:id="@+id/removeUserImageButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/firstName"
android:layout_toEndOf="@+id/firstName"
android:background="@null"
app:srcCompat="@drawable/abc_ic_clear_material" />
</RelativeLayout> </RelativeLayout>

View File

@ -18,7 +18,7 @@
android:layout_height="match_parent" /> android:layout_height="match_parent" />
<TextView <TextView
android:id="@+id/txt_empty_notes_view" android:id="@+id/black_list_empty_text_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"

View File

@ -7,71 +7,33 @@
android:textColor="@color/half_black"> android:textColor="@color/half_black">
<TextView <TextView
android:id="@+id/textViewP1" android:id="@+id/textViewP1_info_icon_blacklist_p1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:layout_weight="1"
android:text="@string/map_info_text_p1"
android:textColor="@color/half_black" />
<TextView
android:id="@+id/textViewP2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:layout_weight="1"
android:text="@string/map_info_text_p2"
android:textColor="@color/half_black" />
<TextView
android:id="@+id/textViewP3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:layout_weight="1"
android:text="@string/map_info_text_p3"
android:textColor="@color/half_black" />
<TextView
android:id="@+id/exactMarkerTextView"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:drawableLeft="@drawable/exact_localization_marker" android:layout_marginTop="5dp"
android:drawablePadding="5dp" android:layout_weight="1"
android:layout_marginBottom="5dp" android:text="@string/info_icon_blacklist_p1"
android:gravity="center"
android:text="@string/map_info_text_marker_exact"
android:textColor="@color/half_black" />
<TextView
android:id="@+id/approximateTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:drawableLeft="@drawable/approximate_localization_marker"
android:drawablePadding="5dp"
android:layout_marginBottom="5dp"
android:gravity="center"
android:text="@string/map_info_text_marker_approximated"
android:textColor="@color/half_black" /> android:textColor="@color/half_black" />
<TextView <TextView
android:id="@+id/manualMarkerTextView" android:id="@+id/textViewP2_info_icon_blacklist_p2"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:layout_marginBottom="5dp" android:layout_marginTop="20dp"
android:drawableLeft="@drawable/manual_localization_marker" android:layout_weight="1"
android:drawablePadding="0dp" android:text="@string/info_icon_blacklist_p2"
android:gravity="center" android:textColor="@color/half_black" />
android:text="@string/map_info_text_marker_manual"
<TextView
android:id="@+id/textViewP3_info_icon_blacklist_p3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="20dp"
android:layout_weight="1"
android:text="@string/info_icon_blacklist_p3"
android:textColor="@color/half_black" /> android:textColor="@color/half_black" />
</LinearLayout> </LinearLayout>

View File

@ -3,8 +3,9 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
tools:context="com.uam.wmi.findmytutor.activity.BlackList"> tools:context="com.uam.wmi.findmytutor.activity.BlackList">
<item <item
android:id="@+id/action_settings" android:id="@+id/action_blacklist_info_popup"
android:orderInCategory="100" android:orderInCategory="100"
android:title="@string/action_settings" android:title="Popup info icon"
app:showAsAction="never" /> android:icon="@drawable/outline_info_24"
app:showAsAction="ifRoom" />
</menu> </menu>

View File

@ -211,12 +211,10 @@
<string name="info_icon_userlist_tab_level_status_offline">- użytkownik jest obecnie offline</string> <string name="info_icon_userlist_tab_level_status_offline">- użytkownik jest obecnie offline</string>
<string name="info_icon_userlist_tab_level_status_inactive">- użytkownik jest nieaktywny</string> <string name="info_icon_userlist_tab_level_status_inactive">- użytkownik jest nieaktywny</string>
<string name="info_icon_userlist_tab_level_status_inactive_tip">(nie udostępnił żadnych danych o lokalizacji od conajmniej tygodnia)</string> <string name="info_icon_userlist_tab_level_status_inactive_tip">(nie udostępnił żadnych danych o lokalizacji od conajmniej tygodnia)</string>
<<<<<<< HEAD
<string name="add">Dodaj</string> <string name="add">Dodaj</string>
<string name="index_user">Index użytkownika</string> <string name="index_user">Index użytkownika</string>
<string name="black_list_title">Dodaj użytkownika do Blacklsi</string> <string name="black_list_title">Dodaj użytkownika do Blacklsi</string>
=======
<string name="info_icon_userlist_summary">Po kliknięciu w imię i nazwisko, wyświetli się karta zawierająca dokładne informacje o profesorze.</string> <string name="info_icon_userlist_summary">Po kliknięciu w imię i nazwisko, wyświetli się karta zawierająca dokładne informacje o profesorze.</string>
@ -245,7 +243,13 @@
<string name="negative_dialog_button">Nie</string> <string name="negative_dialog_button">Nie</string>
<string name="enable_sharing_question">Aby skorzystać z tej funkcji musisz pozwolić na udostępnianie lokalizacji. Zgadzasz sie?</string> <string name="enable_sharing_question">Aby skorzystać z tej funkcji musisz pozwolić na udostępnianie lokalizacji. Zgadzasz sie?</string>
<string name="sharing_modal_title">Udostępnianie</string> <string name="sharing_modal_title">Udostępnianie</string>
>>>>>>> develop <string name="blacklist">Czarna lista</string>
<string name="can_not_be_empty">Pole nie może być puste</string>
<string name="user_added">Użytkownik dodany</string>
<string name="list_is_empty">Lista jest pusta</string>
<string name="on">WŁĄCZONA</string>
<string name="off">WYŁĄCZONA</string>
<string name="title_activity_black_list">Czarna lista</string>
</resources> </resources>

View File

@ -32,7 +32,7 @@
<!-- Tutors list --> <!-- Tutors list -->
<string name="action_settings">Settings</string> <string name="action_settings">Settings</string>
<string name="activity_title_home">Notes</string> <string name="activity_title_blacklist">Blacklist</string>
<string name="prompt_password">Password</string> <string name="prompt_password">Password</string>
<string name="action_sign_in">Sign in or register</string> <string name="action_sign_in">Sign in or register</string>
<string name="action_sign_out">Sign out</string> <string name="action_sign_out">Sign out</string>
@ -297,7 +297,6 @@
<string name="info_icon_userlist_tab_level_status_offline">- user is currently offline</string> <string name="info_icon_userlist_tab_level_status_offline">- user is currently offline</string>
<string name="info_icon_userlist_tab_level_status_inactive">- user is inactive </string> <string name="info_icon_userlist_tab_level_status_inactive">- user is inactive </string>
<string name="info_icon_userlist_tab_level_status_inactive_tip">(didnt share any localization data since 7 days)</string> <string name="info_icon_userlist_tab_level_status_inactive_tip">(didnt share any localization data since 7 days)</string>
<<<<<<< HEAD
<string name="title_activity_black_list">BlackList</string> <string name="title_activity_black_list">BlackList</string>
<string name="index_user">User index</string> <string name="index_user">User index</string>
<string name="black_list_title">Add user to Blacklist</string> <string name="black_list_title">Add user to Blacklist</string>
@ -391,13 +390,11 @@
"when a user tries to pick up one of cards.\n\n" "when a user tries to pick up one of cards.\n\n"
</string> </string>
<string name="add">Add</string> <string name="add">Add</string>
=======
<string name="info_icon_userlist_summary">After clicking on a name, the tutor tab will pop up, containing details about selected tutor.</string> <string name="info_icon_userlist_summary">After clicking on a name, the tutor tab will pop up, containing details about selected tutor.</string>
<string name="possitive_dialog_button">Yes</string> <string name="possitive_dialog_button">Yes</string>
<string name="pref_title_acra" translatable="false">App issues reporting</string> <string name="pref_title_acra" translatable="false">App issues reporting</string>
>>>>>>> develop
<!--(ENG) Profile Activity strings--> <!--(ENG) Profile Activity strings-->
<string name="hint_duty_day">Day</string> <string name="hint_duty_day">Day</string>
@ -415,4 +412,11 @@
<string name="enable_sharing_question">In order to use this function, you have to enable localization sharing. May I do it for you?</string> <string name="enable_sharing_question">In order to use this function, you have to enable localization sharing. May I do it for you?</string>
<string name="sharing_modal_title">Sharing</string> <string name="sharing_modal_title">Sharing</string>
<string name="lack_of_status">The user hasn\'t defined a status.</string> <string name="lack_of_status">The user hasn\'t defined a status.</string>
<string name="blacklist">Blacklist</string>
<string name="can_not_be_empty">Field can not be empty</string>
<string name="user_added">User added</string>
<string name="list_is_empty">The list is empty</string>
<string name="activity_title_home">Map</string>
<string name="on">ON</string>
<string name="off">OFF</string>
</resources> </resources>