tranlation without map updated

This commit is contained in:
Adam Domagalski 2018-12-10 13:32:57 +01:00
parent f177b80fa4
commit 3f725cd3b3
7 changed files with 135 additions and 12 deletions

View File

@ -1,10 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeSettings">
<configurations>
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
</configurations>
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
@ -34,7 +29,7 @@
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8 (1)" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

@ -48,6 +48,7 @@ import com.uam.wmi.findmytutor.service.CoordinateService;
import com.uam.wmi.findmytutor.service.PredefinedStatusesService;
import com.uam.wmi.findmytutor.service.UserService;
import com.uam.wmi.findmytutor.utils.ApproximatedLocalization;
import com.uam.wmi.findmytutor.utils.InfoHelperUtils;
import com.uam.wmi.findmytutor.utils.ManualLocationUtils;
import com.uam.wmi.findmytutor.utils.MapMarker;
import com.uam.wmi.findmytutor.utils.MapUtils;
@ -68,6 +69,8 @@ import io.reactivex.schedulers.Schedulers;
import okhttp3.ResponseBody;
import timber.log.Timber;
import static com.mapbox.mapboxsdk.Mapbox.getApplicationContext;
public class MapActivity extends BaseActivity
implements PermissionsListener, OnMapReadyCallback {
@ -751,4 +754,6 @@ public class MapActivity extends BaseActivity
Toast.makeText(getApplicationContext(), v.getId() + "", Toast.LENGTH_SHORT).show();
}
}

View File

