ecra principal
This commit is contained in:
29
app/google-services.json
Normal file
29
app/google-services.json
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"project_info": {
|
||||||
|
"project_number": "476421715902",
|
||||||
|
"project_id": "namesa-429c1",
|
||||||
|
"storage_bucket": "namesa-429c1.firebasestorage.app"
|
||||||
|
},
|
||||||
|
"client": [
|
||||||
|
{
|
||||||
|
"client_info": {
|
||||||
|
"mobilesdk_app_id": "1:476421715902:android:4147ab5f1cde601e1aebef",
|
||||||
|
"android_client_info": {
|
||||||
|
"package_name": "com.example.pap_teste"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oauth_client": [],
|
||||||
|
"api_key": [
|
||||||
|
{
|
||||||
|
"current_key": "AIzaSyCPz7Pd3tJj3QkF7fV_vudCJythNsyR57k"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"services": {
|
||||||
|
"appinvite_service": {
|
||||||
|
"other_platform_oauth_client": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configuration_version": "1"
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package com.example.pap_teste;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.activity.EdgeToEdge;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.core.graphics.Insets;
|
||||||
|
import androidx.core.view.ViewCompat;
|
||||||
|
import androidx.core.view.WindowInsetsCompat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tela de confirmação apresentada logo após a criação de conta.
|
||||||
|
* Exibe os dados básicos e direciona para a área correspondente
|
||||||
|
* (estabelecimento como admin, cliente como cliente).
|
||||||
|
*/
|
||||||
|
public class AccountCreatedActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
EdgeToEdge.enable(this);
|
||||||
|
setContentView(R.layout.activity_account_created);
|
||||||
|
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.accountCreatedRoot), (v, insets) -> {
|
||||||
|
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||||
|
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||||
|
return insets;
|
||||||
|
});
|
||||||
|
|
||||||
|
TextView txtWelcome = findViewById(R.id.txtWelcome);
|
||||||
|
TextView txtEmail = findViewById(R.id.txtEmail);
|
||||||
|
TextView txtRole = findViewById(R.id.txtRole);
|
||||||
|
Button btnContinue = findViewById(R.id.btnContinuar);
|
||||||
|
Button btnBack = findViewById(R.id.btnVoltar);
|
||||||
|
|
||||||
|
String displayName = getIntent().getStringExtra(MainActivity.EXTRA_DISPLAY_NAME);
|
||||||
|
String email = getIntent().getStringExtra(MainActivity.EXTRA_EMAIL);
|
||||||
|
String accountType = getIntent().getStringExtra(MainActivity.EXTRA_ACCOUNT_TYPE);
|
||||||
|
String role = getIntent().getStringExtra(MainActivity.EXTRA_ROLE);
|
||||||
|
|
||||||
|
txtWelcome.setText(displayName != null ? displayName : "Novo utilizador");
|
||||||
|
txtEmail.setText(email != null ? email : "Email não informado");
|
||||||
|
txtRole.setText(role != null ? role : "CLIENTE");
|
||||||
|
|
||||||
|
btnContinue.setOnClickListener(v -> {
|
||||||
|
boolean isEstablishment = "ESTABELECIMENTO".equalsIgnoreCase(accountType);
|
||||||
|
Intent nextScreen = new Intent(
|
||||||
|
this,
|
||||||
|
isEstablishment ? EstablishmentDashboardActivity.class : ClientDashboardActivity.class
|
||||||
|
);
|
||||||
|
nextScreen.putExtra(MainActivity.EXTRA_ACTION_MODE, MainActivity.AccountAction.CRIAR.name());
|
||||||
|
nextScreen.putExtra(MainActivity.EXTRA_DISPLAY_NAME, displayName);
|
||||||
|
nextScreen.putExtra(MainActivity.EXTRA_EMAIL, email);
|
||||||
|
nextScreen.putExtra(MainActivity.EXTRA_ACCOUNT_TYPE, accountType);
|
||||||
|
nextScreen.putExtra(MainActivity.EXTRA_ROLE, role);
|
||||||
|
startActivity(nextScreen);
|
||||||
|
finish();
|
||||||
|
});
|
||||||
|
|
||||||
|
if (btnBack != null) {
|
||||||
|
btnBack.setOnClickListener(v -> finish());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,145 @@
|
|||||||
|
package com.example.pap_teste;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.ListView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.activity.EdgeToEdge;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.core.graphics.Insets;
|
||||||
|
import androidx.core.view.ViewCompat;
|
||||||
|
import androidx.core.view.WindowInsetsCompat;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class DetalhesReservasActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
private final List<ReservaItem> reservas = new ArrayList<>();
|
||||||
|
private ArrayAdapter<String> adapter;
|
||||||
|
private ListView listReservas;
|
||||||
|
private TextView txtInfo;
|
||||||
|
private TextView txtNotas;
|
||||||
|
private TextView txtEstado;
|
||||||
|
private TextView txtMensagem;
|
||||||
|
private int selectedIndex = -1;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
EdgeToEdge.enable(this);
|
||||||
|
setContentView(R.layout.activity_detalhes_reservas);
|
||||||
|
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.detalhesReservasRoot), (v, insets) -> {
|
||||||
|
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||||
|
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||||
|
return insets;
|
||||||
|
});
|
||||||
|
|
||||||
|
bindViews();
|
||||||
|
seedReservasDemo();
|
||||||
|
setupList();
|
||||||
|
setupActions();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void bindViews() {
|
||||||
|
listReservas = findViewById(R.id.listReservas);
|
||||||
|
txtInfo = findViewById(R.id.txtReservaInfo);
|
||||||
|
txtNotas = findViewById(R.id.txtReservaNotas);
|
||||||
|
txtEstado = findViewById(R.id.txtReservaEstado);
|
||||||
|
txtMensagem = findViewById(R.id.txtMensagemReserva);
|
||||||
|
|
||||||
|
Button back = findViewById(R.id.btnVoltar);
|
||||||
|
if (back != null) {
|
||||||
|
back.setOnClickListener(v -> finish());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void seedReservasDemo() {
|
||||||
|
reservas.add(new ReservaItem("Ana Ribeiro", "Mesa 12", "20h00", 4, "Aniversário", "Confirmada"));
|
||||||
|
reservas.add(new ReservaItem("Bruno Costa", "Mesa 03", "21h15", 2, "Preferência por janela", "Pendente"));
|
||||||
|
reservas.add(new ReservaItem("Carla Silva", "Mesa 07", "19h30", 3, "Levar bolo para a mesa", "Pendente"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupList() {
|
||||||
|
adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_activated_1);
|
||||||
|
listReservas.setAdapter(adapter);
|
||||||
|
refreshList();
|
||||||
|
|
||||||
|
listReservas.setOnItemClickListener((parent, view, position, id) -> {
|
||||||
|
selectedIndex = position;
|
||||||
|
mostrarDetalhe(reservas.get(position));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupActions() {
|
||||||
|
Button btnConfirmar = findViewById(R.id.btnConfirmarReserva);
|
||||||
|
Button btnCancelar = findViewById(R.id.btnCancelarReserva);
|
||||||
|
|
||||||
|
if (btnConfirmar != null) {
|
||||||
|
btnConfirmar.setOnClickListener(v -> atualizarEstadoSelecionado("Confirmada"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (btnCancelar != null) {
|
||||||
|
btnCancelar.setOnClickListener(v -> atualizarEstadoSelecionado("Cancelada"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void atualizarEstadoSelecionado(String novoEstado) {
|
||||||
|
if (selectedIndex < 0 || selectedIndex >= reservas.size()) {
|
||||||
|
Toast.makeText(this, "Selecione uma reserva para atualizar.", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReservaItem item = reservas.get(selectedIndex);
|
||||||
|
item.estado = novoEstado;
|
||||||
|
txtMensagem.setText(String.format("Reserva de %s marcada como %s.", item.nomeCliente, novoEstado));
|
||||||
|
mostrarDetalhe(item);
|
||||||
|
refreshList();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void mostrarDetalhe(ReservaItem item) {
|
||||||
|
txtInfo.setText(String.format("%s • %s • %s • %dp", item.nomeCliente, item.mesa, item.hora, item.pessoas));
|
||||||
|
txtNotas.setText(item.notas);
|
||||||
|
txtEstado.setText(String.format("Estado: %s", item.estado));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshList() {
|
||||||
|
adapter.clear();
|
||||||
|
for (ReservaItem item : reservas) {
|
||||||
|
String resumo = String.format("%s - %s (%s) • %s", item.hora, item.mesa, item.estado, item.nomeCliente);
|
||||||
|
adapter.add(resumo);
|
||||||
|
}
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class ReservaItem {
|
||||||
|
String nomeCliente;
|
||||||
|
String mesa;
|
||||||
|
String hora;
|
||||||
|
int pessoas;
|
||||||
|
String notas;
|
||||||
|
String estado;
|
||||||
|
|
||||||
|
ReservaItem(String nomeCliente, String mesa, String hora, int pessoas, String notas, String estado) {
|
||||||
|
this.nomeCliente = nomeCliente;
|
||||||
|
this.mesa = mesa;
|
||||||
|
this.hora = hora;
|
||||||
|
this.pessoas = pessoas;
|
||||||
|
this.notas = notas;
|
||||||
|
this.estado = estado;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
178
app/src/main/java/com/example/pap_teste/GerirMesasActivity.java
Normal file
178
app/src/main/java/com/example/pap_teste/GerirMesasActivity.java
Normal file
@@ -0,0 +1,178 @@
|
|||||||
|
package com.example.pap_teste;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.ListView;
|
||||||
|
import android.widget.Spinner;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.activity.EdgeToEdge;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.core.graphics.Insets;
|
||||||
|
import androidx.core.view.ViewCompat;
|
||||||
|
import androidx.core.view.WindowInsetsCompat;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class GerirMesasActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
private final List<MesaItem> mesas = new ArrayList<>();
|
||||||
|
private ArrayAdapter<String> adapter;
|
||||||
|
private ListView listMesas;
|
||||||
|
private EditText inputNumero;
|
||||||
|
private EditText inputCapacidade;
|
||||||
|
private Spinner spinnerEstado;
|
||||||
|
private TextView txtMensagem;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
EdgeToEdge.enable(this);
|
||||||
|
setContentView(R.layout.activity_gerir_mesas);
|
||||||
|
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.gerirMesasRoot), (v, insets) -> {
|
||||||
|
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||||
|
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||||
|
return insets;
|
||||||
|
});
|
||||||
|
|
||||||
|
bindViews();
|
||||||
|
seedMesasDemo();
|
||||||
|
setupList();
|
||||||
|
setupFormActions();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void bindViews() {
|
||||||
|
listMesas = findViewById(R.id.listMesas);
|
||||||
|
inputNumero = findViewById(R.id.inputMesaNumero);
|
||||||
|
inputCapacidade = findViewById(R.id.inputMesaCapacidade);
|
||||||
|
spinnerEstado = findViewById(R.id.spinnerEstadoMesa);
|
||||||
|
txtMensagem = findViewById(R.id.txtMensagemMesa);
|
||||||
|
|
||||||
|
Button back = findViewById(R.id.btnVoltar);
|
||||||
|
if (back != null) {
|
||||||
|
back.setOnClickListener(v -> finish());
|
||||||
|
}
|
||||||
|
|
||||||
|
ArrayAdapter<String> estadoAdapter = new ArrayAdapter<>(
|
||||||
|
this,
|
||||||
|
android.R.layout.simple_spinner_dropdown_item,
|
||||||
|
new String[]{"Livre", "Ocupada", "Reservada"}
|
||||||
|
);
|
||||||
|
spinnerEstado.setAdapter(estadoAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void seedMesasDemo() {
|
||||||
|
mesas.add(new MesaItem(1, 4, "Livre"));
|
||||||
|
mesas.add(new MesaItem(2, 2, "Reservada"));
|
||||||
|
mesas.add(new MesaItem(3, 6, "Ocupada"));
|
||||||
|
mesas.add(new MesaItem(4, 4, "Livre"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupList() {
|
||||||
|
adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_activated_1);
|
||||||
|
listMesas.setAdapter(adapter);
|
||||||
|
refreshList();
|
||||||
|
|
||||||
|
listMesas.setOnItemClickListener((parent, view, position, id) -> {
|
||||||
|
MesaItem item = mesas.get(position);
|
||||||
|
inputNumero.setText(String.valueOf(item.numero));
|
||||||
|
inputCapacidade.setText(String.valueOf(item.capacidade));
|
||||||
|
spinnerEstado.setSelection(getEstadoIndex(item.estado));
|
||||||
|
txtMensagem.setText(String.format("Editar mesa %d", item.numero));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getEstadoIndex(String estado) {
|
||||||
|
if ("Ocupada".equalsIgnoreCase(estado)) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if ("Reservada".equalsIgnoreCase(estado)) {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupFormActions() {
|
||||||
|
Button btnGuardar = findViewById(R.id.btnGuardarMesa);
|
||||||
|
if (btnGuardar != null) {
|
||||||
|
btnGuardar.setOnClickListener(v -> guardarMesa());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void guardarMesa() {
|
||||||
|
String numeroStr = inputNumero.getText().toString().trim();
|
||||||
|
String capacidadeStr = inputCapacidade.getText().toString().trim();
|
||||||
|
String estado = (String) spinnerEstado.getSelectedItem();
|
||||||
|
|
||||||
|
if (numeroStr.isEmpty() || capacidadeStr.isEmpty() || estado == null) {
|
||||||
|
Toast.makeText(this, "Preencha número, capacidade e estado.", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int numero;
|
||||||
|
int capacidade;
|
||||||
|
try {
|
||||||
|
numero = Integer.parseInt(numeroStr);
|
||||||
|
capacidade = Integer.parseInt(capacidadeStr);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
Toast.makeText(this, "Use apenas números válidos.", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
MesaItem existente = findMesa(numero);
|
||||||
|
if (existente == null) {
|
||||||
|
mesas.add(new MesaItem(numero, capacidade, estado));
|
||||||
|
txtMensagem.setText(String.format("Mesa %d adicionada/atualizada.", numero));
|
||||||
|
} else {
|
||||||
|
existente.capacidade = capacidade;
|
||||||
|
existente.estado = estado;
|
||||||
|
txtMensagem.setText(String.format("Mesa %d atualizada.", numero));
|
||||||
|
}
|
||||||
|
|
||||||
|
refreshList();
|
||||||
|
}
|
||||||
|
|
||||||
|
private MesaItem findMesa(int numero) {
|
||||||
|
for (MesaItem item : mesas) {
|
||||||
|
if (item.numero == numero) {
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshList() {
|
||||||
|
adapter.clear();
|
||||||
|
for (MesaItem item : mesas) {
|
||||||
|
String resumo = String.format("Mesa %02d • %d lugares • %s", item.numero, item.capacidade, item.estado);
|
||||||
|
adapter.add(resumo);
|
||||||
|
}
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class MesaItem {
|
||||||
|
int numero;
|
||||||
|
int capacidade;
|
||||||
|
String estado;
|
||||||
|
|
||||||
|
MesaItem(int numero, int capacidade, String estado) {
|
||||||
|
this.numero = numero;
|
||||||
|
this.capacidade = capacidade;
|
||||||
|
this.estado = estado;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,6 +1,13 @@
|
|||||||
package com.example.pap_teste;
|
package com.example.pap_teste;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.ListView;
|
||||||
|
import android.widget.Spinner;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.activity.EdgeToEdge;
|
import androidx.activity.EdgeToEdge;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
@@ -8,10 +15,18 @@ import androidx.core.graphics.Insets;
|
|||||||
import androidx.core.view.ViewCompat;
|
import androidx.core.view.ViewCompat;
|
||||||
import androidx.core.view.WindowInsetsCompat;
|
import androidx.core.view.WindowInsetsCompat;
|
||||||
|
|
||||||
import android.widget.Button;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class GestaoStaffActivity extends AppCompatActivity {
|
public class GestaoStaffActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
private final List<StaffAssignment> staffAssignments = new ArrayList<>();
|
||||||
|
private ArrayAdapter<String> staffAdapter;
|
||||||
|
private ListView listStaffMesas;
|
||||||
|
private EditText inputNomeStaff;
|
||||||
|
private Spinner spinnerMesaStaff;
|
||||||
|
private TextView txtMensagemStaff;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -27,6 +42,112 @@ public class GestaoStaffActivity extends AppCompatActivity {
|
|||||||
if (back != null) {
|
if (back != null) {
|
||||||
back.setOnClickListener(v -> finish());
|
back.setOnClickListener(v -> finish());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bindViews();
|
||||||
|
setupMesaSpinner();
|
||||||
|
setupList();
|
||||||
|
setupFormActions();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void bindViews() {
|
||||||
|
listStaffMesas = findViewById(R.id.listStaffMesas);
|
||||||
|
inputNomeStaff = findViewById(R.id.inputNomeStaff);
|
||||||
|
spinnerMesaStaff = findViewById(R.id.spinnerMesaStaff);
|
||||||
|
txtMensagemStaff = findViewById(R.id.txtMensagemStaff);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Preenche o spinner com uma lista simples de mesas (1–20).
|
||||||
|
* Mais tarde isto pode ser ligado às mesas reais configuradas em "Gerir Mesas".
|
||||||
|
*/
|
||||||
|
private void setupMesaSpinner() {
|
||||||
|
ArrayAdapter<String> mesaAdapter = new ArrayAdapter<>(
|
||||||
|
this,
|
||||||
|
android.R.layout.simple_spinner_dropdown_item
|
||||||
|
);
|
||||||
|
|
||||||
|
for (int i = 1; i <= 20; i++) {
|
||||||
|
mesaAdapter.add(String.format("Mesa %02d", i));
|
||||||
|
}
|
||||||
|
|
||||||
|
spinnerMesaStaff.setAdapter(mesaAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupList() {
|
||||||
|
staffAdapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_activated_1);
|
||||||
|
listStaffMesas.setAdapter(staffAdapter);
|
||||||
|
refreshList();
|
||||||
|
|
||||||
|
listStaffMesas.setOnItemClickListener((parent, view, position, id) -> {
|
||||||
|
StaffAssignment item = staffAssignments.get(position);
|
||||||
|
inputNomeStaff.setText(item.nome);
|
||||||
|
int index = Math.max(0, Math.min(spinnerMesaStaff.getCount() - 1, item.mesaNumero - 1));
|
||||||
|
spinnerMesaStaff.setSelection(index);
|
||||||
|
txtMensagemStaff.setText(String.format("A editar: %s (Mesa %02d)", item.nome, item.mesaNumero));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupFormActions() {
|
||||||
|
Button btnAtribuir = findViewById(R.id.btnAtribuirStaff);
|
||||||
|
if (btnAtribuir != null) {
|
||||||
|
btnAtribuir.setOnClickListener(v -> guardarAtribuicao());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void guardarAtribuicao() {
|
||||||
|
String nome = inputNomeStaff != null ? inputNomeStaff.getText().toString().trim() : "";
|
||||||
|
if (nome.isEmpty()) {
|
||||||
|
Toast.makeText(this, "Indique o nome do funcionário.", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (spinnerMesaStaff == null || spinnerMesaStaff.getSelectedItem() == null) {
|
||||||
|
Toast.makeText(this, "Selecione uma mesa.", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int mesaNumero = spinnerMesaStaff.getSelectedItemPosition() + 1;
|
||||||
|
|
||||||
|
StaffAssignment existente = findByNome(nome);
|
||||||
|
if (existente == null) {
|
||||||
|
staffAssignments.add(new StaffAssignment(nome, mesaNumero));
|
||||||
|
txtMensagemStaff.setText(String.format("%s atribuído à mesa %02d.", nome, mesaNumero));
|
||||||
|
} else {
|
||||||
|
existente.mesaNumero = mesaNumero;
|
||||||
|
txtMensagemStaff.setText(String.format("Mesa de %s atualizada para %02d.", nome, mesaNumero));
|
||||||
|
}
|
||||||
|
|
||||||
|
refreshList();
|
||||||
|
}
|
||||||
|
|
||||||
|
private StaffAssignment findByNome(String nome) {
|
||||||
|
for (StaffAssignment item : staffAssignments) {
|
||||||
|
if (item.nome.equalsIgnoreCase(nome)) {
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshList() {
|
||||||
|
if (staffAdapter == null) return;
|
||||||
|
|
||||||
|
staffAdapter.clear();
|
||||||
|
for (StaffAssignment item : staffAssignments) {
|
||||||
|
String resumo = String.format("%s • Mesa %02d", item.nome, item.mesaNumero);
|
||||||
|
staffAdapter.add(resumo);
|
||||||
|
}
|
||||||
|
staffAdapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class StaffAssignment {
|
||||||
|
String nome;
|
||||||
|
int mesaNumero;
|
||||||
|
|
||||||
|
StaffAssignment(String nome, int mesaNumero) {
|
||||||
|
this.nome = nome;
|
||||||
|
this.mesaNumero = mesaNumero;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,3 +20,11 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<solid android:color="#444444" />
|
<solid android:color="#8BC34A" />
|
||||||
<corners android:radius="10dp" />
|
<corners android:radius="10dp" />
|
||||||
</shape>
|
</shape>
|
||||||
111
app/src/main/res/layout/activity_account_created.xml
Normal file
111
app/src/main/res/layout/activity_account_created.xml
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
<?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:id="@+id/accountCreatedRoot"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="#F7F7F7"
|
||||||
|
tools:context=".AccountCreatedActivity">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnVoltar"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="Voltar"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/cardAccountCreated"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="24dp"
|
||||||
|
android:layout_marginEnd="24dp"
|
||||||
|
android:layout_marginTop="32dp"
|
||||||
|
app:cardBackgroundColor="#FFFFFF"
|
||||||
|
app:cardCornerRadius="18dp"
|
||||||
|
app:cardElevation="4dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/btnVoltar"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="24dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtCongrats"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Conta criada!"
|
||||||
|
android:textColor="#000"
|
||||||
|
android:textSize="22sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtWelcome"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:text="Nome"
|
||||||
|
android:textColor="#4D4D4D"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtEmail"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:text="email@example.com"
|
||||||
|
android:textColor="#4D4D4D"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtRoleLabel"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="Função atribuída:"
|
||||||
|
android:textColor="#000"
|
||||||
|
android:textSize="15sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtRole"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:text="ADMIN"
|
||||||
|
android:textColor="#2E7D32"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtInstructions"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="Vamos configurar o seu espaço. Pode aceder à sua área agora."
|
||||||
|
android:textColor="#4D4D4D"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnContinuar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:background="@drawable/btn_primary"
|
||||||
|
android:text="Ir para a minha área"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:textColor="#FFFFFF" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
168
app/src/main/res/layout/activity_detalhes_reservas.xml
Normal file
168
app/src/main/res/layout/activity_detalhes_reservas.xml
Normal file
@@ -0,0 +1,168 @@
|
|||||||
|
<?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:id="@+id/detalhesReservasRoot"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="#F7F7F7"
|
||||||
|
tools:context=".DetalhesReservasActivity">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnVoltar"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="Voltar"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtTituloDetalhes"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Detalhes das reservas"
|
||||||
|
android:textColor="#000"
|
||||||
|
android:textSize="22sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/btnVoltar"
|
||||||
|
android:layout_marginTop="24dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtDescricaoDetalhes"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="24dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:text="Selecione uma reserva para ver os detalhes e atualizar o estado."
|
||||||
|
android:textColor="#4D4D4D"
|
||||||
|
android:textSize="14sp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/txtTituloDetalhes" />
|
||||||
|
|
||||||
|
<ListView
|
||||||
|
android:id="@+id/listReservas"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:divider="#E0E0E0"
|
||||||
|
android:dividerHeight="1dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/txtDescricaoDetalhes"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/cardDetalhes"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/cardDetalhes"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
app:cardBackgroundColor="#FFFFFF"
|
||||||
|
app:cardCornerRadius="16dp"
|
||||||
|
app:cardElevation="4dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Reserva selecionada"
|
||||||
|
android:textColor="#000"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtReservaInfo"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:text="Selecione uma reserva"
|
||||||
|
android:textColor="#4D4D4D"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtReservaNotas"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:text=""
|
||||||
|
android:textColor="#4D4D4D"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtReservaEstado"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:text="Estado:"
|
||||||
|
android:textColor="#2E7D32"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnConfirmarReserva"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/btn_primary"
|
||||||
|
android:text="Confirmar"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:textColor="#FFFFFF" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnCancelarReserva"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/btn_light_border"
|
||||||
|
android:text="Cancelar"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:textColor="#00001A" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtMensagemReserva"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:text=""
|
||||||
|
android:textColor="#2E7D32"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
155
app/src/main/res/layout/activity_gerir_mesas.xml
Normal file
155
app/src/main/res/layout/activity_gerir_mesas.xml
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
<?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:id="@+id/gerirMesasRoot"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="#F7F7F7"
|
||||||
|
tools:context=".GerirMesasActivity">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnVoltar"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="Voltar"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtTituloGerirMesas"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Editar mesas"
|
||||||
|
android:textColor="#000"
|
||||||
|
android:textSize="22sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/btnVoltar"
|
||||||
|
android:layout_marginTop="24dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtDescricaoGerirMesas"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="24dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:text="Atualize rapidamente as mesas disponíveis, capacidade e estado."
|
||||||
|
android:textColor="#4D4D4D"
|
||||||
|
android:textSize="14sp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/txtTituloGerirMesas" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/formMesas"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:background="@drawable/btn_light"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/txtDescricaoGerirMesas">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Editar ou adicionar mesa"
|
||||||
|
android:textColor="#000"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/inputMesaNumero"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:background="@drawable/input_bg"
|
||||||
|
android:hint="Número da mesa"
|
||||||
|
android:inputType="number"
|
||||||
|
android:padding="12dp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/inputMesaCapacidade"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:background="@drawable/input_bg"
|
||||||
|
android:hint="Capacidade (lugares)"
|
||||||
|
android:inputType="number"
|
||||||
|
android:padding="12dp" />
|
||||||
|
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/spinnerEstadoMesa"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_marginTop="12dp" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnGuardarMesa"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:background="@drawable/btn_primary"
|
||||||
|
android:text="Guardar"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:textColor="#FFFFFF" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtMensagemMesa"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:text=""
|
||||||
|
android:textColor="#2E7D32"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtListaTitulo"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:text="Mesas registadas"
|
||||||
|
android:textColor="#000"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/formMesas" />
|
||||||
|
|
||||||
|
<ListView
|
||||||
|
android:id="@+id/listMesas"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:divider="#E0E0E0"
|
||||||
|
android:dividerHeight="1dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/txtListaTitulo"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -45,6 +45,93 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent" />
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/formStaff"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:background="@drawable/btn_light"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/txtDescricaoGestaoStaff">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Atribuir funcionário a uma mesa"
|
||||||
|
android:textColor="#000"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/inputNomeStaff"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:background="@drawable/input_bg"
|
||||||
|
android:hint="Nome do funcionário"
|
||||||
|
android:inputType="textPersonName"
|
||||||
|
android:padding="12dp" />
|
||||||
|
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/spinnerMesaStaff"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_marginTop="12dp" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnAtribuirStaff"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:background="@drawable/btn_primary"
|
||||||
|
android:text="Guardar atribuição"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:textColor="#FFFFFF" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtMensagemStaff"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:text=""
|
||||||
|
android:textColor="#2E7D32"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtListaStaffTitulo"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:text="Funcionários e mesas"
|
||||||
|
android:textColor="#000"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/formStaff" />
|
||||||
|
|
||||||
|
<ListView
|
||||||
|
android:id="@+id/listStaffMesas"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:divider="#E0E0E0"
|
||||||
|
android:dividerHeight="1dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/txtListaStaffTitulo"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,14 @@
|
|||||||
android:background="#F7F7F7"
|
android:background="#F7F7F7"
|
||||||
tools:context=".MainActivity">
|
tools:context=".MainActivity">
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/logoNaMesa"
|
android:id="@+id/logoNaMesa"
|
||||||
android:layout_width="90dp"
|
android:layout_width="90dp"
|
||||||
@@ -40,26 +48,26 @@
|
|||||||
android:id="@+id/txtSub"
|
android:id="@+id/txtSub"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
android:text="Sistema de Reserva de Mesas"
|
android:text="Sistema de Reserva de Mesas"
|
||||||
android:textColor="#777"
|
android:textColor="#777"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
app:layout_constraintTop_toBottomOf="@id/txtTitle"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:layout_marginTop="4dp" />
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/txtTitle" />
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:id="@+id/cardContainer"
|
android:id="@+id/cardContainer"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="40dp"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/txtSub"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
android:layout_marginStart="32dp"
|
android:layout_marginStart="32dp"
|
||||||
|
android:layout_marginTop="40dp"
|
||||||
android:layout_marginEnd="32dp"
|
android:layout_marginEnd="32dp"
|
||||||
app:cardCornerRadius="16dp"
|
app:cardCornerRadius="16dp"
|
||||||
app:cardElevation="3dp">
|
app:cardElevation="3dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/txtSub">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -91,6 +99,7 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@drawable/tab_unselected"
|
android:background="@drawable/tab_unselected"
|
||||||
|
android:backgroundTint="@color/black"
|
||||||
android:text="Estabelecimento"
|
android:text="Estabelecimento"
|
||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
android:textSize="5pt" />
|
android:textSize="5pt" />
|
||||||
@@ -213,4 +222,8 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -2,4 +2,5 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<color name="black">#FF000000</color>
|
<color name="black">#FF000000</color>
|
||||||
<color name="white">#FFFFFFFF</color>
|
<color name="white">#FFFFFFFF</color>
|
||||||
|
<color name="my_light_primary">#BE1F13</color>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="Base.Theme.Pap_teste" parent="Theme.Material3.DayNight.NoActionBar">
|
<style name="Base.Theme.Pap_teste" parent="Theme.Material3.DayNight.NoActionBar">
|
||||||
<!-- Customize your light theme here. -->
|
<!-- Customize your light theme here. -->
|
||||||
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
|
<item name="colorPrimary">#958787</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.Pap_teste" parent="Base.Theme.Pap_teste" />
|
<style name="Theme.Pap_teste" parent="Base.Theme.Pap_teste" />
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[versions]
|
[versions]
|
||||||
agp = "8.13.1"
|
agp = "8.13.2"
|
||||||
junit = "4.13.2"
|
junit = "4.13.2"
|
||||||
junitVersion = "1.3.0"
|
junitVersion = "1.3.0"
|
||||||
espressoCore = "3.7.0"
|
espressoCore = "3.7.0"
|
||||||
|
|||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,4 +1,4 @@
|
|||||||
#Tue Nov 25 09:03:54 WET 2025
|
#Tue Jan 20 14:11:23 WET 2026
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||||
|
|||||||
Reference in New Issue
Block a user