This commit is contained in:
2026-03-10 17:12:51 +00:00
parent 7ad72ad334
commit a33741ba06
11 changed files with 328 additions and 93 deletions

View File

@@ -42,10 +42,13 @@ public class ClientDashboardActivity extends AppCompatActivity {
profileLauncher = registerForActivityResult(
new androidx.activity.result.contract.ActivityResultContracts.StartActivityForResult(),
result -> {
if (result.getResultCode() == RESULT_OK) {
android.widget.Toast.makeText(this,
"Perfil atualizado. Reinicie para ver mudanças.",
android.widget.Toast.LENGTH_SHORT).show();
if (result.getResultCode() == RESULT_OK && result.getData() != null) {
String updatedName = result.getData()
.getStringExtra(MainActivity.EXTRA_DISPLAY_NAME);
if (updatedName != null) {
displayName = updatedName;
updateGreeting();
}
}
});
@@ -64,10 +67,14 @@ public class ClientDashboardActivity extends AppCompatActivity {
cats.add(new FoodCategory("Carnes", R.drawable.cat_carnes));
cats.add(new FoodCategory("Massas", R.drawable.cat_massas));
cats.add(new FoodCategory("Sushi", R.drawable.cat_sushi));
cats.add(new FoodCategory("Pizzas", R.drawable.ic_launcher_background));
cats.add(new FoodCategory("Sobremesas", R.drawable.ic_launcher_background));
cats.add(new FoodCategory("Pizzas", R.drawable.cat_pizzas));
cats.add(new FoodCategory("Sobremesas", R.drawable.cat_sobremesas));
FoodCategoryAdapter adapter = new FoodCategoryAdapter(cats);
FoodCategoryAdapter adapter = new FoodCategoryAdapter(cats, category -> {
Intent intent = new Intent(this, ExplorarRestaurantesActivity.class);
intent.putExtra("category_filter", category.getName());
startActivity(intent);
});
rv.setAdapter(adapter);
}
@@ -92,8 +99,5 @@ public class ClientDashboardActivity extends AppCompatActivity {
findViewById(R.id.btnNovaReserva)
.setOnClickListener(v -> startActivity(new Intent(this, NovaReservaActivity.class)));
findViewById(R.id.btnExplorar).setOnClickListener(
v -> startActivity(new Intent(this, ExplorarRestaurantesActivity.class)));
}
}