@ -15,6 +15,7 @@ import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import com.annimon.stream.Stream;
import com.jakewharton.retrofit2.adapter.rxjava2.HttpException;
@ -27,6 +28,7 @@ import com.uam.wmi.findmytutor.model.User;
import com.uam.wmi.findmytutor.network.ApiClient;
import com.uam.wmi.findmytutor.service.TutorTabApi;
import com.uam.wmi.findmytutor.service.UserService;
import com.uam.wmi.findmytutor.utils.InfoHelperUtils;
import com.uam.wmi.findmytutor.utils.MyDividerItemDecoration;
import com.uam.wmi.findmytutor.utils.RecyclerTouchListener;
import com.uam.wmi.findmytutor.utils.RestApiHelper;
@ -76,12 +78,19 @@ public class UsersListFragment extends Fragment {
mAdapter = new TutorsListAdapter(getActivity().getApplicationContext(), tutorsFiltered);
View view = inflater.inflate(R.layout.users_list, container, false);
view.setBackgroundColor(getResources().getColor(android.R.color.white));
return view;
}
public void onViewCreated(View view, Bundle savedInstanceState) {
ButterKnife.bind(this, view);
// TODO: Merge with code from home
InfoHelperUtils infoHelperUtils = new InfoHelperUtils();
view.findViewById(R.id.userListInfoImageButton).setOnClickListener(v ->
infoHelperUtils.infoDialogUserList(getActivity(), v)
);
userService = ApiClient.getClient(getApplicationContext())
.create(UserService.class);
@ -151,11 +160,11 @@ public class UsersListFragment extends Fragment {
List<String> dutyHoursList = Stream.of(tutorTabViewModel.getDutyHours())
.map(DutyHourViewModel::getSummary).toList();
if(dutyHoursList.isEmpty()){
if (dutyHoursList.isEmpty()) {
dutyHoursList.add(getString(R.string.lack_duty_hours));
}
if(tutorTabViewModel.getNote().isEmpty()){
if (tutorTabViewModel.getNote().isEmpty()) {
userNoteText = getString(R.string.lack_note);
}
@ -225,7 +234,7 @@ public class UsersListFragment extends Fragment {
private int sortByUserName(User t1, User t2) {
return plCollator.compare(t1.getLastName(),t2.getLastName());
return plCollator.compare(t1.getLastName(), t2.getLastName());
}
private void showError(Throwable e) {
@ -234,7 +243,7 @@ public class UsersListFragment extends Fragment {
if (e instanceof HttpException) {
ResponseBody responseBody = ((HttpException) e).response().errorBody();
message = RestApiHelper.getErrorMessage(responseBody);
}else{
} else {
message = "Network Error !";
}

View File

@ -0,0 +1,28 @@
package com.uam.wmi.findmytutor.utils;
import android.app.Activity;
import android.content.Context;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.PopupWindow;
import android.widget.Toast;
import com.uam.wmi.findmytutor.R;
import static com.mapbox.mapboxsdk.Mapbox.getApplicationContext;
public class InfoHelperUtils {
public static void infoDialogUserList(Activity activity, View anchorView ) {
View popupView = LayoutInflater.from(activity).inflate(R.layout.feedback_modal, null);
final PopupWindow popupWindow = new PopupWindow(popupView, WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
popupWindow.showAsDropDown(popupView);
Toast.makeText(getApplicationContext(), anchorView.getId() + "", Toast.LENGTH_SHORT).show();
}
}

View File

@ -1,15 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:mapbox="http://schemas.android.com/apk/res-auto"
android:id="@+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fontFamily="@font/lato_regular"
tools:context=".activity.UsersListFragment">
<include layout="@layout/users_list_main" />
<ImageButton
android:id="@+id/userListInfoImageButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
mapbox:srcCompat="@drawable/outline_info_24"/>
</android.support.design.widget.CoordinatorLayout>

View File

@ -167,6 +167,46 @@
<string name="description_awaiting">Czekam na studentów</string>
<string name="description_onholidays">Na wakacjach</string>
<string name="title_description">Status</string>
<!--(PL) Map Activity info helper-->
<string name="map_info_text">Na mapie wyświetlane są markery reprezentujące profesorów udostępniających w tej chwili swoją lokalizację.</string>
<!--(PL) Blacklist info helper-->
<string name="info_icon_blacklist_p1">W tym panelu możesz dodać użytkowników do swojej czarnej listy. Użytkownicy z czarnej listy nie będą widzieć żadnych danych które udostępniasz - lokalizacji, twojego statusu online, czy informacji o obecności.</string>
<string name="info_icon_blacklist_p2">Jedyną informacją która wciąż będzie udostępniana wszystkim jest notka w Twoim profilu.</string>
<string name="info_icon_blacklist_p3">Za pomocą powyższego przycisku możesz włączyć lub wyłączyć używanie czarnej listy. Czarna lista nie może być aktywna jednocześnie z białą listą.</string>
<!--(PL) Whitelist info helper-->
<string name="info_icon_whitelist_p1">W tym panelu możesz dodać użytkowników do swojej białej listy. Użytkownicy SPOZA listy nie będą widzieć żadnych danych które udostępniasz - lokalizacji, twojego statusu online, czy informacji o obecności.</string>
<string name="info_icon_whitelist_p2">Jedyną informacją która wciąż będzie udostępniana wszystkim jest notka w Twoim profilu.</string>
<string name="info_icon_whitelist_p3">Za pomocą powyższego przycisku możesz włączyć lub wyłączyć używanie białej listy. Biała lista nie może być aktywna jednocześnie z czarną listą.</string>
<!--(PL) Tutor tab info helper-->
<string name="info_icon_tutor_tab_p1">W tej zakładce możesz edytować swój profil widoczny dla wszystkich użytkowników.</string>
<string name="info_icon_tutor_tab_p2">Jeśli zakładka jest pusta lub zawiera nieaktualne dane, możesz je ręcznie uaktualnić.</string>
<string name="info_icon_tutor_tab_p3">W każdej chwili możesz przywrócić dane ze strony WMI za pomocą przycisku (jeśli są dostępne na stronie).</string>
<string name="info_icon_tutor_tab_p4">Dodatkowo możesz uzupełnić notkę, aby przekazać jakąś informację widoczną dla wszystkich studentów: np. “dzisiejszy dyżur odwołany” itp.</string>
<!--(PL) Sharing Tab info helper-->
<string name="info_icon_sharing_tab_p1">W tej zakładce możesz włączyć/wyłączyć udostępnianie swojej lokalizacji oraz ją skonfigurować.</string>
<string name="info_icon_sharing_tab_p2">Niektóre zmiany mogą nie być widoczne od razu! Odświeżanie informacji zajmuje do 2 minut.</string>
<string name="info_icon_sharing_tab_p3">Udostępniać możesz na jednym z 4 poziomów:</string>
<string name="info_icon_sharing_tab_p3_level_exact">- dokładny - lokalizacja wyświetlana na mapie na podstawie GPS</string>
<string name="info_icon_sharing_tab_p3_level_approximate">- przybliżony - przybliżona lokalizacja wyświetlana na podstawie GPS</string>
<string name="info_icon_sharing_tab_p3_level_manual">- manualny - udostępnianie z ręcznie wybranego punktu na mapie</string>
<string name="info_icon_sharing_tab_p3_level_presence">- tylko obecność - udostępnianie jedynie informacji o pojawieniu się na wydziale (aktywny na liście), bez udostępniania lokalizacji</string>
<string name="info_icon_sharing_tab_p4">Każdy poziom z wyjątkiem manualnie wybranej lokalizacji automatycznie zaczyna udostępniać po wejściu na wydział i przestaje udostępniać po jego opuszczeniu. Wystarczy włączyć udostępnianie, a lokalizacja nie będzie udostępniana tylko przy obecności na wydziale.</string>
<string name="info_icon_sharing_tab_p5">Udostępnianie w dowolnym momencie można wyłączyć za pomocą przełącznika.</string>
<string name="info_icon_sharing_tab_p6">Dodatkowo, do Twojej lokalizacji możesz dodać status opisowy (będzie on widoczny dla użytkowników po kliknięciu w marker).</string>
<string name="info_icon_sharing_tab_p7">Zarówno manualne lokalizacje jak i statusy możesz dodać do listy, które potem możesz wybrać w wygodny sposób.</string>
<!--(PL) Userlist Tab info helper-->
<string name="info_icon_userlist_tab_p1">W tym panelu znajduje się listę profesorów. Ich status symbolizowany jest przez kolorowe kropki:</string>
<string name="info_icon_userlist_tab_level_status_online"> GREEN dot - użytkownik jest obecnie online</string>
<string name="info_icon_userlist_tab_level_status_offline">RED dot - użytkownik jest obecnie offline</string>
<string name="info_icon_userlist_tab_level_status_inactive">BLACK dot - użytkownik jest nieaktywny (nie udostępnił żadnych danych o lokalizacji od conajmniej tygodnia).</string>
</resources>

View File

@ -242,5 +242,44 @@
<string name="lack_note">No note.</string>
<string name="search">Search</string>
<string name="mockup_location_string" translatable="false">mock location string</string>
<string name="map_info_text">Na mapie wyświetlane są markery reprezentujące profesorów udostępniających w tej chwili swoją lokalizację.</string>
<!--(ENG) Map Activity info helper-->
<string name="map_info_text">There are markers on the map which represent tutors sharing their location at the very moment.</string>
<!--(ENG) Blacklist info helper-->
<string name="info_icon_blacklist_p1">In this panel you can add users to your blacklist. Users from the blacklist cant see any data that you share - localization, online status, or information about presence.</string>
<string name="info_icon_blacklist_p2">The only thing which remains public is the note in your profile.</string>
<string name="info_icon_blacklist_p3">With the switch you can turn on/off usage of the blacklist. Blacklist and whitelist cannot be active at the same time.</string>
<!--(ENG) Whitelist info helper-->
<string name="info_icon_whitelist_p1">In this panel you can add users to your whitelist. Users OUT OF the whitelist cant see any data that you share - localization, online status, or information about presence.</string>
<string name="info_icon_whitelist_p2">The only thing which remains public is the note in your profile.</string>
<string name="info_icon_whitelist_p3">With the switch you can turn on/off usage of the whitelist. Blacklist and whitelist cannot be active at the same time.</string>
<!--(ENG) Tutor Tab info helper-->
<string name="info_icon_tutor_tab_p1">In this tab you can edit you profile visible for all the users.</string>
<string name="info_icon_tutor_tab_p2">If the tab is empty or contains outdated information, you can update them manually.</string>
<string name="info_icon_tutor_tab_p3">Any time you can restore data from the WMI website with the button (if the data is available).</string>
<string name="info_icon_tutor_tab_p4">Additionally, you can fill your note, to share a message visible for all the users: for example “todays duty hours are cancelled” etc.</string>
<!--(ENG) Sharing Tab info helper-->
<string name="info_icon_sharing_tab_p1">In this tab you can turn on/off sharing your localization and configure it.</string>
<string name="info_icon_sharing_tab_p2">Some of the changes may not happen immediately! Refreshing information takes up to 2 minutes.</string>
<string name="info_icon_sharing_tab_p3">You can share your localization on one of the 4 levels:</string>
<string name="info_icon_sharing_tab_p3_level_exact">- exact - localization displayed on a map, based on GPS</string>
<string name="info_icon_sharing_tab_p3_level_approximate">- approximated - approximated localization based on GPS</string>
<string name="info_icon_sharing_tab_p3_level_manual">- manual - sharing from manually picked point</string>
<string name="info_icon_sharing_tab_p3_level_presence">- presence only - sharing only information whether you are present on the faculty or not, without sharing your localization</string>
<string name="info_icon_sharing_tab_p4">Each level, except from manual, will be automatically turned on when entering, and turn off when leaving the faculty. You only need to make sure that sharing is on, and the localization will be shared only when on the faculty.</string>
<string name="info_icon_sharing_tab_p5">Sharing can be turned off at any time with the switch.</string>
<string name="info_icon_sharing_tab_p6">Additionally, you can add descriptive status to your localization (visible for users after clicking on a marker).</string>
<string name="info_icon_sharing_tab_p7">Both manual localizations and statuses can be added to a list, and then used them in a convenient way. </string>
<!--(ENG) Userlist tab info helper-->
<string name="info_icon_userlist_tab_p1">This panel contains the list of tutors. Their status is represented by colorful dots:</string>
<string name="info_icon_userlist_tab_level_status_online">GREEN dot - user is currently online</string>
<string name="info_icon_userlist_tab_level_status_offline">RED dot - user is currently offline</string>
<string name="info_icon_userlist_tab_level_status_inactive">BLACK dot - user is inactive (didnt share any localization data since 7 days)</string>
</resources>