Fix strings

This commit is contained in:
Mieszko Wrzeszczyński 2018-12-16 17:42:05 +01:00
parent e2a6bfd56c
commit 9f0ef0590d
7 changed files with 46 additions and 32 deletions

View File

@ -47,8 +47,9 @@ 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.EnableSharingDialog;
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;
@ -149,7 +150,7 @@ public class MapActivity extends BaseActivity
String id = markerUserHash.get(marker.getId());
String locationLevel = PrefUtils.getLocationLevel(getApplicationContext());
if (id.equals(myId) && (locationLevel.equals(SharingLevel.MANUAL.toString()) || locationLevel.equals(SharingLevel.PREDEFINED.toString()))) {
/* if (id.equals(myId) && (locationLevel.equals(SharingLevel.MANUAL.toString()) || locationLevel.equals(SharingLevel.PREDEFINED.toString()))) {
selectLocationButton.setVisibility(View.GONE);
removeLocationButton.setVisibility(View.VISIBLE);
@ -160,9 +161,9 @@ public class MapActivity extends BaseActivity
Toast.makeText(MapActivity.this, R.string.manual_marker_info, Toast.LENGTH_SHORT).show();
});
} else {
} else {*/
createMarkerModal(id);
}
/* }*/
return true;
});
@ -214,14 +215,19 @@ public class MapActivity extends BaseActivity
TextView sharingLevelView = view.findViewById(R.id.sharing_level);
userName.setText(String.format("%s %s", user.getFirstName(), user.getLastName()));
if(cordStatus.equals("")){
status.setText(String.format("%s: %s", getResources().getString(R.string.status_switch_title), getString(R.string.lack_of_status)));
}else{
status.setText(String.format("%s: %s", getResources().getString(R.string.status_switch_title), cordStatus));
}
sharingLevelView.setText(String.format("%s: %s", getResources().getString(R.string.settings_location_level), sharingLevel));
final AlertDialog alertDialog = alertDialogBuilderUserInput.create();
alertDialog.show();
}
private void handleError(Throwable error) {
showError(error);
}

View File

