Black list ready to test
This commit is contained in:
commit
84e6b95675
@ -29,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">
|
||||
|
@ -21,6 +21,7 @@ import android.support.v7.app.ActionBarDrawerToggle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.SearchView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
@ -34,7 +35,6 @@ import com.uam.wmi.findmytutor.R;
|
||||
import com.uam.wmi.findmytutor.service.BackgroundLocalizationService;
|
||||
import com.uam.wmi.findmytutor.utils.ActiveFragment;
|
||||
import com.uam.wmi.findmytutor.utils.FeedbackUtils;
|
||||
import com.uam.wmi.findmytutor.utils.InfoHelperUtils;
|
||||
import com.uam.wmi.findmytutor.utils.PrefUtils;
|
||||
import com.uam.wmi.findmytutor.utils.RxSearchObservable;
|
||||
|
||||
@ -51,6 +51,7 @@ import io.reactivex.functions.Function;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
|
||||
import static com.mapbox.mapboxsdk.Mapbox.getApplicationContext;
|
||||
import static com.uam.wmi.findmytutor.utils.Const.defaultMapZoom;
|
||||
import static com.uam.wmi.findmytutor.utils.Const.searchMapZoom;
|
||||
import static com.uam.wmi.findmytutor.utils.PrefUtils.storeBackgroundLocationStatus;
|
||||
@ -88,9 +89,11 @@ public abstract class BaseActivity
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(getContentViewId());
|
||||
|
||||
drawerNavigationView = findViewById(R.id.nav_view);
|
||||
sideDrawer = findViewById(R.id.activity_container);
|
||||
feedbackUtils = new FeedbackUtils(BaseActivity.this);
|
||||
|
||||
drawerNavigationView.setNavigationItemSelectedListener(
|
||||
item -> {
|
||||
String itemName = (String) item.getTitle();
|
||||
@ -197,7 +200,10 @@ public abstract class BaseActivity
|
||||
public void stopBackgroundLocalizationTask() {
|
||||
Intent stopIntent = new Intent(getApplicationContext(), BackgroundLocalizationService.class);
|
||||
stopIntent.putExtra("request_stop", true);
|
||||
startService(stopIntent);
|
||||
Log.e("Localization", "JEstem w stop BG");
|
||||
|
||||
stopService(stopIntent);
|
||||
|
||||
}
|
||||
|
||||
public void startBackgroundLocalizationTask() {
|
||||
@ -213,12 +219,17 @@ public abstract class BaseActivity
|
||||
}
|
||||
|
||||
public void handleBackgroundTaskLifeCycle() {
|
||||
Log.e("Localization", String.valueOf(PrefUtils.isEnableSharingLocalization(getApplicationContext())));
|
||||
Boolean shouldServiceRun = PrefUtils.isEnableSharingLocalization(getApplicationContext()) && isTutor;
|
||||
Log.e("Localization", String.valueOf(shouldServiceRun));
|
||||
|
||||
if (shouldServiceRun) {
|
||||
startBackgroundLocalizationTask();
|
||||
Log.e("Localization", "JEstem i odpalam");
|
||||
|
||||
} else {
|
||||
stopBackgroundLocalizationTask();
|
||||
Log.e("Localization", "JEstem i nie odpalam");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,8 +4,6 @@ import android.Manifest;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Dialog;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.location.Location;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
@ -13,14 +11,11 @@ import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.PopupWindow;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
@ -52,7 +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.InfoHelperUtils;
|
||||
|
||||
import com.uam.wmi.findmytutor.utils.EnableSharingDialog;
|
||||
|
||||
import com.uam.wmi.findmytutor.utils.ManualLocationUtils;
|
||||
import com.uam.wmi.findmytutor.utils.MapMarker;
|
||||
import com.uam.wmi.findmytutor.utils.MapUtils;
|
||||
@ -73,8 +70,6 @@ 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 {
|
||||
|
||||
@ -111,6 +106,7 @@ public class MapActivity extends BaseActivity
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
isTutor = PrefUtils.getIsTutor(this);
|
||||
myId = PrefUtils.getUserId(getApplicationContext());
|
||||
|
||||
@ -131,6 +127,7 @@ public class MapActivity extends BaseActivity
|
||||
|
||||
};
|
||||
|
||||
|
||||
selectLocationButton = findViewById(R.id.select_location_button);
|
||||
removeLocationButton = findViewById(R.id.remove_location_button);
|
||||
mapView = findViewById(R.id.mapView);
|
||||
@ -141,7 +138,6 @@ public class MapActivity extends BaseActivity
|
||||
handleBackgroundTaskLifeCycle();
|
||||
manualLocationUtils = new ManualLocationUtils(MapActivity.this);
|
||||
approximatedLocalization = new ApproximatedLocalization(MapUtils.loadJsonFromAsset(getApplicationContext(), "building.geojson"));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -154,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);
|
||||
|
||||
@ -165,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;
|
||||
});
|
||||
@ -219,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);
|
||||
}
|
||||
@ -234,8 +235,6 @@ public class MapActivity extends BaseActivity
|
||||
private void showError(Throwable e) {
|
||||
String message;
|
||||
|
||||
Log.e("ERR", e.toString());
|
||||
|
||||
if (e instanceof HttpException) {
|
||||
ResponseBody responseBody = ((HttpException) e).response().errorBody();
|
||||
message = RestApiHelper.getErrorMessage(responseBody);
|
||||
@ -290,6 +289,11 @@ public class MapActivity extends BaseActivity
|
||||
PrefUtils.getLocationLevel(getApplicationContext())
|
||||
);
|
||||
|
||||
if (!PrefUtils.isEnableSharingLocalization(getApplicationContext())) {
|
||||
EnableSharingDialog sharingDialog = new EnableSharingDialog();
|
||||
sharingDialog.show(getFragmentManager(), "Sharing");
|
||||
}
|
||||
|
||||
PrefUtils.putManualLocation(this, latLng, approximatedLocation);
|
||||
|
||||
handleBackgroundTaskLifeCycle();
|
||||
@ -333,10 +337,14 @@ public class MapActivity extends BaseActivity
|
||||
|
||||
alertDialog.setOnShowListener(dialogInterface -> {
|
||||
Button sendButton = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE);
|
||||
|
||||
Button dismissButton = alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE);
|
||||
|
||||
dismissButton.setOnClickListener(view1 -> alertDialog.dismiss());
|
||||
dismissButton.setOnClickListener(view1 -> {
|
||||
PrefUtils.putCurrentManualLocationName(getApplicationContext(), "Inne");
|
||||
PrefUtils.putCurrentManualLocation(getApplicationContext(), "-1");
|
||||
|
||||
alertDialog.dismiss();
|
||||
});
|
||||
|
||||
sendButton.setOnClickListener(view1 -> {
|
||||
String body = modalUserInput.getText().toString();
|
||||
@ -346,7 +354,7 @@ public class MapActivity extends BaseActivity
|
||||
modalUserInput.requestFocus();
|
||||
} else {
|
||||
sendLocation(body, latLng);
|
||||
PrefUtils.putCurrentManualLocationName(getApplicationContext(),body);
|
||||
PrefUtils.putCurrentManualLocationName(getApplicationContext(), body);
|
||||
alertDialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
@ -11,6 +11,7 @@ import android.preference.Preference;
|
||||
import android.preference.PreferenceFragment;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import com.uam.wmi.findmytutor.R;
|
||||
@ -54,7 +55,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
||||
Preference languagesList = findPreference(getResources().getString(R.string.key_language));
|
||||
languagesList.setDefaultValue(0);
|
||||
|
||||
if(PrefUtils.getLocale(getActivity()).equals("pl")){
|
||||
if(PrefUtils.getLocale(getActivity()).equals("1")){
|
||||
languagesList.setDefaultValue(1);
|
||||
}
|
||||
|
||||
|
@ -2,11 +2,13 @@ package com.uam.wmi.findmytutor.activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.FragmentTransaction;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.preference.ListPreference;
|
||||
import android.preference.Preference;
|
||||
import android.preference.PreferenceCategory;
|
||||
import android.preference.PreferenceFragment;
|
||||
import android.preference.SwitchPreference;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@ -20,6 +22,8 @@ import com.uam.wmi.findmytutor.R;
|
||||
import com.uam.wmi.findmytutor.model.PredefinedCoordViewModel;
|
||||
import com.uam.wmi.findmytutor.network.ApiClient;
|
||||
import com.uam.wmi.findmytutor.service.PredefinedStatusesService;
|
||||
import com.uam.wmi.findmytutor.utils.Const;
|
||||
import com.uam.wmi.findmytutor.utils.EnableSharingDialog;
|
||||
import com.uam.wmi.findmytutor.utils.PrefUtils;
|
||||
import com.uam.wmi.findmytutor.utils.RestApiHelper;
|
||||
import com.uam.wmi.findmytutor.utils.RightButtonPreference;
|
||||
@ -39,8 +43,8 @@ import okhttp3.ResponseBody;
|
||||
import static com.mapbox.mapboxsdk.Mapbox.getApplicationContext;
|
||||
|
||||
|
||||
public class SharingFragment extends PreferenceFragment {
|
||||
protected Preference locationSharing;
|
||||
public class SharingFragment extends PreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
protected SwitchPreference locationSharing;
|
||||
protected Preference locationMode;
|
||||
protected ListPreference manualLocationList;
|
||||
protected PreferenceCategory preferenceCategory;
|
||||
@ -66,7 +70,7 @@ public class SharingFragment extends PreferenceFragment {
|
||||
@Override
|
||||
public void onSuccess(List<String> strings) {
|
||||
String[] statusesArray = strings.toArray(new String[strings.size()]);
|
||||
setListPreferenceData(statusList, statusesArray,null);
|
||||
setListPreferenceData(statusList, statusesArray, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -85,25 +89,27 @@ public class SharingFragment extends PreferenceFragment {
|
||||
|
||||
@Override
|
||||
public void onSuccess(List<PredefinedCoordViewModel> coords) {
|
||||
List<String> names = Stream.of(coords).map(PredefinedCoordViewModel::getName).collect(com.annimon.stream.Collectors.toList());
|
||||
predefinedCoordsList.addAll(coords);
|
||||
String[] stringnames = names.toArray(new String[0]);
|
||||
String currentCoordId = PrefUtils.getCurrentManualLocation(getApplicationContext());
|
||||
|
||||
List<Integer> activeId = Stream.of(coords).indexed()
|
||||
List<String> predefinedLocationsNames = Stream.of(coords).map(PredefinedCoordViewModel::getName).toList();
|
||||
predefinedCoordsList.addAll(coords);
|
||||
|
||||
String[] stringnames = predefinedLocationsNames.toArray(new String[0]);
|
||||
|
||||
List<Integer> activesId = Stream.of(coords).indexed()
|
||||
.filter(v -> v.getSecond().getPredefinedCoordinateId().equals(currentCoordId)).map(IntPair::getFirst).toList();
|
||||
|
||||
if(activeId.size() > 0)
|
||||
setListPreferenceData(manualLocationList, stringnames, activeId.get(0));
|
||||
else{
|
||||
setListPreferenceData(manualLocationList, stringnames,null);
|
||||
if( activesId.size() == 0){
|
||||
setListPreferenceData(manualLocationList, stringnames, null);
|
||||
}
|
||||
else {
|
||||
setListPreferenceData(manualLocationList, stringnames, activesId.get(0));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Toast.makeText(getApplicationContext(), R.string.error_location_fetch, Toast.LENGTH_SHORT).show();
|
||||
|
||||
}
|
||||
}));
|
||||
}
|
||||
@ -113,7 +119,7 @@ public class SharingFragment extends PreferenceFragment {
|
||||
public void onCreate(final Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
addPreferencesFromResource(R.layout.pref_sharing);
|
||||
locationSharing = findPreference("key_sharing_enabled");
|
||||
locationSharing = (SwitchPreference) findPreference("key_sharing_enabled");
|
||||
locationMode = findPreference("key_location_level");
|
||||
preferenceCategory = (PreferenceCategory) findPreference("category_sharing");
|
||||
manualLocationList = (ListPreference) findPreference("key_manual_location_value");
|
||||
@ -137,7 +143,7 @@ public class SharingFragment extends PreferenceFragment {
|
||||
|
||||
statusList.setSummary(PrefUtils.getUserStatus(getApplicationContext()));
|
||||
manualLocationList.setSummary(PrefUtils.getCurrentManualLocationName(getApplicationContext()));
|
||||
// manualLocationList.setSummary(PrefUtils.getManualLocation(getApplicationContext()));
|
||||
|
||||
/** Main sharing switch**/
|
||||
locationSharing.setOnPreferenceChangeListener((buttonView, newValue) -> {
|
||||
PrefUtils.storeEnableSharingLocalization(getApplicationContext(), (Boolean) newValue);
|
||||
@ -149,8 +155,9 @@ public class SharingFragment extends PreferenceFragment {
|
||||
locationMode.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||
|
||||
PrefUtils.storeLocationMode(getApplicationContext(), locationLevelMapping.get(Integer.parseInt((String) newValue)));
|
||||
if (PrefUtils.getLocationLevel(getApplicationContext()).equals("manual")) {
|
||||
if(!predefinedCoordsList.isEmpty()){
|
||||
|
||||
if (PrefUtils.getLocationLevel(getApplicationContext()).equals(SharingLevel.MANUAL.toString())) {
|
||||
if (!predefinedCoordsList.isEmpty()) {
|
||||
preferenceCategory.addPreference(manualLocationList);
|
||||
}
|
||||
|
||||
@ -167,12 +174,6 @@ public class SharingFragment extends PreferenceFragment {
|
||||
if (!PrefUtils.getLocationLevel(getApplicationContext()).equals("manual")) {
|
||||
preferenceCategory.removePreference(manualLocationList);
|
||||
preferenceCategory.removePreference(manualLocationButton);
|
||||
}else{
|
||||
// if(predefinedCoordsList.isEmpty()){
|
||||
//// preferenceCategory.removePreference(manualLocationList);
|
||||
//
|
||||
//
|
||||
// }
|
||||
}
|
||||
|
||||
/** Custom manual location list change listener **/
|
||||
@ -180,14 +181,24 @@ public class SharingFragment extends PreferenceFragment {
|
||||
ListPreference lp = (ListPreference) preference;
|
||||
CharSequence[] entries = lp.getEntries();
|
||||
PredefinedCoordViewModel temp = Stream.of(predefinedCoordsList).filter(p -> p.getName().equals(lp.getEntries()[Integer.parseInt((String) newValue)].toString())).toList().get(0);
|
||||
PrefUtils.putManualLocation(getApplicationContext(), temp.getGeoData(), temp.getApproximatedLocation() );
|
||||
PrefUtils.putCurrentManualLocation(getApplicationContext(),temp.getPredefinedCoordinateId());
|
||||
PrefUtils.putCurrentManualLocationName(getApplicationContext(), (String )lp.getEntries()[Integer.parseInt((String) newValue)]);
|
||||
|
||||
//sharing dialog -> ask for start BG
|
||||
if (!PrefUtils.isEnableSharingLocalization(getApplicationContext())) {
|
||||
EnableSharingDialog sharingDialog = new EnableSharingDialog();
|
||||
sharingDialog.show(getFragmentManager(), "Sharing");
|
||||
}
|
||||
|
||||
PrefUtils.putManualLocation(getApplicationContext(), temp.getGeoData(), temp.getApproximatedLocation());
|
||||
PrefUtils.putCurrentManualLocation(getApplicationContext(), temp.getPredefinedCoordinateId());
|
||||
PrefUtils.putCurrentManualLocationName(getApplicationContext(), (String) lp.getEntries()[Integer.parseInt((String) newValue)]);
|
||||
lp.setSummary(lp.getEntries()[Integer.parseInt((String) newValue)]);
|
||||
((MapActivity) getActivity()).handleBackgroundTaskLifeCycle();
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
|
||||
|
||||
/** Button 'choose from map' button listener **/
|
||||
manualLocationButton.setOnPreferenceChangeListener((preference, o) -> {
|
||||
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
|
||||
@ -204,6 +215,7 @@ public class SharingFragment extends PreferenceFragment {
|
||||
lp.setSummary(entries[Integer.parseInt((String) newValue)]);
|
||||
return true;
|
||||
});
|
||||
|
||||
/** Custom status list change listener **/
|
||||
manualStatus.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||
|
||||
@ -212,11 +224,8 @@ public class SharingFragment extends PreferenceFragment {
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(this::handleResponse, this::handleError));
|
||||
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -228,7 +237,7 @@ public class SharingFragment extends PreferenceFragment {
|
||||
}
|
||||
|
||||
protected void setListPreferenceData(ListPreference lp, String[] entries, Integer activeId) {
|
||||
Log.d("setlistpref",lp.getKey());
|
||||
|
||||
try {
|
||||
lp.setEntries(entries);
|
||||
CharSequence[] entryValues = new CharSequence[entries.length];
|
||||
@ -240,25 +249,25 @@ public class SharingFragment extends PreferenceFragment {
|
||||
lp.setDefaultValue(0);
|
||||
lp.setEntryValues(entryValues);
|
||||
|
||||
if(entries.length > 0 && activeId != null)
|
||||
if (entries.length > 0 && activeId != null)
|
||||
lp.setValueIndex(activeId);
|
||||
|
||||
}catch (Exception e){
|
||||
Log.e("Failed to set listPref",e.getMessage());
|
||||
} catch (Exception e) {
|
||||
Log.e("Failed to set listPref", e.getMessage());
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
private void handleResponse(List<String> resp) {
|
||||
String[] statusesArray = resp.toArray(new String[resp.size()]);
|
||||
|
||||
setListPreferenceData(statusList, statusesArray,resp.size() - 1);
|
||||
setListPreferenceData(statusList, statusesArray, resp.size() - 1);
|
||||
|
||||
statusList.setValueIndex(resp.size() - 1);
|
||||
PrefUtils.storeStatus(getApplicationContext(), resp.get(resp.size() - 1));
|
||||
statusList.setSummary(PrefUtils.getUserStatus(getApplicationContext()));
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void handleError(Throwable error) {
|
||||
@ -273,4 +282,22 @@ public class SharingFragment extends PreferenceFragment {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
||||
locationSharing.setChecked(PrefUtils.isEnableSharingLocalization(getApplicationContext()));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
getPreferenceManager().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
getPreferenceManager().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);
|
||||
super.onPause();
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ public class StartupActivity extends AppCompatActivity {
|
||||
|
||||
if (PrefUtils.isLoggedIn(getApplicationContext())){
|
||||
Intent startupIntent = new Intent(this, MapActivity.class);
|
||||
PrefUtils.storeLocale(getApplicationContext(),PrefUtils.getLocale(getApplicationContext()));
|
||||
startupIntent.putExtra(currentLang, PrefUtils.getLocale(getApplicationContext()));
|
||||
startupIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
startActivity(startupIntent);
|
||||
|
@ -1,17 +1,25 @@
|
||||
package com.uam.wmi.findmytutor.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.TextInputEditText;
|
||||
import android.support.design.widget.TextInputLayout;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Adapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.jakewharton.retrofit2.adapter.rxjava2.HttpException;
|
||||
import com.uam.wmi.findmytutor.R;
|
||||
import com.uam.wmi.findmytutor.adapters.DutyHoursAdapter;
|
||||
import com.uam.wmi.findmytutor.model.DutyHour;
|
||||
import com.uam.wmi.findmytutor.model.DutyHourViewModel;
|
||||
import com.uam.wmi.findmytutor.model.TutorTabViewModel;
|
||||
import com.uam.wmi.findmytutor.model.User;
|
||||
@ -22,6 +30,7 @@ import com.uam.wmi.findmytutor.utils.InfoHelperUtils;
|
||||
import com.uam.wmi.findmytutor.utils.PrefUtils;
|
||||
import com.uam.wmi.findmytutor.utils.RestApiHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@ -38,32 +47,41 @@ public class TutorTab extends AppCompatActivity {
|
||||
private CompositeDisposable disposable = new CompositeDisposable();
|
||||
private TextView userName;
|
||||
private TextView userDutyHours;
|
||||
private EditText userNote;
|
||||
private TextInputEditText userNote;
|
||||
private TextView userRoom;
|
||||
private TextView userEmail;
|
||||
private TextView department;
|
||||
private Button addDutyButton;
|
||||
private Button saveButon;
|
||||
private Boolean ifTutorTabExists = true;
|
||||
private List<DutyHourViewModel> dutyHourList;
|
||||
private RecyclerView dutyHoursRecycller;
|
||||
private DutyHoursAdapter dutyHoursAdapter;
|
||||
private RecyclerView.LayoutManager dutyHoursLayoutManager;
|
||||
private TutorTabViewModel newTab;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.content_tutor_tab);
|
||||
|
||||
userName = findViewById(R.id.userName);
|
||||
userNote = (TextInputEditText) findViewById(R.id.userNote);
|
||||
userRoom = findViewById(R.id.userRoom);
|
||||
userEmail = findViewById(R.id.userEmail);
|
||||
department = findViewById(R.id.userDepartment);
|
||||
saveButon = findViewById(R.id.saveButon);
|
||||
addDutyButton = findViewById(R.id.addDuty);
|
||||
dutyHoursRecycller = (RecyclerView) findViewById(R.id.dutyHourView);
|
||||
dutyHoursLayoutManager = new LinearLayoutManager(this);
|
||||
dutyHoursRecycller.setLayoutManager(dutyHoursLayoutManager);
|
||||
|
||||
|
||||
tutorTabService = ApiClient.getClient(getApplicationContext())
|
||||
.create(TutorTabApi.class);
|
||||
userService = ApiClient.getClient(getApplicationContext())
|
||||
.create(UserService.class);
|
||||
setContentView(R.layout.content_tutor_tab);
|
||||
TextView userName = findViewById(R.id.userName);
|
||||
TextView userDutyHours = findViewById(R.id.userDutyHours);
|
||||
EditText userNote = findViewById(R.id.userNote);
|
||||
TextView userRoom = findViewById(R.id.userRoom);
|
||||
TextView userEmail = findViewById(R.id.userEmail);
|
||||
TextView department = findViewById(R.id.userDepartment);
|
||||
Button saveButon = findViewById(R.id.saveButon);
|
||||
findViewById(R.id.contentTutorTabInfoImageButton).setOnClickListener(v-> InfoHelperUtils.infoPopUp(v,R.layout.info_popup_tutor_tab));
|
||||
|
||||
userName.setText(String.format("%s %s", PrefUtils.getUserFirstName(getApplicationContext()), PrefUtils.getUserLastName(getApplicationContext())));
|
||||
disposable.add(
|
||||
tutorTabService.apiUsersTutorTabByTutorIdGet(PrefUtils.getUserId(getApplicationContext()))
|
||||
.subscribeOn(Schedulers.io())
|
||||
@ -72,23 +90,49 @@ public class TutorTab extends AppCompatActivity {
|
||||
@Override
|
||||
public void onSuccess(TutorTabViewModel tutorTabViewModel) {
|
||||
|
||||
List<String> dutyHoursList = Stream.of(tutorTabViewModel.getDutyHours())
|
||||
.map(DutyHourViewModel::getSummary).toList();
|
||||
|
||||
userRoom.setText(String.format("%s: %s", getString(R.string.userRoom), tutorTabViewModel.getRoom()));
|
||||
userEmail.setText(String.format("%s: %s", getString(R.string.userEmail), tutorTabViewModel.getEmailTutorTab()));
|
||||
dutyHourList = tutorTabViewModel.getDutyHours();
|
||||
if(dutyHourList == null){
|
||||
}else{
|
||||
dutyHoursAdapter = new DutyHoursAdapter(getApplicationContext(),dutyHourList);
|
||||
dutyHoursRecycller.setAdapter(dutyHoursAdapter);
|
||||
addDutyButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
addEmptyDuty(dutyHoursAdapter);
|
||||
}
|
||||
});
|
||||
}
|
||||
userRoom.setText(String.format("%s", tutorTabViewModel.getRoom()));
|
||||
userEmail.setText(String.format("%s", tutorTabViewModel.getEmailTutorTab()));
|
||||
if (!tutorTabViewModel.getNote().equals("")) {
|
||||
userNote.setText(String.format("%s", tutorTabViewModel.getNote()));
|
||||
}
|
||||
userDutyHours.setText(String.format("%s: %s", getString(R.string.userDutyHoursHeader), Arrays.toString(dutyHoursList.toArray())));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
int code = ((HttpException) e).response().code();
|
||||
if( code == 404){
|
||||
ifTutorTabExists = false;
|
||||
dutyHoursAdapter = new DutyHoursAdapter(getApplicationContext(),new ArrayList<DutyHourViewModel>());
|
||||
dutyHoursRecycller.setAdapter(dutyHoursAdapter);
|
||||
addDutyButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
addEmptyDuty(dutyHoursAdapter);
|
||||
}
|
||||
});
|
||||
}
|
||||
showError(e);
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
|
||||
findViewById(R.id.contentTutorTabInfoImageButton).setOnClickListener(v-> InfoHelperUtils.infoPopUp(v,R.layout.info_popup_tutor_tab));
|
||||
|
||||
userName.setText(String.format("%s %s", PrefUtils.getUserFirstName(getApplicationContext()), PrefUtils.getUserLastName(getApplicationContext())));
|
||||
|
||||
disposable.add(
|
||||
|
||||
userService.getUserById(PrefUtils.getUserId(getApplicationContext()))
|
||||
@ -104,18 +148,33 @@ public class TutorTab extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
|
||||
showError(e);
|
||||
}
|
||||
}));
|
||||
setUpSaveListener(saveButon, userNote);
|
||||
setUpSaveListener(saveButon);
|
||||
}
|
||||
private void addEmptyDuty(DutyHoursAdapter adapter){
|
||||
adapter.addDuty(new DutyHourViewModel());
|
||||
adapter.notifyItemInserted(adapter.getItemCount());
|
||||
dutyHoursRecycller.scrollToPosition(adapter.getItemCount()-1);
|
||||
}
|
||||
|
||||
private void setUpSaveListener(Button button, EditText note) {
|
||||
private void setUpSaveListener(Button button) {
|
||||
button.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
newTab = new TutorTabViewModel(PrefUtils.getUserId(getApplicationContext()),note.getText().toString());
|
||||
newTab = new TutorTabViewModel(PrefUtils.getUserId(getApplicationContext()),
|
||||
userRoom.getText().toString(),
|
||||
userEmail.getText().toString(),
|
||||
userNote.getText().toString(),
|
||||
dutyHoursAdapter.getDutyList());
|
||||
if(ifTutorTabExists){
|
||||
putUserTab(newTab);
|
||||
}else{
|
||||
postUserTab(newTab);
|
||||
ifTutorTabExists=true;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -124,11 +183,21 @@ public class TutorTab extends AppCompatActivity {
|
||||
disposable.add(tutorTabService.apiUsersTutorTabByTutorIdPut(PrefUtils.getUserId(getApplicationContext()), tutorTabViewModel)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(this::handleResponse, this::handleError));
|
||||
.subscribe(this::handleResponsePut, this::handleError));
|
||||
}
|
||||
private void postUserTab(TutorTabViewModel tutorTabViewModel) {
|
||||
disposable.add(tutorTabService.apiUsersTutorTabByTutorIdPost(PrefUtils.getUserId(getApplicationContext()), tutorTabViewModel)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(this::handleResponsePost, this::handleError));
|
||||
}
|
||||
|
||||
private void handleResponse(TutorTabViewModel tutorTabViewModel) {
|
||||
Toast.makeText(getApplicationContext(), getApplicationContext().getString(R.string.modal_feedback_thankyou), Toast.LENGTH_SHORT).show();
|
||||
private void handleResponsePut(Response<Void> resp) {
|
||||
Toast.makeText(getApplicationContext(), getApplicationContext().getString(R.string.updateToast), Toast.LENGTH_SHORT).show();
|
||||
|
||||
}
|
||||
private void handleResponsePost(TutorTabViewModel tutorTabViewModel ) {
|
||||
Toast.makeText(getApplicationContext(), getApplicationContext().getString(R.string.updateToast), Toast.LENGTH_SHORT).show();
|
||||
|
||||
}
|
||||
|
||||
@ -155,9 +224,6 @@ public class TutorTab extends AppCompatActivity {
|
||||
} else {
|
||||
message = "Network Error!";
|
||||
}
|
||||
|
||||
// Snackbar.make(coordinatorLayout, message, Snackbar.LENGTH_LONG)
|
||||
// .show();
|
||||
Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,163 @@
|
||||
package com.uam.wmi.findmytutor.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
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 com.annimon.stream.Collectors;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.uam.wmi.findmytutor.R;
|
||||
import com.uam.wmi.findmytutor.model.DutyHourViewModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
|
||||
|
||||
public class DutyHoursAdapter extends RecyclerView.Adapter<DutyHoursAdapter.MyViewHolder> {
|
||||
private Context context;
|
||||
private List<DutyHourViewModel> hours;
|
||||
|
||||
public DutyHoursAdapter(Context context, List<DutyHourViewModel> hours) {
|
||||
this.context = context;
|
||||
this.hours = new ArrayList<DutyHourViewModel>(hours);
|
||||
}
|
||||
|
||||
|
||||
public List<DutyHourViewModel> getDutyList(){
|
||||
ArrayList<DutyHourViewModel> notEmpty = Stream.of(hours).filter(DutyHourViewModel::isValid).collect(Collectors.toCollection(ArrayList::new));
|
||||
return notEmpty;
|
||||
}
|
||||
public void addDuty(DutyHourViewModel duty){
|
||||
hours.add(duty);
|
||||
}
|
||||
private void removeDuty(int pos){
|
||||
hours.remove(pos);
|
||||
this.notifyItemRemoved(pos);
|
||||
Log.d("DutyIndex af rm size",Integer.toString(getItemCount()));
|
||||
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View itemView = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.duty_hour_row, parent, false);
|
||||
|
||||
return new MyViewHolder(itemView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
|
||||
DutyHourViewModel duty = hours.get(position);
|
||||
holder.dutyDay.setText(duty.getDay());
|
||||
holder.dutyDay.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
duty.setDay(holder.dutyDay.getText().toString());
|
||||
}
|
||||
});
|
||||
holder.dutyStart.setText(duty.getStart());
|
||||
holder.dutyStart.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
duty.setStart(holder.dutyStart.getText().toString());
|
||||
}
|
||||
});
|
||||
holder.dutyStop.setText(duty.getEnd());
|
||||
holder.dutyStop.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
duty.setEnd(holder.dutyStop.getText().toString());
|
||||
}
|
||||
});
|
||||
holder.deleteRow.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
try{
|
||||
Log.d("DutyIndex bf rm size",Integer.toString(getItemCount()));
|
||||
Log.d("DutyIndex bf rm pos",Integer.toString(holder.getLayoutPosition()));
|
||||
removeDuty(holder.getLayoutPosition());
|
||||
Log.d("DutyIndex af rm pos",Integer.toString(holder.getLayoutPosition()));
|
||||
|
||||
|
||||
}catch(Error e){
|
||||
Log.e("DutyIndex error",e.getMessage());
|
||||
Log.e("DutyIndex size",Integer.toString(getItemCount()));
|
||||
Log.e("DutyIndex pos",Integer.toString(holder.getAdapterPosition()));
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return hours.size();
|
||||
}
|
||||
|
||||
class MyViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
@BindView(R.id.duty_day_value)
|
||||
TextView dutyDay;
|
||||
|
||||
@BindView(R.id.duty_start_value)
|
||||
TextView dutyStart;
|
||||
|
||||
@BindView(R.id.duty_stop_value)
|
||||
TextView dutyStop;
|
||||
|
||||
@BindView(R.id.deleteRow)
|
||||
ImageButton deleteRow;
|
||||
|
||||
MyViewHolder(View view) {
|
||||
super(view);
|
||||
ButterKnife.bind(this, view);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -24,6 +24,20 @@ public class DutyHourViewModel {
|
||||
this.day = day;
|
||||
return this;
|
||||
}
|
||||
public Boolean isValid(){
|
||||
if(this.day.isEmpty()){
|
||||
return false;
|
||||
}else if( !this.start.isEmpty() && this.end.isEmpty() ){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public DutyHourViewModel(){
|
||||
day="";
|
||||
start="";
|
||||
end="";
|
||||
}
|
||||
|
||||
/**
|
||||
* Get day
|
||||
@ -94,12 +108,11 @@ public class DutyHourViewModel {
|
||||
return Objects.hash(day, start, end);
|
||||
}
|
||||
|
||||
|
||||
public String getSummary() {
|
||||
return this.getDay() + " " + this.getStart() + " " + this.getEnd();
|
||||
return this.getDay() + ": " + this.getStart() + " - " + this.getEnd();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
@ -33,11 +33,12 @@ public class TutorTabViewModel {
|
||||
@SerializedName("dutyHours")
|
||||
private List<DutyHourViewModel> dutyHours = null;
|
||||
|
||||
public TutorTabViewModel(String userId, String note){
|
||||
public TutorTabViewModel(String userId, String room, String email, String note, List<DutyHourViewModel> dutyHours){
|
||||
this.userId=userId;
|
||||
// this.room=room;
|
||||
// this.emailTutorTab=emailTutorTab;
|
||||
this.room=room;
|
||||
this.emailTutorTab=email;
|
||||
this.note=note;
|
||||
this.dutyHours = new ArrayList<DutyHourViewModel>(dutyHours);
|
||||
}
|
||||
|
||||
public TutorTabViewModel tutorTabId(UUID tutorTabId) {
|
||||
|
@ -27,7 +27,6 @@ public class ApiClient {
|
||||
private static Retrofit retrofit = null;
|
||||
private static int REQUEST_TIMEOUT = 60;
|
||||
private static OkHttpClient okHttpClient;
|
||||
// private static final String BASE_URL = "https://s416084.projektstudencki.pl/master/";
|
||||
|
||||
public static Retrofit getClient(Context context) {
|
||||
|
||||
|
@ -5,6 +5,7 @@ import com.uam.wmi.findmytutor.model.TutorTabViewModel;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.Single;
|
||||
import retrofit2.Response;
|
||||
import retrofit2.http.*;
|
||||
|
||||
|
||||
@ -40,6 +41,10 @@ public interface TutorTabApi {
|
||||
@retrofit2.http.Path("tutorId") String tutorId
|
||||
);
|
||||
|
||||
@POST("api/users/tutorTab/{tutorId}")
|
||||
Single<TutorTabViewModel> apiUsersTutorTabByTutorIdPost(
|
||||
@retrofit2.http.Path("tutorId") String tutorId, @retrofit2.http.Body TutorTabViewModel tutorTab
|
||||
);
|
||||
/**
|
||||
*
|
||||
*
|
||||
@ -51,7 +56,7 @@ public interface TutorTabApi {
|
||||
"Content-Type:application/json"
|
||||
})
|
||||
@PUT("api/users/tutorTab/{tutorId}")
|
||||
Observable<TutorTabViewModel> apiUsersTutorTabByTutorIdPut(
|
||||
Observable<Response<Void>> apiUsersTutorTabByTutorIdPut(
|
||||
@retrofit2.http.Path("tutorId") String tutorId, @retrofit2.http.Body TutorTabViewModel tutorTab
|
||||
);
|
||||
|
||||
|
@ -1,25 +1,18 @@
|
||||
package com.uam.wmi.findmytutor.utils;
|
||||
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.mapbox.geojson.BoundingBox;
|
||||
import com.mapbox.geojson.Feature;
|
||||
import com.mapbox.geojson.FeatureCollection;
|
||||
import com.mapbox.geojson.Geometry;
|
||||
import com.mapbox.geojson.Point;
|
||||
import com.mapbox.geojson.Polygon;
|
||||
import com.mapbox.geojson.gson.BoundingBoxDeserializer;
|
||||
import com.mapbox.geojson.gson.GeoJsonAdapterFactory;
|
||||
import com.mapbox.geojson.gson.GeometryDeserializer;
|
||||
import com.mapbox.geojson.gson.PointDeserializer;
|
||||
import com.mapbox.turf.TurfClassification;
|
||||
import com.mapbox.turf.TurfJoins;
|
||||
import com.mapbox.turf.TurfMeasurement;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
;
|
||||
;import static com.mapbox.geojson.FeatureCollection.fromJson;
|
||||
|
||||
public class ApproximatedLocalization {
|
||||
private FeatureCollection buildingSchema = null;
|
||||
@ -28,17 +21,6 @@ public class ApproximatedLocalization {
|
||||
buildingSchema = fromJson(buildingObject);
|
||||
}
|
||||
|
||||
private FeatureCollection fromJson(@NonNull String json) {
|
||||
GsonBuilder gson = new GsonBuilder();
|
||||
|
||||
gson.registerTypeAdapterFactory(GeoJsonAdapterFactory.create());
|
||||
gson.registerTypeAdapter(Point.class, new PointDeserializer());
|
||||
gson.registerTypeAdapter(Geometry.class, new GeometryDeserializer());
|
||||
gson.registerTypeAdapter(BoundingBox.class, new BoundingBoxDeserializer());
|
||||
|
||||
return gson.create().fromJson(json, FeatureCollection.class);
|
||||
}
|
||||
|
||||
public String getNameOfBuildingPart(Point point) {
|
||||
|
||||
for (Feature feature : Objects.requireNonNull(buildingSchema.features())) {
|
||||
@ -56,7 +38,9 @@ public class ApproximatedLocalization {
|
||||
for (Feature feature : Objects.requireNonNull(buildingSchema.features())) {
|
||||
String partName = feature.getStringProperty("name");
|
||||
|
||||
|
||||
if (buildingPart != null && buildingPart.equals(partName)) {
|
||||
|
||||
Double longitude = feature.getNumberProperty("longitude").doubleValue();
|
||||
Double latitude = feature.getNumberProperty("latitude").doubleValue();
|
||||
|
||||
|
@ -7,7 +7,7 @@ import java.util.List;
|
||||
|
||||
public class Const {
|
||||
public final static String BASE_URL = "https://s416084.projektstudencki.pl/master/";
|
||||
public final static Integer onlineBackgroundLocationInterval = 15000;
|
||||
public final static Integer onlineBackgroundLocationInterval = 7000;
|
||||
public final static Integer offlineBackgroundLocationInterval = 36000;
|
||||
public final static Integer defaultMapZoom = 17;
|
||||
public final static Integer searchMapZoom = 13;
|
||||
|
@ -0,0 +1,31 @@
|
||||
package com.uam.wmi.findmytutor.utils;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.app.DialogFragment;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.uam.wmi.findmytutor.R;
|
||||
import com.uam.wmi.findmytutor.activity.MapActivity;
|
||||
|
||||
public class EnableSharingDialog extends DialogFragment {
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
return new AlertDialog.Builder(getActivity())
|
||||
.setTitle(R.string.sharing_modal_title)
|
||||
.setMessage(R.string.enable_sharing_question)
|
||||
.setPositiveButton(R.string.possitive_dialog_button, (dialog, which) ->
|
||||
dialogPositiveAnswer(getActivity())
|
||||
)
|
||||
.setNegativeButton(R.string.negative_dialog_button, (dialog, which) -> dialog.cancel()).create();
|
||||
}
|
||||
|
||||
private void dialogPositiveAnswer(Context context) {
|
||||
PrefUtils.storeEnableSharingLocalization(context, true);
|
||||
((MapActivity) getActivity()).handleBackgroundTaskLifeCycle();
|
||||
|
||||
}
|
||||
}
|
@ -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);
|
||||
|
@ -1,15 +1,10 @@
|
||||
package com.uam.wmi.findmytutor.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.content.res.Resources;
|
||||
import android.support.v4.os.ConfigurationCompat;
|
||||
|
||||
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));
|
||||
} else{
|
||||
//noinspection deprecation
|
||||
return String.valueOf(context.getResources().getConfiguration().locale);
|
||||
}
|
||||
public static String getCurrentLocale(){
|
||||
return String.valueOf(ConfigurationCompat.getLocales(Resources.getSystem().getConfiguration()));
|
||||
}
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ public class PrefUtils {
|
||||
}
|
||||
|
||||
public static String getLocale(Context context) {
|
||||
return getSharedPreferences(context).getString("LOCALE", LocaleUtils.getCurrentLocale(context));
|
||||
return getSharedPreferences(context).getString("LOCALE", LocaleUtils.getCurrentLocale());
|
||||
}
|
||||
|
||||
public static Boolean isBackgroundLocationServiceRunning(Context context) {
|
||||
@ -162,7 +162,7 @@ public class PrefUtils {
|
||||
editor.putString("key_location_level","3");
|
||||
editor.putString("location_mode", "manual");
|
||||
editor.putString("approx_manual_loc", approximatedLocation);
|
||||
editor.putBoolean("key_sharing_enabled", true);
|
||||
/*editor.putBoolean("key_sharing_enabled", true);*/
|
||||
editor.putLong("longitude_manual_location", Double.doubleToRawLongBits(latLng.getLongitude()));
|
||||
editor.putLong("latitude_manual_location", Double.doubleToRawLongBits(latLng.getLatitude()));
|
||||
editor.apply();
|
||||
|
@ -1,6 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
|
||||
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:mapbox="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@ -9,7 +16,6 @@
|
||||
android:paddingLeft="@dimen/activity_margin"
|
||||
android:paddingRight="@dimen/activity_margin"
|
||||
android:paddingTop="@dimen/activity_margin">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/contentTutorTabInfoImageButton"
|
||||
android:layout_width="wrap_content"
|
||||
@ -17,7 +23,9 @@
|
||||
android:layout_gravity="right"
|
||||
mapbox:srcCompat="@drawable/outline_info_24"/>
|
||||
|
||||
<TextView android:id="@+id/userName"
|
||||
|
||||
<TextView
|
||||
android:id="@+id/userName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dimen_10"
|
||||
@ -27,50 +35,116 @@
|
||||
android:textSize="@dimen/lbl_new_note_title"
|
||||
android:textStyle="normal" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
<TextView
|
||||
android:id="@+id/personalInfoTitle"
|
||||
android:textSize="16sp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="0dp"
|
||||
android:paddingBottom="0dp"
|
||||
android:textColor="@color/mapboxRedDark"
|
||||
android:text="@string/personalInfoTitle"/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.7">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/userDepartment"
|
||||
android:maxLines="1"
|
||||
android:inputType="text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:lineSpacingExtra="8sp"
|
||||
android:paddingTop="5dp"
|
||||
android:textColor="@color/note_list_text"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/userRoom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:lineSpacingExtra="8sp"
|
||||
android:paddingTop="5dp"
|
||||
android:textColor="@color/note_list_text"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/userEmail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/hint_department"
|
||||
android:lineSpacingExtra="8sp"
|
||||
android:paddingTop="5dp"
|
||||
android:textColor="@color/note_list_text" />
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.3">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/userDutyHours"
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/userRoom"
|
||||
android:maxLines="1"
|
||||
android:inputType="text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/hint_room"
|
||||
android:lineSpacingExtra="8sp"
|
||||
android:paddingTop="5dp"
|
||||
android:textColor="@color/note_list_text" />
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
</LinearLayout>
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/userEmail"
|
||||
android:maxLines="1"
|
||||
android:inputType="text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:lineSpacingExtra="8sp"
|
||||
android:paddingTop="5dp"
|
||||
android:textColor="@color/note_list_text"
|
||||
tools:text="@string/dutyHours" />
|
||||
android:hint="@string/hint_email"
|
||||
/>
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dutyTitle"
|
||||
android:textSize="16sp"
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="0dp"
|
||||
android:paddingBottom="0dp"
|
||||
android:textColor="@color/mapboxRedDark"
|
||||
android:text="@string/dutyTitle"/>
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/dutyHourView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/addDuty"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/addDuty"
|
||||
android:layout_gravity="end"/>
|
||||
|
||||
<TextView
|
||||
android:textSize="16sp"
|
||||
android:id="@+id/userNoteTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="0dp"
|
||||
android:paddingBottom="0dp"
|
||||
android:paddingStart="@dimen/activity_margin"
|
||||
android:textColor="@color/note_list_text" />
|
||||
<EditText
|
||||
android:textColor="@color/mapboxRedDark"
|
||||
android:text="@string/userNoteTitle"/>
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<android.support.design.widget.TextInputEditText
|
||||
|
||||
android:id="@+id/userNote"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="150dp"
|
||||
@ -83,11 +157,15 @@
|
||||
android:maxLines="7"
|
||||
android:requiresFadingEdge="vertical"
|
||||
android:scrollbars="vertical"/>
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/saveButon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/saveButton" />
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
61
app/src/main/res/layout/duty_hour_row.xml
Normal file
61
app/src/main/res/layout/duty_hour_row.xml
Normal file
@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:id="@+id/duty_day"
|
||||
android:layout_width="95dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/hint_duty_day">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/duty_day_value"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
tools:text="@tools:sample/date/day_of_week" />
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:id="@+id/duty_start"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/hint_duty_start">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/duty_start_value"
|
||||
android:maxLines="1"
|
||||
android:inputType="text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:text="@tools:sample/date/hhmm" />
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:id="@+id/duty_stop"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/hint_duty_end">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/duty_stop_value"
|
||||
android:maxLines="1"
|
||||
android:inputType="text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:text="@tools:sample/date/hhmm" />
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/deleteRow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleX="0.7"
|
||||
android:scaleY="0.7"
|
||||
app:srcCompat="@android:drawable/ic_delete" />
|
||||
</LinearLayout>
|
@ -3,8 +3,8 @@
|
||||
android:id="@android:id/text1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceListItemSmall"
|
||||
android:gravity="center_vertical"
|
||||
android:textSize="16sp"
|
||||
android:textSize="14sp"
|
||||
android:paddingTop="2dp"
|
||||
android:fontFamily="@font/lato_regular"
|
||||
android:textColor="@color/mapboxWhite" />
|
77
app/src/main/res/layout/info_popup_blacklist.xml
Normal file
77
app/src/main/res/layout/info_popup_blacklist.xml
Normal file
@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@drawable/layout_bg"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp"
|
||||
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: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:textColor="@color/half_black" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/manualMarkerTextView"
|
||||
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:textColor="@color/half_black" />
|
||||
|
||||
</LinearLayout>
|
@ -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" />
|
||||
|
@ -63,4 +63,13 @@
|
||||
android:text="@string/info_icon_userlist_tab_level_status_inactive_tip"
|
||||
android:textColor="@color/half_black"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/userListPopupInfoTextViewSummary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/info_icon_userlist_summary"
|
||||
android:textColor="@color/half_black"/>
|
||||
|
||||
</LinearLayout>
|
@ -7,7 +7,6 @@
|
||||
<PreferenceCategory android:title="@string/settings_category_general">
|
||||
|
||||
<ListPreference
|
||||
android:defaultValue="0"
|
||||
android:dialogTitle="@string/settings_language"
|
||||
android:entries="@array/language_entries"
|
||||
android:entryValues="@array/language_values"
|
||||
|
@ -63,6 +63,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textColor="@color/mapboxWhite"
|
||||
android:paddingLeft="10dp"
|
||||
/>
|
||||
</LinearLayout>
|
||||
@ -83,6 +84,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textColor="@color/mapboxWhite"
|
||||
android:paddingLeft="10dp"
|
||||
/>
|
||||
</LinearLayout>
|
||||
@ -103,6 +105,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textColor="@color/mapboxWhite"
|
||||
android:paddingLeft="10dp"
|
||||
/>
|
||||
</LinearLayout>
|
||||
@ -124,6 +127,7 @@
|
||||
android:id="@+id/userDutyHoursTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/mapboxWhite"
|
||||
android:paddingLeft="10dp"
|
||||
/>
|
||||
</LinearLayout>
|
||||
@ -147,6 +151,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="25dp"
|
||||
android:paddingTop="-10dp"
|
||||
android:divider="@color/background_user_modal"
|
||||
android:dividerHeight="1dp"
|
||||
android:textColor="@color/mapboxWhite"
|
||||
/>
|
||||
</LinearLayout>
|
||||
@ -167,6 +173,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textColor="@color/mapboxWhite"
|
||||
android:paddingLeft="10dp"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
@ -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"
|
||||
|
@ -121,7 +121,7 @@
|
||||
<string name="prompt_login">Login (Ldap)</string>
|
||||
<string name="action_log_in">Zaloguj!</string>
|
||||
<string name="error_invalid_login_name">Niepoprawny format loginu.</string>
|
||||
<string name="user_list_nav">Lista użytkowników</string>
|
||||
<string name="user_list_nav">Kadra</string>
|
||||
<string name="select_a_location">Wybierz lokalizacje</string>
|
||||
<string name="user_location_permission_not_granted">Nie dodano uprawnień do lokalizacji.</string>
|
||||
<string name="user_location_permission_explanation">Ta aplikacja potrzebuje uprawnień do lokalizacji.</string>
|
||||
@ -147,7 +147,7 @@
|
||||
<string name="remove_manual_location">Usuń manualną lokację</string>
|
||||
<string name="title_activity_tutor_tab">Profil</string>
|
||||
<string name="saveButton">Zapisz!</string>
|
||||
<string name="tutorTabHint">Tutaj możesz dodać swoją notatkę. Będzie widoczna dla innych użytkowników.</string>
|
||||
<string name="tutorTabHint">Edytuj swoją notatkę. Będzie widoczna dla innych.</string>
|
||||
<string name="modal_location_send">WYŚLIJ</string>
|
||||
<string name="modal_location_hint">Proszę nazwać wybraną lokację.</string>
|
||||
<string name="manual_modal_title">Czy chcesz zapisać tę lokalizację?</string>
|
||||
@ -204,7 +204,6 @@
|
||||
<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ę lista profesorów.</string>
|
||||
<string name="info_icon_userlist_tab_p2">Ich status symbolizowany jest przez kolorowe kropki:</string>
|
||||
@ -212,10 +211,41 @@
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
<!--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>
|
||||
|
||||
|
||||
<string name="hint_duty_day">Dzień</string>
|
||||
<string name="hint_duty_start">Start</string>
|
||||
<string name="hint_duty_end">Koniec</string>
|
||||
<string name="hint_department">Zakład</string>
|
||||
<string name="hint_room">Pokój</string>
|
||||
<string name="addDuty">DODAJ DYŻUR</string>
|
||||
<string name="dutyTitle">Godziny dyżurów</string>
|
||||
<string name="personalInfoTitle">Dane kontaktowe</string>
|
||||
<string name="userNoteTitle">Twoja notka</string>
|
||||
<string name="updateToast">Dziękujemy za aktualizację profilu</string>
|
||||
<string name="error_location_fetch">Błąd podczas pobierania lokalizacji.</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>
|
||||
>>>>>>> develop
|
||||
</resources>
|
||||
|
||||
|
||||
|
@ -88,7 +88,8 @@
|
||||
|
||||
<string name="settings_description">Descrition</string>
|
||||
<string name="saveButton">Save</string>
|
||||
<string name="tutorTabHint">Here you can add your note. It will be visible to the other users.</string>
|
||||
<string name="tutorTabHint">Edit your note. It will be shown in the users list.</string>
|
||||
|
||||
|
||||
<string name="key_description">key_description</string>
|
||||
|
||||
@ -233,8 +234,12 @@
|
||||
<string name="network_error">Network Error!</string>
|
||||
<string name="manual_status_error">Error handling status fetch</string>
|
||||
<string name="error_status_fetch">Error handling status fetch</string>
|
||||
<string name="error_location_fetch" translatable="false">Error handling status fetch</string>
|
||||
<string name="error_location_fetch">Error handling status fetch</string>
|
||||
|
||||
<!--<string name="pref_acra_disabled" translatable="false">Auto reporting on issue is OFF</string>-->
|
||||
<!--<string name="pref_acra_enabled" translatable="false">Auto reporting on issue is ON</string>-->
|
||||
<!--<string name="pref_disable_acra" translatable="false">ACRA reporting tool</string>-->
|
||||
<string name="acra_toast_text" translatable="false">Sorry, the application crashed. A report will be sent to the developers</string>
|
||||
<string name="notification_text">Sorry, the application crashed. A report will be sent to the developers</string>
|
||||
<string name="notification_title" translatable="false">FMT Issue</string>
|
||||
<string name="notification_channel" translatable="false">FMT</string>
|
||||
@ -246,8 +251,7 @@
|
||||
<!--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_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>
|
||||
<string name="pref_disable_acra" translatable="false">App issues reporting</string>
|
||||
|
||||
<!--(ENG) Map Activity info helper-->
|
||||
<string name="map_info_text_p1">On the map there are markers which represents tutors sharing their location right now.</string>
|
||||
@ -293,6 +297,7 @@
|
||||
<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>
|
||||
@ -386,5 +391,28 @@
|
||||
"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>
|
||||
<string name="hint_duty_start">Start</string>
|
||||
<string name="hint_duty_end">End</string>
|
||||
<string name="hint_department">Department</string>
|
||||
<string name="hint_room">Room</string>
|
||||
<string name="hint_email" translatable="false">Email</string>
|
||||
<string name="addDuty">ADD DUTY</string>
|
||||
<string name="dutyTitle">Duty hours</string>
|
||||
<string name="personalInfoTitle">Personal info</string>
|
||||
<string name="userNoteTitle">Your note</string>
|
||||
<string name="updateToast">Thank you for updating your profile.</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>
|
||||
|
Loading…
Reference in New Issue
Block a user