From 8987339acba92766fd6b4db2c29b98a609bf3648 Mon Sep 17 00:00:00 2001 From: FurWaz <fur.waz06@gmail.com> Date: Sun, 4 Dec 2022 17:58:23 +0100 Subject: [PATCH] Added route finding + minor improvements --- Sources/app/src/main/AndroidManifest.xml | 3 + .../src/main/java/Common/DirectionStep.java | 46 ++++ .../app/src/main/java/Common/Directions.java | 92 +++++++ .../src/main/java/Popups/BuildingPopup.java | 17 ++ .../src/main/java/Popups/DirectionsPopup.java | 123 +++++++++ .../src/main/java/Popups/PathwayPopup.java | 18 +- .../src/main/java/Popups/PhotoInfoPopup.java | 53 ++++ .../app/src/main/java/Popups/RoomPopup.java | 18 +- .../src/main/java/Popups/StairsDestPopup.java | 54 ++++ .../app/src/main/java/Popups/ZonePopup.java | 18 +- .../main/java/Structures/BuildingInfo.java | 2 +- .../src/main/java/Structures/MeteoInfo.java | 5 + .../src/main/java/Structures/PathInfo.java | 2 +- .../src/main/java/Structures/PathStairs.java | 3 + .../src/main/java/Structures/PhotoInfo.java | 33 ++- .../src/main/java/Structures/RoomInfo.java | 4 +- .../src/main/java/Structures/ZoneInfo.java | 17 +- .../app/src/main/java/Views/InfoAdapter.java | 42 +-- .../com/furwaz/roomview/BuildingView.java | 16 +- .../furwaz/roomview/DirectionsActivity.java | 55 ++++ .../java/com/furwaz/roomview/ZoneView.java | 65 ++++- .../ic_baseline_delete_forever_24.xml | 5 + .../main/res/drawable/ic_baseline_edit_24.xml | 4 +- .../res/drawable/ic_baseline_edit_24_dark.xml | 5 + .../main/res/drawable/ic_baseline_info_24.xml | 5 + .../main/res/layout/activity_directions.xml | 125 +++++++++ .../main/res/layout/activity_zone_view.xml | 59 +++-- .../app/src/main/res/layout/building_tile.xml | 13 +- .../src/main/res/layout/direction_tile.xml | 33 +++ .../src/main/res/layout/directions_popup.xml | 249 ++++++++++++++++++ .../app/src/main/res/layout/pathway_tile.xml | 22 +- .../src/main/res/layout/photo_info_popup.xml | 104 ++++++++ .../app/src/main/res/layout/photo_tile.xml | 22 +- Sources/app/src/main/res/layout/room_tile.xml | 22 +- .../src/main/res/layout/stairs_dest_popup.xml | 75 ++++++ Sources/app/src/main/res/layout/zone_tile.xml | 22 +- .../app/src/main/res/values-fr/strings.xml | 18 +- Sources/app/src/main/res/values/strings.xml | 18 +- 38 files changed, 1341 insertions(+), 146 deletions(-) create mode 100644 Sources/app/src/main/java/Common/DirectionStep.java create mode 100644 Sources/app/src/main/java/Common/Directions.java create mode 100644 Sources/app/src/main/java/Popups/DirectionsPopup.java create mode 100644 Sources/app/src/main/java/Popups/PhotoInfoPopup.java create mode 100644 Sources/app/src/main/java/Popups/StairsDestPopup.java create mode 100644 Sources/app/src/main/java/com/furwaz/roomview/DirectionsActivity.java create mode 100644 Sources/app/src/main/res/drawable/ic_baseline_delete_forever_24.xml create mode 100644 Sources/app/src/main/res/drawable/ic_baseline_edit_24_dark.xml create mode 100644 Sources/app/src/main/res/drawable/ic_baseline_info_24.xml create mode 100644 Sources/app/src/main/res/layout/activity_directions.xml create mode 100644 Sources/app/src/main/res/layout/direction_tile.xml create mode 100644 Sources/app/src/main/res/layout/directions_popup.xml create mode 100644 Sources/app/src/main/res/layout/photo_info_popup.xml create mode 100644 Sources/app/src/main/res/layout/stairs_dest_popup.xml diff --git a/Sources/app/src/main/AndroidManifest.xml b/Sources/app/src/main/AndroidManifest.xml index 7d18134..f45be74 100644 --- a/Sources/app/src/main/AndroidManifest.xml +++ b/Sources/app/src/main/AndroidManifest.xml @@ -22,6 +22,9 @@ android:supportsRtl="true" android:theme="@style/Theme.RoomView" tools:targetApi="31"> + <activity + android:name=".DirectionsActivity" + android:exported="false" /> <activity android:name=".ZoneView" android:exported="false" /> diff --git a/Sources/app/src/main/java/Common/DirectionStep.java b/Sources/app/src/main/java/Common/DirectionStep.java new file mode 100644 index 0000000..c472c1a --- /dev/null +++ b/Sources/app/src/main/java/Common/DirectionStep.java @@ -0,0 +1,46 @@ +package Common; + +import android.content.Context; + +import com.furwaz.roomview.R; + +import Structures.PathInfo; + +public class DirectionStep { + Context context; + PathInfo path; + String title = ""; + String description = ""; + + private void generateStrings() { + this.title = context.getString(R.string.go_to_value).replace("{{value}}", path.getDestination().getName()); + this.description = context.getString(R.string.go_to_value_desc) + .replace("{{value1}}", path.getDestination().getName()) + .replace("{{value2}}", path.getName()); + } + + public DirectionStep(PathInfo path) { + this.context = BuildingManager.getContext(); + this.path = path; + this.generateStrings(); + } + + public void setPath(PathInfo path) { + this.path = path; + this.generateStrings(); + } + + public PathInfo getPath() { + return path; + } + + public String getTitle() { + if (this.title.equals("")) this.generateStrings(); + return title; + } + + public String getDescription() { + if (this.description.equals("")) this.generateStrings(); + return description; + } +} diff --git a/Sources/app/src/main/java/Common/Directions.java b/Sources/app/src/main/java/Common/Directions.java new file mode 100644 index 0000000..5664277 --- /dev/null +++ b/Sources/app/src/main/java/Common/Directions.java @@ -0,0 +1,92 @@ +package Common; + +import android.widget.Toast; + +import java.util.ArrayList; +import java.util.List; + +import Structures.PathInfo; +import Structures.PathStairs; +import Structures.PathType; +import Structures.RoomInfo; +import Structures.StairsDirection; + +public class Directions { + private static List<DirectionStep> testRoute(List<RoomInfo> blacklist, PathInfo path, RoomInfo pdest, RoomInfo dest) { + if (pdest == null || dest == null || path == null) return new ArrayList<>(); + + for (int i = 0; i < blacklist.size(); i++) { + if (blacklist.get(i) == pdest) + return new ArrayList<>(); + } + + List<DirectionStep> res = new ArrayList<>(); + if (pdest == dest) { + res.add(new DirectionStep(path)); + } else { + List<DirectionStep> route = findRoute(blacklist, pdest, dest); + if (route.size() > 0) { + res.add(new DirectionStep(path)); + res.addAll(route); + } + } + return res; + } + + private static void tryToAdd(List<DirectionStep> steps, List<List<DirectionStep>> paths) { + if (steps.size() > 0) paths.add(steps); + } + + public static List<DirectionStep> findRoute(RoomInfo from, RoomInfo to) { + return findRoute(new ArrayList<>(), from, to); + } + + public static List<DirectionStep> findRoute(List<RoomInfo> blacklist, RoomInfo from, RoomInfo to) { + if (from == null || to == null) return new ArrayList<>(); + blacklist.add(from); + + List<List<DirectionStep>> paths = new ArrayList<>(); + for (PathInfo path: from.getPaths()) { + List<RoomInfo> blacklist_copy = new ArrayList<>(blacklist); + if (path.getType() == PathType.STAIRS) { + PathStairs stairs = (PathStairs) path; + switch (stairs.getDirection()) { + case UP: { + List<DirectionStep> up = testRoute(blacklist_copy, path, stairs.getDestination(StairsDirection.UP), to); + tryToAdd(up, paths); + break; + } + case DOWN: { + List<DirectionStep> down = testRoute(blacklist_copy, path, stairs.getDestination(StairsDirection.DOWN), to); + tryToAdd(down, paths); + break; + } + default: { + List<DirectionStep> up = testRoute(blacklist_copy, path, stairs.getDestination(StairsDirection.UP), to); + tryToAdd(up, paths); + List<DirectionStep> down = testRoute(blacklist_copy, path, stairs.getDestination(StairsDirection.DOWN), to); + tryToAdd(down, paths); + break; + } + } + } else { + List<DirectionStep> route = testRoute(blacklist_copy, path, path.getDestination(), to); + if (route.size() > 0) paths.add(route); + } + } + + List<DirectionStep> res = new ArrayList<>(); + if (paths.size() == 0) return res; + + int length = paths.get(0).size() + 1; + for (List<DirectionStep> path: paths) { + int size = path.size(); + if (size < length) { + length = size; + res = path; + } + } + return res; + } +} + diff --git a/Sources/app/src/main/java/Popups/BuildingPopup.java b/Sources/app/src/main/java/Popups/BuildingPopup.java index 3ae616a..9e1d549 100644 --- a/Sources/app/src/main/java/Popups/BuildingPopup.java +++ b/Sources/app/src/main/java/Popups/BuildingPopup.java @@ -5,6 +5,7 @@ import android.text.Editable; import android.text.TextWatcher; import android.view.LayoutInflater; import android.view.View; +import android.view.inputmethod.InputMethodManager; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; @@ -49,6 +50,17 @@ public class BuildingPopup { validate_btn.setText(btn_text); validate_btn.setEnabled(false); b_err.setText(""); + + // display the keyboard + b_name.setOnFocusChangeListener(((view, hasFocus) -> { + if (hasFocus) { + InputMethodManager inputMgr = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); + inputMgr.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); + inputMgr.showSoftInput(b_name, InputMethodManager.SHOW_IMPLICIT); + } + })); + b_name.requestFocus(); + b_name.addTextChangedListener(new TextWatcher() { public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {} public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {} @@ -77,6 +89,11 @@ public class BuildingPopup { validate_btn.setOnClickListener(view -> onValidate.call(this)); }); + + dialog.setOnDismissListener(dialogInterface -> { + InputMethodManager inputMgr = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); + inputMgr.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0); + }); } public void show() { diff --git a/Sources/app/src/main/java/Popups/DirectionsPopup.java b/Sources/app/src/main/java/Popups/DirectionsPopup.java new file mode 100644 index 0000000..53ffaaf --- /dev/null +++ b/Sources/app/src/main/java/Popups/DirectionsPopup.java @@ -0,0 +1,123 @@ +package Popups; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.AdapterView; +import android.widget.ArrayAdapter; +import android.widget.Button; +import android.widget.LinearLayout; +import android.widget.ListView; +import android.widget.SearchView; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.appcompat.app.AlertDialog; + +import com.furwaz.roomview.R; + +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import java.util.function.Function; + +import Common.Callback; +import Structures.BuildingInfo; +import Structures.Orientation; +import Structures.RoomInfo; + +public class DirectionsPopup { + final int ZONE_FROM = 0; + final int ZONE_TO = 1; + + AlertDialog dialog; + Context context; + RoomInfo fromRoom; + RoomInfo toRoom; + BuildingInfo building; + List<RoomInfo> matching_rooms = new ArrayList<>(); + + private String[] getMatchingRooms(String query) { + matching_rooms.clear(); + for (RoomInfo room: building.getRooms()) { + String formattedName = room.getName().toLowerCase(Locale.ROOT).replaceAll(" ", ""); + String formattedQuery = query.toLowerCase(Locale.ROOT).replaceAll(" ", ""); + if (formattedName.contains(formattedQuery)) + matching_rooms.add(room); + } + String[] res = new String[matching_rooms.size()]; + for (int i = 0; i < res.length; i++) res[i] = matching_rooms.get(i).getName(); + return res; + } + + private void setupSelectionZone(int ZONE_ID) { + LinearLayout select_zone = dialog.findViewById(ZONE_ID==ZONE_FROM? R.id.select_from_room : R.id.select_to_room); + LinearLayout show_zone = dialog.findViewById(ZONE_ID==ZONE_FROM? R.id.show_from_room : R.id.show_to_room); + View edit_btn = dialog.findViewById(ZONE_ID==ZONE_FROM? R.id.edit_from_room : R.id.edit_to_room); + TextView room_name = dialog.findViewById(ZONE_ID==ZONE_FROM? R.id.name_from_room : R.id.name_to_room); + ListView room_list = dialog.findViewById(ZONE_ID==ZONE_FROM? R.id.room_list_from : R.id.room_list_to); + SearchView search = dialog.findViewById(ZONE_ID==ZONE_FROM? R.id.room_search_from : R.id.room_search_to); + + show_zone.setOnClickListener(view -> { + show_zone.setVisibility(View.GONE); + select_zone.setVisibility(View.VISIBLE); + }); + + search.setOnQueryTextListener(new SearchView.OnQueryTextListener() { + public boolean onQueryTextSubmit(String s) { return true; } + public boolean onQueryTextChange(String s) { + room_list.setAdapter(new ArrayAdapter<String>(context, android.R.layout.simple_spinner_dropdown_item, getMatchingRooms(s))); + return true; + } + }); + + + room_list.setAdapter(new ArrayAdapter<String>(context, android.R.layout.simple_spinner_dropdown_item, getMatchingRooms(""))); + room_list.setOnItemClickListener((adapterView, view, i, l) -> { + show_zone.setVisibility(View.VISIBLE); + select_zone.setVisibility(View.GONE); + RoomInfo selected = matching_rooms.get(i); + room_name.setText(selected.getName()); + if (ZONE_ID == ZONE_FROM) fromRoom = selected; + else toRoom = selected; + }); + } + + public DirectionsPopup(Context context, BuildingInfo building, Callback onSearch) { + AlertDialog.Builder builder = new AlertDialog.Builder(context); + dialog = builder.create(); + LayoutInflater factory = LayoutInflater.from(context); + View popup = factory.inflate(R.layout.directions_popup, null); + dialog.setView(popup); + + this.context = context; + this.building = building; + dialog.setOnShowListener(dialogInterface -> { + setupSelectionZone(ZONE_FROM); + setupSelectionZone(ZONE_TO); + + Button cancel_btn = dialog.findViewById(R.id.btn_cancel); + cancel_btn.setOnClickListener(view -> this.dismiss()); + + Button search_btn = dialog.findViewById(R.id.btn_search); + search_btn.setOnClickListener(view -> onSearch.call(this)); + }); + dialog.show(); + } + + public void dismiss() { + dialog.dismiss(); + } + + public RoomInfo getFromRoom() { + return this.fromRoom; + } + + public RoomInfo getToRoom() { + return this.toRoom; + } + + public void show() { + dialog.show(); + } +} diff --git a/Sources/app/src/main/java/Popups/PathwayPopup.java b/Sources/app/src/main/java/Popups/PathwayPopup.java index d47d334..0df2827 100644 --- a/Sources/app/src/main/java/Popups/PathwayPopup.java +++ b/Sources/app/src/main/java/Popups/PathwayPopup.java @@ -5,6 +5,7 @@ import android.text.Editable; import android.text.TextWatcher; import android.view.LayoutInflater; import android.view.View; +import android.view.inputmethod.InputMethodManager; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; @@ -64,6 +65,17 @@ public class PathwayPopup { validate_btn.setEnabled(false); p_err.setText(""); + + // display the keyboard + p_name.setOnFocusChangeListener(((view, hasFocus) -> { + if (hasFocus) { + InputMethodManager inputMgr = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); + inputMgr.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); + inputMgr.showSoftInput(p_name, InputMethodManager.SHOW_IMPLICIT); + } + })); + p_name.requestFocus(); + p_name.addTextChangedListener(new TextWatcher() { public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {} public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {} @@ -117,7 +129,11 @@ public class PathwayPopup { cancel_btn.setOnClickListener(view -> onCancel.call(this)); validate_btn.setOnClickListener(view -> onValidate.call(this)); }); - dialog.show(); + + dialog.setOnDismissListener(dialogInterface -> { + InputMethodManager inputMgr = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); + inputMgr.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0); + }); } public void dismiss() { diff --git a/Sources/app/src/main/java/Popups/PhotoInfoPopup.java b/Sources/app/src/main/java/Popups/PhotoInfoPopup.java new file mode 100644 index 0000000..324da13 --- /dev/null +++ b/Sources/app/src/main/java/Popups/PhotoInfoPopup.java @@ -0,0 +1,53 @@ +package Popups; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.Button; +import android.widget.TextView; + +import androidx.appcompat.app.AlertDialog; + +import com.furwaz.roomview.R; + +import java.text.SimpleDateFormat; +import java.util.Date; + +import Common.Callback; +import Structures.PhotoInfo; + +public class PhotoInfoPopup { + public static final int MODE_NEW = 1; + public static final int MODE_EDIT = 2; + + AlertDialog dialog = null; + Button validate_btn = null; + + public PhotoInfoPopup(Context context, PhotoInfo photo) { + AlertDialog.Builder builder = new AlertDialog.Builder(context); + dialog = builder.create(); + LayoutInflater factory = LayoutInflater.from(context); + View popup = factory.inflate(R.layout.photo_info_popup, null); + dialog.setView(popup); + + dialog.setOnShowListener(dialogInterface -> { + TextView tv_hour = popup.findViewById(R.id.photo_hour); + TextView tv_date = popup.findViewById(R.id.photo_date); + Date d = photo.getDate(); + tv_hour.setText(new SimpleDateFormat("HH:mm").format(d)); + tv_date.setText(new SimpleDateFormat("yyyy / MM / dd").format(d)); + + validate_btn = popup.findViewById(R.id.btn_validate_room); + validate_btn.setOnClickListener(view -> this.dismiss()); + }); + dialog.show(); + } + + public void dismiss() { + dialog.dismiss(); + } + + public void show() { + dialog.show(); + } +} diff --git a/Sources/app/src/main/java/Popups/RoomPopup.java b/Sources/app/src/main/java/Popups/RoomPopup.java index f00a796..9a42d38 100644 --- a/Sources/app/src/main/java/Popups/RoomPopup.java +++ b/Sources/app/src/main/java/Popups/RoomPopup.java @@ -5,6 +5,7 @@ import android.text.Editable; import android.text.TextWatcher; import android.view.LayoutInflater; import android.view.View; +import android.view.inputmethod.InputMethodManager; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; @@ -51,6 +52,17 @@ public class RoomPopup { validate_btn.setText(btn_text); validate_btn.setEnabled(false); r_err.setText(""); + + // display the keyboard + r_name.setOnFocusChangeListener(((view, hasFocus) -> { + if (hasFocus) { + InputMethodManager inputMgr = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); + inputMgr.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); + inputMgr.showSoftInput(r_name, InputMethodManager.SHOW_IMPLICIT); + } + })); + r_name.requestFocus(); + r_name.addTextChangedListener(new TextWatcher() { public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {} public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {} @@ -75,7 +87,11 @@ public class RoomPopup { validate_btn.setOnClickListener(view -> onValidate.call(this)); }); - dialog.show(); + + dialog.setOnDismissListener(dialogInterface -> { + InputMethodManager inputMgr = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); + inputMgr.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0); + }); } public void dismiss() { diff --git a/Sources/app/src/main/java/Popups/StairsDestPopup.java b/Sources/app/src/main/java/Popups/StairsDestPopup.java new file mode 100644 index 0000000..f152ac6 --- /dev/null +++ b/Sources/app/src/main/java/Popups/StairsDestPopup.java @@ -0,0 +1,54 @@ +package Popups; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.Button; +import android.widget.TextView; + +import androidx.appcompat.app.AlertDialog; + +import com.furwaz.roomview.R; + +import java.text.SimpleDateFormat; +import java.util.Date; + +import Common.Callback; +import Structures.PhotoInfo; + +public class StairsDestPopup { + public static final int MODE_NEW = 1; + public static final int MODE_EDIT = 2; + + AlertDialog dialog = null; + + public StairsDestPopup(Context context, Callback onUpSelected, Callback onDownSelected) { + AlertDialog.Builder builder = new AlertDialog.Builder(context); + dialog = builder.create(); + LayoutInflater factory = LayoutInflater.from(context); + View popup = factory.inflate(R.layout.stairs_dest_popup, null); + dialog.setView(popup); + + dialog.setOnShowListener(dialogInterface -> { + Button btn_up = popup.findViewById(R.id.btn_dir_up); + Button btn_down = popup.findViewById(R.id.btn_dir_down); + btn_up.setOnClickListener(view -> { + onUpSelected.call(this); + this.dismiss(); + }); + btn_down.setOnClickListener(view -> { + onDownSelected.call(this); + this.dismiss(); + }); + }); + dialog.show(); + } + + public void dismiss() { + dialog.dismiss(); + } + + public void show() { + dialog.show(); + } +} diff --git a/Sources/app/src/main/java/Popups/ZonePopup.java b/Sources/app/src/main/java/Popups/ZonePopup.java index 919d464..eb3517a 100644 --- a/Sources/app/src/main/java/Popups/ZonePopup.java +++ b/Sources/app/src/main/java/Popups/ZonePopup.java @@ -5,6 +5,7 @@ import android.text.Editable; import android.text.TextWatcher; import android.view.LayoutInflater; import android.view.View; +import android.view.inputmethod.InputMethodManager; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; @@ -43,6 +44,17 @@ public class ZonePopup { validate_btn.setEnabled(false); z_err.setText(""); + + // display the keyboard + z_name.setOnFocusChangeListener(((view, hasFocus) -> { + if (hasFocus) { + InputMethodManager inputMgr = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); + inputMgr.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); + inputMgr.showSoftInput(z_name, InputMethodManager.SHOW_IMPLICIT); + } + })); + z_name.requestFocus(); + z_name.addTextChangedListener(new TextWatcher() { public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {} public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {} @@ -73,7 +85,11 @@ public class ZonePopup { validate_btn.setText(context.getResources().getString(R.string.edit)); } }); - dialog.show(); + + dialog.setOnDismissListener(dialogInterface -> { + InputMethodManager inputMgr = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); + inputMgr.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0); + }); } public void dismiss() { diff --git a/Sources/app/src/main/java/Structures/BuildingInfo.java b/Sources/app/src/main/java/Structures/BuildingInfo.java index aa576ac..4ce25e6 100644 --- a/Sources/app/src/main/java/Structures/BuildingInfo.java +++ b/Sources/app/src/main/java/Structures/BuildingInfo.java @@ -19,7 +19,7 @@ public class BuildingInfo implements Serializable { } public BuildingInfo(String name, Date date) { - this.name = name; + this.name = name.trim(); this.date = date; } diff --git a/Sources/app/src/main/java/Structures/MeteoInfo.java b/Sources/app/src/main/java/Structures/MeteoInfo.java index 5a17287..42225ad 100644 --- a/Sources/app/src/main/java/Structures/MeteoInfo.java +++ b/Sources/app/src/main/java/Structures/MeteoInfo.java @@ -3,6 +3,11 @@ package Structures; import java.io.Serializable; public class MeteoInfo implements Serializable { + public static MeteoInfo GetCurrentMeteo() { + // TODO + return null; + } + float temperature = 0f; float humidity = 0f; float pressure = 1000f; diff --git a/Sources/app/src/main/java/Structures/PathInfo.java b/Sources/app/src/main/java/Structures/PathInfo.java index edcb507..b2319ed 100644 --- a/Sources/app/src/main/java/Structures/PathInfo.java +++ b/Sources/app/src/main/java/Structures/PathInfo.java @@ -16,7 +16,7 @@ public class PathInfo implements Serializable { } public PathInfo(String name, RoomInfo destination) { - this.name = name; + this.name = name.trim(); this.destination = destination; this.askForSave(); } diff --git a/Sources/app/src/main/java/Structures/PathStairs.java b/Sources/app/src/main/java/Structures/PathStairs.java index d9d24d1..da3bd27 100644 --- a/Sources/app/src/main/java/Structures/PathStairs.java +++ b/Sources/app/src/main/java/Structures/PathStairs.java @@ -26,6 +26,9 @@ public class PathStairs extends PathInfo implements Serializable { } else if (dir == StairsDirection.UP) this.destination = dest; else this.roomDown = dest; + + this.direction = (destination == null)? StairsDirection.DOWN: + ( (roomDown == null)? StairsDirection.UP : StairsDirection.BOTH ); this.askForSave(); } diff --git a/Sources/app/src/main/java/Structures/PhotoInfo.java b/Sources/app/src/main/java/Structures/PhotoInfo.java index 5cdd815..9aa41f6 100644 --- a/Sources/app/src/main/java/Structures/PhotoInfo.java +++ b/Sources/app/src/main/java/Structures/PhotoInfo.java @@ -6,12 +6,15 @@ import android.graphics.Matrix; import java.io.Serializable; import java.util.ArrayList; +import java.util.Date; import java.util.List; public class PhotoInfo implements Serializable { Orientation orientation = Orientation.NORTH; byte[] image = null; ZoneInfo zone = null; + MeteoInfo meteo = null; + Date date = null; List<PathView> pathViews = new ArrayList<>(); transient Bitmap bitmap = null; @@ -22,6 +25,12 @@ public class PhotoInfo implements Serializable { this.bitmap = Bitmap.createBitmap(source, 0, 0, source.getWidth(), source.getHeight(), mat, true); } + protected void setPicture(byte[] im) { + this.image = im; + this.date = new Date(); + this.meteo = MeteoInfo.GetCurrentMeteo(); + } + public PhotoInfo() { } @@ -31,13 +40,13 @@ public class PhotoInfo implements Serializable { } public PhotoInfo(byte[] im) { - this.image = im; + setPicture(im); createBitmap(); this.askForSave(); } public PhotoInfo(byte[] im, Orientation orientation) { - this.image = im; + setPicture(im); this.orientation = orientation; createBitmap(); this.askForSave(); @@ -66,7 +75,7 @@ public class PhotoInfo implements Serializable { } public void setImage(byte[] data) { - this.image = data; + setPicture(data); createBitmap(); this.askForSave(); } @@ -98,6 +107,24 @@ public class PhotoInfo implements Serializable { return zone; } + public MeteoInfo getMeteo() { + return this.meteo; + } + + public void setMeteo(MeteoInfo meteo) { + this.meteo = meteo; + this.askForSave(); + } + + public Date getDate() { + return date; + } + + public void setDate(Date date) { + this.date = date; + this.askForSave(); + } + public void askForSave() { if (this.zone != null) this.zone.askForSave(); } diff --git a/Sources/app/src/main/java/Structures/RoomInfo.java b/Sources/app/src/main/java/Structures/RoomInfo.java index df25246..44477da 100644 --- a/Sources/app/src/main/java/Structures/RoomInfo.java +++ b/Sources/app/src/main/java/Structures/RoomInfo.java @@ -16,7 +16,7 @@ enum RoomType { } public class RoomInfo implements Serializable { - String name = "X"; + String name = ""; RoomType type = RoomType.ROOM; List<ZoneInfo> zones = new ArrayList<>(); List<PathInfo> paths = new ArrayList<>(); @@ -27,7 +27,7 @@ public class RoomInfo implements Serializable { } public RoomInfo(String name) { - this.name = name; + this.name = name.trim(); this.addZone(new ZoneInfo(BuildingManager.getContext().getResources().getString(com.furwaz.roomview.R.string.center))); this.askForSave(); } diff --git a/Sources/app/src/main/java/Structures/ZoneInfo.java b/Sources/app/src/main/java/Structures/ZoneInfo.java index fd32c5e..d0c3626 100644 --- a/Sources/app/src/main/java/Structures/ZoneInfo.java +++ b/Sources/app/src/main/java/Structures/ZoneInfo.java @@ -6,9 +6,8 @@ import java.util.Date; import java.util.List; public class ZoneInfo implements Serializable { - String name = "X"; + String name = ""; Date date; - MeteoInfo meteo; RoomInfo room = null; List<PhotoInfo> photos = new ArrayList<>(); List<WalkInfo> walks = new ArrayList<>(); @@ -18,14 +17,13 @@ public class ZoneInfo implements Serializable { } public ZoneInfo(String name) { - this.name = name; + this.name = name.trim(); this.askForSave(); } - public ZoneInfo(String name, Date date, MeteoInfo meteo) { + public ZoneInfo(String name, Date date) { this.name = name; this.date = date; - this.meteo = meteo; this.askForSave(); } @@ -78,15 +76,6 @@ public class ZoneInfo implements Serializable { this.askForSave(); } - public MeteoInfo getMeteo() { - return meteo; - } - - public void setMeteo(MeteoInfo meteo) { - this.meteo = meteo; - this.askForSave(); - } - public List<WalkInfo> getWalks() { return walks; } diff --git a/Sources/app/src/main/java/Views/InfoAdapter.java b/Sources/app/src/main/java/Views/InfoAdapter.java index 20bb09a..72ff605 100644 --- a/Sources/app/src/main/java/Views/InfoAdapter.java +++ b/Sources/app/src/main/java/Views/InfoAdapter.java @@ -104,21 +104,33 @@ public class InfoAdapter<A> extends BaseAdapter { LinearLayout ll = view.findViewById(R.id.tile_box); Button b1 = view.findViewById(R.id.tile_remove); Button b2 = view.findViewById(R.id.tile_edit); - ll.setOnClickListener(view1 -> { - if (this.viewCallback != null) - this.viewCallback.call(this.queryList.get(i)); - this.updateQueryList(); - }); - b1.setOnClickListener(view12 -> { - if (this.removeCallback != null) - this.removeCallback.call(this.queryList.get(i)); - this.updateQueryList(); - }); - b2.setOnClickListener(view13 -> { - if (this.editCallback != null) - this.editCallback.call(this.queryList.get(i)); - this.updateQueryList(); - }); + + if (b2 == null) { + ll.setOnClickListener(view1 -> { + if (this.editCallback != null) + this.editCallback.call(this.queryList.get(i)); + this.updateQueryList(); + }); + } else { + ll.setOnClickListener(view1 -> { + if (this.viewCallback != null) + this.viewCallback.call(this.queryList.get(i)); + this.updateQueryList(); + }); + + b2.setOnClickListener(view2 -> { + if (this.editCallback != null) + this.editCallback.call(this.queryList.get(i)); + this.updateQueryList(); + }); + } + + if (b1 != null) + b1.setOnClickListener(view1 -> { + if (this.removeCallback != null) + this.removeCallback.call(this.queryList.get(i)); + this.updateQueryList(); + }); } public void setBindings(InfoBinding[] objs) { diff --git a/Sources/app/src/main/java/com/furwaz/roomview/BuildingView.java b/Sources/app/src/main/java/com/furwaz/roomview/BuildingView.java index 592401a..32e9ac5 100644 --- a/Sources/app/src/main/java/com/furwaz/roomview/BuildingView.java +++ b/Sources/app/src/main/java/com/furwaz/roomview/BuildingView.java @@ -2,11 +2,13 @@ package com.furwaz.roomview; import androidx.appcompat.app.AppCompatActivity; +import android.content.Intent; import android.os.Bundle; import android.widget.LinearLayout; import android.widget.TextView; import Common.BuildingManager; +import Popups.DirectionsPopup; import Popups.GotoPopup; import Structures.BuildingInfo; @@ -42,6 +44,18 @@ public class BuildingView extends AppCompatActivity { } protected void showDirectionsPopup() { - + new DirectionsPopup( + this, + building, + param -> { + DirectionsPopup popup = (DirectionsPopup) param; + Intent intent = new Intent(this, DirectionsActivity.class); + intent.putExtra("building", BuildingManager.getBuildings().indexOf(building)); + intent.putExtra("from_room", building.getRooms().indexOf(popup.getFromRoom())); + intent.putExtra("to_room", building.getRooms().indexOf(popup.getToRoom())); + this.startActivity(intent); + return null; + } + ).show(); } } \ No newline at end of file diff --git a/Sources/app/src/main/java/com/furwaz/roomview/DirectionsActivity.java b/Sources/app/src/main/java/com/furwaz/roomview/DirectionsActivity.java new file mode 100644 index 0000000..bd050e2 --- /dev/null +++ b/Sources/app/src/main/java/com/furwaz/roomview/DirectionsActivity.java @@ -0,0 +1,55 @@ +package com.furwaz.roomview; + +import androidx.appcompat.app.AppCompatActivity; + +import android.os.Bundle; +import android.widget.LinearLayout; +import android.widget.ListView; +import android.widget.TextView; +import android.widget.Toast; + +import java.util.List; + +import Common.BuildingManager; +import Common.DirectionStep; +import Common.Directions; +import Common.InfoBinding; +import Structures.BuildingInfo; +import Structures.RoomInfo; +import Views.InfoAdapter; + +public class DirectionsActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_directions); + + Bundle extras = getIntent().getExtras(); + int buildingIndex = extras.getInt("building"); + int fromIndex = extras.getInt("from_room"); + int toIndex = extras.getInt("to_room"); + + BuildingInfo building = BuildingManager.getBuilding(buildingIndex); + RoomInfo fromRoom = building.getRoom(fromIndex); + RoomInfo toRoom = building.getRoom(toIndex); + + LinearLayout noDataLayout = findViewById(R.id.no_directions_layout); + ListView dirs_lv = findViewById(R.id.directions_list); + + TextView from_label = findViewById(R.id.from_room_name); + TextView to_label = findViewById(R.id.to_room_name); + from_label.setText(fromRoom.getName()); + to_label.setText(toRoom.getName()); + + List<DirectionStep> res = Directions.findRoute(fromRoom, toRoom); + InfoAdapter<DirectionStep> adapter = new InfoAdapter<>(this, res, noDataLayout, R.layout.direction_tile); + dirs_lv.setAdapter(adapter); + + adapter.setBindings(new InfoBinding[]{ + new InfoBinding(param -> ((DirectionStep) param).getTitle(), R.id.direction_title), + new InfoBinding(param -> ((DirectionStep) param).getDescription(), R.id.direction_description) + }); + adapter.setSearchQuery(""); + } +} \ No newline at end of file diff --git a/Sources/app/src/main/java/com/furwaz/roomview/ZoneView.java b/Sources/app/src/main/java/com/furwaz/roomview/ZoneView.java index 45df174..438396d 100644 --- a/Sources/app/src/main/java/com/furwaz/roomview/ZoneView.java +++ b/Sources/app/src/main/java/com/furwaz/roomview/ZoneView.java @@ -18,11 +18,17 @@ import android.widget.Toast; import Common.BuildingManager; import Common.Coord; +import Popups.PhotoInfoPopup; +import Popups.StairsDestPopup; import Structures.BuildingInfo; import Structures.Orientation; +import Structures.PathInfo; +import Structures.PathStairs; +import Structures.PathType; import Structures.PathView; import Structures.PhotoInfo; import Structures.RoomInfo; +import Structures.StairsDirection; import Structures.WalkInfo; import Structures.ZoneInfo; import Views.ClickDetector; @@ -102,6 +108,11 @@ public class ZoneView extends AppCompatActivity { this.updateUI(); }); + ImageView info_btn = findViewById(R.id.info_btn); + info_btn.setOnClickListener(view -> { + new PhotoInfoPopup(this, photo).show(); + }); + ClickDetector bitmap_zone = findViewById(R.id.bitmap_zone); bitmap_zone.setOnClickCallback(param -> { Coord c = (Coord) param; @@ -214,25 +225,55 @@ public class ZoneView extends AppCompatActivity { error_layout.setVisibility(View.GONE); } + protected void gotoDest(RoomInfo dest) { + if (dest == null) { + Toast.makeText(this, "Your can't go here.\nThis pathway is not defined yet.", Toast.LENGTH_SHORT).show(); + return; + } + if (dest.getNbZones() == 0) { + Toast.makeText(this, "Your can't go here.\nThis room doesn't have any zone or photos yet.", Toast.LENGTH_SHORT).show(); + return; + } + ZoneInfo new_zone = dest.getNearestZone(this.room); + old_zone = this.zone; + this.room = dest; + this.zone = new_zone; + this.updateUI(); + return; + } + + protected void displayStairsDirectionPopup(PathStairs ps) { + new StairsDestPopup(this, param -> { + gotoDest(ps.getDestination(StairsDirection.UP)); + return null; + }, param -> { + gotoDest(ps.getDestination(StairsDirection.DOWN)); + return null; + }).show(); + } + protected void onClickAt(Coord c) { if (photo == null) return; for (PathView pv : photo.getPathViews()) { if (pv.getRect().contains(c.getX(), c.getY())) { - RoomInfo dest = pv.getPath().getDestination(); - if (dest == null) { - Toast.makeText(this, "Your can't go here.\nThis pathway is not defined yet.", Toast.LENGTH_SHORT).show(); + PathInfo pi = pv.getPath(); + + if (pi.getType() == PathType.DOOR) { + gotoDest(pi.getDestination()); return; } - if (dest.getNbZones() == 0) { - Toast.makeText(this, "Your can't go here.\nThis room doesn't have any zone or photos yet.", Toast.LENGTH_SHORT).show(); - return; + + if (pi.getType() == PathType.STAIRS) { + PathStairs ps = (PathStairs) pi; + switch (ps.getDirection()) { + case UP: + gotoDest(ps.getDestination(StairsDirection.UP)); break; + case DOWN: + gotoDest(ps.getDestination(StairsDirection.DOWN)); break; + default: + displayStairsDirectionPopup(ps); + } } - ZoneInfo new_zone = dest.getNearestZone(this.room); - old_zone = this.zone; - this.room = dest; - this.zone = new_zone; - this.updateUI(); - return; } } } diff --git a/Sources/app/src/main/res/drawable/ic_baseline_delete_forever_24.xml b/Sources/app/src/main/res/drawable/ic_baseline_delete_forever_24.xml new file mode 100644 index 0000000..f54f7d4 --- /dev/null +++ b/Sources/app/src/main/res/drawable/ic_baseline_delete_forever_24.xml @@ -0,0 +1,5 @@ +<vector android:height="24dp" android:tint="#FFFFFF" + android:viewportHeight="24" android:viewportWidth="24" + android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="@android:color/white" android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2L18,7L6,7v12zM8.46,11.88l1.41,-1.41L12,12.59l2.12,-2.12 1.41,1.41L13.41,14l2.12,2.12 -1.41,1.41L12,15.41l-2.12,2.12 -1.41,-1.41L10.59,14l-2.13,-2.12zM15.5,4l-1,-1h-5l-1,1L5,4v2h14L19,4z"/> +</vector> diff --git a/Sources/app/src/main/res/drawable/ic_baseline_edit_24.xml b/Sources/app/src/main/res/drawable/ic_baseline_edit_24.xml index afb9aac..4688878 100644 --- a/Sources/app/src/main/res/drawable/ic_baseline_edit_24.xml +++ b/Sources/app/src/main/res/drawable/ic_baseline_edit_24.xml @@ -1,5 +1,5 @@ -<vector android:height="40dp" android:tint="@color/blue_500" +<vector android:height="24dp" android:tint="@color/slate_50" android:viewportHeight="24" android:viewportWidth="24" - android:width="40dp" xmlns:android="http://schemas.android.com/apk/res/android"> + android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> <path android:fillColor="@android:color/white" android:pathData="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z"/> </vector> diff --git a/Sources/app/src/main/res/drawable/ic_baseline_edit_24_dark.xml b/Sources/app/src/main/res/drawable/ic_baseline_edit_24_dark.xml new file mode 100644 index 0000000..acb6b80 --- /dev/null +++ b/Sources/app/src/main/res/drawable/ic_baseline_edit_24_dark.xml @@ -0,0 +1,5 @@ +<vector android:height="24dp" android:tint="@color/slate_700" + android:viewportHeight="24" android:viewportWidth="24" + android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="@android:color/white" android:pathData="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z"/> +</vector> diff --git a/Sources/app/src/main/res/drawable/ic_baseline_info_24.xml b/Sources/app/src/main/res/drawable/ic_baseline_info_24.xml new file mode 100644 index 0000000..8c89cb3 --- /dev/null +++ b/Sources/app/src/main/res/drawable/ic_baseline_info_24.xml @@ -0,0 +1,5 @@ +<vector android:height="24dp" android:tint="@color/blue_500" + android:viewportHeight="24" android:viewportWidth="24" + android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="@android:color/white" android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-6h2v6zM13,9h-2L11,7h2v2z"/> +</vector> diff --git a/Sources/app/src/main/res/layout/activity_directions.xml b/Sources/app/src/main/res/layout/activity_directions.xml new file mode 100644 index 0000000..56ae2a2 --- /dev/null +++ b/Sources/app/src/main/res/layout/activity_directions.xml @@ -0,0 +1,125 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".MainActivity"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:background="@color/slate_50"> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> + <TextView + android:layout_width="0dp" + android:layout_weight="6" + android:layout_height="wrap_content" + android:gravity="center" + android:paddingBottom="20dp" + android:paddingTop="20dp" + android:textSize="40sp" + android:text="@string/directions" + android:maxLines="1" + android:ellipsize="end" + android:scrollHorizontally="true" + android:textStyle="bold" + android:textColor="@color/blue_500"/> + </LinearLayout> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/blue_500" + android:orientation="vertical"> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:background="@color/slate_200" + android:layout_marginBottom="6dp" + android:paddingLeft="10dp" + android:paddingRight="10dp" + android:paddingTop="8dp" + android:paddingBottom="8dp"> + <TextView + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:gravity="center" + android:textSize="20sp" + android:textStyle="bold" + android:textColor="@color/slate_800" + android:text="@string/from" /> + <TextView + android:id="@+id/from_room_name" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:gravity="center" + android:textSize="20sp" + android:textStyle="bold" + android:layout_marginStart="8dp" + android:layout_marginEnd="8dp" + android:textColor="@color/blue_500" + android:text="@string/room_name" /> + <TextView + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:gravity="center" + android:textSize="20sp" + android:textStyle="bold" + android:textColor="@color/slate_800" + android:text="@string/to" /> + <TextView + android:id="@+id/to_room_name" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:gravity="center" + android:textSize="20sp" + android:textStyle="bold" + android:layout_marginStart="8dp" + android:layout_marginEnd="8dp" + android:textColor="@color/blue_500" + android:text="@string/room_name" /> + </LinearLayout> + <LinearLayout + android:id="@+id/no_directions_layout" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:visibility="visible" + android:gravity="center" + android:background="@color/slate_50" > + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/no_directions" + android:textColor="@color/slate_400" + android:textStyle="bold" + android:textAlignment="center" + android:layout_marginStart="20dp" + android:layout_marginEnd="20dp" + android:textSize="24sp"/> + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/no_directions_desc" + android:textColor="@color/slate_300" + android:textStyle="normal" + android:textAlignment="center" + android:layout_marginStart="20dp" + android:layout_marginEnd="20dp" + android:textSize="20sp"/> + </LinearLayout> + <ListView + android:id="@+id/directions_list" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/slate_50" + android:divider="@null" + android:dividerHeight="0dp" + android:padding="10dp"/> + </LinearLayout> + </LinearLayout> +</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/Sources/app/src/main/res/layout/activity_zone_view.xml b/Sources/app/src/main/res/layout/activity_zone_view.xml index 23d644c..c9eef4f 100644 --- a/Sources/app/src/main/res/layout/activity_zone_view.xml +++ b/Sources/app/src/main/res/layout/activity_zone_view.xml @@ -15,24 +15,51 @@ android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" - android:orientation="vertical" + android:orientation="horizontal" android:gravity="center"> - <TextView - android:id="@+id/room_name" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="" - android:textSize="24sp" - android:textStyle="bold" - android:textColor="@color/blue_500"/> - <TextView - android:id="@+id/zone_name" - android:layout_width="wrap_content" + <LinearLayout + android:layout_width="0dp" + android:layout_weight="1" + android:layout_height="match_parent" + android:orientation="vertical" /> + <LinearLayout + android:layout_width="0dp" + android:layout_weight="4" android:layout_height="wrap_content" - android:text="" - android:textSize="18sp" - android:textStyle="normal" - android:textColor="@color/blue_400"/> + android:orientation="vertical" + android:gravity="center"> + <TextView + android:id="@+id/room_name" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="" + android:textSize="24sp" + android:textStyle="bold" + android:textColor="@color/blue_500"/> + <TextView + android:id="@+id/zone_name" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="" + android:textSize="18sp" + android:textStyle="normal" + android:textColor="@color/blue_400"/> + </LinearLayout> + <LinearLayout + android:layout_width="0dp" + android:layout_weight="1" + android:layout_height="match_parent" + android:orientation="vertical" + android:gravity="center"> + <ImageView + android:id="@+id/info_btn" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:src="@drawable/ic_baseline_info_24" + android:padding="4dp" + android:layout_margin="8dp" + android:background="@drawable/flat_btn"/> + </LinearLayout> </LinearLayout> <LinearLayout android:layout_width="match_parent" diff --git a/Sources/app/src/main/res/layout/building_tile.xml b/Sources/app/src/main/res/layout/building_tile.xml index a3be8ca..6d571c7 100644 --- a/Sources/app/src/main/res/layout/building_tile.xml +++ b/Sources/app/src/main/res/layout/building_tile.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout 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="match_parent" @@ -74,29 +75,33 @@ android:layout_height="wrap_content" android:orientation="horizontal" android:layout_marginTop="10dp"> + <Button android:id="@+id/tile_remove" android:layout_width="wrap_content" android:layout_height="wrap_content" android:backgroundTint="@color/red_500" android:text="@string/remove" - android:textSize="16sp" android:textColor="@color/slate_50" - android:textStyle="normal"/> + android:textSize="16sp" + android:textStyle="normal" + app:icon="@drawable/ic_baseline_delete_forever_24" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="right"> + <Button android:id="@+id/tile_edit" android:layout_width="wrap_content" android:layout_height="wrap_content" android:backgroundTint="@color/blue_500" android:text="@string/edit" - android:textSize="16sp" android:textColor="@color/slate_50" - android:textStyle="normal" /> + android:textSize="16sp" + android:textStyle="normal" + app:icon="@drawable/ic_baseline_edit_24"/> </LinearLayout> </LinearLayout> </LinearLayout> diff --git a/Sources/app/src/main/res/layout/direction_tile.xml b/Sources/app/src/main/res/layout/direction_tile.xml new file mode 100644 index 0000000..0806aa8 --- /dev/null +++ b/Sources/app/src/main/res/layout/direction_tile.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.constraintlayout.widget.ConstraintLayout 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="match_parent" + android:paddingBottom="10dp"> + <LinearLayout + android:id="@+id/tile_box" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:padding="10dp" + android:background="@drawable/round_bg"> + <TextView + android:id="@+id/direction_title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textStyle="bold" + android:text="" + android:textSize="20sp" + android:textColor="@color/slate_700" /> + <TextView + android:id="@+id/direction_description" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textStyle="normal" + android:text="" + android:layout_marginTop="8dp" + android:textSize="16sp" + android:textColor="@color/slate_500" /> + </LinearLayout> +</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/Sources/app/src/main/res/layout/directions_popup.xml b/Sources/app/src/main/res/layout/directions_popup.xml new file mode 100644 index 0000000..d833ef6 --- /dev/null +++ b/Sources/app/src/main/res/layout/directions_popup.xml @@ -0,0 +1,249 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="wrap_content" + android:layout_height="wrap_content"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:background="@color/slate_50"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:background="@color/blue_500" + android:layout_marginBottom="20dp"> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/slate_200" + android:text="@string/directions" + android:textColor="@color/blue_500" + android:textSize="20sp" + android:layout_marginBottom="4dp" + android:textStyle="bold" + android:padding="10dp" + /> + </LinearLayout> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="8dp" + android:layout_marginBottom="8dp" + android:textStyle="bold" + android:textSize="16sp" + android:text="@string/from"/> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginStart="10dp" + android:layout_marginEnd="10dp" + android:orientation="vertical" + android:background="@color/slate_200"> + <LinearLayout + android:id="@+id/select_from_room" + android:visibility="gone" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="@color/slate_700" + android:textSize="16sp" + android:textStyle="normal" + android:text="@string/select_room" + android:layout_marginStart="10dp" + android:layout_marginEnd="10dp" + android:paddingTop="10dp" + android:paddingBottom="4dp"/> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="end"> + <SearchView + android:id="@+id/room_search_from" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="end" + android:searchIcon="@drawable/ic_search_black" /> + </LinearLayout> + </LinearLayout> + <ListView + android:id="@+id/room_list_from" + android:layout_width="match_parent" + android:layout_marginStart="4dp" + android:layout_marginEnd="4dp" + android:layout_marginBottom="4dp" + android:background="@color/slate_50" + android:layout_height="200dp"/> + </LinearLayout> + <LinearLayout + android:id="@+id/show_from_room" + android:visibility="visible" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> + <TextView + android:id="@+id/name_from_room" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="@color/slate_700" + android:textSize="16sp" + android:textStyle="normal" + android:text="@string/no_room_selected" + android:layout_marginStart="10dp" + android:layout_marginEnd="10dp" + android:paddingTop="10dp" + android:paddingBottom="4dp"/> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="end"> + <ImageView + android:id="@+id/edit_from_room" + android:layout_width="30dp" + android:layout_height="30dp" + android:layout_margin="6dp" + android:src="@drawable/ic_baseline_edit_24_dark"/> + </LinearLayout> + </LinearLayout> + </LinearLayout> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="8dp" + android:layout_marginTop="16dp" + android:layout_marginBottom="8dp" + android:textStyle="bold" + android:textSize="16sp" + android:text="@string/to"/> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginStart="10dp" + android:layout_marginEnd="10dp" + android:orientation="vertical" + android:background="@color/slate_200"> + <LinearLayout + android:id="@+id/select_to_room" + android:visibility="gone" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="@color/slate_700" + android:textSize="16sp" + android:textStyle="normal" + android:text="@string/select_room" + android:layout_marginStart="10dp" + android:layout_marginEnd="10dp" + android:paddingTop="10dp" + android:paddingBottom="4dp"/> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="end"> + <SearchView + android:id="@+id/room_search_to" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="end" + android:searchIcon="@drawable/ic_search_black" /> + </LinearLayout> + </LinearLayout> + <ListView + android:id="@+id/room_list_to" + android:layout_width="match_parent" + android:layout_marginStart="4dp" + android:layout_marginEnd="4dp" + android:layout_marginBottom="4dp" + android:background="@color/slate_50" + android:layout_height="200dp"/> + </LinearLayout> + <LinearLayout + android:id="@+id/show_to_room" + android:visibility="visible" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> + <TextView + android:id="@+id/name_to_room" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="@color/slate_700" + android:textSize="16sp" + android:textStyle="normal" + android:text="@string/no_room_selected" + android:layout_marginStart="10dp" + android:layout_marginEnd="10dp" + android:paddingTop="10dp" + android:paddingBottom="4dp"/> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="end"> + <ImageView + android:id="@+id/edit_to_room" + android:layout_width="30dp" + android:layout_height="30dp" + android:layout_margin="6dp" + android:src="@drawable/ic_baseline_edit_24_dark"/> + </LinearLayout> + </LinearLayout> + </LinearLayout> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:layout_marginTop="20dp" + android:padding="8dp"> + + <Button + android:id="@+id/btn_cancel" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="@color/red_500" + style="@style/Widget.AppCompat.Button.Borderless" + android:text="@string/cancel"/> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="end"> + + <Button + android:id="@+id/btn_search" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:backgroundTint="@color/blue_500" + android:textColor="@color/slate_50" + android:text="@string/search"/> + </LinearLayout> + </LinearLayout> + </LinearLayout> +</RelativeLayout> \ No newline at end of file diff --git a/Sources/app/src/main/res/layout/pathway_tile.xml b/Sources/app/src/main/res/layout/pathway_tile.xml index a542f2b..5d0c9bf 100644 --- a/Sources/app/src/main/res/layout/pathway_tile.xml +++ b/Sources/app/src/main/res/layout/pathway_tile.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout 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="match_parent" @@ -71,30 +72,17 @@ android:layout_height="wrap_content" android:orientation="horizontal" android:layout_marginTop="10dp"> + <Button android:id="@+id/tile_remove" android:layout_width="wrap_content" android:layout_height="wrap_content" android:backgroundTint="@color/red_500" android:text="@string/remove" - android:textSize="16sp" android:textColor="@color/slate_50" - android:textStyle="normal"/> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:gravity="end"> - <Button - android:id="@+id/tile_edit" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:backgroundTint="@color/blue_500" - android:text="@string/edit" - android:textSize="16sp" - android:textColor="@color/slate_50" - android:textStyle="normal" /> - </LinearLayout> + android:textSize="16sp" + android:textStyle="normal" + app:icon="@drawable/ic_baseline_delete_forever_24" /> </LinearLayout> </LinearLayout> </androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/Sources/app/src/main/res/layout/photo_info_popup.xml b/Sources/app/src/main/res/layout/photo_info_popup.xml new file mode 100644 index 0000000..5f2bd20 --- /dev/null +++ b/Sources/app/src/main/res/layout/photo_info_popup.xml @@ -0,0 +1,104 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="wrap_content" + android:layout_height="wrap_content"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:background="@color/slate_50"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:background="@color/blue_500" + android:layout_marginBottom="20dp"> + + <TextView + android:id="@+id/info_title" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/slate_200" + android:text="@string/photo_info" + android:textColor="@color/blue_500" + android:textSize="20sp" + android:layout_marginBottom="4dp" + android:textStyle="bold" + android:padding="10dp" + /> + </LinearLayout> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/hour" + android:textStyle="bold" + android:textColor="@color/slate_600" + android:textSize="16sp" + android:layout_marginStart="8sp" + android:layout_marginEnd="8sp"/> + <TextView + android:id="@+id/photo_hour" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="" + android:textStyle="normal" + android:textColor="@color/blue_500" + android:textSize="16sp" + android:layout_marginStart="8sp" + android:layout_marginEnd="8sp"/> + </LinearLayout> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/date" + android:textStyle="bold" + android:textColor="@color/slate_600" + android:textSize="16sp" + android:layout_marginStart="8sp" + android:layout_marginEnd="8sp"/> + <TextView + android:id="@+id/photo_date" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="" + android:textStyle="normal" + android:textColor="@color/blue_500" + android:textSize="16sp" + android:layout_marginStart="8sp" + android:layout_marginEnd="8sp"/> + </LinearLayout> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:layout_marginTop="20dp" + android:padding="8dp"> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="right"> + <Button + android:id="@+id/btn_validate_room" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:backgroundTint="@color/blue_500" + android:text="@string/ok"/> + </LinearLayout> + </LinearLayout> + </LinearLayout> +</RelativeLayout> \ No newline at end of file diff --git a/Sources/app/src/main/res/layout/photo_tile.xml b/Sources/app/src/main/res/layout/photo_tile.xml index 9511489..ea50fe5 100644 --- a/Sources/app/src/main/res/layout/photo_tile.xml +++ b/Sources/app/src/main/res/layout/photo_tile.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout 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="match_parent" @@ -78,30 +79,17 @@ android:layout_height="wrap_content" android:orientation="horizontal" android:layout_marginTop="10dp"> + <Button android:id="@+id/tile_remove" android:layout_width="wrap_content" android:layout_height="wrap_content" android:backgroundTint="@color/red_500" android:text="@string/remove" - android:textSize="16sp" android:textColor="@color/slate_50" - android:textStyle="normal"/> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:gravity="end"> - <Button - android:id="@+id/tile_edit" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:backgroundTint="@color/blue_500" - android:text="@string/edit" - android:textSize="16sp" - android:textColor="@color/slate_50" - android:textStyle="normal" /> - </LinearLayout> + android:textSize="16sp" + android:textStyle="normal" + app:icon="@drawable/ic_baseline_delete_forever_24" /> </LinearLayout> </LinearLayout> </androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/Sources/app/src/main/res/layout/room_tile.xml b/Sources/app/src/main/res/layout/room_tile.xml index 3326757..0776c49 100644 --- a/Sources/app/src/main/res/layout/room_tile.xml +++ b/Sources/app/src/main/res/layout/room_tile.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout 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="match_parent" @@ -55,30 +56,17 @@ android:layout_height="wrap_content" android:orientation="horizontal" android:layout_marginTop="10dp"> + <Button android:id="@+id/tile_remove" android:layout_width="wrap_content" android:layout_height="wrap_content" android:backgroundTint="@color/red_500" android:text="@string/remove" - android:textSize="16sp" android:textColor="@color/slate_50" - android:textStyle="normal"/> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:gravity="end"> - <Button - android:id="@+id/tile_edit" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:backgroundTint="@color/blue_500" - android:text="@string/edit" - android:textSize="16sp" - android:textColor="@color/slate_50" - android:textStyle="normal" /> - </LinearLayout> + android:textSize="16sp" + android:textStyle="normal" + app:icon="@drawable/ic_baseline_delete_forever_24" /> </LinearLayout> </LinearLayout> </androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/Sources/app/src/main/res/layout/stairs_dest_popup.xml b/Sources/app/src/main/res/layout/stairs_dest_popup.xml new file mode 100644 index 0000000..762a3d9 --- /dev/null +++ b/Sources/app/src/main/res/layout/stairs_dest_popup.xml @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="wrap_content" + android:layout_height="wrap_content"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:background="@color/slate_50"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:background="@color/blue_500" + android:layout_marginBottom="20dp"> + + <TextView + android:id="@+id/info_title" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/slate_200" + android:text="@string/stairs_direction" + android:textColor="@color/blue_500" + android:textSize="20sp" + android:layout_marginBottom="4dp" + android:textStyle="bold" + android:padding="10dp" + /> + </LinearLayout> + + <Button + android:id="@+id/btn_dir_up" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:backgroundTint="@color/slate_200" + android:text="@string/go_up" + android:textColor="@color/slate_700" + android:textSize="16sp" + android:textStyle="bold" + android:layout_marginTop="4dp" + android:layout_marginStart="8dp" + android:layout_marginEnd="8dp"/> + + <Button + android:id="@+id/btn_dir_down" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:backgroundTint="@color/slate_200" + android:text="@string/go_down" + android:textColor="@color/slate_700" + android:textSize="16sp" + android:textStyle="bold" + android:layout_marginTop="4dp" + android:layout_marginStart="8dp" + android:layout_marginEnd="8dp"/> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:layout_marginTop="20dp" + android:padding="8dp"> + <Button + android:id="@+id/btn_cancel_room" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="@color/blue_500" + style="@style/Widget.AppCompat.Button.Borderless" + android:text="@string/cancel"/> + </LinearLayout> + </LinearLayout> +</RelativeLayout> \ No newline at end of file diff --git a/Sources/app/src/main/res/layout/zone_tile.xml b/Sources/app/src/main/res/layout/zone_tile.xml index 25bdf71..d69e59c 100644 --- a/Sources/app/src/main/res/layout/zone_tile.xml +++ b/Sources/app/src/main/res/layout/zone_tile.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout 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="match_parent" @@ -55,30 +56,17 @@ android:layout_height="wrap_content" android:orientation="horizontal" android:layout_marginTop="10dp"> + <Button android:id="@+id/tile_remove" android:layout_width="wrap_content" android:layout_height="wrap_content" android:backgroundTint="@color/red_500" android:text="@string/remove" - android:textSize="16sp" android:textColor="@color/slate_50" - android:textStyle="normal"/> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:gravity="end"> - <Button - android:id="@+id/tile_edit" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:backgroundTint="@color/blue_500" - android:text="@string/edit" - android:textSize="16sp" - android:textColor="@color/slate_50" - android:textStyle="normal" /> - </LinearLayout> + android:textSize="16sp" + android:textStyle="normal" + app:icon="@drawable/ic_baseline_delete_forever_24" /> </LinearLayout> </LinearLayout> </androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/Sources/app/src/main/res/values-fr/strings.xml b/Sources/app/src/main/res/values-fr/strings.xml index 0072997..10e0ed5 100644 --- a/Sources/app/src/main/res/values-fr/strings.xml +++ b/Sources/app/src/main/res/values-fr/strings.xml @@ -15,7 +15,7 @@ <string name="building_name">Nom du bâtiment</string> <string name="create">Créer</string> <string name="new_room">Nouvelle pièce</string> - <string name="room_name">Nom de la pièce ...</string> + <string name="room_name">Nom de la pièce</string> <string name="no_zones">Pas de zones</string> <string name="no_zones_desc">Appuyez sur l\'icône + pour ajouter une zone</string> <string name="doors">Portes</string> @@ -67,7 +67,7 @@ <string name="pathview_path">Passage correspondant</string> <string name="add">Ajouter</string> <string name="actions">Actions</string> - <string name="directions">Directions</string> + <string name="directions">Itinéraire</string> <string name="go_to">Aller à</string> <string name="edit_pathview">Modifier la zone de passage</string> <string name="no_pathways_available">Aucun passage créé</string> @@ -83,4 +83,18 @@ <string name="no_zones_available">Aucune zone disponible</string> <string name="remove_title">Supprimer {{value}} ?</string> <string name="remove_msg">"Voulez-vous supprimer {{value}} ?\nCet element sera supprimé pour toujours."</string> + <string name="hour">Heure</string> + <string name="date">Date</string> + <string name="ok">Ok</string> + <string name="photo_info">Informations sur la photo</string> + <string name="stairs_direction">Direction des escaliers</string> + <string name="go_up">Aller en haut</string> + <string name="go_down">Aller en bas</string> + <string name="from">Depuis</string> + <string name="no_room_selected">Aucune pièce sélectionnée</string> + <string name="search">Chercher</string> + <string name="no_directions">Pas d\'itinéraire</string> + <string name="no_directions_desc">Aucun itinéraire disponible entre ces pièces</string> + <string name="go_to_value">Allez dans la pièce {{value}}</string> + <string name="go_to_value_desc">Allez dans la pièce {{value1}} en utilisant le passage {{value2}}</string> </resources> \ No newline at end of file diff --git a/Sources/app/src/main/res/values/strings.xml b/Sources/app/src/main/res/values/strings.xml index 60fa070..1427a90 100644 --- a/Sources/app/src/main/res/values/strings.xml +++ b/Sources/app/src/main/res/values/strings.xml @@ -15,7 +15,7 @@ <string name="building_name">Building name</string> <string name="create">Create</string> <string name="new_room">New room</string> - <string name="room_name">Room name ...</string> + <string name="room_name">Room name</string> <string name="no_zones">No zones</string> <string name="no_zones_desc">Click on the + icon to add a zone</string> <string name="doors">Doors</string> @@ -67,7 +67,7 @@ <string name="pathview_path">Corresponding pathway</string> <string name="add">Add</string> <string name="actions">Actions</string> - <string name="directions">Directions</string> + <string name="directions">Route</string> <string name="go_to">Go to</string> <string name="edit_pathview">Edit pathview</string> <string name="no_pathways_available">No pathways created</string> @@ -83,4 +83,18 @@ <string name="no_zones_available">No zones available</string> <string name="remove_title">Remove {{value}} ?</string> <string name="remove_msg">Do you want to remove {{value}} ?\nIt will be deleted for ever.</string> + <string name="photo_info">Photo informations</string> + <string name="hour">Hour</string> + <string name="date">Date</string> + <string name="ok">Ok</string> + <string name="stairs_direction">Stairs direction</string> + <string name="go_up">Go up</string> + <string name="go_down">Go down</string> + <string name="from">From</string> + <string name="no_room_selected">No room selected</string> + <string name="search">Search</string> + <string name="no_directions">No route</string> + <string name="no_directions_desc">No route available between those rooms</string> + <string name="go_to_value">Go to the room {{value}}</string> + <string name="go_to_value_desc">Go to the room {{value1}} by using the path {{value2}}</string> </resources> \ No newline at end of file -- GitLab