Fix duty hours
This commit is contained in:
parent
e7a2ecf86a
commit
9d82261be9
@ -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);
|
||||
|
@ -95,7 +95,7 @@ public class DutyHourViewModel {
|
||||
}
|
||||
|
||||
public String getSummary() {
|
||||
return this.getDay() + " " + this.getStart() + " " + this.getEnd();
|
||||
return this.getDay() + ": " + this.getStart() + " - " + this.getEnd();
|
||||
}
|
||||
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
@ -280,7 +280,7 @@
|
||||
<string name="info_icon_sharing_tab_p3_level_exact"><b>exact</b> - localization displayed on a map, based on GPS</string>
|
||||
<string name="info_icon_sharing_tab_p3_level_approximate"><b>approximated</b> - approximated localization based on GPS</string>
|
||||
<string name="info_icon_sharing_tab_p3_level_manual"><b>manual</b> - sharing from manually picked point</string>
|
||||
<string name="info_icon_sharing_tab_p3_level_presence"><b>presence only</ b> - sharing only information whether you are present on the faculty or not, without sharing your localization</string>
|
||||
<string name="info_icon_sharing_tab_p3_level_presence"><b>presence only</b> - 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>
|
||||
|
Loading…
Reference in New Issue
Block a user