mirror of
https://github.com/Nezumi-2711/Foodify.git
synced 2026-09-22 20:00:50 +00:00
Fix layout favorite food
This commit is contained in:
@@ -50,7 +50,7 @@ public class FavoriteFoodActivity extends AppCompatActivity implements ItemTouch
|
||||
private FoodFavoriteAdapter adapter;
|
||||
private final List<Food> listFavoriteFood = new ArrayList<>();
|
||||
private ImageView back_image;
|
||||
private ConstraintLayout listFavoriteFoodView, progressLayout;
|
||||
private ConstraintLayout listFavoriteFoodView;
|
||||
private NestedScrollView nestedScrollView;
|
||||
private ProgressBar progressBar;
|
||||
private TextView endOfListText;
|
||||
@@ -61,7 +61,6 @@ public class FavoriteFoodActivity extends AppCompatActivity implements ItemTouch
|
||||
|
||||
//Init component
|
||||
back_image = findViewById(R.id.back_image);
|
||||
progressLayout = findViewById(R.id.progress_layout);
|
||||
nestedScrollView = findViewById(R.id.nestedScrollView);
|
||||
progressBar = findViewById(R.id.progress_bar);
|
||||
endOfListText = findViewById(R.id.end_of_list_text);
|
||||
@@ -124,8 +123,6 @@ public class FavoriteFoodActivity extends AppCompatActivity implements ItemTouch
|
||||
FoodApiToken.apiService.getListFavoriteFood(Common.CURRENT_USER.getId(), page, PAGE_SIZE, SORT_BY, SORT_DIR).enqueue(new Callback<Foods>() {
|
||||
@Override
|
||||
public void onResponse(Call<Foods> call, Response<Foods> response) {
|
||||
//Dismiss progress
|
||||
progressLayout.setVisibility(View.GONE);
|
||||
|
||||
Foods foodData = response.body();
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.fragment.app.Fragment;
|
||||
@@ -31,19 +32,26 @@ import io.paperdb.Paper;
|
||||
public class ProfileFragment extends Fragment {
|
||||
LinearLayout account_and_profile, manage_address, favorite_food, order_history, log_out;
|
||||
PopupDialog popupDialog;
|
||||
TextView user_name;
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
View rootView = inflater.inflate(R.layout.fragment_profile, container, false);
|
||||
|
||||
//Init component
|
||||
account_and_profile = rootView.findViewById(R.id.account_and_profile);
|
||||
manage_address = rootView.findViewById(R.id.manage_address);
|
||||
favorite_food = rootView.findViewById(R.id.favorite_food);
|
||||
order_history = rootView.findViewById(R.id.order_history);
|
||||
log_out = rootView.findViewById(R.id.log_out);
|
||||
user_name = rootView.findViewById(R.id.user_name);
|
||||
|
||||
popupDialog = PopupDialog.getInstance(getContext());
|
||||
|
||||
//Set user name on textview
|
||||
user_name.setText(Common.CURRENT_USER.getFullName());
|
||||
|
||||
account_and_profile.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view_favorite_food"
|
||||
tools:listitem="@layout/item_food_search_and_favorite"
|
||||
tools:listitem="@layout/item_food_favorite"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
@@ -79,24 +79,4 @@
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#80000000"
|
||||
android:id="@+id/progress_layout"
|
||||
>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBarLoadData"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminateTint="@color/primaryColor"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user