@ -1,30 +1,23 @@
package com.uam.wmi.findmytutor.utils;
import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.support.v7.app.AlertDialog;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.Toast;
import com.uam.wmi.findmytutor.R;
import java.util.Objects;
import static com.mapbox.mapboxsdk.Mapbox.getApplicationContext;
public class InfoHelperUtils {
public static void infoPopUp(View anchorView, int layoutId) {
LayoutInflater layoutInflater = (LayoutInflater)getApplicationContext().getSystemService( Context.LAYOUT_INFLATER_SERVICE );
View popupView = layoutInflater.inflate(layoutId, null);
View popupView = Objects.requireNonNull(layoutInflater).inflate(layoutId, null);
PopupWindow popupWindow = new PopupWindow(popupView,
LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);

View File

@ -1,15 +1,20 @@
package com.uam.wmi.findmytutor.utils;
import android.content.Context;
import android.content.res.Resources;
import android.os.Build;
import android.support.v4.os.ConfigurationCompat;
import java.util.Locale;
public class LocaleUtils {
public static String getCurrentLocale(Context context){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N){
return String.valueOf(context.getResources().getConfiguration().getLocales().get(0));
return String.valueOf(ConfigurationCompat.getLocales(Resources.getSystem().getConfiguration()));
} else{
//noinspection deprecation
return String.valueOf(context.getResources().getConfiguration().locale);
}
}
}

View File

@ -42,10 +42,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="20dp"
android:layout_weight="1"
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" />
@ -56,9 +55,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_weight="1"
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" />
@ -68,9 +67,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:layout_marginBottom="5dp"
android:drawableLeft="@drawable/manual_localization_marker"
android:drawablePadding="5dp"
android:drawablePadding="0dp"
android:gravity="center"
android:text="@string/map_info_text_marker_manual"
android:textColor="@color/half_black" />

View File

@ -1,6 +1,4 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
@ -11,7 +9,6 @@
android:fontFamily="@font/lato_regular"
tools:showIn="@layout/users_list_main">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"

View File

@ -172,9 +172,9 @@
<string name="map_info_text_p1">Na mapie wyświetlane są markery reprezentujące profesorów udostępniających w tej chwili swoją lokalizację.</string>
<string name="map_info_text_p2">Po kliknięciu w marker możemy sprawdzić kto udostępnia lokalizację, oraz status opisowy (jeśli profesor go ustawił).</string>
<string name="map_info_text_p3">W aplikacji dostępne są 3 rodzaje lokalizacji, które reprezentowane są przez markery różnego koloru.</string>
<string name="map_info_text_marker_exact">lokalizacja dokładna (udostępniana z GPS telefonu)</string>
<string name="map_info_text_marker_approximated">lokalizacja przybliżona</string>
<string name="map_info_text_marker_manual"> lokalizacja manualna (wybrana ręcznie)</string>
<string name="map_info_text_marker_exact">- lokalizacja dokładna (udostępniana z GPS telefonu)</string>
<string name="map_info_text_marker_approximated">- lokalizacja przybliżona</string>
<string name="map_info_text_marker_manual">- lokalizacja manualna (wybrana ręcznie)</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>
@ -212,12 +212,22 @@
<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>
<string name="lack_of_status">Użytkownik nie zdefiniował statusu.</string>
<string name="possitive_dialog_button">Tak</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="sharing_modal_title">Udostępnianie</string>
<!--ACRA ON/OFF switch-->
<string name="pref_acra_disabled" translatable="false">Pozwól na wysyłanie raportów o błędach.</string>
<string name="pref_acra_enabled" translatable="false">Pozwól na wysyłanie raportów o błędach.</string>
<string name="pref_title_acra" translatable="false">Raportowanie błędów.</string>
<string name="acra_toast_text" translatable="false">Błąd aplikacji. Informacje o błędzie zostanie wysłana do twórców.</string>
</resources>

View File

@ -244,8 +244,8 @@
<string name="mockup_location_string" translatable="false">mock location string</string>
<!--ACRA ON/OFF switch-->
<string name="pref_acra_disabled" translatable="false">Allow to send raport to developers is ON</string>
<string name="pref_acra_enabled" translatable="false">Allow to send raport to developers is OFF</string>
<string name="pref_acra_disabled" translatable="false">Allow to send report to developers is ON</string>
<string name="pref_acra_enabled" translatable="false">Allow to send report to developers is OFF</string>
<string name="pref_title_acra" translatable="false">App issues reporting</string>
<string name="acra_toast_text" translatable="false">Sorry, the application crashed. A report will be sent to the developers</string>
@ -253,9 +253,9 @@
<string name="map_info_text_p1">On the map there are markers which represents tutors sharing their location right now.</string>
<string name="map_info_text_p2">After clicking on a marker, you can check who is sharing it and the descriptive status (if the tutor have set one).</string>
<string name="map_info_text_p3">In the app there are 3 possible types of localization, represented by various colors.</string>
<string name="map_info_text_marker_exact">exact localization (from mobile GPS)</string>
<string name="map_info_text_marker_approximated">approximated localization</string>
<string name="map_info_text_marker_manual">manual localization (manually picked)</string>
<string name="map_info_text_marker_exact">- exact localization (from mobile GPS)</string>
<string name="map_info_text_marker_approximated">- approximated localization</string>
<string name="map_info_text_marker_manual">- manual localization (manually picked)</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>
@ -293,9 +293,13 @@
<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">(didnt share any localization data since 7 days)</string>
<string name="possitive_dialog_button">yes</string>
<string name="negative_dialog_button">No</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="lack_of_status">The user hasn\'t defined a status.</string>
</resources>