mirror of
https://github.com/Nezumi-2711/Foodify.git
synced 2026-09-22 05:31:59 +00:00
Fix layout, bug and improvement performance app
This commit is contained in:
@@ -1,55 +0,0 @@
|
||||
name: Android CI
|
||||
|
||||
env:
|
||||
# The name of the main module repository
|
||||
main_project_module: app
|
||||
|
||||
on:
|
||||
# Triggers the workflow on push or pull request events but only for default and protected branches
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
# Set Current Date As Env Variable
|
||||
- name: Set current date as env variable
|
||||
run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
||||
|
||||
# Set Repository Name As Env Variable
|
||||
- name: Set repository name as env variable
|
||||
run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
|
||||
|
||||
- name: Set Up JDK
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 11
|
||||
|
||||
- name: Change wrapper permissions
|
||||
run: chmod +x ./gradlew
|
||||
|
||||
# Run Build Project
|
||||
- name: Build gradle project
|
||||
run: ./gradlew build
|
||||
|
||||
# Create APK Debug
|
||||
- name: Build apk debug project (APK) - ${{ env.main_project_module }} module
|
||||
run: ./gradlew assembleDebug
|
||||
|
||||
# Upload Artifact Build
|
||||
# Noted For Output [main_project_module]/build/outputs/apk/debug/
|
||||
- name: Upload APK Debug - ${{ env.repository_name }}
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: ${{ env.date_today }} - ${{ env.playstore_name }} - ${{ env.repository_name }} - APK(s) debug generated
|
||||
path: ${{ env.main_project_module }}/build/outputs/apk/debug/
|
||||
@@ -31,11 +31,11 @@ public interface FoodApi {
|
||||
Gson gson = new GsonBuilder().setDateFormat("HH:mm:ss dd-MM-yyyy").setLenient().create();
|
||||
|
||||
FoodApi apiService = new Retrofit.Builder()
|
||||
.baseUrl("http://192.168.1.183:8080/api/").addConverterFactory(GsonConverterFactory.create(gson))
|
||||
.baseUrl("https://foodify-backend-production.up.railway.app/api/").addConverterFactory(GsonConverterFactory.create(gson))
|
||||
.build()
|
||||
.create(FoodApi.class);
|
||||
|
||||
@GET("products/enable?pageNo=0&pageSize=10&sortBy=id&sortDir=asc")
|
||||
@GET("products/random?pageSize=10")
|
||||
Call<Foods> recommendFood();
|
||||
|
||||
@GET("products/enable?pageNo=0&pageSize=10&sortBy=createdTime&sortDir=desc")
|
||||
|
||||
@@ -50,7 +50,7 @@ public interface FoodApiToken {
|
||||
|
||||
FoodApiToken apiService = new Retrofit.Builder()
|
||||
.client(client)
|
||||
.baseUrl("http://192.168.1.183:8080/api/").addConverterFactory(GsonConverterFactory.create(gson))
|
||||
.baseUrl("https://foodify-backend-production.up.railway.app/api/").addConverterFactory(GsonConverterFactory.create(gson))
|
||||
.build()
|
||||
.create(FoodApiToken.class);
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
@@ -74,6 +76,40 @@ public class ChangePasswordActivity extends AppCompatActivity {
|
||||
textInput_password.setErrorEnabled(false);
|
||||
}
|
||||
});
|
||||
|
||||
edtPassword.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
textInput_password.setErrorEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
edtPasswordConfirm.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
textInput_password_confirm.setErrorEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private boolean validateData(){
|
||||
|
||||
@@ -208,7 +208,9 @@ public class FoodDetailActivity extends AppCompatActivity {
|
||||
shopName_txt.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
startActivity(new Intent(FoodDetailActivity.this, ShopDetailActivity.class));
|
||||
Intent intent = new Intent(FoodDetailActivity.this, ShopDetailActivity.class);
|
||||
intent.putExtra("ShopId", food.getShop().getId());
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
super.onStart();
|
||||
|
||||
//Get user from Paper
|
||||
user = Paper.book().read("user");
|
||||
// user = Paper.book().read("user");
|
||||
|
||||
// Check if user is signed in (non-null) and update UI accordingly.
|
||||
user = mAuth.getCurrentUser();
|
||||
@@ -117,6 +117,8 @@ public class MainActivity extends AppCompatActivity {
|
||||
if (userData != null) {
|
||||
Common.CURRENT_USER = userData;
|
||||
HomeFragment.setNameUser();
|
||||
|
||||
progressLayout.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.capstone.foodify.Activity;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
@@ -17,12 +18,15 @@ public class OrderActivity extends AppCompatActivity {
|
||||
ViewPager2 viewPager2;
|
||||
ViewPagerAdapter viewPagerAdapter;
|
||||
ImageView back_image;
|
||||
public static Activity orderActivity;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_order);
|
||||
|
||||
orderActivity = this;
|
||||
|
||||
//Init Component
|
||||
tabLayout = findViewById(R.id.tab_layout);
|
||||
viewPager2 = findViewById(R.id.view_pager);
|
||||
|
||||
@@ -388,7 +388,7 @@ public class OrderCheckOutActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onClick(@NonNull AestheticDialog.Builder builder) {
|
||||
Common.LIST_BASKET_FOOD.clear();
|
||||
startActivity(new Intent(OrderCheckOutActivity.this, OrderActivity.class));
|
||||
startActivity(new Intent(OrderCheckOutActivity.this, MainActivity.class));
|
||||
builder.dismiss();
|
||||
finish();
|
||||
}
|
||||
|
||||
@@ -138,6 +138,9 @@ public class OrderDetailActivity extends AppCompatActivity {
|
||||
.setOnClickListener(new OnDialogClickListener() {
|
||||
@Override
|
||||
public void onClick(@NonNull AestheticDialog.Builder builder) {
|
||||
|
||||
OrderActivity.orderActivity.finish();
|
||||
|
||||
startActivity(new Intent(OrderDetailActivity.this, OrderActivity.class));
|
||||
builder.dismiss();
|
||||
finish();
|
||||
|
||||
@@ -40,11 +40,10 @@ public class ShopDetailActivity extends AppCompatActivity {
|
||||
private static boolean LAST_PAGE = false;
|
||||
private int shopId;
|
||||
private List<Food> listFood = new ArrayList<>();
|
||||
TextView content_description_text_view, student_shop_text_view, end_of_list_text_view;
|
||||
TextView content_description_text_view, student_shop_text_view, end_of_list_text_view, txt_shop_name;
|
||||
ImageView imageShop, back_image;
|
||||
RecyclerView recycler_view_food_shop;
|
||||
FoodShopAdapter adapter;
|
||||
private CollapsingToolbarLayout collapsingToolbarLayout;
|
||||
private NestedScrollView nestedScrollView;
|
||||
private ProgressBar progressBar;
|
||||
private Shop shop;
|
||||
@@ -60,13 +59,13 @@ public class ShopDetailActivity extends AppCompatActivity {
|
||||
recycler_view_food_shop = findViewById(R.id.recycler_view_food_shop);
|
||||
back_image = findViewById(R.id.back_image);
|
||||
adapter = new FoodShopAdapter(this);
|
||||
collapsingToolbarLayout = findViewById(R.id.collapsing);
|
||||
content_description_text_view = findViewById(R.id.content_description_text_view);
|
||||
student_shop_text_view = findViewById(R.id.student_shop_text_view);
|
||||
nestedScrollView = findViewById(R.id.food_detail);
|
||||
progressBar = findViewById(R.id.progress_bar);
|
||||
end_of_list_text_view = findViewById(R.id.end_of_list_text);
|
||||
progressLayout = findViewById(R.id.progress_layout);
|
||||
txt_shop_name = findViewById(R.id.txt_shop_name);
|
||||
|
||||
//Get data
|
||||
if (getIntent() != null)
|
||||
@@ -159,7 +158,7 @@ public class ShopDetailActivity extends AppCompatActivity {
|
||||
private void initData(Shop shop) {
|
||||
//Init data
|
||||
Picasso.get().load(shop.getImageUrl()).into(imageShop);
|
||||
collapsingToolbarLayout.setTitle(shop.getName());
|
||||
txt_shop_name.setText(shop.getName());
|
||||
content_description_text_view.setText(shop.getDescription());
|
||||
|
||||
//If shop is studentShop, enable tag student shop
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.capstone.foodify.Activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
@@ -17,6 +19,7 @@ import com.capstone.foodify.Fragment.HomeFragment;
|
||||
import com.capstone.foodify.Model.User;
|
||||
import com.capstone.foodify.R;
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
import com.google.android.gms.tasks.OnFailureListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.android.material.button.MaterialButton;
|
||||
import com.google.android.material.textfield.TextInputEditText;
|
||||
@@ -26,6 +29,7 @@ import com.google.firebase.auth.AuthResult;
|
||||
import com.google.firebase.auth.FirebaseAuth;
|
||||
import com.google.firebase.auth.FirebaseUser;
|
||||
import com.google.firebase.auth.GetTokenResult;
|
||||
import com.google.firebase.auth.SignInMethodQueryResult;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -99,6 +103,24 @@ public class SignInActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
edt_password.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
textInput_password.setErrorEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void initData(){
|
||||
@@ -146,7 +168,26 @@ public class SignInActivity extends AppCompatActivity {
|
||||
|
||||
mAuth.setLanguageCode("vi");
|
||||
|
||||
mAuth.signInWithEmailAndPassword(edt_email.getText().toString(), edt_password.getText().toString())
|
||||
mAuth.fetchSignInMethodsForEmail(email)
|
||||
.addOnCompleteListener(new OnCompleteListener<SignInMethodQueryResult>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<SignInMethodQueryResult> task) {
|
||||
|
||||
boolean isNewUser = task.getResult().getSignInMethods().isEmpty();
|
||||
|
||||
if (isNewUser) {
|
||||
Toast.makeText(SignInActivity.this, "Tài khoản chưa được đăng ký! Vui lòng đăng ký để tiếp tục sử dụng!", Toast.LENGTH_SHORT).show();
|
||||
progressLayout.setVisibility(View.GONE);
|
||||
} else {
|
||||
signInMethod();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void signInMethod(){
|
||||
mAuth.signInWithEmailAndPassword(email, password)
|
||||
.addOnCompleteListener(SignInActivity.this, new OnCompleteListener<AuthResult>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<AuthResult> task) {
|
||||
@@ -155,7 +196,7 @@ public class SignInActivity extends AppCompatActivity {
|
||||
FirebaseUser user = mAuth.getCurrentUser();
|
||||
|
||||
//Save user
|
||||
Paper.book().write("user", user);
|
||||
// Paper.book().write("user", user);
|
||||
|
||||
user.getIdToken(true)
|
||||
.addOnCompleteListener(new OnCompleteListener<GetTokenResult>() {
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
@@ -103,6 +104,7 @@ public class VerifyAccountActivity extends AppCompatActivity {
|
||||
//Init text changedListener
|
||||
textChangedListenerEditTextOTP();
|
||||
|
||||
|
||||
//Add event to confirm button
|
||||
confirm_code.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -283,104 +285,119 @@ public class VerifyAccountActivity extends AppCompatActivity {
|
||||
inputCode1.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
if(inputCode1.getText().toString().length()== 0) //size as per your requirement
|
||||
{
|
||||
inputCode2.requestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
// Nothing to do
|
||||
if (s.length() == 1) {
|
||||
inputCode2.requestFocus(View.FOCUS_DOWN);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
// Nothing to do
|
||||
}
|
||||
});
|
||||
|
||||
inputCode2.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
if(inputCode2.getText().toString().length()== 0) //size as per your requirement
|
||||
{
|
||||
inputCode3.requestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
// Nothing to do
|
||||
if(count == 0) {
|
||||
inputCode1.requestFocus(View.FOCUS_DOWN);
|
||||
} else {
|
||||
if (s.length() == 1) {
|
||||
inputCode3.requestFocus(View.FOCUS_DOWN);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
// Nothing to do
|
||||
}
|
||||
});
|
||||
|
||||
inputCode3.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
if(inputCode3.getText().toString().length()== 0) //size as per your requirement
|
||||
{
|
||||
inputCode4.requestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
// Nothing to do
|
||||
if(count == 0) {
|
||||
inputCode2.requestFocus(View.FOCUS_DOWN);
|
||||
} else {
|
||||
if (s.length() == 1) {
|
||||
inputCode4.requestFocus(View.FOCUS_DOWN);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
// Nothing to do
|
||||
}
|
||||
});
|
||||
|
||||
inputCode4.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
if(inputCode4.getText().toString().length()== 0) //size as per your requirement
|
||||
{
|
||||
inputCode5.requestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
// Nothing to do
|
||||
if(count == 0) {
|
||||
inputCode3.requestFocus(View.FOCUS_DOWN);
|
||||
} else {
|
||||
if (s.length() == 1) {
|
||||
inputCode5.requestFocus(View.FOCUS_DOWN);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
// Nothing to do
|
||||
}
|
||||
});
|
||||
|
||||
inputCode5.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
if(inputCode5.getText().toString().length()== 0) //size as per your requirement
|
||||
{
|
||||
inputCode6.requestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
// Nothing to do
|
||||
if(count == 0) {
|
||||
inputCode4.requestFocus(View.FOCUS_DOWN);
|
||||
} else {
|
||||
if (s.length() == 1) {
|
||||
inputCode6.requestFocus(View.FOCUS_DOWN);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
}
|
||||
});
|
||||
|
||||
inputCode6.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
if(count == 0) {
|
||||
inputCode5.requestFocus(View.FOCUS_DOWN);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
// Nothing to do
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void requestSMSPermission()
|
||||
{
|
||||
String permission = Manifest.permission.RECEIVE_SMS;
|
||||
|
||||
@@ -51,9 +51,9 @@ public class FoodAdapter extends RecyclerView.Adapter<FoodAdapter.FoodViewHolder
|
||||
}
|
||||
|
||||
String foodName = food.getName();
|
||||
if(foodName.length() >= 30){
|
||||
if(foodName.length() >= 24){
|
||||
StringBuilder stringBuilder = new StringBuilder(food.getName());
|
||||
stringBuilder.replace(30, food.getName().length(), "..." );
|
||||
stringBuilder.replace(24, food.getName().length(), "..." );
|
||||
holder.name.setText(stringBuilder);
|
||||
} else {
|
||||
holder.name.setText(foodName);
|
||||
|
||||
@@ -49,7 +49,16 @@ public class ShopAdapter extends RecyclerView.Adapter<ShopAdapter.ShopViewHolder
|
||||
|
||||
//Init data
|
||||
Picasso.get().load(shop.getImageUrl()).into(holder.imageView);
|
||||
holder.shopName.setText(shop.getName());
|
||||
|
||||
String shopName = shop.getName();
|
||||
|
||||
if(shopName.length() >= 24){
|
||||
StringBuilder stringBuilder = new StringBuilder(shop.getName());
|
||||
stringBuilder.replace(24, shop.getName().length(), "..." );
|
||||
holder.shopName.setText(stringBuilder);
|
||||
} else {
|
||||
holder.shopName.setText(shopName);
|
||||
}
|
||||
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
||||
@@ -128,7 +128,7 @@ public class HomeFragment extends Fragment {
|
||||
List<Menu> listMenu = new ArrayList<>();
|
||||
|
||||
listMenu.add(new Menu("Món ăn khuyến nghị", listFood));
|
||||
listMenu.add(new Menu("Món ăn phổ biến", recentFood));
|
||||
listMenu.add(new Menu("Món ăn được thêm gần đây", recentFood));
|
||||
|
||||
return listMenu;
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ public class ProfileFragment extends Fragment {
|
||||
FirebaseAuth.getInstance().signOut();
|
||||
|
||||
//Delete user from local storage
|
||||
Paper.book().delete("user");
|
||||
// Paper.book().delete("user");
|
||||
|
||||
Common.TOKEN = null;
|
||||
Common.CURRENT_USER = null;
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/end_of_list_text"
|
||||
android:text="End of list"
|
||||
android:text="Đã hết"
|
||||
android:fontFamily="@font/opensans"
|
||||
android:textColor="@color/grayLight"
|
||||
android:visibility="gone"
|
||||
|
||||
@@ -441,7 +441,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/end_of_list_text"
|
||||
android:text="End of list"
|
||||
android:text="Đã hết"
|
||||
android:fontFamily="@font/opensans"
|
||||
android:textColor="@color/grayLight"
|
||||
android:visibility="gone"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<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"
|
||||
@@ -7,27 +7,27 @@
|
||||
tools:context=".Activity.ShopDetailActivity"
|
||||
>
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/app_bar_layout"
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/food_detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/Theme.Foodify"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
>
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
android:id="@+id/collapsing"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="250dp"
|
||||
android:fitsSystemWindows="true"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
|
||||
app:contentScrim="@color/primaryDarkColor"
|
||||
android:theme="@style/CustomToolbarTheme"
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image_shop"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
@@ -39,123 +39,125 @@
|
||||
android:layout_marginTop="25dp"
|
||||
android:background="@drawable/circle_button"
|
||||
android:translationZ="90dp"
|
||||
android:padding="8dp"/>
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
app:layout_collapseMode="pin"/>
|
||||
|
||||
|
||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/food_detail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"
|
||||
>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/student_shop_text_view"
|
||||
android:text="Student Shop"
|
||||
android:fontFamily="@font/bebas"
|
||||
android:textColor="@color/red"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/description_text_view"
|
||||
android:text="Mô tả"
|
||||
android:textSize="18sp"
|
||||
android:fontFamily="@font/bebas"
|
||||
android:textColor="@color/black"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content_description_text_view"
|
||||
android:textColor="@color/gray"
|
||||
android:fontFamily="@font/opensans"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/description_text_view"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:background="#c0c0c0"
|
||||
android:layout_marginTop="5dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/content_description_text_view"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:text="Danh sách các món ăn"
|
||||
android:fontFamily="@font/bebas"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/content_description_text_view"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view_food_shop"
|
||||
tools:listitem="@layout/item_food_shop"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/textView"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress_bar"
|
||||
android:indeterminateTint="@color/primaryColor"
|
||||
app:layout_constraintTop_toBottomOf="@id/recycler_view_food_shop"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginEnd="7dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@id/image_shop"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/end_of_list_text"
|
||||
android:text="End of list"
|
||||
android:fontFamily="@font/opensans"
|
||||
android:textColor="@color/grayLight"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toBottomOf="@id/progress_bar"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/student_shop_text_view"
|
||||
android:text="Student Shop"
|
||||
android:fontFamily="@font/bebas"
|
||||
android:textColor="@color/red"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@+id/txt_shop_name"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:visibility="visible"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_shop_name"
|
||||
android:text="Shop name"
|
||||
android:fontFamily="@font/bebas"
|
||||
android:textColor="@color/primaryColor"
|
||||
android:textSize="35sp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/description_text_view"
|
||||
android:text="Mô tả"
|
||||
android:textSize="18sp"
|
||||
android:fontFamily="@font/bebas"
|
||||
android:textColor="@color/black"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@+id/txt_shop_name"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content_description_text_view"
|
||||
android:textColor="@color/gray"
|
||||
android:fontFamily="@font/opensans"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/description_text_view"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:background="#c0c0c0"
|
||||
android:layout_marginTop="5dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/content_description_text_view"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:text="Danh sách các món ăn"
|
||||
android:fontFamily="@font/bebas"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/content_description_text_view"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view_food_shop"
|
||||
tools:listitem="@layout/item_food_shop"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/textView"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress_bar"
|
||||
android:indeterminateTint="@color/primaryColor"
|
||||
app:layout_constraintTop_toBottomOf="@id/recycler_view_food_shop"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/end_of_list_text"
|
||||
android:text="Đã hết"
|
||||
android:fontFamily="@font/opensans"
|
||||
android:textColor="@color/grayLight"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toBottomOf="@id/progress_bar"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
@@ -182,4 +184,4 @@
|
||||
|
||||
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -105,7 +105,9 @@
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textInput_password" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/textInput_password"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/sign_in_button"
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/end_of_list_text"
|
||||
android:text="End of list"
|
||||
android:text="Đã hết"
|
||||
android:fontFamily="@font/opensans"
|
||||
android:textColor="@color/grayLight"
|
||||
android:visibility="gone"
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/end_of_list_text"
|
||||
android:text="End of list"
|
||||
android:text="Đã hết"
|
||||
android:fontFamily="@font/opensans"
|
||||
android:textColor="@color/grayLight"
|
||||
android:visibility="gone"
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/end_of_list_text"
|
||||
android:text="End of list"
|
||||
android:text="Đã hết"
|
||||
android:fontFamily="@font/opensans"
|
||||
android:textColor="@color/grayLight"
|
||||
android:visibility="gone"
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/end_of_list_text"
|
||||
android:text="End of list"
|
||||
android:text="Đã hết"
|
||||
android:fontFamily="@font/opensans"
|
||||
android:textColor="@color/grayLight"
|
||||
android:visibility="gone"
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/end_of_list_text"
|
||||
android:text="End of list"
|
||||
android:text="Đã hết"
|
||||
android:fontFamily="@font/opensans"
|
||||
android:textColor="@color/grayLight"
|
||||
android:visibility="gone"
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/end_of_list_text"
|
||||
android:text="End of list"
|
||||
android:text="Đã hết"
|
||||
android:fontFamily="@font/opensans"
|
||||
android:textColor="@color/grayLight"
|
||||
android:visibility="gone"
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/price"
|
||||
android:textSize="18sp"
|
||||
android:textSize="17sp"
|
||||
android:text="1000000000"
|
||||
android:textColor="@color/primaryColor"
|
||||
android:fontFamily="@font/bebas"
|
||||
@@ -66,7 +66,7 @@
|
||||
<TextView
|
||||
android:id="@+id/discount"
|
||||
android:text="-59%"
|
||||
android:textSize="8sp"
|
||||
android:textSize="6sp"
|
||||
android:textColor="@color/red"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
android:id="@+id/shopName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:text="Shop Name"
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_marginEnd="3dp"
|
||||
|
||||
Reference in New Issue
Block a user