blacklist ready to test
This commit is contained in:
parent
84e6b95675
commit
87642c5d7a
@ -29,7 +29,7 @@
|
||||
</value>
|
||||
</option>
|
||||
</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" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.uam.wmi.findmytutor.activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.CoordinatorLayout;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
@ -14,18 +15,28 @@ import android.support.v7.widget.RecyclerView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.PopupWindow;
|
||||
import android.widget.Switch;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import android.widget.ToggleButton;
|
||||
|
||||
import com.jakewharton.retrofit2.adapter.rxjava2.HttpException;
|
||||
import com.mapbox.geojson.Point;
|
||||
import com.mapbox.mapboxsdk.geometry.LatLng;
|
||||
import com.uam.wmi.findmytutor.R;
|
||||
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.StudentIdModel;
|
||||
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 java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
@ -54,18 +67,21 @@ public class BlackList extends AppCompatActivity {
|
||||
|
||||
private CompositeDisposable disposable = new CompositeDisposable();
|
||||
private UserService userService;
|
||||
|
||||
private boolean didFetched = false;
|
||||
private String tutorId;
|
||||
|
||||
@BindView(R.id.recycler_view)
|
||||
RecyclerView recyclerView;
|
||||
@BindView(R.id.black_list_empty_text_view)
|
||||
TextView noNotesView;
|
||||
|
||||
@BindView(R.id.switch_blacklist_toggle)
|
||||
Switch aSwitch;
|
||||
@BindView(R.id.add_to_black_list_fab)
|
||||
FloatingActionButton addToBlackListFab;
|
||||
|
||||
private BlackListAdapter mAdapter;
|
||||
private List<User> blacklistedUsers = new ArrayList<>();
|
||||
private HashSet<String> blacklistedUsersIDs = new HashSet<>();
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@ -73,9 +89,11 @@ public class BlackList extends AppCompatActivity {
|
||||
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
|
||||
setContentView(R.layout.activity_black_list);
|
||||
ButterKnife.bind(this);
|
||||
aSwitch.setText(getString(R.string.blacklist) +" ON");
|
||||
tutorId = PrefUtils.getUserId(getApplicationContext());
|
||||
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
toolbar.setTitle(getString(R.string.activity_title_home));
|
||||
toolbar.setTitle(getString(R.string.activity_title_blacklist));
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
userService = ApiClient.getClient(getApplicationContext())
|
||||
@ -101,31 +119,26 @@ public class BlackList extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
public void onLongClick(View view, int position) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}));
|
||||
|
||||
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(
|
||||
userService.getTutorBlacklistedByID(userId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeWith(new DisposableSingleObserver<List<User>>() {
|
||||
.subscribeWith(new DisposableSingleObserver<List<String>>() {
|
||||
@Override
|
||||
public void onSuccess(List<User> users) {
|
||||
blacklistedUsers.addAll(users);
|
||||
|
||||
mAdapter.notifyDataSetChanged();
|
||||
Log.e("BLACKLIST","fetch success");
|
||||
Snackbar.make(getWindow().getDecorView().getRootView(), "fetch success", Snackbar.LENGTH_LONG)
|
||||
.setAction("Action", null).show();
|
||||
public void onSuccess(List<String> users) {
|
||||
blacklistedUsersIDs.addAll(users);
|
||||
didFetched = true;
|
||||
fetchBlackListedUsers();
|
||||
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){
|
||||
LayoutInflater layoutInflaterAndroid = LayoutInflater.from(getApplicationContext());
|
||||
@ -150,6 +190,7 @@ public class BlackList extends AppCompatActivity {
|
||||
.setNegativeButton(R.string.cancel, null);
|
||||
|
||||
final AlertDialog alertDialog = alertDialogBuilderUserInput.create();
|
||||
alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
|
||||
|
||||
EditText modalUserInput = view.findViewById(R.id.black_list_modal_input);
|
||||
|
||||
@ -164,10 +205,9 @@ public class BlackList extends AppCompatActivity {
|
||||
String body = modalUserInput.getText().toString();
|
||||
|
||||
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();
|
||||
} else {
|
||||
// send4Location(body, latLng);
|
||||
sendUserToBlacklist(body);
|
||||
alertDialog.dismiss();
|
||||
}
|
||||
@ -178,20 +218,18 @@ public class BlackList extends AppCompatActivity {
|
||||
}
|
||||
|
||||
private void sendUserToBlacklist(String body) {
|
||||
|
||||
UserService userService = ApiClient.getClient(getApplicationContext()).create(UserService.class);
|
||||
StudentIdModel studentIdModel = new StudentIdModel(body);
|
||||
Toast.makeText(getApplicationContext(), body, Toast.LENGTH_SHORT).show();
|
||||
//TODO subscribe Completable #how to do that?
|
||||
// disposable.add(
|
||||
// userService.addStudentToBlacklist(PrefUtils.getUserId(getApplicationContext()), studentIdModel)
|
||||
// .observeOn(AndroidSchedulers.mainThread())
|
||||
//
|
||||
//
|
||||
// );
|
||||
disposable.add(
|
||||
userService.addStudentToBlacklist(PrefUtils.getUserId(getApplicationContext()), studentIdModel)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.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) {
|
||||
String message;
|
||||
|
||||
@ -201,14 +239,22 @@ public class BlackList extends AppCompatActivity {
|
||||
} else {
|
||||
message = "Network Error !";
|
||||
}
|
||||
Toast.makeText(getApplicationContext(), e.toString(), Toast.LENGTH_SHORT).show();
|
||||
|
||||
|
||||
Snackbar.make(getWindow().getDecorView().getRootView(), message, Snackbar.LENGTH_LONG)
|
||||
.setAction("Action", null).show();
|
||||
}
|
||||
|
||||
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);
|
||||
} else {
|
||||
noNotesView.setText(getString(R.string.loading));
|
||||
noNotesView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
@ -222,7 +268,6 @@ public class BlackList extends AppCompatActivity {
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
fetchBlackListedUsers(PrefUtils.getUserId(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -234,4 +279,57 @@ public class BlackList extends AppCompatActivity {
|
||||
public void 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)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -3,25 +3,44 @@ package com.uam.wmi.findmytutor.adapters;
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageButton;
|
||||
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.model.StudentIdModel;
|
||||
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 butterknife.BindView;
|
||||
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> {
|
||||
|
||||
private Context context;
|
||||
private List<User> tutorsList;
|
||||
private CompositeDisposable disposable = new CompositeDisposable();
|
||||
private UserService userService;
|
||||
|
||||
|
||||
public BlackListAdapter(Context context, List<User> tutors) {
|
||||
this.context = context;
|
||||
@ -30,6 +49,8 @@ public class BlackListAdapter extends RecyclerView.Adapter<BlackListAdapter.MyVi
|
||||
@NonNull
|
||||
@Override
|
||||
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
userService = ApiClient.getClient(getApplicationContext())
|
||||
.create(UserService.class);
|
||||
View itemView = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.black_list_row, parent, false);
|
||||
|
||||
@ -41,21 +62,36 @@ public class BlackListAdapter extends RecyclerView.Adapter<BlackListAdapter.MyVi
|
||||
Drawable image = null;
|
||||
User tutor = tutorsList.get(position);
|
||||
|
||||
holder.firstName.setText(tutor.getFirstName());
|
||||
holder.lastName.setText(tutor.getLastName());
|
||||
holder.firstName.setText(tutor.getFirstName() + " " + 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 = 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);
|
||||
}
|
||||
|
||||
image.setBounds(0, 0, image.getIntrinsicWidth(), image.getIntrinsicHeight());
|
||||
holder.isOnline.setCompoundDrawables(image, null, null, null);
|
||||
// image.setBounds(0, 0, image.getIntrinsicWidth(), image.getIntrinsicHeight());
|
||||
// holder.isOnline.setCompoundDrawables(image, null, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -71,8 +107,10 @@ public class BlackListAdapter extends RecyclerView.Adapter<BlackListAdapter.MyVi
|
||||
@BindView(R.id.lastName)
|
||||
TextView lastName;
|
||||
|
||||
@BindView(R.id.isOnline)
|
||||
TextView isOnline;
|
||||
// @BindView(R.id.isOnline)
|
||||
// TextView isOnline;
|
||||
@BindView(R.id.removeUserImageButton)
|
||||
ImageButton imageButton;
|
||||
|
||||
MyViewHolder(View 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();
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -20,10 +20,11 @@ public class StudentIdModel extends BaseResponse{
|
||||
|
||||
/**
|
||||
*
|
||||
* @param studentId
|
||||
* @param str
|
||||
*/
|
||||
public StudentIdModel(String studentId){
|
||||
this.studentId = studentId;
|
||||
public StudentIdModel(String str){
|
||||
// this.studentId = str;
|
||||
this.ldapLogin = str;
|
||||
}
|
||||
|
||||
public StudentIdModel studentId(String studentId) {
|
||||
|
@ -15,6 +15,7 @@ import retrofit2.Response;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.DELETE;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.HTTP;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.PUT;
|
||||
import retrofit2.http.Path;
|
||||
@ -61,7 +62,7 @@ public interface UserService {
|
||||
Completable setUserInActive(@Path("userID") String userID);
|
||||
|
||||
@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}")
|
||||
Completable setTutorBlacklist(@Path("tutorID") String tutorID, @Body IsUsingListBool isUsing);
|
||||
@ -69,7 +70,8 @@ public interface UserService {
|
||||
@POST("api/users/blacklist/{tutorID}")
|
||||
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);
|
||||
|
||||
@GET("api/users/whitelist/{tutorID}")
|
||||
|
@ -6,7 +6,7 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
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 offlineBackgroundLocationInterval = 36000;
|
||||
public final static Integer defaultMapZoom = 17;
|
||||
|
@ -5,6 +5,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
android:id="@+id/activity_blacklist_container"
|
||||
tools:context=".activity.BlackList">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
@ -39,16 +40,17 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:text="Block the niggas"
|
||||
android:text="Block the users"
|
||||
android:textSize="15sp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_description"
|
||||
<Switch
|
||||
android:id="@+id/switch_blacklist_toggle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:textSize="20sp"
|
||||
android:text="Each nigga on dat list won't see you ugly AF ass, bitch"/>
|
||||
android:thumbTextPadding="45dp"
|
||||
android:checked="true"
|
||||
android:text="BLACKLIST TEXT SWITCH" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
@ -59,8 +61,6 @@
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
</android.support.design.widget.CollapsingToolbarLayout>
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
@ -68,25 +68,17 @@
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
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_margin="@dimen/fab_margin"
|
||||
android:layout_marginTop="-322dp"
|
||||
app:layout_anchor="@id/app_bar"
|
||||
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 -->
|
||||
|
||||
|
||||
<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>
|
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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_height="90dp"
|
||||
android:clickable="true"
|
||||
@ -34,16 +35,25 @@
|
||||
android:textSize="15sp" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/isOnline"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_below="@+id/firstName"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginTop="-10dp"
|
||||
android:layout_toEndOf="@+id/firstName"
|
||||
android:textColor="@color/note_list_text"
|
||||
android:textSize="@dimen/note_list_text" />
|
||||
<!--<TextView-->
|
||||
<!--android:id="@+id/isOnline"-->
|
||||
<!--android:layout_width="48dp"-->
|
||||
<!--android:layout_height="30dp"-->
|
||||
<!--android:layout_below="@+id/firstName"-->
|
||||
<!--android:layout_marginStart="7dp"-->
|
||||
<!--android:layout_marginTop="-10dp"-->
|
||||
<!--android:layout_toEndOf="@+id/firstName"-->
|
||||
<!--android:textColor="@color/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>
|
@ -18,7 +18,7 @@
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_empty_notes_view"
|
||||
android:id="@+id/black_list_empty_text_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
|
@ -7,71 +7,33 @@
|
||||
android:textColor="@color/half_black">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewP1"
|
||||
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:id="@+id/textViewP1_info_icon_blacklist_p1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:drawableLeft="@drawable/exact_localization_marker"
|
||||
android:drawablePadding="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
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:layout_marginTop="5dp"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/info_icon_blacklist_p1"
|
||||
android:textColor="@color/half_black" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/manualMarkerTextView"
|
||||
android:id="@+id/textViewP2_info_icon_blacklist_p2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:drawableLeft="@drawable/manual_localization_marker"
|
||||
android:drawablePadding="0dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/map_info_text_marker_manual"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/info_icon_blacklist_p2"
|
||||
android:textColor="@color/half_black" />
|
||||
|
||||
<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" />
|
||||
|
||||
</LinearLayout>
|
@ -3,8 +3,9 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context="com.uam.wmi.findmytutor.activity.BlackList">
|
||||
<item
|
||||
android:id="@+id/action_settings"
|
||||
android:id="@+id/action_blacklist_info_popup"
|
||||
android:orderInCategory="100"
|
||||
android:title="@string/action_settings"
|
||||
app:showAsAction="never" />
|
||||
android:title="Popup info icon"
|
||||
android:icon="@drawable/outline_info_24"
|
||||
app:showAsAction="ifRoom" />
|
||||
</menu>
|
||||
|
@ -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_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>
|
||||
<<<<<<< HEAD
|
||||
<string name="add">Dodaj</string>
|
||||
<string name="index_user">Index użytkownika</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>
|
||||
|
||||
|
||||
@ -245,7 +243,13 @@
|
||||
<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="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>
|
||||
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
|
||||
<!-- Tutors list -->
|
||||
<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="action_sign_in">Sign in or register</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_inactive">- user is inactive </string>
|
||||
<string name="info_icon_userlist_tab_level_status_inactive_tip">(didn’t share any localization data since 7 days)</string>
|
||||
<<<<<<< HEAD
|
||||
<string name="title_activity_black_list">BlackList</string>
|
||||
<string name="index_user">User index</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"
|
||||
</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="possitive_dialog_button">Yes</string>
|
||||
|
||||
<string name="pref_title_acra" translatable="false">App issues reporting</string>
|
||||
>>>>>>> develop
|
||||
|
||||
<!--(ENG) Profile Activity strings-->
|
||||
<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="sharing_modal_title">Sharing</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>
|
||||
|
Loading…
Reference in New Issue
Block a user