show on map modal fix, Status added
This commit is contained in:
parent
b7b284252b
commit
4300c33d65
@ -412,7 +412,6 @@ public abstract class BaseActivity
|
|||||||
FragmentTransaction ft = getFragmentManager().beginTransaction();
|
FragmentTransaction ft = getFragmentManager().beginTransaction();
|
||||||
ft.replace(R.id.activity_content, sharingFragment);
|
ft.replace(R.id.activity_content, sharingFragment);
|
||||||
ft.commit();
|
ft.commit();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadUserListFragment() {
|
private void loadUserListFragment() {
|
||||||
|
@ -74,7 +74,7 @@ import static com.uam.wmi.findmytutor.utils.Const.mapRefreshInterval;
|
|||||||
public class MapActivity extends BaseActivity
|
public class MapActivity extends BaseActivity
|
||||||
implements PermissionsListener, OnMapReadyCallback {
|
implements PermissionsListener, OnMapReadyCallback {
|
||||||
|
|
||||||
public HashMap<Long, String> markerUserHash = new HashMap<>();
|
private HashMap<Long, String> markerUserHash = new HashMap<>();
|
||||||
private String tag = getClass().getName();
|
private String tag = getClass().getName();
|
||||||
private PermissionsManager permissionsManager;
|
private PermissionsManager permissionsManager;
|
||||||
private LocationComponent locationComponent;
|
private LocationComponent locationComponent;
|
||||||
@ -90,7 +90,7 @@ public class MapActivity extends BaseActivity
|
|||||||
private Button removeLocationButton;
|
private Button removeLocationButton;
|
||||||
private Marker tmpLocalMarker;
|
private Marker tmpLocalMarker;
|
||||||
private Coordinate droppedMarkercoordinate;
|
private Coordinate droppedMarkercoordinate;
|
||||||
private HashMap<String, Coordinate> coordsMap = new HashMap<>();
|
public HashMap<String, Coordinate> coordsMap = new HashMap<>();
|
||||||
private HashMap<String, MapMarker> markerHash = new HashMap<>();
|
private HashMap<String, MapMarker> markerHash = new HashMap<>();
|
||||||
private Set<String> previousCoordsIds = new HashSet<>();
|
private Set<String> previousCoordsIds = new HashSet<>();
|
||||||
private ManualLocationUtils manualLocationUtils;
|
private ManualLocationUtils manualLocationUtils;
|
||||||
|
@ -24,13 +24,16 @@ import android.view.MenuItem;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
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.adapters.TutorsListAdapter;
|
import com.uam.wmi.findmytutor.adapters.TutorsListAdapter;
|
||||||
|
import com.uam.wmi.findmytutor.model.Coordinate;
|
||||||
import com.uam.wmi.findmytutor.model.DutyHourViewModel;
|
import com.uam.wmi.findmytutor.model.DutyHourViewModel;
|
||||||
import com.uam.wmi.findmytutor.model.TutorTabViewModel;
|
import com.uam.wmi.findmytutor.model.TutorTabViewModel;
|
||||||
import com.uam.wmi.findmytutor.model.User;
|
import com.uam.wmi.findmytutor.model.User;
|
||||||
@ -192,6 +195,9 @@ public class UsersListFragment extends Fragment {
|
|||||||
TextView userRoom = view.findViewById(R.id.userRoom);
|
TextView userRoom = view.findViewById(R.id.userRoom);
|
||||||
TextView userEmail = view.findViewById(R.id.userEmail);
|
TextView userEmail = view.findViewById(R.id.userEmail);
|
||||||
TextView department = view.findViewById(R.id.userDepartment);
|
TextView department = view.findViewById(R.id.userDepartment);
|
||||||
|
TextView userStatusLabel = view.findViewById(R.id.user_status_label);
|
||||||
|
LinearLayout userStatusLabelLL = view.findViewById(R.id.user_status_label_linearLayout);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
userName.setText(String.format("%s %s", user.getFirstName(), user.getLastName()));
|
userName.setText(String.format("%s %s", user.getFirstName(), user.getLastName()));
|
||||||
@ -221,7 +227,8 @@ public class UsersListFragment extends Fragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess(TutorTabViewModel tutorTabViewModel) {
|
public void onSuccess(TutorTabViewModel tutorTabViewModel) {
|
||||||
final AlertDialog alertDialog;
|
final AlertDialog alertDialog;
|
||||||
if (((MapActivity) getActivity()).markerUserHash.containsValue(user.getId())) {
|
if (((MapActivity) getActivity()).coordsMap.containsKey(user.getId())) {
|
||||||
|
|
||||||
alertDialogBuilderUserInput.setPositiveButton(R.string.show_on_map, (dialog, id) -> {
|
alertDialogBuilderUserInput.setPositiveButton(R.string.show_on_map, (dialog, id) -> {
|
||||||
// User cancelled the dialog
|
// User cancelled the dialog
|
||||||
((MapActivity) getActivity()).activeFragment = ActiveFragment.NONE;
|
((MapActivity) getActivity()).activeFragment = ActiveFragment.NONE;
|
||||||
@ -230,11 +237,6 @@ public class UsersListFragment extends Fragment {
|
|||||||
fragmentTransaction.commit();
|
fragmentTransaction.commit();
|
||||||
((MapActivity) getActivity()).searchUser(user.getFirstName());
|
((MapActivity) getActivity()).searchUser(user.getFirstName());
|
||||||
((MapActivity) getActivity()).updateNavigationBarState();
|
((MapActivity) getActivity()).updateNavigationBarState();
|
||||||
|
|
||||||
/* List<User> list = new ArrayList<User>();
|
|
||||||
list.add(user);
|
|
||||||
((MapActivity) getActivity()).filterMarkers(list);
|
|
||||||
((MapActivity) getActivity()).updateNavigationBarState();*/
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
alertDialog = alertDialogBuilderUserInput.create();
|
alertDialog = alertDialogBuilderUserInput.create();
|
||||||
@ -257,6 +259,16 @@ public class UsersListFragment extends Fragment {
|
|||||||
department.setText(String.format("%s: %s", getString(R.string.userDepartment), user.getDepartment()));
|
department.setText(String.format("%s: %s", getString(R.string.userDepartment), user.getDepartment()));
|
||||||
userDutyHoursTitle.setText(String.format("%s:", getString(R.string.userDutyHoursHeader)));
|
userDutyHoursTitle.setText(String.format("%s:", getString(R.string.userDutyHoursHeader)));
|
||||||
|
|
||||||
|
Coordinate coordinate = ((MapActivity) getActivity()).coordsMap.get(user.getId());
|
||||||
|
if (coordinate != null){
|
||||||
|
String label = coordinate.getLabel();
|
||||||
|
if (!label.isEmpty()) {
|
||||||
|
userStatusLabelLL.setVisibility(View.VISIBLE);
|
||||||
|
userStatusLabel.setText(String.format("%s: %s", getString(R.string.user_status_label),label));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(getActivity(),
|
final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(getActivity(),
|
||||||
R.layout.duty_hours_item, dutyHoursList);
|
R.layout.duty_hours_item, dutyHoursList);
|
||||||
|
|
||||||
|
13
app/src/main/res/drawable/user_modal_title.xml
Normal file
13
app/src/main/res/drawable/user_modal_title.xml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
|
||||||
|
<path
|
||||||
|
android:fillColor="#ffffff"
|
||||||
|
android:pathData="M22 10l-6-6H4c-1.1 0-2 0.9-2 2v12.01c0 1.1 0.9 1.99 2 1.99l16-0.01c1.1 0 2-0.89 2-1.99v-8zm-7-4.5l5.5 5.5H15V5.5z" />
|
||||||
|
<path
|
||||||
|
android:pathData="M0 0h24v24H0V0z" />
|
||||||
|
</vector>
|
@ -27,19 +27,20 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/userName"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="15dp"
|
||||||
|
android:drawablePadding="10dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:text="Name Surname"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/lbl_new_note_title"
|
||||||
|
android:textStyle="normal"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/userName"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="15dp"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="@dimen/lbl_new_note_title"
|
|
||||||
android:textStyle="normal"
|
|
||||||
android:drawablePadding="10dp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"/>
|
|
||||||
</android.support.constraint.ConstraintLayout>
|
</android.support.constraint.ConstraintLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@ -50,6 +51,28 @@
|
|||||||
android:layout_marginTop="25dp"
|
android:layout_marginTop="25dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/user_status_label_linearLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:paddingLeft="20dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="25dp"
|
||||||
|
android:layout_height="25dp"
|
||||||
|
android:src="@drawable/user_modal_title" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/user_status_label"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:textColor="@color/mapboxWhite" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -59,15 +82,15 @@
|
|||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="25dp"
|
android:layout_width="25dp"
|
||||||
android:layout_height="25dp"
|
android:layout_height="25dp"
|
||||||
android:src="@drawable/user_modal_department"/>
|
android:src="@drawable/user_modal_department" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/userDepartment"
|
android:id="@+id/userDepartment"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:textColor="@color/mapboxWhite"
|
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
/>
|
android:textColor="@color/mapboxWhite" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -80,15 +103,15 @@
|
|||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="25dp"
|
android:layout_width="25dp"
|
||||||
android:layout_height="25dp"
|
android:layout_height="25dp"
|
||||||
android:src="@drawable/user_modal_room"/>
|
android:src="@drawable/user_modal_room" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/userRoom"
|
android:id="@+id/userRoom"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:textColor="@color/mapboxWhite"
|
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
/>
|
android:textColor="@color/mapboxWhite" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -101,15 +124,15 @@
|
|||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="25dp"
|
android:layout_width="25dp"
|
||||||
android:layout_height="25dp"
|
android:layout_height="25dp"
|
||||||
android:src="@drawable/user_modal_email"/>
|
android:src="@drawable/user_modal_email" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/userEmail"
|
android:id="@+id/userEmail"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:textColor="@color/mapboxWhite"
|
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
/>
|
android:textColor="@color/mapboxWhite" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
@ -123,15 +146,14 @@
|
|||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="25dp"
|
android:layout_width="25dp"
|
||||||
android:layout_height="25dp"
|
android:layout_height="25dp"
|
||||||
android:src="@drawable/user_modal_duty"/>
|
android:src="@drawable/user_modal_duty" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/userDutyHoursTitle"
|
android:id="@+id/userDutyHoursTitle"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="@color/mapboxWhite"
|
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
/>
|
android:textColor="@color/mapboxWhite" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -151,34 +173,33 @@
|
|||||||
android:id="@+id/userDutyHours"
|
android:id="@+id/userDutyHours"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingLeft="25dp"
|
|
||||||
android:paddingTop="-10dp"
|
|
||||||
android:divider="@color/background_user_modal"
|
android:divider="@color/background_user_modal"
|
||||||
android:dividerHeight="1dp"
|
android:dividerHeight="1dp"
|
||||||
android:textColor="@color/mapboxWhite"
|
android:paddingLeft="25dp"
|
||||||
/>
|
android:paddingTop="-10dp"
|
||||||
|
android:textColor="@color/mapboxWhite" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:paddingLeft="20dp">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="25dp"
|
|
||||||
android:layout_height="25dp"
|
|
||||||
android:src="@drawable/user_modal_note"/>
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/userNote"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_marginTop="5dp"
|
||||||
android:textColor="@color/mapboxWhite"
|
android:orientation="horizontal"
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="20dp">
|
||||||
/>
|
|
||||||
</LinearLayout>
|
<ImageView
|
||||||
|
android:layout_width="25dp"
|
||||||
|
android:layout_height="25dp"
|
||||||
|
android:src="@drawable/user_modal_note" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/userNote"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:textColor="@color/mapboxWhite" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -453,4 +453,5 @@
|
|||||||
|
|
||||||
<!--(ENG) Undefined manual -->
|
<!--(ENG) Undefined manual -->
|
||||||
<string name="other_location">Not saved location.</string>
|
<string name="other_location">Not saved location.</string>
|
||||||
|
<string name="user_status_label">Status</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
Reference in New Issue
Block a user