..asd
This commit is contained in:
@@ -98,7 +98,7 @@ public class ClientDashboardActivity extends AppCompatActivity {
|
||||
// NovaReservaActivity
|
||||
// We pass the filter so it can maybe open directly or we just pass restaurant
|
||||
// email
|
||||
intent.putExtra("category_filter", restaurant.getCategory());
|
||||
intent.putExtra("restaurant", restaurant);
|
||||
startActivity(intent);
|
||||
};
|
||||
|
||||
@@ -293,7 +293,7 @@ public class ClientDashboardActivity extends AppCompatActivity {
|
||||
featuredAdapter = new FeaturedRestaurantAdapter(featuredList,
|
||||
mainAdapter instanceof RestaurantAdapter ? restaurant -> {
|
||||
Intent intent = new Intent(this, ExplorarRestaurantesActivity.class);
|
||||
intent.putExtra("category_filter", restaurant.getCategory());
|
||||
intent.putExtra("restaurant", restaurant);
|
||||
startActivity(intent);
|
||||
} : null);
|
||||
rvFeatured.setAdapter(featuredAdapter);
|
||||
|
||||
@@ -59,6 +59,11 @@ public class ExplorarRestaurantesActivity extends AppCompatActivity {
|
||||
back.setOnClickListener(v -> handleBackNavigation());
|
||||
}
|
||||
|
||||
if (getIntent().hasExtra("restaurant")) {
|
||||
selectedRestaurant = (com.example.pap_teste.models.Restaurant) getIntent().getSerializableExtra("restaurant");
|
||||
currentState = State.DETAILS;
|
||||
}
|
||||
|
||||
setupRestaurantList();
|
||||
updateViewState();
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public class FavoritosActivity extends AppCompatActivity {
|
||||
list = new ArrayList<>();
|
||||
adapter = new RestaurantAdapter(list, restaurant -> {
|
||||
android.content.Intent intent = new android.content.Intent(this, ExplorarRestaurantesActivity.class);
|
||||
intent.putExtra("category_filter", restaurant.getCategory()); // just as demo
|
||||
intent.putExtra("restaurant", restaurant);
|
||||
startActivity(intent);
|
||||
});
|
||||
rv.setAdapter(adapter);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.example.pap_teste.models;
|
||||
|
||||
public class Restaurant {
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Restaurant implements Serializable {
|
||||
private String name;
|
||||
private String category;
|
||||
private String email;
|
||||
|
||||
@@ -36,15 +36,13 @@
|
||||
android:id="@+id/txtClientGreeting"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="sans-serif"
|
||||
android:text="Olá, convidado!"
|
||||
android:textColor="@color/colorTextPrimary"
|
||||
android:textSize="28sp"
|
||||
android:textStyle="bold"
|
||||
android:fontFamily="sans-serif"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/imgNotification"
|
||||
android:layout_marginEnd="16dp" />
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
@@ -52,21 +50,8 @@
|
||||
android:text="Encontre a sua próxima mesa."
|
||||
android:textColor="@color/colorTextSecondary"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintTop_toBottomOf="@id/txtClientGreeting"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/imgNotification" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/imgNotification"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="@drawable/bg_circle_white"
|
||||
android:src="@android:drawable/ic_popup_reminder"
|
||||
app:tint="@color/colorTextPrimary"
|
||||
android:layout_marginEnd="12dp"
|
||||
app:layout_constraintTop_toTopOf="@id/cardProfile"
|
||||
app:layout_constraintBottom_toBottomOf="@id/cardProfile"
|
||||
app:layout_constraintEnd_toStartOf="@id/cardProfile" />
|
||||
app:layout_constraintTop_toBottomOf="@id/txtClientGreeting" />
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cardProfile"
|
||||
|
||||
@@ -19,13 +19,14 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/logoNaMesa"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="156dp"
|
||||
android:layout_marginTop="124dp"
|
||||
android:src="@drawable/na_mesa"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.508"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="50dp" />
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txtTitle"
|
||||
@@ -70,20 +71,13 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="387dp"
|
||||
android:orientation="vertical"
|
||||
android:padding="24dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="@drawable/bg_tabs"
|
||||
android:orientation="horizontal"
|
||||
android:padding="3dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/bg_tabs"
|
||||
android:orientation="horizontal"
|
||||
@@ -198,37 +192,37 @@
|
||||
android:layout_height="54dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/ic_visibility_off"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="?attr/selectableItemBackgroundBorderless" />
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/ic_visibility_off" />
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txtForgotPassword"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="12dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:text="Esqueceu-se da palavra-passe?"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:textSize="14sp"
|
||||
android:visibility="visible"
|
||||
android:clickable="true"
|
||||
android:focusable="true"/>
|
||||
android:visibility="visible" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnFinalCriarConta"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginTop="24dp"
|
||||
app:cornerRadius="14dp"
|
||||
app:backgroundTint="@color/colorPrimary"
|
||||
android:text="Entrar"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/white" />
|
||||
app:backgroundTint="@color/colorPrimary"
|
||||
app:cornerRadius="14dp" />
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
Reference in New Issue
Block a user