diff --git a/Sources/app/src/main/AndroidManifest.xml b/Sources/app/src/main/AndroidManifest.xml index 4b27f6da17af03c08293432dc6bf47d5d5ca9c03..17eb3668245eab5a48242a2ef02e01130af20f8c 100644 --- a/Sources/app/src/main/AndroidManifest.xml +++ b/Sources/app/src/main/AndroidManifest.xml @@ -7,17 +7,24 @@ android:allowBackup="true" android:dataExtractionRules="@xml/data_extraction_rules" android:fullBackupContent="@xml/backup_rules" - android:icon="@mipmap/ic_launcher" + android:icon="@mipmap/icon" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme.RoomView" tools:targetApi="31"> <activity - android:name="com.furwaz.roomview.MainActivity" + android:name=".RoomActivity" + android:exported="false" /> + <activity + android:name=".BuildingActivity" + android:exported="false" /> + <activity + android:name=".MainActivity" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> + <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> diff --git a/Sources/app/src/main/icon-playstore.png b/Sources/app/src/main/icon-playstore.png new file mode 100644 index 0000000000000000000000000000000000000000..60109104cfaba4c58e8d4801379ffa5df603f73e Binary files /dev/null and b/Sources/app/src/main/icon-playstore.png differ diff --git a/Sources/app/src/main/java/Common/BuildingManager.java b/Sources/app/src/main/java/Common/BuildingManager.java new file mode 100644 index 0000000000000000000000000000000000000000..72355fa63e4251a82ffe970efebdd89a469da7da --- /dev/null +++ b/Sources/app/src/main/java/Common/BuildingManager.java @@ -0,0 +1,95 @@ +package Common; + +import android.content.Context; +import android.widget.Toast; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.ArrayList; +import java.util.List; + +import Structures.BuildingInfo; + +public class BuildingManager { + private static Context context; + private static List<BuildingInfo> buildings = null; + private static File save_dir = null; + + public static void setContext(Context c) { + BuildingManager.context = c; + save_dir = context.getFilesDir(); + } + + public static void removeBuilding(BuildingInfo b) { + if (BuildingManager.buildings == null) + loadBuildings(); + BuildingManager.buildings.remove(b); + BuildingManager.saveBuildings(); + new File(save_dir, b.getName()).delete(); + } + + public static void addBuilding(BuildingInfo b) { + if (BuildingManager.buildings == null) + loadBuildings(); + BuildingManager.buildings.add(b); + BuildingManager.saveBuildings(); + } + + public static List<BuildingInfo> getBuildings() { + if (BuildingManager.buildings == null) + loadBuildings(); + return BuildingManager.buildings; + } + + public static BuildingInfo getBuilding(int index) { + if (BuildingManager.buildings == null) + loadBuildings(); + return BuildingManager.buildings.get(index); + } + + public static void saveBuilding(BuildingInfo building) { + Toast.makeText(context, "saving "+building.getName(), Toast.LENGTH_SHORT).show(); + new File(save_dir, building.getName()).delete(); + + try { + FileOutputStream outputStream = new FileOutputStream( new File(save_dir, building.getName()) ); + ObjectOutputStream obStream = new ObjectOutputStream(outputStream); + obStream.writeObject(building); + obStream.close(); + outputStream.close(); + } catch( Exception e ) { + Toast.makeText(context, "Error: "+e.toString(), Toast.LENGTH_SHORT).show(); + } + + int index = BuildingManager.buildings.indexOf(building); + if (index != -1) { + BuildingManager.buildings.remove(index); + } + BuildingManager.buildings.add(building); + } + + public static void saveBuildings() { + for(BuildingInfo building: BuildingManager.buildings) + saveBuilding(building); + } + + public static void loadBuildings() { + BuildingManager.buildings = new ArrayList<>(); + for(String file : save_dir.list()) + { + try { + FileInputStream inputStream = new FileInputStream( new File(save_dir, file) ); + ObjectInputStream obStream = new ObjectInputStream(inputStream); + BuildingInfo building = (BuildingInfo) obStream.readObject(); + BuildingManager.buildings.add(building); + inputStream.close(); + } catch ( Exception e ) { + new File(save_dir, file).delete(); + } + } + } +} diff --git a/Sources/app/src/main/java/Common/Callback.java b/Sources/app/src/main/java/Common/Callback.java new file mode 100644 index 0000000000000000000000000000000000000000..ad3e6f0ce7b5ba6c6364bd991ca0d6dadf6ac69b --- /dev/null +++ b/Sources/app/src/main/java/Common/Callback.java @@ -0,0 +1,5 @@ +package Common; + +public interface Callback { + public Object call(Object param); +} diff --git a/Sources/app/src/main/java/Common/InfoBinding.java b/Sources/app/src/main/java/Common/InfoBinding.java new file mode 100644 index 0000000000000000000000000000000000000000..17affb9143f905ac7affd0c9d10158532c6d25bc --- /dev/null +++ b/Sources/app/src/main/java/Common/InfoBinding.java @@ -0,0 +1,19 @@ +package Common; + +public class InfoBinding { + private Callback callback; + private int element; + + public InfoBinding(Callback cb, int el) { + this.element = el; + this.callback = cb; + } + + public Callback getCallback() { + return callback; + } + + public int getElement() { + return element; + } +} diff --git a/Sources/app/src/main/java/Structures/BuildingInfo.java b/Sources/app/src/main/java/Structures/BuildingInfo.java index 2fd62328e3799e173dbdb75e4f37939a924fc6d7..b03dc86a3e9056334c47bd8af8a4b60970d6146f 100644 --- a/Sources/app/src/main/java/Structures/BuildingInfo.java +++ b/Sources/app/src/main/java/Structures/BuildingInfo.java @@ -1,11 +1,14 @@ package Structures; +import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Objects; -public class BuildingInfo { +import Common.BuildingManager; + +public class BuildingInfo implements Serializable { String name = ""; Date date = new Date(); List<RoomInfo> rooms = new ArrayList<>(); @@ -34,6 +37,17 @@ public class BuildingInfo { return null; } + public void removeRoom(RoomInfo room) { + this.rooms.remove(room); + this.save(); + } + + public void addRoom(RoomInfo room) { + room.setBuilding(this); + this.rooms.add(room); + this.save(); + } + public Date getDate() { return date; } @@ -54,6 +68,10 @@ public class BuildingInfo { return this.rooms.size(); } + public void save() { + BuildingManager.saveBuilding(this); + } + @Override public boolean equals(Object o) { if (this == o) return true; @@ -66,4 +84,9 @@ public class BuildingInfo { public int hashCode() { return Objects.hash(name, date); } + + @Override + public String toString() { + return this.name; + } } diff --git a/Sources/app/src/main/java/Structures/MeteoInfo.java b/Sources/app/src/main/java/Structures/MeteoInfo.java index 4b3b76bae33b86811e681001ecac7911e47e304c..5a1728706cc725f8ec74db698f1c0d9a8c33127b 100644 --- a/Sources/app/src/main/java/Structures/MeteoInfo.java +++ b/Sources/app/src/main/java/Structures/MeteoInfo.java @@ -1,6 +1,8 @@ package Structures; -public class MeteoInfo { +import java.io.Serializable; + +public class MeteoInfo implements Serializable { float temperature = 0f; float humidity = 0f; float pressure = 1000f; diff --git a/Sources/app/src/main/java/Structures/PathDoor.java b/Sources/app/src/main/java/Structures/PathDoor.java index da6de88e0cc8dbd60d69bc9891c587e04f6b3db1..a006307a70be594b0059a5f0282a73cc912530bc 100644 --- a/Sources/app/src/main/java/Structures/PathDoor.java +++ b/Sources/app/src/main/java/Structures/PathDoor.java @@ -1,6 +1,8 @@ package Structures; -public class PathDoor extends PathInfo { +import java.io.Serializable; + +public class PathDoor extends PathInfo implements Serializable { public PathDoor() { super(PathType.DOOR); } diff --git a/Sources/app/src/main/java/Structures/PathInfo.java b/Sources/app/src/main/java/Structures/PathInfo.java index 6ed7507e369f652a4e432b0d08a24ee753bd7240..78dd67de405b84d23e785b5d5cb7a88d2a064ea5 100644 --- a/Sources/app/src/main/java/Structures/PathInfo.java +++ b/Sources/app/src/main/java/Structures/PathInfo.java @@ -1,11 +1,13 @@ package Structures; +import java.io.Serializable; + enum PathType { STAIRS, DOOR } -public class PathInfo { +public class PathInfo implements Serializable { PathType type = PathType.DOOR; RoomInfo destination; diff --git a/Sources/app/src/main/java/Structures/PathStairs.java b/Sources/app/src/main/java/Structures/PathStairs.java index 0a5e1d72ef8265abe9dc093c22a607f7501f36dc..3137e69d94d7f9dbd26236fb41ab4430156e3926 100644 --- a/Sources/app/src/main/java/Structures/PathStairs.java +++ b/Sources/app/src/main/java/Structures/PathStairs.java @@ -1,12 +1,14 @@ package Structures; +import java.io.Serializable; + enum StairsDirection { UP, DOWN, BOTH } -public class PathStairs extends PathInfo { +public class PathStairs extends PathInfo implements Serializable { RoomInfo roomDown; StairsDirection direction = StairsDirection.BOTH; diff --git a/Sources/app/src/main/java/Structures/PathView.java b/Sources/app/src/main/java/Structures/PathView.java index ce1de81c1d1057d107f06a219c767210dd027264..5fae525a36298bfc32468cce6754ddf5dc782ca6 100644 --- a/Sources/app/src/main/java/Structures/PathView.java +++ b/Sources/app/src/main/java/Structures/PathView.java @@ -1,6 +1,8 @@ package Structures; -public class PathView { +import java.io.Serializable; + +public class PathView implements Serializable { int x, y, width, height; PathInfo path; diff --git a/Sources/app/src/main/java/Structures/PhotoInfo.java b/Sources/app/src/main/java/Structures/PhotoInfo.java index 9c9419f6ab2f77f54076f2cbaeb4c492f85cc92a..8ffb536dded3d10f71706a210efb518a10f655f0 100644 --- a/Sources/app/src/main/java/Structures/PhotoInfo.java +++ b/Sources/app/src/main/java/Structures/PhotoInfo.java @@ -2,6 +2,7 @@ package Structures; import android.graphics.Bitmap; +import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -12,7 +13,7 @@ enum Orientation { WEST } -public class PhotoInfo { +public class PhotoInfo implements Serializable { Orientation orientation = Orientation.NORTH; Bitmap image; List<PathView> pathViews = new ArrayList<>(); diff --git a/Sources/app/src/main/java/Structures/RoomInfo.java b/Sources/app/src/main/java/Structures/RoomInfo.java index 8bf5ddf88ec8b880af80d0d8582975e0e6499174..30ba7bd6f3b76a6ed47a2738da027aa4d67437fc 100644 --- a/Sources/app/src/main/java/Structures/RoomInfo.java +++ b/Sources/app/src/main/java/Structures/RoomInfo.java @@ -1,5 +1,6 @@ package Structures; +import java.io.Serializable; import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -9,10 +10,11 @@ enum RoomType { ROOM } -public class RoomInfo { +public class RoomInfo implements Serializable { String name = "X"; RoomType type = RoomType.ROOM; List<ZoneInfo> zones = new ArrayList<>(); + BuildingInfo building = null; public RoomInfo() { @@ -40,12 +42,16 @@ public class RoomInfo { public void addZone(ZoneInfo zone) { this.zones.add(zone); + if (this.building != null) this.building.save(); } public void removeZone(ZoneInfo zone) { this.zones.remove(zone); + if (this.building != null) this.building.save(); } + public int getNbZones() { return this.zones.size(); } + public String getName() { return name; } @@ -54,6 +60,8 @@ public class RoomInfo { this.name = name; } + public void setBuilding(BuildingInfo building) { this.building = building; } + @Override public boolean equals(Object o) { if (this == o) return true; @@ -68,4 +76,9 @@ public class RoomInfo { public int hashCode() { return Objects.hash(type, zones); } + + @Override + public String toString() { + return this.name; + } } diff --git a/Sources/app/src/main/java/Structures/WalkInfo.java b/Sources/app/src/main/java/Structures/WalkInfo.java index 66e0deef3940f4f6c8d192a1a03b8fea9d7c5fc3..4d07af231718de7976692c66ff2b4e291d9c4ff3 100644 --- a/Sources/app/src/main/java/Structures/WalkInfo.java +++ b/Sources/app/src/main/java/Structures/WalkInfo.java @@ -1,6 +1,8 @@ package Structures; -public class WalkInfo { +import java.io.Serializable; + +public class WalkInfo implements Serializable { ZoneInfo destination; Orientation orientation = Orientation.NORTH; diff --git a/Sources/app/src/main/java/Structures/ZoneInfo.java b/Sources/app/src/main/java/Structures/ZoneInfo.java index 7792bc6c683e1917e0f39260ecbe00c306ea5bd1..57056610c5c68b4cb0c051f2fe2dd60fac59e45e 100644 --- a/Sources/app/src/main/java/Structures/ZoneInfo.java +++ b/Sources/app/src/main/java/Structures/ZoneInfo.java @@ -1,10 +1,11 @@ package Structures; +import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.List; -public class ZoneInfo { +public class ZoneInfo implements Serializable { String name = "X"; Date date; MeteoInfo meteo; @@ -15,6 +16,10 @@ public class ZoneInfo { } + public ZoneInfo(String name) { + this.name = name; + } + public ZoneInfo(String name, Date date, MeteoInfo meteo) { this.name = name; this.date = date; diff --git a/Sources/app/src/main/java/Views/BuildingAdapter.java b/Sources/app/src/main/java/Views/BuildingAdapter.java deleted file mode 100644 index cff5b8dd93d7d213dd2e799973f941112033a4f6..0000000000000000000000000000000000000000 --- a/Sources/app/src/main/java/Views/BuildingAdapter.java +++ /dev/null @@ -1,100 +0,0 @@ -package Views; - -import android.content.Context; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.BaseAdapter; -import android.widget.Button; -import android.widget.LinearLayout; -import android.widget.TextView; -import android.widget.Toast; - -import com.furwaz.roomview.MainActivity; -import com.furwaz.roomview.R; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import Structures.BuildingInfo; - -public class BuildingAdapter extends BaseAdapter { - private Context context; - private List<BuildingInfo> data; - private List<BuildingInfo> queryList = new ArrayList<>(); - private String searchQuery = ""; - - public BuildingAdapter(Context context, List<BuildingInfo> data) { - this.context = context; - this.data = data; - updateQueryList(); - } - - public void setData(List<BuildingInfo> data) { - this.data = data; - this.updateQueryList(); - } - - @Override - public int getCount() { - return queryList.size(); - } - - @Override - public Object getItem(int i) { - return queryList.get(i); - } - - @Override - public long getItemId(int i) { - return i; - } - - public void updateQueryList() { - this.queryList.clear(); - for(BuildingInfo info: this.data) { - String formattedName = info.getName().replaceAll(" ", "").toLowerCase(); - if (formattedName.contains(this.searchQuery.toLowerCase())) - this.queryList.add(info); - } - this.notifyDataSetChanged(); - } - - @Override - public View getView(int i, View view, ViewGroup viewGroup) { - view = LayoutInflater.from(context).inflate(R.layout.building_tile, viewGroup, false); - TextView name = view.findViewById(R.id.building_name); - TextView date = view.findViewById(R.id.building_date); - name.setText(queryList.get(i).getName()); - Date d = queryList.get(i).getDate(); - String stringDate = d.getDate()+" / "+(d.getMonth()+1)+" / "+(d.getYear()-100); - date.setText(stringDate); - - this.setupOnClick(view, i); - - return view; - } - - public void setupOnClick(View view, int i) { - LinearLayout ll = view.findViewById(R.id.building_box); - Button b1 = view.findViewById(R.id.building_remove); - Button b2 = view.findViewById(R.id.building_edit); - ll.setOnClickListener(view1 -> { - Toast.makeText(context, "Building box click", Toast.LENGTH_SHORT).show(); - }); - b1.setOnClickListener(view12 -> { - Toast.makeText(context, "Remove button click", Toast.LENGTH_SHORT).show(); - data.remove(data.indexOf(queryList.get(i))); - this.updateQueryList(); - }); - b2.setOnClickListener(view13 -> { - Toast.makeText(context, "Edit button click", Toast.LENGTH_SHORT).show(); - }); - } - - public void setSearchQuery(String query) { - this.searchQuery = query; - this.updateQueryList(); - } -} diff --git a/Sources/app/src/main/java/Views/InfoAdapter.java b/Sources/app/src/main/java/Views/InfoAdapter.java new file mode 100644 index 0000000000000000000000000000000000000000..3a0e9fcdd9bdb19f43604f9d39f07f2c2962fc02 --- /dev/null +++ b/Sources/app/src/main/java/Views/InfoAdapter.java @@ -0,0 +1,140 @@ +package Views; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; +import android.widget.Button; +import android.widget.LinearLayout; +import android.widget.TextView; + +import com.furwaz.roomview.R; + +import java.text.Normalizer; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import Common.Callback; +import Common.InfoBinding; +import Structures.BuildingInfo; + +public class InfoAdapter<A> extends BaseAdapter { + private Context context; + private List<A> data; + private List<A> queryList = new ArrayList<>(); + private String searchQuery = ""; + private View noDataLayout = null; + + private Callback editCallback = null; + private Callback viewCallback = null; + private Callback removeCallback = null; + private InfoBinding[] bindings = new InfoBinding[0]; + + private int tile = 0; + + public InfoAdapter(Context context, List<A> data, View noDataLayout, int tile) { + this.context = context; + this.data = data; + this.noDataLayout = noDataLayout; + this.updateQueryList(); + this.tile = tile; + } + + public void setData(List<A> data) { + this.data = data; + this.updateQueryList(); + } + + @Override + public int getCount() { + return queryList.size(); + } + + @Override + public Object getItem(int i) { + return queryList.get(i); + } + + @Override + public long getItemId(int i) { + return i; + } + + public void updateQueryList() { + this.queryList.clear(); + for(A info: this.data) { + String formattedName = info.toString().replaceAll(" ", "").toLowerCase(); + formattedName = Normalizer.normalize(formattedName, Normalizer.Form.NFD).replaceAll("\\p{InCombiningDiacriticalMarks}+", "").trim(); + if (formattedName.contains(this.searchQuery.toLowerCase().trim())) + this.queryList.add(info); + } + + if (this.queryList.size() > 0) + this.noDataLayout.setVisibility(View.GONE); + else this.noDataLayout.setVisibility(View.VISIBLE); + + this.notifyDataSetChanged(); + } + + @Override + public View getView(int i, View view, ViewGroup viewGroup) { + view = LayoutInflater.from(context).inflate(this.tile, viewGroup, false); + + A building = queryList.get(i); + if (this.bindings != null) + for (InfoBinding b : this.bindings) { + try { + View v = view.findViewById(b.getElement()); + if (v instanceof TextView) + ((TextView) v).setText( b.getCallback().call(building).toString() ); + } catch (Exception e) { } + } + + this.setupOnClick(view, i); + return view; + } + + private void setupOnClick(View view, int i) { + 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(); + }); + } + + public void setBindings(InfoBinding[] bindings) { + this.bindings = bindings; + } + + public void setOnEditListener(Callback cb) { + this.editCallback = cb; + } + + public void setOnViewListener(Callback cb) { + this.viewCallback = cb; + } + + public void setOnRemoveListener(Callback cb) { + this.removeCallback = cb; + } + + public void setSearchQuery(String query) { + this.searchQuery = query; + this.updateQueryList(); + } +} diff --git a/Sources/app/src/main/java/com/furwaz/roomview/BuildingActivity.java b/Sources/app/src/main/java/com/furwaz/roomview/BuildingActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..5ca19454deea0a757641288f2f84035531c11cf0 --- /dev/null +++ b/Sources/app/src/main/java/com/furwaz/roomview/BuildingActivity.java @@ -0,0 +1,124 @@ +package com.furwaz.roomview; + +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; + +import android.content.Intent; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageButton; +import android.widget.LinearLayout; +import android.widget.ListView; +import android.widget.SearchView; +import android.widget.TextView; +import android.widget.Toast; + +import java.io.Serializable; +import java.util.Date; + +import Common.BuildingManager; +import Common.InfoBinding; +import Structures.BuildingInfo; +import Structures.RoomInfo; +import Views.InfoAdapter; + +public class BuildingActivity extends AppCompatActivity { + InfoAdapter room_adapter = null; + BuildingInfo building; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_building); + + int buildingIndex = getIntent().getExtras().getInt("building"); + building = BuildingManager.getBuilding(buildingIndex); + if (building == null) { + Toast.makeText(this, "Error : Building is null !", Toast.LENGTH_SHORT).show(); + return; + } + + ListView room_lv = findViewById(R.id.room_list); + LinearLayout noDataLayout = findViewById(R.id.no_room_layout); + + room_adapter = new InfoAdapter(this, building.getRooms(), noDataLayout, R.layout.room_tile); + room_lv.setAdapter(room_adapter); + + room_adapter.setOnRemoveListener(param -> { + building.removeRoom((RoomInfo) param); + return null; + }); + + room_adapter.setOnEditListener(param -> { + Intent intent = new Intent(BuildingActivity.this, RoomActivity.class); + intent.putExtra("building", BuildingManager.getBuildings().indexOf(building)); + intent.putExtra("room", building.getRooms().indexOf(param)); + BuildingActivity.this.startActivity(intent); + return null; + }); + + room_adapter.setOnViewListener(param -> { + return null; + }); + + room_adapter.setBindings(new InfoBinding[]{ + new InfoBinding(param -> ((RoomInfo) param).getName(), R.id.room_name), + new InfoBinding(param -> ((RoomInfo) param).getNbZones(), R.id.room_zones) + }); + + SearchView building_sv = findViewById(R.id.room_search); + building_sv.setOnQueryTextListener(new SearchView.OnQueryTextListener() { + public boolean onQueryTextSubmit(String s) { + return true; + } + + public boolean onQueryTextChange(String s) { + room_adapter.setSearchQuery(s); + room_lv.setAdapter(room_adapter); + return true; + } + }); + + ImageButton add_btn = findViewById(R.id.add_room_btn); + add_btn.setOnClickListener(view -> { + showAddRoomPopup(view); + }); + + TextView building_tv_name = findViewById(R.id.building_name); + building_tv_name.setText(building.getName()); + } + + @Override + protected void onResume() { + super.onResume(); + room_adapter.setData(building.getRooms()); + } + + protected void showAddRoomPopup(View v) { + AlertDialog.Builder builder = new AlertDialog.Builder(BuildingActivity.this); + AlertDialog dialog = builder.create(); + LayoutInflater factory = LayoutInflater.from(BuildingActivity.this); + View popup = factory.inflate(R.layout.add_room_popup, null); + dialog.setView(popup); + + dialog.setOnShowListener(dialogInterface -> { + EditText r_name = popup.findViewById(R.id.input_room_name); + Button validate_btn = popup.findViewById(R.id.btn_validate_room); + Button cancel_btn = popup.findViewById(R.id.btn_cancel_room); + + cancel_btn.setOnClickListener(view -> { + dialog.dismiss(); + }); + + validate_btn.setOnClickListener(view -> { + building.addRoom(new RoomInfo(r_name.getText().toString())); + room_adapter.setData(building.getRooms()); + dialog.dismiss(); + }); + }); + dialog.show(); + } +} \ No newline at end of file diff --git a/Sources/app/src/main/java/com/furwaz/roomview/MainActivity.java b/Sources/app/src/main/java/com/furwaz/roomview/MainActivity.java index 2291b92022eff1d69195a334c6945f28fe47709a..741b1f5ab549f3d9dd80784c3271ed5929ed8460 100644 --- a/Sources/app/src/main/java/com/furwaz/roomview/MainActivity.java +++ b/Sources/app/src/main/java/com/furwaz/roomview/MainActivity.java @@ -1,45 +1,121 @@ package com.furwaz.roomview; +import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; +import android.content.Intent; import android.os.Bundle; +import android.view.Gravity; +import android.view.LayoutInflater; +import android.view.View; +import android.view.Window; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageButton; +import android.widget.LinearLayout; import android.widget.ListView; +import android.widget.PopupWindow; import android.widget.SearchView; +import android.widget.TextView; +import android.widget.Toast; +import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.List; +import Common.BuildingManager; +import Common.InfoBinding; import Structures.BuildingInfo; -import Views.BuildingAdapter; +import Views.InfoAdapter; public class MainActivity extends AppCompatActivity { + InfoAdapter building_adapter = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); - List<BuildingInfo> buildings = new ArrayList<>(); - buildings.add(new BuildingInfo("FST HP Building", new Date())); - buildings.add(new BuildingInfo("Home", new Date())); - buildings.add(new BuildingInfo("Test Building", new Date())); + BuildingManager.setContext(getBaseContext()); ListView building_lv = findViewById(R.id.building_list); - BuildingAdapter building_adapter = new BuildingAdapter(this, buildings); + LinearLayout noDataLayout = findViewById(R.id.no_building_layout); + + building_adapter = new InfoAdapter(this, BuildingManager.getBuildings(), noDataLayout, R.layout.building_tile); building_lv.setAdapter(building_adapter); + building_adapter.setOnRemoveListener(param -> { + BuildingManager.removeBuilding((BuildingInfo) param); + return null; + }); + + building_adapter.setOnViewListener(param -> { + Toast.makeText(this, "Viewing building named "+((BuildingInfo) param).getName(), Toast.LENGTH_SHORT).show(); + return null; + }); + + building_adapter.setOnEditListener(param -> { + Intent intent = new Intent(MainActivity.this, BuildingActivity.class); + intent.putExtra("building", BuildingManager.getBuildings().indexOf(param)); + MainActivity.this.startActivity(intent); + return null; + }); + + building_adapter.setBindings(new InfoBinding[]{ + new InfoBinding(param -> ((BuildingInfo) param).getName(), R.id.building_name), + new InfoBinding(param -> ((BuildingInfo) param).getNbRooms(), R.id.building_nb_rooms), + new InfoBinding(param -> { + Date d = ((BuildingInfo) param).getDate(); + return d.getDate()+" / "+(d.getMonth()+1)+" / "+(d.getYear()-100); + }, R.id.building_date) + }); + SearchView building_sv = findViewById(R.id.building_search); building_sv.setOnQueryTextListener(new SearchView.OnQueryTextListener() { - @Override public boolean onQueryTextSubmit(String s) { return true; } - @Override public boolean onQueryTextChange(String s) { building_adapter.setSearchQuery(s); building_lv.setAdapter(building_adapter); return true; } }); + + ImageButton add_btn = findViewById(R.id.add_building_btn); + add_btn.setOnClickListener(view -> { + showAddBuildingPopup(view); + }); + } + + @Override + protected void onResume() { + super.onResume(); + building_adapter.setData(BuildingManager.getBuildings()); + } + + protected void showAddBuildingPopup(View v) { + AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this); + AlertDialog dialog = builder.create(); + LayoutInflater factory = LayoutInflater.from(MainActivity.this); + View popup = factory.inflate(R.layout.add_building_popup, null); + dialog.setView(popup); + + dialog.setOnShowListener(dialogInterface -> { + EditText b_name = popup.findViewById(R.id.input_building_name); + Button validate_btn = popup.findViewById(R.id.btn_validate_building); + Button cancel_btn = popup.findViewById(R.id.btn_cancel_building); + + cancel_btn.setOnClickListener(view -> { + dialog.dismiss(); + }); + + validate_btn.setOnClickListener(view -> { + BuildingManager.addBuilding(new BuildingInfo(b_name.getText().toString(), new Date())); + building_adapter.setData(BuildingManager.getBuildings()); + dialog.dismiss(); + }); + }); + dialog.show(); } } \ No newline at end of file diff --git a/Sources/app/src/main/java/com/furwaz/roomview/RoomActivity.java b/Sources/app/src/main/java/com/furwaz/roomview/RoomActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..9cff2175775ad39bdc18e661985862312953106d --- /dev/null +++ b/Sources/app/src/main/java/com/furwaz/roomview/RoomActivity.java @@ -0,0 +1,116 @@ +package com.furwaz.roomview; + +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageButton; +import android.widget.LinearLayout; +import android.widget.ListView; +import android.widget.SearchView; +import android.widget.TextView; +import android.widget.Toast; + +import Common.BuildingManager; +import Common.InfoBinding; +import Structures.BuildingInfo; +import Structures.RoomInfo; +import Structures.ZoneInfo; +import Views.InfoAdapter; + +public class RoomActivity extends AppCompatActivity { + RoomInfo room = null; + InfoAdapter zone_adapter = null; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_room); + + int buildingIndex = getIntent().getExtras().getInt("building"); + int roomIndex = getIntent().getExtras().getInt("room"); + BuildingInfo building = BuildingManager.getBuilding(buildingIndex); + room = building.getRoom(roomIndex); + if (room == null) { + Toast.makeText(this, "Error : Building is null !", Toast.LENGTH_SHORT).show(); + return; + } + + ListView room_lv = findViewById(R.id.zone_list); + LinearLayout noDataLayout = findViewById(R.id.no_zone_layout); + + zone_adapter = new InfoAdapter(this, room.getZones(), noDataLayout, R.layout.zone_tile); + room_lv.setAdapter(zone_adapter); + + zone_adapter.setOnRemoveListener(param -> { + room.removeZone((ZoneInfo) param); + return null; + }); + + zone_adapter.setOnEditListener(param -> { + return null; + }); + + zone_adapter.setOnViewListener(param -> { + return null; + }); + + zone_adapter.setBindings(new InfoBinding[]{ + new InfoBinding(param -> ((ZoneInfo) param).getName(), R.id.zone_name) + }); + + SearchView building_sv = findViewById(R.id.zone_search); + building_sv.setOnQueryTextListener(new SearchView.OnQueryTextListener() { + public boolean onQueryTextSubmit(String s) { return true; } + + public boolean onQueryTextChange(String s) { + zone_adapter.setSearchQuery(s); + room_lv.setAdapter(zone_adapter); + return true; + } + }); + + ImageButton add_btn = findViewById(R.id.add_zone_btn); + add_btn.setOnClickListener(view -> { + showAddZonePopup(view); + }); + + TextView room_tv_name = findViewById(R.id.room_name); + room_tv_name.setText(room.getName()); + } + + @Override + protected void onResume() { + super.onResume(); + zone_adapter.setData(room.getZones()); + } + + protected void showAddZonePopup(View v) { + AlertDialog.Builder builder = new AlertDialog.Builder(RoomActivity.this); + AlertDialog dialog = builder.create(); + LayoutInflater factory = LayoutInflater.from(RoomActivity.this); + View popup = factory.inflate(R.layout.add_zone_popup, null); + dialog.setView(popup); + + dialog.setOnShowListener(dialogInterface -> { + EditText r_name = popup.findViewById(R.id.input_zone_name); + Button validate_btn = popup.findViewById(R.id.btn_validate_room); + Button cancel_btn = popup.findViewById(R.id.btn_cancel_room); + + cancel_btn.setOnClickListener(view -> { + dialog.dismiss(); + }); + + validate_btn.setOnClickListener(view -> { + room.addZone(new ZoneInfo(r_name.getText().toString())); // TODO + zone_adapter.setData(room.getZones()); + dialog.dismiss(); + }); + }); + dialog.show(); + } +} \ No newline at end of file diff --git a/Sources/app/src/main/res/drawable/ic_baseline_add_circle_24.xml b/Sources/app/src/main/res/drawable/ic_baseline_add_circle_24.xml new file mode 100644 index 0000000000000000000000000000000000000000..c3e7535977d195bc1fc110352510e16f69f12344 --- /dev/null +++ b/Sources/app/src/main/res/drawable/ic_baseline_add_circle_24.xml @@ -0,0 +1,5 @@ +<vector android:height="80dp" android:tint="@color/blue_500" + android:viewportHeight="24" android:viewportWidth="24" + android:width="80dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="@color/blue_500" android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM17,13h-4v4h-2v-4L7,13v-2h4L11,7h2v4h4v2z"/> +</vector> diff --git a/Sources/app/src/main/res/drawable/icon_background.xml b/Sources/app/src/main/res/drawable/icon_background.xml new file mode 100644 index 0000000000000000000000000000000000000000..ca3826a46ce070f906d0d3fbe6987df882134381 --- /dev/null +++ b/Sources/app/src/main/res/drawable/icon_background.xml @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector + android:height="108dp" + android:width="108dp" + android:viewportHeight="108" + android:viewportWidth="108" + xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="#3DDC84" + android:pathData="M0,0h108v108h-108z"/> + <path android:fillColor="#00000000" android:pathData="M9,0L9,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,0L19,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M29,0L29,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M39,0L39,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M49,0L49,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M59,0L59,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M69,0L69,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M79,0L79,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M89,0L89,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M99,0L99,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,9L108,9" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,19L108,19" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,29L108,29" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,39L108,39" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,49L108,49" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,59L108,59" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,69L108,69" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,79L108,79" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,89L108,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,99L108,99" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,29L89,29" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,39L89,39" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,49L89,49" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,59L89,59" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,69L89,69" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,79L89,79" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M29,19L29,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M39,19L39,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M49,19L49,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M59,19L59,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M69,19L69,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M79,19L79,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> +</vector> diff --git a/Sources/app/src/main/res/drawable/round_bg.xml b/Sources/app/src/main/res/drawable/round_bg.xml index 47afb375fd518c29f728a4cd8a0c12bc38016888..5067dd994151ce58a850af129e19f581f64d47e4 100644 --- a/Sources/app/src/main/res/drawable/round_bg.xml +++ b/Sources/app/src/main/res/drawable/round_bg.xml @@ -2,6 +2,6 @@ <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="@color/slate_200"/> <stroke android:width="2dp" android:color="@color/slate_300" /> - <corners android:radius="10dp"/> + <corners android:radius="8dp"/> <padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" /> </shape> \ No newline at end of file diff --git a/Sources/app/src/main/res/layout/activity_building.xml b/Sources/app/src/main/res/layout/activity_building.xml new file mode 100644 index 0000000000000000000000000000000000000000..608e6980934a3ba15dbbb28c27f9728343933dfa --- /dev/null +++ b/Sources/app/src/main/res/layout/activity_building.xml @@ -0,0 +1,113 @@ +<?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" + tools:context=".BuildingActivity"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:background="@color/slate_50"> + <TextView + android:id="@+id/building_name" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center" + android:paddingBottom="20dp" + android:paddingTop="20dp" + android:textSize="40dp" + android:text="Building name" + android:textStyle="bold" + android:textColor="@color/blue_500"/> + <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"> + <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/rooms" /> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="end"> + <SearchView + android:id="@+id/room_search" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="end" + android:searchIcon="@drawable/ic_search_black" /> + </LinearLayout> + </LinearLayout> + <LinearLayout + android:id="@+id/no_room_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_rooms" + 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_rooms_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/room_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> + + <RelativeLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="bottom|right"> + + <ImageButton + android:id="@+id/add_room_btn" + android:layout_width="80dp" + android:layout_height="80dp" + android:layout_marginRight="20dp" + android:layout_marginBottom="20dp" + android:src="@drawable/ic_baseline_add_circle_24" + android:backgroundTint="#00FFFFFF"/> + </RelativeLayout> +</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/Sources/app/src/main/res/layout/activity_main.xml b/Sources/app/src/main/res/layout/activity_main.xml index ca3b8a17ee84bbcd1f20b1e34b5b5c48d379413a..79cf8e12336bbf17f1de371a29cb6e102b4d5214 100644 --- a/Sources/app/src/main/res/layout/activity_main.xml +++ b/Sources/app/src/main/res/layout/activity_main.xml @@ -17,7 +17,7 @@ android:paddingBottom="20dp" android:paddingTop="20dp" android:textSize="40dp" - android:text="RoomView" + android:text="@string/app_name" android:textStyle="bold" android:textColor="@color/blue_500"/> <LinearLayout @@ -40,7 +40,7 @@ android:textSize="20sp" android:textStyle="bold" android:textColor="@color/slate_800" - android:text="@string/myBuilding" /> + android:text="@string/buildings" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" @@ -54,6 +54,35 @@ android:searchIcon="@drawable/ic_search_black" /> </LinearLayout> </LinearLayout> + <LinearLayout + android:id="@+id/no_building_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_building" + 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_building_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/building_list" android:layout_width="match_parent" @@ -64,4 +93,19 @@ android:padding="10dp"/> </LinearLayout> </LinearLayout> + + <RelativeLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="bottom|right"> + + <ImageButton + android:id="@+id/add_building_btn" + android:layout_width="80dp" + android:layout_height="80dp" + android:layout_marginRight="20dp" + android:layout_marginBottom="20dp" + android:src="@drawable/ic_baseline_add_circle_24" + android:backgroundTint="#00FFFFFF"/> + </RelativeLayout> </androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/Sources/app/src/main/res/layout/activity_room.xml b/Sources/app/src/main/res/layout/activity_room.xml new file mode 100644 index 0000000000000000000000000000000000000000..e3c60fc30bc9a853114e99b6909f26c4654de819 --- /dev/null +++ b/Sources/app/src/main/res/layout/activity_room.xml @@ -0,0 +1,113 @@ +<?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" + tools:context=".BuildingActivity"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:background="@color/slate_50"> + <TextView + android:id="@+id/room_name" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center" + android:paddingBottom="20dp" + android:paddingTop="20dp" + android:textSize="40dp" + android:text="Room name" + android:textStyle="bold" + android:textColor="@color/blue_500"/> + <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"> + <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/zones" /> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="end"> + <SearchView + android:id="@+id/zone_search" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="end" + android:searchIcon="@drawable/ic_search_black" /> + </LinearLayout> + </LinearLayout> + <LinearLayout + android:id="@+id/no_zone_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_zones" + 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_zones_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/zone_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> + + <RelativeLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="bottom|right"> + + <ImageButton + android:id="@+id/add_zone_btn" + android:layout_width="80dp" + android:layout_height="80dp" + android:layout_marginRight="20dp" + android:layout_marginBottom="20dp" + android:src="@drawable/ic_baseline_add_circle_24" + android:backgroundTint="#00FFFFFF"/> + </RelativeLayout> +</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/Sources/app/src/main/res/layout/add_building_popup.xml b/Sources/app/src/main/res/layout/add_building_popup.xml new file mode 100644 index 0000000000000000000000000000000000000000..69c19f05f3e27237e4d355f66c2e660694564e19 --- /dev/null +++ b/Sources/app/src/main/res/layout/add_building_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:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/slate_200" + android:text="@string/new_building" + android:textColor="@color/blue_500" + android:textSize="20sp" + android:layout_marginBottom="4dp" + android:textStyle="bold" + android:padding="10dp" + /> + </LinearLayout> + + <EditText + android:id="@+id/input_building_name" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:inputType="text" + android:hint="@string/building_name" + android:textColorHint="@color/slate_300" + android:textColor="@color/slate_500" + android:backgroundTint="@color/blue_500" + android:textSize="20sp" + android:textStyle="bold" + android:layout_marginLeft="10dp" + android:layout_marginRight="10dp"/> + + <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_building" + 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="right"> + <Button + android:id="@+id/btn_validate_building" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:backgroundTint="@color/blue_500" + android:text="@string/create"/> + </LinearLayout> + </LinearLayout> + </LinearLayout> +</RelativeLayout> \ No newline at end of file diff --git a/Sources/app/src/main/res/layout/add_room_popup.xml b/Sources/app/src/main/res/layout/add_room_popup.xml new file mode 100644 index 0000000000000000000000000000000000000000..7142aac0fe0bef613681f179d6f15ba0f62768aa --- /dev/null +++ b/Sources/app/src/main/res/layout/add_room_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:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/slate_200" + android:text="@string/new_room" + android:textColor="@color/blue_500" + android:textSize="20sp" + android:layout_marginBottom="4dp" + android:textStyle="bold" + android:padding="10dp" + /> + </LinearLayout> + + <EditText + android:id="@+id/input_room_name" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:inputType="text" + android:hint="@string/room_name" + android:textColorHint="@color/slate_300" + android:textColor="@color/slate_500" + android:backgroundTint="@color/blue_500" + android:textSize="20sp" + android:textStyle="bold" + android:layout_marginLeft="10dp" + android:layout_marginRight="10dp"/> + + <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/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="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/create"/> + </LinearLayout> + </LinearLayout> + </LinearLayout> +</RelativeLayout> \ No newline at end of file diff --git a/Sources/app/src/main/res/layout/add_zone_popup.xml b/Sources/app/src/main/res/layout/add_zone_popup.xml new file mode 100644 index 0000000000000000000000000000000000000000..713153b18032b6ce9eb96e16dad7f2648825a2ff --- /dev/null +++ b/Sources/app/src/main/res/layout/add_zone_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:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/slate_200" + android:text="@string/new_zone" + android:textColor="@color/blue_500" + android:textSize="20sp" + android:layout_marginBottom="4dp" + android:textStyle="bold" + android:padding="10dp" + /> + </LinearLayout> + + <EditText + android:id="@+id/input_zone_name" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:inputType="text" + android:hint="@string/zone_name" + android:textColorHint="@color/slate_300" + android:textColor="@color/slate_500" + android:backgroundTint="@color/blue_500" + android:textSize="20sp" + android:textStyle="bold" + android:layout_marginLeft="10dp" + android:layout_marginRight="10dp"/> + + <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/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="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/create"/> + </LinearLayout> + </LinearLayout> + </LinearLayout> +</RelativeLayout> \ No newline at end of file diff --git a/Sources/app/src/main/res/layout/building_tile.xml b/Sources/app/src/main/res/layout/building_tile.xml index 033796987fda3d50597ba387dea70fdf5cc79c6e..a2f3f68b00cda292aa41d2b4d5ed56c096275747 100644 --- a/Sources/app/src/main/res/layout/building_tile.xml +++ b/Sources/app/src/main/res/layout/building_tile.xml @@ -5,7 +5,7 @@ android:layout_height="match_parent" android:paddingBottom="10dp"> <LinearLayout - android:id="@+id/building_box" + android:id="@+id/tile_box" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" @@ -21,7 +21,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:textStyle="bold" - android:text="@string/app_name" + android:text="Building name" android:textSize="20sp" android:textColor="@color/blue_500" /> <LinearLayout @@ -37,19 +37,27 @@ android:textStyle="normal" android:text="XX / XX / XXXX" android:textSize="16sp" - android:textColor="@color/slate_300" /> + android:textColor="@color/slate_500" /> </LinearLayout> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="vertical"> + android:orientation="horizontal"> + <TextView + android:id="@+id/building_nb_rooms" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textStyle="normal" + android:text="XX" + android:layout_marginEnd="4dp" + android:textSize="16sp" + android:textColor="@color/slate_500" /> <TextView - android:id="@+id/building_rooms" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textStyle="normal" - android:text="XXX Rooms" + android:text="@string/rooms" android:textSize="16sp" android:textColor="@color/slate_500" /> </LinearLayout> @@ -59,7 +67,7 @@ android:orientation="horizontal" android:layout_marginTop="10dp"> <Button - android:id="@+id/building_remove" + android:id="@+id/tile_remove" android:layout_width="wrap_content" android:layout_height="wrap_content" android:backgroundTint="@color/red_500" @@ -73,7 +81,7 @@ android:orientation="horizontal" android:gravity="right"> <Button - android:id="@+id/building_edit" + android:id="@+id/tile_edit" android:layout_width="wrap_content" android:layout_height="wrap_content" android:backgroundTint="@color/blue_500" diff --git a/Sources/app/src/main/res/layout/room_tile.xml b/Sources/app/src/main/res/layout/room_tile.xml new file mode 100644 index 0000000000000000000000000000000000000000..655aea2a95d3dd69ce0f0222dee37a7cb815db20 --- /dev/null +++ b/Sources/app/src/main/res/layout/room_tile.xml @@ -0,0 +1,81 @@ +<?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" + 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" + tools:ignore="MissingConstraints"> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> + <TextView + android:id="@+id/room_name" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textStyle="bold" + android:text="Room name" + android:textSize="20sp" + android:textColor="@color/blue_500" /> + </LinearLayout> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> + <TextView + android:id="@+id/room_zones" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textStyle="normal" + android:text="XX" + android:layout_marginEnd="4dp" + android:textSize="16sp" + android:textColor="@color/slate_500" /> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textStyle="normal" + android:text="@string/zones" + android:layout_marginEnd="20dp" + android:textSize="16sp" + android:textColor="@color/slate_500" /> + </LinearLayout> + <LinearLayout + android:layout_width="match_parent" + 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="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" /> + </LinearLayout> + </LinearLayout> + </LinearLayout> +</androidx.constraintlayout.widget.ConstraintLayout> \ 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 new file mode 100644 index 0000000000000000000000000000000000000000..a56a07d5c7bd5753f2b079c493754e07502a3005 --- /dev/null +++ b/Sources/app/src/main/res/layout/zone_tile.xml @@ -0,0 +1,81 @@ +<?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" + 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" + tools:ignore="MissingConstraints"> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> + <TextView + android:id="@+id/zone_name" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textStyle="bold" + android:text="Zone name" + android:textSize="20sp" + android:textColor="@color/blue_500" /> + </LinearLayout> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> + <TextView + android:id="@+id/zone_doors" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textStyle="normal" + android:text="XX" + android:layout_marginEnd="4dp" + android:textSize="16sp" + android:textColor="@color/slate_500" /> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textStyle="normal" + android:text="@string/doors" + android:layout_marginEnd="20dp" + android:textSize="16sp" + android:textColor="@color/slate_500" /> + </LinearLayout> + <LinearLayout + android:layout_width="match_parent" + 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="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" /> + </LinearLayout> + </LinearLayout> + </LinearLayout> +</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/Sources/app/src/main/res/mipmap-anydpi-v26/icon.xml b/Sources/app/src/main/res/mipmap-anydpi-v26/icon.xml new file mode 100644 index 0000000000000000000000000000000000000000..c1c1a28f1805c0e6be2004afc4c3a9698329547f --- /dev/null +++ b/Sources/app/src/main/res/mipmap-anydpi-v26/icon.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/icon_background"/> + <foreground android:drawable="@mipmap/icon_foreground"/> +</adaptive-icon> \ No newline at end of file diff --git a/Sources/app/src/main/res/mipmap-anydpi-v26/icon_round.xml b/Sources/app/src/main/res/mipmap-anydpi-v26/icon_round.xml new file mode 100644 index 0000000000000000000000000000000000000000..c1c1a28f1805c0e6be2004afc4c3a9698329547f --- /dev/null +++ b/Sources/app/src/main/res/mipmap-anydpi-v26/icon_round.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/icon_background"/> + <foreground android:drawable="@mipmap/icon_foreground"/> +</adaptive-icon> \ No newline at end of file diff --git a/Sources/app/src/main/res/mipmap-hdpi/icon.png b/Sources/app/src/main/res/mipmap-hdpi/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..81c17183b1e28ba0d5f30691f707c24d93f2bd4e Binary files /dev/null and b/Sources/app/src/main/res/mipmap-hdpi/icon.png differ diff --git a/Sources/app/src/main/res/mipmap-hdpi/icon_foreground.png b/Sources/app/src/main/res/mipmap-hdpi/icon_foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..7697982fc647e072173b5d4417cebc527ca13d56 Binary files /dev/null and b/Sources/app/src/main/res/mipmap-hdpi/icon_foreground.png differ diff --git a/Sources/app/src/main/res/mipmap-hdpi/icon_round.png b/Sources/app/src/main/res/mipmap-hdpi/icon_round.png new file mode 100644 index 0000000000000000000000000000000000000000..5b7808ef806540ba11985ec6ea112dcb02b4818e Binary files /dev/null and b/Sources/app/src/main/res/mipmap-hdpi/icon_round.png differ diff --git a/Sources/app/src/main/res/mipmap-mdpi/icon.png b/Sources/app/src/main/res/mipmap-mdpi/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..5838260ffe8f5894ab6e6086b9f464a9fa5b8f06 Binary files /dev/null and b/Sources/app/src/main/res/mipmap-mdpi/icon.png differ diff --git a/Sources/app/src/main/res/mipmap-mdpi/icon_foreground.png b/Sources/app/src/main/res/mipmap-mdpi/icon_foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..ecff597c95c784d3fc3928c4834fe47f47c4f1c0 Binary files /dev/null and b/Sources/app/src/main/res/mipmap-mdpi/icon_foreground.png differ diff --git a/Sources/app/src/main/res/mipmap-mdpi/icon_round.png b/Sources/app/src/main/res/mipmap-mdpi/icon_round.png new file mode 100644 index 0000000000000000000000000000000000000000..82086b7a7b009758378956b747f4e765c689cde0 Binary files /dev/null and b/Sources/app/src/main/res/mipmap-mdpi/icon_round.png differ diff --git a/Sources/app/src/main/res/mipmap-xhdpi/icon.png b/Sources/app/src/main/res/mipmap-xhdpi/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..900c959cbd5c8405be1dc896f2995cc2f570f77b Binary files /dev/null and b/Sources/app/src/main/res/mipmap-xhdpi/icon.png differ diff --git a/Sources/app/src/main/res/mipmap-xhdpi/icon_foreground.png b/Sources/app/src/main/res/mipmap-xhdpi/icon_foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..0966a95233a568d9b770402d1fb0eb74890ae8fe Binary files /dev/null and b/Sources/app/src/main/res/mipmap-xhdpi/icon_foreground.png differ diff --git a/Sources/app/src/main/res/mipmap-xhdpi/icon_round.png b/Sources/app/src/main/res/mipmap-xhdpi/icon_round.png new file mode 100644 index 0000000000000000000000000000000000000000..3314796659c1e8ad87e35fca7d27143c5f0776a1 Binary files /dev/null and b/Sources/app/src/main/res/mipmap-xhdpi/icon_round.png differ diff --git a/Sources/app/src/main/res/mipmap-xxhdpi/icon.png b/Sources/app/src/main/res/mipmap-xxhdpi/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..5e8bb46dd15c0d9c31b673f95308d12637b1c2c0 Binary files /dev/null and b/Sources/app/src/main/res/mipmap-xxhdpi/icon.png differ diff --git a/Sources/app/src/main/res/mipmap-xxhdpi/icon_foreground.png b/Sources/app/src/main/res/mipmap-xxhdpi/icon_foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..d6dd74afb9d21a4d0393da26a0712fdf1c811357 Binary files /dev/null and b/Sources/app/src/main/res/mipmap-xxhdpi/icon_foreground.png differ diff --git a/Sources/app/src/main/res/mipmap-xxhdpi/icon_round.png b/Sources/app/src/main/res/mipmap-xxhdpi/icon_round.png new file mode 100644 index 0000000000000000000000000000000000000000..a1d3f100b7867ce7a29bd310b4d1b64904a02e56 Binary files /dev/null and b/Sources/app/src/main/res/mipmap-xxhdpi/icon_round.png differ diff --git a/Sources/app/src/main/res/mipmap-xxxhdpi/icon.png b/Sources/app/src/main/res/mipmap-xxxhdpi/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..4bf20c260d7577ec532ec6e4eb64a6d3d8eab6a0 Binary files /dev/null and b/Sources/app/src/main/res/mipmap-xxxhdpi/icon.png differ diff --git a/Sources/app/src/main/res/mipmap-xxxhdpi/icon_foreground.png b/Sources/app/src/main/res/mipmap-xxxhdpi/icon_foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..cb3d98198b5ffc75756957fe067383b364420bb3 Binary files /dev/null and b/Sources/app/src/main/res/mipmap-xxxhdpi/icon_foreground.png differ diff --git a/Sources/app/src/main/res/mipmap-xxxhdpi/icon_round.png b/Sources/app/src/main/res/mipmap-xxxhdpi/icon_round.png new file mode 100644 index 0000000000000000000000000000000000000000..e37aaab2dff4afb8df56664cfc17043069c080a6 Binary files /dev/null and b/Sources/app/src/main/res/mipmap-xxxhdpi/icon_round.png differ diff --git a/Sources/app/src/main/res/values-fr/strings.xml b/Sources/app/src/main/res/values-fr/strings.xml index 1118ccb1b97c3297a68258826b926f8f04b21f0c..917be1eb369ddff07a0ad05a7f6cbcfbfd7327be 100644 --- a/Sources/app/src/main/res/values-fr/strings.xml +++ b/Sources/app/src/main/res/values-fr/strings.xml @@ -1,4 +1,21 @@ <?xml version="1.0" encoding="utf-8"?> <resources> - <string name="myBuilding">Mes bâtiments:</string> + <string name="buildings">Bâtiments</string> + <string name="cancel">Annuler</string> + <string name="remove">Supprimer</string> + <string name="edit">Modifier</string> + <string name="rooms">Pièces</string> + <string name="pathways">Chemins</string> + <string name="zones">Zones</string> + <string name="no_building">Pas de bâtiments</string> + <string name="no_building_desc">Appuyez sur l\'icône + pour ajouter un bâtiment</string> + <string name="no_rooms">Pas de pièces</string> + <string name="no_rooms_desc">Appuyez sur l\'icône + pour ajouter une pièce</string> + <string name="new_building">Nouveau bâtiment</string> + <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="no_zones">Pas de zones</string> + <string name="no_zones_desc">Appuyez sur l\'icône + pour ajouter une zone</string> </resources> \ No newline at end of file diff --git a/Sources/app/src/main/res/values-night/themes.xml b/Sources/app/src/main/res/values-night/themes.xml index 58e49324afe53de76561804f3d0cf64dd6ee0844..3e5dd4e2da1dd5e0a5649b483132baec6ff80b29 100644 --- a/Sources/app/src/main/res/values-night/themes.xml +++ b/Sources/app/src/main/res/values-night/themes.xml @@ -6,6 +6,7 @@ <item name="colorPrimaryVariant">@color/slate_800</item> <item name="backgroundColor">@color/slate_50</item> <item name="colorOnPrimary">@color/slate_700</item> + <item name="colorAccent">@color/blue_500</item> <item name="android:editTextColor">@color/slate_50</item> <!-- Status bar color. --> <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item> diff --git a/Sources/app/src/main/res/values/strings.xml b/Sources/app/src/main/res/values/strings.xml index 16cc51a73394f00aa405cf6a122e69e0bc27a3a3..4a3bd2b8693629e6e8d886d927ae745ec37d0008 100644 --- a/Sources/app/src/main/res/values/strings.xml +++ b/Sources/app/src/main/res/values/strings.xml @@ -1,7 +1,24 @@ <resources> <string name="app_name" translatable="false">RoomView</string> - <string name="myBuilding">My Buildings:</string> + <string name="buildings">Buildings</string> <string name="cancel">Cancel</string> <string name="remove">Remove</string> <string name="edit">Edit</string> + <string name="rooms">Rooms</string> + <string name="pathways">Pathways</string> + <string name="zones">Zones</string> + <string name="no_building">No buildings</string> + <string name="no_building_desc">Click on the + icon to add a building</string> + <string name="no_rooms_desc">Click on the + icon to add a room</string> + <string name="no_rooms">No rooms</string> + <string name="new_building">New building</string> + <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="no_zones">No zones</string> + <string name="no_zones_desc">Click on the + icon to add a zone</string> + <string name="doors">Doors</string> + <string name="new_zone">New zone</string> + <string name="zone_name">Zone name ...</string> </resources> \ No newline at end of file diff --git a/Sources/app/src/main/res/values/themes.xml b/Sources/app/src/main/res/values/themes.xml index a787af504170adcc68c544ce0909a78009eb1eef..46b9a4bf1ac6fa501ad894cd248d387adb252daa 100644 --- a/Sources/app/src/main/res/values/themes.xml +++ b/Sources/app/src/main/res/values/themes.xml @@ -7,7 +7,7 @@ <item name="backgroundColor">@color/slate_50</item> <item name="colorOnPrimary">@color/slate_50</item> <item name="colorAccent">@color/blue_500</item> - <item name="android:editTextColor">@color/slate_50</item> + <item name="android:editTextColor">@color/slate_900</item> <!-- Status bar color. --> <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item> <!-- Customize your theme here. --> diff --git a/logo.png b/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..1daae2dc2e5729e7269847124d914394c17bdec0 Binary files /dev/null and b/logo.png differ diff --git a/logo.png~ b/logo.png~ new file mode 100644 index 0000000000000000000000000000000000000000..ec72bdc799b4ecb02d2005fdece8699739530db9 Binary files /dev/null and b/logo.png~ differ