mirror of
https://github.com/Nezumi-2711/Foodify.git
synced 2026-09-22 13:38:41 +00:00
Add swipeRefreshLayout
This commit is contained in:
+16
-3
@@ -5,6 +5,14 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
storeFile file('C:\\Users\\phanh\\Desktop\\mykeystore\\foodify-keystore.jks')
|
||||||
|
storePassword 'Phanhuuloi2@@1'
|
||||||
|
keyAlias 'foodify'
|
||||||
|
keyPassword 'Phanhuuloi2@@1'
|
||||||
|
}
|
||||||
|
}
|
||||||
namespace 'com.capstone.foodify'
|
namespace 'com.capstone.foodify'
|
||||||
compileSdk 33
|
compileSdk 33
|
||||||
|
|
||||||
@@ -16,11 +24,12 @@ android {
|
|||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.capstone.foodify"
|
applicationId "com.capstone.foodify"
|
||||||
minSdk 26
|
minSdk 26
|
||||||
targetSdk 31
|
targetSdk 32
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0"
|
versionName "0.1.0"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
signingConfig signingConfigs.release
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
@@ -67,8 +76,9 @@ dependencies {
|
|||||||
|
|
||||||
implementation 'androidx.core:core-splashscreen:1.0.0'
|
implementation 'androidx.core:core-splashscreen:1.0.0'
|
||||||
|
|
||||||
|
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
|
||||||
implementation 'com.google.code.gson:gson:2.10.1'
|
implementation 'com.google.code.gson:gson:2.10.1'
|
||||||
implementation 'com.google.android.material:material:1.7.0'
|
implementation 'com.google.android.material:material:1.8.0'
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||||
implementation 'com.squareup.retrofit2:converter-scalars:2.9.0'
|
implementation 'com.squareup.retrofit2:converter-scalars:2.9.0'
|
||||||
@@ -95,4 +105,7 @@ dependencies {
|
|||||||
implementation platform('com.google.firebase:firebase-bom:31.2.3')
|
implementation platform('com.google.firebase:firebase-bom:31.2.3')
|
||||||
implementation("com.squareup.okhttp3:okhttp:4.10.0")
|
implementation("com.squareup.okhttp3:okhttp:4.10.0")
|
||||||
|
|
||||||
|
// ADD the API-only library to all variants
|
||||||
|
implementation 'com.google.firebase:firebase-appdistribution-api:16.0.0-beta07'
|
||||||
|
|
||||||
}
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"artifactType": {
|
||||||
|
"type": "APK",
|
||||||
|
"kind": "Directory"
|
||||||
|
},
|
||||||
|
"applicationId": "com.capstone.foodify",
|
||||||
|
"variantName": "release",
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"type": "SINGLE",
|
||||||
|
"filters": [],
|
||||||
|
"attributes": [],
|
||||||
|
"versionCode": 1,
|
||||||
|
"versionName": "0.1.0",
|
||||||
|
"outputFile": "app-release.apk"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"elementType": "File"
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
tools:ignore="LockedOrientationActivity">
|
||||||
|
|
||||||
<uses-feature
|
<uses-feature
|
||||||
android:name="android.hardware.telephony"
|
android:name="android.hardware.telephony"
|
||||||
@@ -52,10 +53,12 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".Activity.TrackingOrderActivity"
|
android:name=".Activity.TrackingOrderActivity"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:label="@string/title_activity_tracking_order" />
|
android:label="@string/title_activity_tracking_order" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".Activity.OrderCheckOutActivity"
|
android:name=".Activity.OrderCheckOutActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:launchMode="singleTask">
|
android:launchMode="singleTask">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
@@ -70,45 +73,58 @@
|
|||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".Activity.FavoriteFoodActivity"
|
android:name=".Activity.FavoriteFoodActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".Activity.ShopDetailActivity"
|
android:name=".Activity.ShopDetailActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".Activity.OrderDetailActivity"
|
android:name=".Activity.OrderDetailActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".Activity.OrderActivity"
|
android:name=".Activity.OrderActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".Activity.AddressManagerActivity"
|
android:name=".Activity.AddressManagerActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".Activity.ChangePasswordActivity"
|
android:name=".Activity.ChangePasswordActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".Activity.AccountAndProfileActivity"
|
android:name=".Activity.AccountAndProfileActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".Activity.FoodDetailActivity"
|
android:name=".Activity.FoodDetailActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:noHistory="true" />
|
android:noHistory="true" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".Activity.VerifyAccountActivity"
|
android:name=".Activity.VerifyAccountActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".Activity.ForgotPasswordActivity"
|
android:name=".Activity.ForgotPasswordActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:noHistory="true" />
|
android:noHistory="true" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".Activity.SignInActivity"
|
android:name=".Activity.SignInActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".Activity.SignUpActivity"
|
android:name=".Activity.SignUpActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:noHistory="true" />
|
android:noHistory="true" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".Activity.MainActivity"
|
android:name=".Activity.MainActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:theme="@style/Theme.Foodify.SplashScreen">
|
android:theme="@style/Theme.Foodify.SplashScreen">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|||||||
@@ -96,4 +96,7 @@ public interface FoodApi {
|
|||||||
|
|
||||||
@GET("products/{productId}/user")
|
@GET("products/{productId}/user")
|
||||||
Call<CustomResponse> checkUserBuyProduct(@Path("productId") int productId, @Query("userId") int userId);
|
Call<CustomResponse> checkUserBuyProduct(@Path("productId") int productId, @Query("userId") int userId);
|
||||||
|
|
||||||
|
@GET("auth/check")
|
||||||
|
Call<CustomResponse> checkIdentifiedCode(@Query("code") String code);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -296,12 +296,7 @@ public class AccountAndProfileActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void showDialogCaution() {
|
private void showDialogCaution() {
|
||||||
new AestheticDialog.Builder(this, DialogStyle.FLAT, DialogType.WARNING)
|
Common.notificationDialog(this, DialogStyle.FLAT, DialogType.WARNING, "Email chưa được xác thực!", "Vui lòng xác thực email để bảo vệ tài khoản của bạn!");
|
||||||
.setTitle("Email chưa được xác thực!")
|
|
||||||
.setMessage("Vui lòng xác thực email để bạn có thể thực hiện việc lấy lại mật khẩu nếu quên!")
|
|
||||||
.setAnimation(DialogAnimation.SHRINK)
|
|
||||||
.setCancelable(true)
|
|
||||||
.show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateUser(String imageUrl) {
|
private void updateUser(String imageUrl) {
|
||||||
|
|||||||
@@ -155,11 +155,7 @@ public class ChangePasswordActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onComplete(@NonNull Task<Void> task) {
|
public void onComplete(@NonNull Task<Void> task) {
|
||||||
if (task.isSuccessful()) {
|
if (task.isSuccessful()) {
|
||||||
new AestheticDialog.Builder(ChangePasswordActivity.this, DialogStyle.RAINBOW, DialogType.SUCCESS)
|
Common.notificationDialog(ChangePasswordActivity.this, DialogStyle.RAINBOW, DialogType.SUCCESS, "Thành công!", "Đã thay đổi mật khẩu thành công!");
|
||||||
.setTitle("Thàng công!")
|
|
||||||
.setMessage("Đã thay đổi mật khẩu thành công!")
|
|
||||||
.setCancelable(true)
|
|
||||||
.show();
|
|
||||||
|
|
||||||
progressLayout.setVisibility(View.GONE);
|
progressLayout.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
@@ -169,11 +165,8 @@ public class ChangePasswordActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
new AestheticDialog.Builder(ChangePasswordActivity.this, DialogStyle.RAINBOW, DialogType.ERROR)
|
Common.notificationDialog(ChangePasswordActivity.this, DialogStyle.RAINBOW, DialogType.ERROR, "Lỗi!", "Mật khẩu không đúng! Xin vui lòng thử lại!");
|
||||||
.setTitle("Lỗi!")
|
|
||||||
.setMessage("Mật khẩu không đúng! Xin vui lòng thử lại!")
|
|
||||||
.setCancelable(true)
|
|
||||||
.show();
|
|
||||||
progressLayout.setVisibility(View.GONE);
|
progressLayout.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import androidx.constraintlayout.widget.ConstraintLayout;
|
|||||||
import androidx.core.widget.NestedScrollView;
|
import androidx.core.widget.NestedScrollView;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||||
|
|
||||||
import com.capstone.foodify.API.FoodApi;
|
import com.capstone.foodify.API.FoodApi;
|
||||||
import com.capstone.foodify.API.FoodApiToken;
|
import com.capstone.foodify.API.FoodApiToken;
|
||||||
@@ -66,7 +67,6 @@ import retrofit2.Response;
|
|||||||
|
|
||||||
public class FoodDetailActivity extends AppCompatActivity {
|
public class FoodDetailActivity extends AppCompatActivity {
|
||||||
ArrayList<Comment> listComment = new ArrayList<>();
|
ArrayList<Comment> listComment = new ArrayList<>();
|
||||||
private static final int ACTION_CODE = 0;
|
|
||||||
private static final int CREATE_COMMENT = 1;
|
private static final int CREATE_COMMENT = 1;
|
||||||
private static final int EDIT_COMMENT = 2;
|
private static final int EDIT_COMMENT = 2;
|
||||||
private static int CURRENT_PAGE = 0;
|
private static int CURRENT_PAGE = 0;
|
||||||
@@ -94,6 +94,7 @@ public class FoodDetailActivity extends AppCompatActivity {
|
|||||||
private CardView user_comment_layout;
|
private CardView user_comment_layout;
|
||||||
private Comment commentUser = null;
|
private Comment commentUser = null;
|
||||||
private ChipGroup list_category;
|
private ChipGroup list_category;
|
||||||
|
private SwipeRefreshLayout swipeRefreshLayout;
|
||||||
|
|
||||||
private void initComponent() {
|
private void initComponent() {
|
||||||
horizontalQuantitizer = findViewById(R.id.quantity_option);
|
horizontalQuantitizer = findViewById(R.id.quantity_option);
|
||||||
@@ -124,6 +125,7 @@ public class FoodDetailActivity extends AppCompatActivity {
|
|||||||
edt_button = findViewById(R.id.edit_button);
|
edt_button = findViewById(R.id.edit_button);
|
||||||
list_category = findViewById(R.id.list_category);
|
list_category = findViewById(R.id.list_category);
|
||||||
count_sold_txt = findViewById(R.id.count_sold);
|
count_sold_txt = findViewById(R.id.count_sold);
|
||||||
|
swipeRefreshLayout = findViewById(R.id.swipe_refresh);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -143,14 +145,23 @@ public class FoodDetailActivity extends AppCompatActivity {
|
|||||||
if (getIntent() != null)
|
if (getIntent() != null)
|
||||||
foodId = getIntent().getStringExtra("FoodId");
|
foodId = getIntent().getStringExtra("FoodId");
|
||||||
|
|
||||||
commentAdapter.setData(getListComment(0));
|
|
||||||
recyclerView_comment.setAdapter(commentAdapter);
|
recyclerView_comment.setAdapter(commentAdapter);
|
||||||
|
|
||||||
|
|
||||||
hideUI();
|
hideUI();
|
||||||
|
|
||||||
checkUserBuyThisProduct();
|
getData();
|
||||||
|
|
||||||
|
swipeRefreshLayout.setColorSchemeColors(getResources().getColor(R.color.primaryColor, null));
|
||||||
|
|
||||||
|
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||||
|
@Override
|
||||||
|
public void onRefresh() {
|
||||||
|
listComment.clear();
|
||||||
|
|
||||||
|
getData();
|
||||||
|
swipeRefreshLayout.setRefreshing(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
if(Common.CURRENT_USER == null){
|
if(Common.CURRENT_USER == null){
|
||||||
@@ -183,8 +194,6 @@ public class FoodDetailActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
getFoodById(foodId);
|
|
||||||
|
|
||||||
//Turn previous action when click
|
//Turn previous action when click
|
||||||
back_image.setOnClickListener(new View.OnClickListener() {
|
back_image.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -203,10 +212,10 @@ public class FoodDetailActivity extends AppCompatActivity {
|
|||||||
openCommentDialog(Gravity.CENTER, CREATE_COMMENT);
|
openCommentDialog(Gravity.CENTER, CREATE_COMMENT);
|
||||||
} else {
|
} else {
|
||||||
//If not
|
//If not
|
||||||
Toast.makeText(FoodDetailActivity.this, "Bạn cần phải mua sản phẩm trước khi bình luận!", Toast.LENGTH_SHORT).show();
|
Common.notificationDialog(FoodDetailActivity.this, DialogStyle.TOASTER, DialogType.INFO, "Thông báo!", "Bạn cần phải mua sản phẩm này trước khi bình luận!");
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
Toast.makeText(FoodDetailActivity.this, "Bạn cần phải đăng nhập để thực hiện hành động này!", Toast.LENGTH_SHORT).show();
|
Common.notificationDialog(FoodDetailActivity.this, DialogStyle.TOASTER, DialogType.WARNING, "Thông báo!", "Bạn cần phải đăng nhập trước khi thực hiện hành động này!");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -275,6 +284,13 @@ public class FoodDetailActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void getData() {
|
||||||
|
CURRENT_PAGE = 0;
|
||||||
|
commentAdapter.setData(getListComment(0));
|
||||||
|
checkUserBuyThisProduct();
|
||||||
|
getFoodById(foodId);
|
||||||
|
}
|
||||||
|
|
||||||
private void checkUserBuyThisProduct(){
|
private void checkUserBuyThisProduct(){
|
||||||
|
|
||||||
if(Common.CURRENT_USER != null){
|
if(Common.CURRENT_USER != null){
|
||||||
@@ -347,12 +363,7 @@ public class FoodDetailActivity extends AppCompatActivity {
|
|||||||
if(Common.FINAL_SHOP.equals(food.getShop().getName())){
|
if(Common.FINAL_SHOP.equals(food.getShop().getName())){
|
||||||
addFood();
|
addFood();
|
||||||
} else {
|
} else {
|
||||||
new AestheticDialog.Builder(this, DialogStyle.FLAT, DialogType.INFO)
|
Common.notificationDialog(this, DialogStyle.FLAT, DialogType.INFO, "Thông báo!", "Bạn chỉ có thể đặt những món ăn cùng cửa hàng, xin vui lòng kiểm tra lại giỏ hàng!");
|
||||||
.setTitle("Thông báo!")
|
|
||||||
.setMessage("Bạn chỉ có thể đặt những món ăn cùng cửa hàng, xin vui lòng kiểm tra lại giỏ hàng!")
|
|
||||||
.setAnimation(DialogAnimation.SHRINK)
|
|
||||||
.setCancelable(true)
|
|
||||||
.show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -512,6 +523,7 @@ public class FoodDetailActivity extends AppCompatActivity {
|
|||||||
count_sold_txt.setText(food.getSold() + " đã bán");
|
count_sold_txt.setText(food.getSold() + " đã bán");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
list_category.removeAllViews();
|
||||||
//Init category
|
//Init category
|
||||||
for(Category category: food.getCategories()){
|
for(Category category: food.getCategories()){
|
||||||
Chip chip = (Chip) inflater.inflate(R.layout.chip_item, null, false);
|
Chip chip = (Chip) inflater.inflate(R.layout.chip_item, null, false);
|
||||||
|
|||||||
@@ -78,10 +78,11 @@ public class ForgotPasswordActivity extends AppCompatActivity {
|
|||||||
boolean isNewUser = task.getResult().getSignInMethods().isEmpty();
|
boolean isNewUser = task.getResult().getSignInMethods().isEmpty();
|
||||||
|
|
||||||
if (isNewUser) {
|
if (isNewUser) {
|
||||||
new AestheticDialog.Builder(ForgotPasswordActivity.this, DialogStyle.TOASTER, DialogType.ERROR)
|
|
||||||
.setTitle("Thông báo!")
|
Common.notificationDialog(ForgotPasswordActivity.this, DialogStyle.FLAT, DialogType.ERROR, "Thông báo!", "Email " +
|
||||||
.setMessage("Tài khoản chưa được đăng ký ở hệ thống! Vui lòng kiểm tra lại")
|
"này chưa được đăng ký ở hệ thống! Vui lòng kiểm tra lại!");
|
||||||
.setCancelable(true).show();
|
|
||||||
|
progress_layout.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
sendEmail();
|
sendEmail();
|
||||||
}
|
}
|
||||||
@@ -101,10 +102,8 @@ public class ForgotPasswordActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onComplete(@NonNull Task<Void> task) {
|
public void onComplete(@NonNull Task<Void> task) {
|
||||||
if(task.isSuccessful()){
|
if(task.isSuccessful()){
|
||||||
new AestheticDialog.Builder(ForgotPasswordActivity.this, DialogStyle.TOASTER, DialogType.SUCCESS)
|
Common.notificationDialog(ForgotPasswordActivity.this, DialogStyle.FLAT, DialogType.SUCCESS, "Email đã được gửi", "Vui lòng kiểm tra " +
|
||||||
.setTitle("Email đã được gửi!")
|
"hộp thư và làm theo hướng dẫn để tiếp tục!");
|
||||||
.setMessage("Vui lòng kiểm tra hộp thư và làm theo hướng dẫn để tiếp tục!")
|
|
||||||
.setCancelable(true).show();
|
|
||||||
|
|
||||||
progress_layout.setVisibility(View.GONE);
|
progress_layout.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,9 @@ import android.view.MenuItem;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.app.AppCompatDelegate;
|
import androidx.appcompat.app.AppCompatDelegate;
|
||||||
import androidx.appcompat.widget.AppCompatCheckBox;
|
import androidx.appcompat.widget.AppCompatCheckBox;
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
@@ -31,9 +33,6 @@ import androidx.core.app.ActivityCompat;
|
|||||||
import androidx.core.app.NotificationManagerCompat;
|
import androidx.core.app.NotificationManagerCompat;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.core.splashscreen.SplashScreen;
|
import androidx.core.splashscreen.SplashScreen;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import androidx.viewpager2.widget.ViewPager2;
|
import androidx.viewpager2.widget.ViewPager2;
|
||||||
|
|
||||||
import com.capstone.foodify.API.FoodApiToken;
|
import com.capstone.foodify.API.FoodApiToken;
|
||||||
@@ -56,20 +55,19 @@ import com.google.android.gms.location.LocationSettingsResponse;
|
|||||||
import com.google.android.gms.location.LocationSettingsStatusCodes;
|
import com.google.android.gms.location.LocationSettingsStatusCodes;
|
||||||
import com.google.android.gms.location.Priority;
|
import com.google.android.gms.location.Priority;
|
||||||
import com.google.android.gms.location.SettingsClient;
|
import com.google.android.gms.location.SettingsClient;
|
||||||
import com.google.android.gms.maps.model.LatLng;
|
|
||||||
import com.google.android.gms.tasks.OnCompleteListener;
|
import com.google.android.gms.tasks.OnCompleteListener;
|
||||||
import com.google.android.gms.tasks.OnFailureListener;
|
import com.google.android.gms.tasks.OnFailureListener;
|
||||||
import com.google.android.gms.tasks.OnSuccessListener;
|
import com.google.android.gms.tasks.OnSuccessListener;
|
||||||
import com.google.android.gms.tasks.Task;
|
import com.google.android.gms.tasks.Task;
|
||||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||||
import com.google.android.material.navigation.NavigationBarView;
|
import com.google.android.material.navigation.NavigationBarView;
|
||||||
|
import com.google.firebase.appdistribution.FirebaseAppDistribution;
|
||||||
|
import com.google.firebase.appdistribution.InterruptionLevel;
|
||||||
import com.google.firebase.auth.FirebaseAuth;
|
import com.google.firebase.auth.FirebaseAuth;
|
||||||
import com.google.firebase.auth.FirebaseUser;
|
import com.google.firebase.auth.FirebaseUser;
|
||||||
import com.google.firebase.auth.GetTokenResult;
|
import com.google.firebase.auth.GetTokenResult;
|
||||||
import com.google.firebase.messaging.FirebaseMessaging;
|
import com.google.firebase.messaging.FirebaseMessaging;
|
||||||
|
|
||||||
import org.objectweb.asm.Handle;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -80,6 +78,7 @@ import retrofit2.Response;
|
|||||||
|
|
||||||
public class MainActivity extends AppCompatActivity {
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
FirebaseAppDistribution firebaseAppDistribution = FirebaseAppDistribution.getInstance();
|
||||||
ViewPager2 viewPager2;
|
ViewPager2 viewPager2;
|
||||||
ViewPagerAdapter viewPagerAdapter;
|
ViewPagerAdapter viewPagerAdapter;
|
||||||
BottomNavigationView bottomNavigationView;
|
BottomNavigationView bottomNavigationView;
|
||||||
@@ -131,8 +130,6 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
HomeFragment.setNameUser();
|
HomeFragment.setNameUser();
|
||||||
|
|
||||||
getTokenFCM();
|
getTokenFCM();
|
||||||
|
|
||||||
progressLayout.setVisibility(View.GONE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,6 +165,13 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
startPowerSaverIntent(this);
|
startPowerSaverIntent(this);
|
||||||
checkNotificationPermission();
|
checkNotificationPermission();
|
||||||
|
|
||||||
|
firebaseAppDistribution.showFeedbackNotification(
|
||||||
|
// Text providing notice to your testers about collection and
|
||||||
|
// processing of their feedback data
|
||||||
|
"Nhấp vào đây để đánh giá app Foodify!",
|
||||||
|
// The level of interruption for the notification
|
||||||
|
InterruptionLevel.HIGH);
|
||||||
|
|
||||||
|
|
||||||
if (Common.CURRENT_LOCATION == null) {
|
if (Common.CURRENT_LOCATION == null) {
|
||||||
mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);
|
mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);
|
||||||
@@ -206,8 +210,10 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
stopLocationUpdates();
|
stopLocationUpdates();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
progressLayout.setVisibility(View.GONE);
|
||||||
|
|
||||||
}
|
}
|
||||||
}, 5000);
|
}, 4000);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -230,6 +236,8 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
public void onResponse(Call<CustomResponse> call, Response<CustomResponse> response) {
|
public void onResponse(Call<CustomResponse> call, Response<CustomResponse> response) {
|
||||||
if(response.code() != 200)
|
if(response.code() != 200)
|
||||||
Toast.makeText(MainActivity.this, "Không thể cập nhật FCM Token. Mã lỗi: " + response.code(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(MainActivity.this, "Không thể cập nhật FCM Token. Mã lỗi: " + response.code(), Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
|
progressLayout.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class OrderCheckOutActivity extends AppCompatActivity {
|
|||||||
spn_ward = findViewById(R.id.ward);
|
spn_ward = findViewById(R.id.ward);
|
||||||
edt_address_detect = findViewById(R.id.edt_address_detect);
|
edt_address_detect = findViewById(R.id.edt_address_detect);
|
||||||
manual_input_address_layout = findViewById(R.id.manual_input_address_layout);
|
manual_input_address_layout = findViewById(R.id.manual_input_address_layout);
|
||||||
adapter = new OrderDetailAdapter();
|
adapter = new OrderDetailAdapter(OrderCheckOutActivity.this);
|
||||||
recyclerView = findViewById(R.id.list_order);
|
recyclerView = findViewById(R.id.list_order);
|
||||||
back_image = findViewById(R.id.back_image);
|
back_image = findViewById(R.id.back_image);
|
||||||
change_address_button = findViewById(R.id.change_address_button);
|
change_address_button = findViewById(R.id.change_address_button);
|
||||||
@@ -144,10 +144,8 @@ public class OrderCheckOutActivity extends AppCompatActivity {
|
|||||||
//Check current location is null or not
|
//Check current location is null or not
|
||||||
if(Common.CURRENT_LOCATION == null){
|
if(Common.CURRENT_LOCATION == null){
|
||||||
auto_detect_location.setEnabled(false);
|
auto_detect_location.setEnabled(false);
|
||||||
new AestheticDialog.Builder(OrderCheckOutActivity.this, DialogStyle.FLAT, DialogType.INFO)
|
|
||||||
.setTitle("Thông báo")
|
Common.notificationDialog(OrderCheckOutActivity.this, DialogStyle.FLAT, DialogType.INFO, "Thông báo", "Tính năng \"Lấy vị trí theo thiết bị của bạn\" sẽ không khả dụng do ứng dụng chưa được cấp quyền vị trí!");
|
||||||
.setMessage("Tính năng \"Lấy vị trí theo thiết bị của bạn\" sẽ không khả dụng do ứng dụng chưa được cấp quyền vị trí!")
|
|
||||||
.setCancelable(true).show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -254,12 +252,9 @@ public class OrderCheckOutActivity extends AppCompatActivity {
|
|||||||
btn_Pay.setEnabled(true);
|
btn_Pay.setEnabled(true);
|
||||||
btn_ZaloPay.setEnabled(true);
|
btn_ZaloPay.setEnabled(true);
|
||||||
} else {
|
} else {
|
||||||
new AestheticDialog.Builder(OrderCheckOutActivity.this, DialogStyle.FLAT, DialogType.INFO)
|
|
||||||
.setTitle("Thông báo!")
|
Common.notificationDialog(OrderCheckOutActivity.this, DialogStyle.FLAT, DialogType.INFO, "Thông báo!", "Chưa thể lấy được vị trí shop, vui lòng thử lại hoặc có thể chọn \"Đến shop lấy\" để tiếp tục!");
|
||||||
.setMessage("Chưa thể lấy được vị trí shop, vui lòng thử lại hoặc có thể chọn \"Đến shop lấy\" để tiếp tục!")
|
|
||||||
.setAnimation(DialogAnimation.SHRINK)
|
|
||||||
.setCancelable(true)
|
|
||||||
.show();
|
|
||||||
progress_layout.setVisibility(View.GONE);
|
progress_layout.setVisibility(View.GONE);
|
||||||
|
|
||||||
btn_Pay.setEnabled(false);
|
btn_Pay.setEnabled(false);
|
||||||
@@ -395,11 +390,7 @@ public class OrderCheckOutActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPaymentCanceled(String zpTransToken, String appTransID) {
|
public void onPaymentCanceled(String zpTransToken, String appTransID) {
|
||||||
new AestheticDialog.Builder(OrderCheckOutActivity.this, DialogStyle.RAINBOW, DialogType.INFO)
|
Common.notificationDialog(OrderCheckOutActivity.this, DialogStyle.RAINBOW, DialogType.INFO, "Thông báo!", "Huỷ thanh toán thành công!");
|
||||||
.setTitle("Thông báo!")
|
|
||||||
.setMessage("Huỷ thanh toán thành công!")
|
|
||||||
.setCancelable(true)
|
|
||||||
.show();
|
|
||||||
progress_layout.setVisibility(View.GONE);
|
progress_layout.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ public class OrderDetailActivity extends AppCompatActivity {
|
|||||||
address = findViewById(R.id.address);
|
address = findViewById(R.id.address);
|
||||||
orderTime = findViewById(R.id.order_time);
|
orderTime = findViewById(R.id.order_time);
|
||||||
total = findViewById(R.id.total);
|
total = findViewById(R.id.total);
|
||||||
adapter = new OrderDetailAdapter();
|
adapter = new OrderDetailAdapter(OrderDetailActivity.this);
|
||||||
recyclerView = findViewById(R.id.recycler_view_order_detail);
|
recyclerView = findViewById(R.id.recycler_view_order_detail);
|
||||||
back_image = findViewById(R.id.back_image);
|
back_image = findViewById(R.id.back_image);
|
||||||
btn_cancel_order = findViewById(R.id.cancel_order_button);
|
btn_cancel_order = findViewById(R.id.cancel_order_button);
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ import com.capstone.foodify.Model.DistrictWardResponse;
|
|||||||
import com.capstone.foodify.Model.Response.CustomResponse;
|
import com.capstone.foodify.Model.Response.CustomResponse;
|
||||||
import com.capstone.foodify.Model.User;
|
import com.capstone.foodify.Model.User;
|
||||||
import com.capstone.foodify.R;
|
import com.capstone.foodify.R;
|
||||||
|
import com.google.android.gms.tasks.OnCompleteListener;
|
||||||
|
import com.google.android.gms.tasks.Task;
|
||||||
import com.google.android.material.button.MaterialButton;
|
import com.google.android.material.button.MaterialButton;
|
||||||
import com.google.android.material.textfield.TextInputLayout;
|
import com.google.android.material.textfield.TextInputLayout;
|
||||||
import com.google.firebase.FirebaseException;
|
import com.google.firebase.FirebaseException;
|
||||||
@@ -36,6 +38,7 @@ import com.google.firebase.auth.FirebaseAuth;
|
|||||||
import com.google.firebase.auth.PhoneAuthCredential;
|
import com.google.firebase.auth.PhoneAuthCredential;
|
||||||
import com.google.firebase.auth.PhoneAuthOptions;
|
import com.google.firebase.auth.PhoneAuthOptions;
|
||||||
import com.google.firebase.auth.PhoneAuthProvider;
|
import com.google.firebase.auth.PhoneAuthProvider;
|
||||||
|
import com.google.firebase.auth.SignInMethodQueryResult;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
@@ -45,6 +48,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
@@ -64,7 +68,7 @@ public class SignUpActivity extends AppCompatActivity {
|
|||||||
private MaterialButton signUpButton;
|
private MaterialButton signUpButton;
|
||||||
private ConstraintLayout progressLayout;
|
private ConstraintLayout progressLayout;
|
||||||
private String email, phone, name, dateOfBirth, address, district, ward, password = null, identifiedCode;
|
private String email, phone, name, dateOfBirth, address, district, ward, password = null, identifiedCode;
|
||||||
|
private static boolean validIdentifiedCode, validPhone, validEmail = false;
|
||||||
private static final ArrayList<String> wardList = new ArrayList<>();
|
private static final ArrayList<String> wardList = new ArrayList<>();
|
||||||
private static final ArrayList<String> districtList = new ArrayList<>();
|
private static final ArrayList<String> districtList = new ArrayList<>();
|
||||||
|
|
||||||
@@ -157,7 +161,10 @@ public class SignUpActivity extends AppCompatActivity {
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if(validateData()){
|
if(validateData()){
|
||||||
loading();
|
loading();
|
||||||
checkEmailOrPhoneExist();
|
|
||||||
|
checkIdentifiedCodeExist();
|
||||||
|
checkPhoneExist();
|
||||||
|
checkEmailExist();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -197,7 +204,55 @@ public class SignUpActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkEmailOrPhoneExist(){
|
private void checkEmailExist(){
|
||||||
|
FirebaseAuth.getInstance().fetchSignInMethodsForEmail(email).addOnCompleteListener(new OnCompleteListener<SignInMethodQueryResult>() {
|
||||||
|
@Override
|
||||||
|
public void onComplete(@NonNull Task<SignInMethodQueryResult> task) {
|
||||||
|
|
||||||
|
boolean isNewUser = Objects.requireNonNull(task.getResult().getSignInMethods()).isEmpty();
|
||||||
|
|
||||||
|
if (!isNewUser) {
|
||||||
|
textInput_email.setError("Email này đã được đăng ký sử dụng!");
|
||||||
|
validEmail = false;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
validEmail = true;
|
||||||
|
signUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkIdentifiedCodeExist(){
|
||||||
|
FoodApi.apiService.checkIdentifiedCode(identifiedCode).enqueue(new Callback<CustomResponse>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<CustomResponse> call, Response<CustomResponse> response) {
|
||||||
|
if(response.code() == 200){
|
||||||
|
CustomResponse tempData = response.body();
|
||||||
|
|
||||||
|
assert tempData != null;
|
||||||
|
if(tempData.isTrue()){
|
||||||
|
//Have identifiedCode exist
|
||||||
|
validIdentifiedCode = false;
|
||||||
|
textInput_id_card.setError("Số này đã được đăng ký!");
|
||||||
|
} else {
|
||||||
|
validIdentifiedCode = true;
|
||||||
|
textInput_id_card.setErrorEnabled(false);
|
||||||
|
|
||||||
|
signUp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<CustomResponse> call, Throwable t) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
private void checkPhoneExist(){
|
||||||
//Create user object
|
//Create user object
|
||||||
User user = new User(new Address(address, ward, district), dateOfBirth, email, name, identifiedCode, phone);
|
User user = new User(new Address(address, ward, district), dateOfBirth, email, name, identifiedCode, phone);
|
||||||
|
|
||||||
@@ -206,17 +261,16 @@ public class SignUpActivity extends AppCompatActivity {
|
|||||||
public void onResponse(Call<CustomResponse> call, Response<CustomResponse> response) {
|
public void onResponse(Call<CustomResponse> call, Response<CustomResponse> response) {
|
||||||
CustomResponse dataTemp = response.body();
|
CustomResponse dataTemp = response.body();
|
||||||
|
|
||||||
boolean isExist = false;
|
loadCompleted();
|
||||||
|
assert dataTemp != null;
|
||||||
if(dataTemp != null)
|
if(dataTemp.isTrue()){
|
||||||
isExist = dataTemp.isTrue();
|
textInput_phone.setError("Số điện thoại đã được đăng ký!");
|
||||||
|
validPhone = false;
|
||||||
if(!isExist){
|
|
||||||
//If user not exist on database, the app will create account
|
|
||||||
signUp(user);
|
|
||||||
} else {
|
} else {
|
||||||
loadCompleted();
|
validPhone = true;
|
||||||
Toast.makeText(SignUpActivity.this, "Địa chỉ email hoặc số điện thoại đã trùng, vui lòng kiểm tra lại!", Toast.LENGTH_SHORT).show();
|
textInput_phone.setErrorEnabled(false);
|
||||||
|
|
||||||
|
signUp();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -269,7 +323,7 @@ public class SignUpActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Check identified Code
|
//Check identified Code
|
||||||
if(identifiedCode.length() < 9 && identifiedCode.length() > 10){
|
if(identifiedCode.length() < 8 || identifiedCode.length() > 11){
|
||||||
textInput_id_card.setError("CCCD / CMND không hợp lệ!");
|
textInput_id_card.setError("CCCD / CMND không hợp lệ!");
|
||||||
dataHasValidate = false;
|
dataHasValidate = false;
|
||||||
} else {
|
} else {
|
||||||
@@ -355,47 +409,52 @@ public class SignUpActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void signUp(User user){
|
private void signUp(){
|
||||||
FirebaseAuth auth = FirebaseAuth.getInstance();
|
|
||||||
auth.setLanguageCode("vi");
|
|
||||||
PhoneAuthOptions options = PhoneAuthOptions.newBuilder(auth)
|
|
||||||
.setPhoneNumber(Common.PHONE_CODE + edt_phone.getText().toString())
|
|
||||||
.setTimeout(0L, TimeUnit.SECONDS)
|
|
||||||
.setActivity(this)
|
|
||||||
.setCallbacks(new PhoneAuthProvider.OnVerificationStateChangedCallbacks() {
|
|
||||||
@Override
|
|
||||||
public void onCodeSent(@NonNull String verificationId,
|
|
||||||
@NonNull PhoneAuthProvider.ForceResendingToken forceResendingToken) {
|
|
||||||
loadCompleted();
|
|
||||||
|
|
||||||
Intent intent = new Intent(SignUpActivity.this, VerifyAccountActivity.class);
|
if(validEmail && validIdentifiedCode && validPhone){
|
||||||
intent.putExtra("user", user);
|
User user = new User(new Address(address, ward, district), dateOfBirth, email, name, identifiedCode, phone);
|
||||||
intent.putExtra("phone", edt_phone.getText().toString());
|
|
||||||
intent.putExtra("verificationId", verificationId);
|
|
||||||
intent.putExtra("token", forceResendingToken);
|
|
||||||
intent.putExtra("password", password);
|
|
||||||
startActivity(intent);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
FirebaseAuth auth = FirebaseAuth.getInstance();
|
||||||
public void onVerificationCompleted(@NonNull PhoneAuthCredential phoneAuthCredential) {
|
auth.setLanguageCode("vi");
|
||||||
loadCompleted();
|
PhoneAuthOptions options = PhoneAuthOptions.newBuilder(auth)
|
||||||
}
|
.setPhoneNumber(Common.PHONE_CODE + edt_phone.getText().toString())
|
||||||
|
.setTimeout(0L, TimeUnit.SECONDS)
|
||||||
|
.setActivity(this)
|
||||||
|
.setCallbacks(new PhoneAuthProvider.OnVerificationStateChangedCallbacks() {
|
||||||
|
@Override
|
||||||
|
public void onCodeSent(@NonNull String verificationId,
|
||||||
|
@NonNull PhoneAuthProvider.ForceResendingToken forceResendingToken) {
|
||||||
|
loadCompleted();
|
||||||
|
|
||||||
@Override
|
Intent intent = new Intent(SignUpActivity.this, VerifyAccountActivity.class);
|
||||||
public void onVerificationFailed(@NonNull FirebaseException e) {
|
intent.putExtra("user", user);
|
||||||
// ...
|
intent.putExtra("phone", edt_phone.getText().toString());
|
||||||
loadCompleted();
|
intent.putExtra("verificationId", verificationId);
|
||||||
showError(e.toString());
|
intent.putExtra("token", forceResendingToken);
|
||||||
}
|
intent.putExtra("password", password);
|
||||||
})
|
startActivity(intent);
|
||||||
.build();
|
finish();
|
||||||
PhoneAuthProvider.verifyPhoneNumber(options);
|
}
|
||||||
// [END auth_test_phone_verify]
|
|
||||||
|
@Override
|
||||||
|
public void onVerificationCompleted(@NonNull PhoneAuthCredential phoneAuthCredential) {
|
||||||
|
loadCompleted();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onVerificationFailed(@NonNull FirebaseException e) {
|
||||||
|
// ...
|
||||||
|
loadCompleted();
|
||||||
|
showError(e.toString());
|
||||||
|
}
|
||||||
|
}).build();
|
||||||
|
|
||||||
|
PhoneAuthProvider.verifyPhoneNumber(options);
|
||||||
|
// [END auth_test_phone_verify]
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void showError(String msg){
|
private void showError(String msg){
|
||||||
errorText.setText(msg);
|
errorText.setText(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package com.capstone.foodify.Adapter;
|
package com.capstone.foodify.Adapter;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.ContentResolver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@@ -12,6 +14,7 @@ import android.widget.TextView;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.capstone.foodify.Activity.FoodDetailActivity;
|
||||||
import com.capstone.foodify.Common;
|
import com.capstone.foodify.Common;
|
||||||
import com.capstone.foodify.Fragment.BasketFragment;
|
import com.capstone.foodify.Fragment.BasketFragment;
|
||||||
import com.capstone.foodify.Model.Basket;
|
import com.capstone.foodify.Model.Basket;
|
||||||
@@ -27,9 +30,11 @@ public class BasketAdapter extends RecyclerView.Adapter<BasketAdapter.BasketView
|
|||||||
public List<Basket> listBasketFood;
|
public List<Basket> listBasketFood;
|
||||||
|
|
||||||
private final BasketFragment basketFragment;
|
private final BasketFragment basketFragment;
|
||||||
|
private Context context;
|
||||||
|
|
||||||
public BasketAdapter(BasketFragment basketFragment) {
|
public BasketAdapter(BasketFragment basketFragment, Context context) {
|
||||||
this.basketFragment = basketFragment;
|
this.basketFragment = basketFragment;
|
||||||
|
this.context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("NotifyDataSetChanged")
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
@@ -123,6 +128,15 @@ public class BasketAdapter extends RecyclerView.Adapter<BasketAdapter.BasketView
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
Intent intent = new Intent(context, FoodDetailActivity.class);
|
||||||
|
intent.putExtra("FoodId", foodBasket.getId());
|
||||||
|
context.startActivity(intent);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void calculateTotalPrice() {
|
private void calculateTotalPrice() {
|
||||||
|
|||||||
@@ -93,12 +93,8 @@ public class FoodAdapter extends RecyclerView.Adapter<FoodAdapter.FoodViewHolder
|
|||||||
Common.addFoodToBasket(food);
|
Common.addFoodToBasket(food);
|
||||||
Toast.makeText(context, "Đã thêm " + food.getName() + " vào giỏ hàng!", Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, "Đã thêm " + food.getName() + " vào giỏ hàng!", Toast.LENGTH_SHORT).show();
|
||||||
} else {
|
} else {
|
||||||
new AestheticDialog.Builder((Activity) context, DialogStyle.FLAT, DialogType.INFO)
|
|
||||||
.setTitle("Thông báo!")
|
Common.notificationDialog((Activity) context, DialogStyle.FLAT, DialogType.INFO, "Thông báo!", "Bạn chỉ có thể đặt những món ăn cùng cửa hàng, xin vui lòng kiểm tra lại giỏ hàng!");
|
||||||
.setMessage("Bạn chỉ có thể đặt những món ăn cùng cửa hàng, xin vui lòng kiểm tra lại giỏ hàng!")
|
|
||||||
.setAnimation(DialogAnimation.SHRINK)
|
|
||||||
.setCancelable(true)
|
|
||||||
.show();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -95,12 +95,8 @@ public class FoodFavoriteAdapter extends RecyclerView.Adapter<FoodFavoriteAdapt
|
|||||||
Common.addFoodToBasket(food);
|
Common.addFoodToBasket(food);
|
||||||
Toast.makeText(context, "Đã thêm " + food.getName() + " vào giỏ hàng!", Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, "Đã thêm " + food.getName() + " vào giỏ hàng!", Toast.LENGTH_SHORT).show();
|
||||||
} else {
|
} else {
|
||||||
new AestheticDialog.Builder((Activity) context, DialogStyle.FLAT, DialogType.INFO)
|
|
||||||
.setTitle("Thông báo!")
|
Common.notificationDialog((Activity) context, DialogStyle.FLAT, DialogType.INFO, "Thông báo!", "Bạn chỉ có thể đặt những món ăn cùng cửa hàng, xin vui lòng kiểm tra lại giỏ hàng!");
|
||||||
.setMessage("Bạn chỉ có thể đặt những món ăn cùng cửa hàng, xin vui lòng kiểm tra lại giỏ hàng!")
|
|
||||||
.setAnimation(DialogAnimation.SHRINK)
|
|
||||||
.setCancelable(true)
|
|
||||||
.show();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -95,12 +95,8 @@ public class FoodSearchAdapter extends RecyclerView.Adapter<FoodSearchAdapter.Fo
|
|||||||
Common.addFoodToBasket(food);
|
Common.addFoodToBasket(food);
|
||||||
Toast.makeText(context, "Đã thêm " + food.getName() + " vào giỏ hàng!", Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, "Đã thêm " + food.getName() + " vào giỏ hàng!", Toast.LENGTH_SHORT).show();
|
||||||
} else {
|
} else {
|
||||||
new AestheticDialog.Builder((Activity) context, DialogStyle.FLAT, DialogType.INFO)
|
|
||||||
.setTitle("Thông báo!")
|
Common.notificationDialog((Activity) context, DialogStyle.FLAT, DialogType.INFO, "Thông báo!", "Bạn chỉ có thể đặt những món ăn cùng cửa hàng, xin vui lòng kiểm tra lại giỏ hàng!");
|
||||||
.setMessage("Bạn chỉ có thể đặt những món ăn cùng cửa hàng, xin vui lòng kiểm tra lại giỏ hàng!")
|
|
||||||
.setAnimation(DialogAnimation.SHRINK)
|
|
||||||
.setCancelable(true)
|
|
||||||
.show();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -102,12 +102,7 @@ public class FoodShopAdapter extends RecyclerView.Adapter<FoodShopAdapter.FoodSh
|
|||||||
Common.addFoodToBasket(food);
|
Common.addFoodToBasket(food);
|
||||||
Toast.makeText(context, "Đã thêm " + food.getName() + " vào giỏ hàng!", Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, "Đã thêm " + food.getName() + " vào giỏ hàng!", Toast.LENGTH_SHORT).show();
|
||||||
} else {
|
} else {
|
||||||
new AestheticDialog.Builder((Activity) context, DialogStyle.FLAT, DialogType.INFO)
|
Common.notificationDialog((Activity) context, DialogStyle.FLAT, DialogType.INFO, "Thông báo!", "Bạn chỉ có thể đặt những món ăn cùng cửa hàng, xin vui lòng kiểm tra lại giỏ hàng!");
|
||||||
.setTitle("Thông báo!")
|
|
||||||
.setMessage("Bạn chỉ có thể đặt những món ăn cùng cửa hàng, xin vui lòng kiểm tra lại giỏ hàng!")
|
|
||||||
.setAnimation(DialogAnimation.SHRINK)
|
|
||||||
.setCancelable(true)
|
|
||||||
.show();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.capstone.foodify.Adapter;
|
package com.capstone.foodify.Adapter;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@@ -9,6 +11,7 @@ import android.widget.TextView;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.capstone.foodify.Activity.FoodDetailActivity;
|
||||||
import com.capstone.foodify.Common;
|
import com.capstone.foodify.Common;
|
||||||
import com.capstone.foodify.Model.Basket;
|
import com.capstone.foodify.Model.Basket;
|
||||||
import com.capstone.foodify.Model.OrderDetail;
|
import com.capstone.foodify.Model.OrderDetail;
|
||||||
@@ -20,8 +23,10 @@ import java.util.List;
|
|||||||
public class OrderDetailAdapter extends RecyclerView.Adapter<OrderDetailAdapter.OrderDetailViewHolder>{
|
public class OrderDetailAdapter extends RecyclerView.Adapter<OrderDetailAdapter.OrderDetailViewHolder>{
|
||||||
|
|
||||||
public List<Basket> listFoodInBasket;
|
public List<Basket> listFoodInBasket;
|
||||||
|
public Context context;
|
||||||
public OrderDetailAdapter(){}
|
public OrderDetailAdapter(Context context){
|
||||||
|
this.context = context;
|
||||||
|
}
|
||||||
|
|
||||||
public void setData(List<Basket> listFoodInBasket){
|
public void setData(List<Basket> listFoodInBasket){
|
||||||
this.listFoodInBasket = listFoodInBasket;
|
this.listFoodInBasket = listFoodInBasket;
|
||||||
@@ -65,6 +70,15 @@ public class OrderDetailAdapter extends RecyclerView.Adapter<OrderDetailAdapter.
|
|||||||
}
|
}
|
||||||
|
|
||||||
holder.price.setText(Common.changeCurrencyUnit(cost));
|
holder.price.setText(Common.changeCurrencyUnit(cost));
|
||||||
|
|
||||||
|
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
Intent intent = new Intent(context, FoodDetailActivity.class);
|
||||||
|
intent.putExtra("FoodId", food.getId());
|
||||||
|
context.startActivity(intent);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ import retrofit2.Callback;
|
|||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
public class Common {
|
public class Common {
|
||||||
public static final String BASE_URL = "https://foodify-backend-production.up.railway.app/api/";
|
public static final String BASE_URL = "http://192.168.1.183:8080/api/";
|
||||||
public static String FCM_TOKEN = null;
|
public static String FCM_TOKEN = null;
|
||||||
public static Location CURRENT_LOCATION = null;
|
public static Location CURRENT_LOCATION = null;
|
||||||
public static final String MAP_API = "AIzaSyAY14Ic32UP26Hg6GILznOfbBihiY5BUxw";
|
public static final String MAP_API = "AIzaSyAY14Ic32UP26Hg6GILznOfbBihiY5BUxw";
|
||||||
@@ -124,6 +124,14 @@ public class Common {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void notificationDialog(Activity activity, DialogStyle dialogStyle, DialogType dialogType, String title, String message){
|
||||||
|
new AestheticDialog.Builder(activity, dialogStyle, dialogType)
|
||||||
|
.setTitle(title)
|
||||||
|
.setMessage(message)
|
||||||
|
.setCancelable(true)
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
|
||||||
public static void showErrorInternetConnectionNotification(Activity activity){
|
public static void showErrorInternetConnectionNotification(Activity activity){
|
||||||
new AestheticDialog.Builder(activity, DialogStyle.CONNECTIFY, DialogType.ERROR)
|
new AestheticDialog.Builder(activity, DialogStyle.CONNECTIFY, DialogType.ERROR)
|
||||||
.setTitle("Lỗi kết nối mạng!")
|
.setTitle("Lỗi kết nối mạng!")
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class BasketFragment extends Fragment implements ItemTouchHelperListener
|
|||||||
//Init Component
|
//Init Component
|
||||||
recyclerView_basket_food = view.findViewById(R.id.recycler_view_basket_food);
|
recyclerView_basket_food = view.findViewById(R.id.recycler_view_basket_food);
|
||||||
listBasketFoodView = view.findViewById(R.id.list_basket_food_view);
|
listBasketFoodView = view.findViewById(R.id.list_basket_food_view);
|
||||||
adapter = new BasketAdapter(this);
|
adapter = new BasketAdapter(this, getContext());
|
||||||
total = view.findViewById(R.id.total_text_view);
|
total = view.findViewById(R.id.total_text_view);
|
||||||
empty_layout = view.findViewById(R.id.empty_layout);
|
empty_layout = view.findViewById(R.id.empty_layout);
|
||||||
btnCheckOut = view.findViewById(R.id.btnCheckOut);
|
btnCheckOut = view.findViewById(R.id.btnCheckOut);
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ public class HomeFragment extends Fragment {
|
|||||||
private RecyclerView rcvMenu, recyclerView_restaurant;
|
private RecyclerView rcvMenu, recyclerView_restaurant;
|
||||||
private MenuAdapter menuAdapter;
|
private MenuAdapter menuAdapter;
|
||||||
private ShopAdapter shopAdapter;
|
private ShopAdapter shopAdapter;
|
||||||
private ConstraintLayout progressLayout;
|
|
||||||
private static TextView welcomeText;
|
private static TextView welcomeText;
|
||||||
|
|
||||||
|
|
||||||
@@ -60,7 +59,6 @@ public class HomeFragment extends Fragment {
|
|||||||
menuAdapter = new MenuAdapter(getContext());
|
menuAdapter = new MenuAdapter(getContext());
|
||||||
recyclerView_restaurant = view.findViewById(R.id.recycler_view_restaurant);
|
recyclerView_restaurant = view.findViewById(R.id.recycler_view_restaurant);
|
||||||
shopAdapter = new ShopAdapter(getContext());
|
shopAdapter = new ShopAdapter(getContext());
|
||||||
progressLayout = getActivity().findViewById(R.id.progress_layout);
|
|
||||||
welcomeText = view.findViewById(R.id.welcome_text);
|
welcomeText = view.findViewById(R.id.welcome_text);
|
||||||
|
|
||||||
|
|
||||||
@@ -116,14 +114,10 @@ public class HomeFragment extends Fragment {
|
|||||||
|
|
||||||
imageSlider.setImageList(slideModels, ScaleTypes.FIT);
|
imageSlider.setImageList(slideModels, ScaleTypes.FIT);
|
||||||
|
|
||||||
//Dismiss progress bar
|
|
||||||
progressLayout.setVisibility(View.GONE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<List<Slider>> call, Throwable t) {
|
public void onFailure(Call<List<Slider>> call, Throwable t) {
|
||||||
//Dismiss progress bar
|
|
||||||
progressLayout.setVisibility(View.GONE);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -157,8 +151,6 @@ public class HomeFragment extends Fragment {
|
|||||||
if(getActivity() != null)
|
if(getActivity() != null)
|
||||||
Common.showNotificationError(getContext(), getActivity());
|
Common.showNotificationError(getContext(), getActivity());
|
||||||
|
|
||||||
//Dismiss progress bar
|
|
||||||
progressLayout.setVisibility(View.GONE);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import androidx.core.widget.NestedScrollView;
|
|||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||||
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -44,6 +45,7 @@ public class CancelOrderFragment extends Fragment {
|
|||||||
private ProgressBar progressBar;
|
private ProgressBar progressBar;
|
||||||
private TextView endOfListText;
|
private TextView endOfListText;
|
||||||
private LinearLayout empty_layout;
|
private LinearLayout empty_layout;
|
||||||
|
private SwipeRefreshLayout swipeRefreshLayout;
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
@@ -53,7 +55,7 @@ public class CancelOrderFragment extends Fragment {
|
|||||||
//Init Component
|
//Init Component
|
||||||
initComponent(view);
|
initComponent(view);
|
||||||
|
|
||||||
getOrderUser(0);
|
getOrderUser(CURRENT_PAGE);
|
||||||
|
|
||||||
orderAdapter = new OrderAdapter(getContext());
|
orderAdapter = new OrderAdapter(getContext());
|
||||||
|
|
||||||
@@ -73,6 +75,22 @@ public class CancelOrderFragment extends Fragment {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
swipeRefreshLayout.setColorSchemeColors(getResources().getColor(R.color.primaryColor, null));
|
||||||
|
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||||
|
@Override
|
||||||
|
public void onRefresh() {
|
||||||
|
listOrders.clear();
|
||||||
|
CURRENT_PAGE = 0;
|
||||||
|
|
||||||
|
getOrderUser(CURRENT_PAGE);
|
||||||
|
|
||||||
|
nestedScrollView.setVisibility(View.VISIBLE);
|
||||||
|
empty_layout.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
swipeRefreshLayout.setRefreshing(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,6 +100,7 @@ public class CancelOrderFragment extends Fragment {
|
|||||||
progressBar = view.findViewById(R.id.progress_bar);
|
progressBar = view.findViewById(R.id.progress_bar);
|
||||||
endOfListText = view.findViewById(R.id.end_of_list_text);
|
endOfListText = view.findViewById(R.id.end_of_list_text);
|
||||||
empty_layout = view.findViewById(R.id.empty_layout);
|
empty_layout = view.findViewById(R.id.empty_layout);
|
||||||
|
swipeRefreshLayout = view.findViewById(R.id.swipe_refresh);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getOrderUser(int page){
|
private void getOrderUser(int page){
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import androidx.core.widget.NestedScrollView;
|
|||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||||
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -45,6 +46,7 @@ public class CompleteOrderFragment extends Fragment {
|
|||||||
private ProgressBar progressBar;
|
private ProgressBar progressBar;
|
||||||
private TextView endOfListText;
|
private TextView endOfListText;
|
||||||
private LinearLayout empty_layout;
|
private LinearLayout empty_layout;
|
||||||
|
private SwipeRefreshLayout swipeRefreshLayout;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
@@ -55,7 +57,7 @@ public class CompleteOrderFragment extends Fragment {
|
|||||||
//Init Component
|
//Init Component
|
||||||
initComponent(view);
|
initComponent(view);
|
||||||
|
|
||||||
getOrderUser(0);
|
getOrderUser(CURRENT_PAGE);
|
||||||
|
|
||||||
orderAdapter = new OrderAdapter(getContext());
|
orderAdapter = new OrderAdapter(getContext());
|
||||||
|
|
||||||
@@ -75,6 +77,22 @@ public class CompleteOrderFragment extends Fragment {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
swipeRefreshLayout.setColorSchemeColors(getResources().getColor(R.color.primaryColor, null));
|
||||||
|
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||||
|
@Override
|
||||||
|
public void onRefresh() {
|
||||||
|
listOrders.clear();
|
||||||
|
CURRENT_PAGE = 0;
|
||||||
|
|
||||||
|
getOrderUser(CURRENT_PAGE);
|
||||||
|
|
||||||
|
nestedScrollView.setVisibility(View.VISIBLE);
|
||||||
|
empty_layout.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
swipeRefreshLayout.setRefreshing(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,6 +102,7 @@ public class CompleteOrderFragment extends Fragment {
|
|||||||
progressBar = view.findViewById(R.id.progress_bar);
|
progressBar = view.findViewById(R.id.progress_bar);
|
||||||
endOfListText = view.findViewById(R.id.end_of_list_text);
|
endOfListText = view.findViewById(R.id.end_of_list_text);
|
||||||
empty_layout = view.findViewById(R.id.empty_layout);
|
empty_layout = view.findViewById(R.id.empty_layout);
|
||||||
|
swipeRefreshLayout = view.findViewById(R.id.swipe_refresh);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getOrderUser(int page){
|
private void getOrderUser(int page){
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import androidx.core.widget.NestedScrollView;
|
|||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||||
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -45,6 +46,8 @@ public class PreparingFragment extends Fragment {
|
|||||||
private TextView endOfListText;
|
private TextView endOfListText;
|
||||||
private LinearLayout empty_layout;
|
private LinearLayout empty_layout;
|
||||||
|
|
||||||
|
private SwipeRefreshLayout swipeRefreshLayout;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
@@ -54,7 +57,7 @@ public class PreparingFragment extends Fragment {
|
|||||||
//Init Component
|
//Init Component
|
||||||
initComponent(view);
|
initComponent(view);
|
||||||
|
|
||||||
getOrderUser(0);
|
getOrderUser(CURRENT_PAGE);
|
||||||
|
|
||||||
orderAdapter = new OrderAdapter(getContext());
|
orderAdapter = new OrderAdapter(getContext());
|
||||||
|
|
||||||
@@ -74,6 +77,22 @@ public class PreparingFragment extends Fragment {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
swipeRefreshLayout.setColorSchemeColors(getResources().getColor(R.color.primaryColor, null));
|
||||||
|
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||||
|
@Override
|
||||||
|
public void onRefresh() {
|
||||||
|
listOrders.clear();
|
||||||
|
CURRENT_PAGE = 0;
|
||||||
|
|
||||||
|
getOrderUser(CURRENT_PAGE);
|
||||||
|
|
||||||
|
nestedScrollView.setVisibility(View.VISIBLE);
|
||||||
|
empty_layout.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
swipeRefreshLayout.setRefreshing(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,6 +102,7 @@ public class PreparingFragment extends Fragment {
|
|||||||
progressBar = view.findViewById(R.id.progress_bar);
|
progressBar = view.findViewById(R.id.progress_bar);
|
||||||
endOfListText = view.findViewById(R.id.end_of_list_text);
|
endOfListText = view.findViewById(R.id.end_of_list_text);
|
||||||
empty_layout = view.findViewById(R.id.empty_layout);
|
empty_layout = view.findViewById(R.id.empty_layout);
|
||||||
|
swipeRefreshLayout = view.findViewById(R.id.swipe_refresh);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getOrderUser(int page){
|
private void getOrderUser(int page){
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import androidx.core.widget.NestedScrollView;
|
|||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||||
|
|
||||||
import com.capstone.foodify.API.FoodApiToken;
|
import com.capstone.foodify.API.FoodApiToken;
|
||||||
import com.capstone.foodify.Adapter.OrderAdapter;
|
import com.capstone.foodify.Adapter.OrderAdapter;
|
||||||
@@ -44,6 +45,7 @@ public class ProcessOderFragment extends Fragment {
|
|||||||
private ProgressBar progressBar;
|
private ProgressBar progressBar;
|
||||||
private TextView endOfListText;
|
private TextView endOfListText;
|
||||||
private LinearLayout empty_layout;
|
private LinearLayout empty_layout;
|
||||||
|
private SwipeRefreshLayout swipeRefreshLayout;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
@@ -54,10 +56,10 @@ public class ProcessOderFragment extends Fragment {
|
|||||||
//Init Component
|
//Init Component
|
||||||
initComponent(view);
|
initComponent(view);
|
||||||
|
|
||||||
getOrderUser(0);
|
|
||||||
|
|
||||||
orderAdapter = new OrderAdapter(getContext());
|
orderAdapter = new OrderAdapter(getContext());
|
||||||
|
|
||||||
|
getOrderUser(CURRENT_PAGE);
|
||||||
|
|
||||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext(), RecyclerView.VERTICAL, false);
|
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext(), RecyclerView.VERTICAL, false);
|
||||||
recyclerView.setLayoutManager(linearLayoutManager);
|
recyclerView.setLayoutManager(linearLayoutManager);
|
||||||
|
|
||||||
@@ -74,6 +76,23 @@ public class ProcessOderFragment extends Fragment {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
swipeRefreshLayout.setColorSchemeColors(getResources().getColor(R.color.primaryColor, null));
|
||||||
|
|
||||||
|
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||||
|
@Override
|
||||||
|
public void onRefresh() {
|
||||||
|
listOrders.clear();
|
||||||
|
CURRENT_PAGE = 0;
|
||||||
|
|
||||||
|
getOrderUser(CURRENT_PAGE);
|
||||||
|
|
||||||
|
nestedScrollView.setVisibility(View.VISIBLE);
|
||||||
|
empty_layout.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
swipeRefreshLayout.setRefreshing(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,6 +104,7 @@ public class ProcessOderFragment extends Fragment {
|
|||||||
progressBar = view.findViewById(R.id.progress_bar);
|
progressBar = view.findViewById(R.id.progress_bar);
|
||||||
endOfListText = view.findViewById(R.id.end_of_list_text);
|
endOfListText = view.findViewById(R.id.end_of_list_text);
|
||||||
empty_layout = view.findViewById(R.id.empty_layout);
|
empty_layout = view.findViewById(R.id.empty_layout);
|
||||||
|
swipeRefreshLayout = view.findViewById(R.id.swipe_refresh);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getOrderUser(int page){
|
private void getOrderUser(int page){
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import androidx.core.widget.NestedScrollView;
|
|||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||||
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -45,6 +46,7 @@ public class ShipOrderFragment extends Fragment {
|
|||||||
private ProgressBar progressBar;
|
private ProgressBar progressBar;
|
||||||
private TextView endOfListText;
|
private TextView endOfListText;
|
||||||
private LinearLayout empty_layout;
|
private LinearLayout empty_layout;
|
||||||
|
private SwipeRefreshLayout swipeRefreshLayout;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
@@ -55,7 +57,7 @@ public class ShipOrderFragment extends Fragment {
|
|||||||
//Init Component
|
//Init Component
|
||||||
initComponent(view);
|
initComponent(view);
|
||||||
|
|
||||||
getOrderUser(0);
|
getOrderUser(CURRENT_PAGE);
|
||||||
|
|
||||||
orderAdapter = new OrderAdapter(getContext());
|
orderAdapter = new OrderAdapter(getContext());
|
||||||
|
|
||||||
@@ -74,6 +76,23 @@ public class ShipOrderFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
swipeRefreshLayout.setColorSchemeColors(getResources().getColor(R.color.primaryColor, null));
|
||||||
|
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||||
|
@Override
|
||||||
|
public void onRefresh() {
|
||||||
|
listOrders.clear();
|
||||||
|
CURRENT_PAGE = 0;
|
||||||
|
|
||||||
|
getOrderUser(CURRENT_PAGE);
|
||||||
|
|
||||||
|
nestedScrollView.setVisibility(View.VISIBLE);
|
||||||
|
empty_layout.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
swipeRefreshLayout.setRefreshing(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,6 +102,7 @@ public class ShipOrderFragment extends Fragment {
|
|||||||
progressBar = view.findViewById(R.id.progress_bar);
|
progressBar = view.findViewById(R.id.progress_bar);
|
||||||
endOfListText = view.findViewById(R.id.end_of_list_text);
|
endOfListText = view.findViewById(R.id.end_of_list_text);
|
||||||
empty_layout = view.findViewById(R.id.empty_layout);
|
empty_layout = view.findViewById(R.id.empty_layout);
|
||||||
|
swipeRefreshLayout = view.findViewById(R.id.swipe_refresh);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getOrderUser(int page){
|
private void getOrderUser(int page){
|
||||||
|
|||||||
@@ -44,427 +44,436 @@
|
|||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
android:id="@+id/food_detail"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="10dp"
|
||||||
|
android:id="@+id/swipe_refresh"
|
||||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"
|
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"
|
||||||
>
|
>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.core.widget.NestedScrollView
|
||||||
android:id="@+id/content_view"
|
android:id="@+id/food_detail"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
>
|
>
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/linear_layout_1"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
>
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/food_name_text_view"
|
|
||||||
android:textSize="30sp"
|
|
||||||
android:text="Food Name"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:fontFamily="@font/bebas"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_weight="0.8"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="60dp"
|
|
||||||
android:layout_weight="0.2"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/discount"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="-89%"
|
|
||||||
android:textSize="18sp"
|
|
||||||
android:textColor="@color/red"
|
|
||||||
android:layout_gravity="right"
|
|
||||||
/>
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/not_favorite"
|
|
||||||
android:src="@drawable/baseline_favorite_border_24"
|
|
||||||
android:layout_width="30dp"
|
|
||||||
android:layout_height="30dp"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_gravity="right"
|
|
||||||
/>
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/is_favorite"
|
|
||||||
android:src="@drawable/baseline_favorite_24"
|
|
||||||
android:layout_width="30dp"
|
|
||||||
android:layout_height="30dp"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_gravity="right"
|
|
||||||
android:visibility="gone"
|
|
||||||
/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/shop_name_text_view"
|
|
||||||
android:textSize="20sp"
|
|
||||||
android:text="Shop Name"
|
|
||||||
android:textColor="@color/secondary"
|
|
||||||
android:fontFamily="@font/opensans"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/linear_layout_1"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/rating_layout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/shop_name_text_view"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:gravity="center"
|
|
||||||
>
|
|
||||||
|
|
||||||
<com.willy.ratingbar.ScaleRatingBar
|
|
||||||
android:id="@+id/rating_bar"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:srb_starPadding="5dp"
|
|
||||||
app:srb_clickable="false"
|
|
||||||
app:srb_starWidth="22dp"
|
|
||||||
app:srb_starHeight="22dp"
|
|
||||||
app:srb_numStars="5"
|
|
||||||
app:srb_scrollable="false"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/count_rating_text_view"
|
|
||||||
android:textSize="13sp"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="235 đánh giá" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/count_sold"
|
|
||||||
android:textSize="13sp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textAlignment="center"
|
|
||||||
android:text="250 đã bán" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/category"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/rating_layout"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:text="Danh mục:"
|
|
||||||
android:textSize="18sp"
|
|
||||||
android:fontFamily="@font/bebas"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<com.google.android.material.chip.ChipGroup
|
|
||||||
android:id="@+id/list_category"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<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/category"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/content_description_text_view"
|
|
||||||
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"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/constraintLayout"
|
android:id="@+id/content_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="30dp"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/content_description_text_view"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
>
|
>
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/linear_layout_3"
|
android:id="@+id/linear_layout_1"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
android:orientation="vertical"
|
|
||||||
>
|
|
||||||
<TextView
|
|
||||||
android:text="Số lượng"
|
|
||||||
android:fontFamily="@font/bebas"
|
|
||||||
android:textColor="@color/primaryColor"
|
|
||||||
android:textSize="15sp"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<com.mcdev.quantitizerlibrary.HorizontalQuantitizer
|
|
||||||
android:id="@+id/quantity_option"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="-10dp"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/content_description_text_view"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
android:orientation="vertical"
|
|
||||||
>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/total_text_view"
|
|
||||||
android:text="Giá"
|
|
||||||
android:fontFamily="@font/bebas"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="15sp"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="right"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/price"
|
|
||||||
android:text="25.000 VND"
|
|
||||||
android:fontFamily="@font/bebas"
|
|
||||||
android:textColor="@color/primaryColor"
|
|
||||||
android:textSize="30sp"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
|
||||||
android:id="@+id/add_to_basket_button"
|
|
||||||
style="@style/DefaultSolid"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="40dp"
|
|
||||||
android:layout_marginStart="40dp"
|
|
||||||
android:layout_marginEnd="40dp"
|
|
||||||
android:fontFamily="@font/bebas"
|
|
||||||
android:padding="10dp"
|
|
||||||
android:text="Add to basket - 15000 VND"
|
|
||||||
android:textSize="18sp"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/constraintLayout"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<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/add_to_basket_button"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/linear_layout_2"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/add_to_basket_button"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/rating_button"
|
|
||||||
android:text="Bình luận"
|
|
||||||
android:backgroundTint="@color/yellow"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:fontFamily="@font/opensans"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
android:drawableLeft="@drawable/pencil"
|
|
||||||
|
|
||||||
/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:cardElevation="5dp"
|
|
||||||
app:cardUseCompatPadding="true"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/linear_layout_2"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:id="@+id/user_comment_layout"
|
|
||||||
>
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="10dp"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
>
|
>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/user_name_text_view"
|
android:id="@+id/food_name_text_view"
|
||||||
android:text="User A"
|
android:textSize="30sp"
|
||||||
android:fontFamily="@font/opensans"
|
android:text="Food Name"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="16sp"
|
android:fontFamily="@font/bebas"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
android:layout_gravity="center_vertical"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_weight="0.8"
|
||||||
/>
|
|
||||||
|
|
||||||
<com.willy.ratingbar.ScaleRatingBar
|
|
||||||
android:id="@+id/rating_bar_comment"
|
|
||||||
android:layout_width="110dp"
|
|
||||||
android:layout_height="26dp"
|
|
||||||
app:srb_starPadding="5dp"
|
|
||||||
app:srb_clickable="false"
|
|
||||||
app:srb_starWidth="12dp"
|
|
||||||
app:srb_starHeight="12dp"
|
|
||||||
app:srb_numStars="5"
|
|
||||||
app:srb_scrollable="false"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/user_name_text_view"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
android:layout_marginStart="-5dp"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/comment_user"
|
|
||||||
android:text="Food is good!"
|
|
||||||
android:fontFamily="@font/opensans"
|
|
||||||
android:textSize="15sp"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/rating_bar_comment"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="30dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="60dp"
|
||||||
|
android:layout_weight="0.2"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/discount"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="-89%"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textColor="@color/red"
|
||||||
|
android:layout_gravity="right"
|
||||||
|
/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/not_favorite"
|
||||||
|
android:src="@drawable/baseline_favorite_border_24"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_gravity="right"
|
||||||
|
/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/is_favorite"
|
||||||
|
android:src="@drawable/baseline_favorite_24"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_gravity="right"
|
||||||
|
android:visibility="gone"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/shop_name_text_view"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:text="Shop Name"
|
||||||
|
android:textColor="@color/secondary"
|
||||||
|
android:fontFamily="@font/opensans"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/linear_layout_1"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/rating_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/shop_name_text_view"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center"
|
||||||
|
>
|
||||||
|
|
||||||
|
<com.willy.ratingbar.ScaleRatingBar
|
||||||
|
android:id="@+id/rating_bar"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:srb_starPadding="5dp"
|
||||||
|
app:srb_clickable="false"
|
||||||
|
app:srb_starWidth="22dp"
|
||||||
|
app:srb_starHeight="22dp"
|
||||||
|
app:srb_numStars="5"
|
||||||
|
app:srb_scrollable="false"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/count_rating_text_view"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="235 đánh giá" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/count_sold"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:text="250 đã bán" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/category"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/rating_layout"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:text="Danh mục:"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:fontFamily="@font/bebas"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<com.google.android.material.chip.ChipGroup
|
||||||
|
android:id="@+id/list_category"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<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/category"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/content_description_text_view"
|
||||||
|
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"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/constraintLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/content_description_text_view"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/linear_layout_3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:text="Số lượng"
|
||||||
|
android:fontFamily="@font/bebas"
|
||||||
|
android:textColor="@color/primaryColor"
|
||||||
|
android:textSize="15sp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<com.mcdev.quantitizerlibrary.HorizontalQuantitizer
|
||||||
|
android:id="@+id/quantity_option"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="-10dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/content_description_text_view"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
>
|
>
|
||||||
|
|
||||||
<ImageView
|
<TextView
|
||||||
android:src="@drawable/baseline_edit_24"
|
android:id="@+id/total_text_view"
|
||||||
|
android:text="Giá"
|
||||||
|
android:fontFamily="@font/bebas"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="15sp"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0.5"
|
android:layout_gravity="right"
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:id="@+id/edit_button"
|
|
||||||
android:layout_marginBottom="10dp"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ImageView
|
<TextView
|
||||||
android:id="@+id/delete_button"
|
android:id="@+id/price"
|
||||||
android:src="@drawable/baseline_delete_24"
|
android:text="25.000 VND"
|
||||||
|
android:fontFamily="@font/bebas"
|
||||||
|
android:textColor="@color/primaryColor"
|
||||||
|
android:textSize="30sp"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0.5"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/recycler_view_comment"
|
|
||||||
tools:listitem="@layout/item_comment"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/user_comment_layout"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<ProgressBar
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/progress_bar"
|
android:id="@+id/add_to_basket_button"
|
||||||
android:indeterminateTint="@color/primaryColor"
|
style="@style/DefaultSolid"
|
||||||
app:layout_constraintTop_toBottomOf="@id/recycler_view_comment"
|
android:layout_width="match_parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
android:layout_marginTop="40dp"
|
||||||
android:layout_width="wrap_content"
|
android:layout_marginStart="40dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_marginEnd="40dp"
|
||||||
/>
|
android:fontFamily="@font/bebas"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:text="Add to basket - 15000 VND"
|
||||||
|
android:textSize="18sp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/constraintLayout"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<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/add_to_basket_button"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/linear_layout_2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/add_to_basket_button"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/rating_button"
|
||||||
|
android:text="Bình luận"
|
||||||
|
android:backgroundTint="@color/yellow"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:fontFamily="@font/opensans"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:drawableLeft="@drawable/pencil"
|
||||||
|
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:cardElevation="5dp"
|
||||||
|
app:cardUseCompatPadding="true"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/linear_layout_2"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:id="@+id/user_comment_layout"
|
||||||
|
>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/user_name_text_view"
|
||||||
|
android:text="User A"
|
||||||
|
android:fontFamily="@font/opensans"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<com.willy.ratingbar.ScaleRatingBar
|
||||||
|
android:id="@+id/rating_bar_comment"
|
||||||
|
android:layout_width="110dp"
|
||||||
|
android:layout_height="26dp"
|
||||||
|
app:srb_starPadding="5dp"
|
||||||
|
app:srb_clickable="false"
|
||||||
|
app:srb_starWidth="12dp"
|
||||||
|
app:srb_starHeight="12dp"
|
||||||
|
app:srb_numStars="5"
|
||||||
|
app:srb_scrollable="false"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/user_name_text_view"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
android:layout_marginStart="-5dp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/comment_user"
|
||||||
|
android:text="Food is good!"
|
||||||
|
android:fontFamily="@font/opensans"
|
||||||
|
android:textSize="15sp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/rating_bar_comment"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:src="@drawable/baseline_edit_24"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:id="@+id/edit_button"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/delete_button"
|
||||||
|
android:src="@drawable/baseline_delete_24"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recycler_view_comment"
|
||||||
|
tools:listitem="@layout/item_comment"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/user_comment_layout"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/progress_bar"
|
||||||
|
android:indeterminateTint="@color/primaryColor"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/recycler_view_comment"
|
||||||
|
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"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
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.core.widget.NestedScrollView>
|
||||||
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/end_of_list_text"
|
|
||||||
android:text="Đã hết"
|
|
||||||
android:fontFamily="@font/opensans"
|
|
||||||
android:textColor="@color/grayLight"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
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.core.widget.NestedScrollView>
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
@@ -7,51 +7,59 @@
|
|||||||
tools:context=".Fragment.Order.CancelOrderFragment"
|
tools:context=".Fragment.Order.CancelOrderFragment"
|
||||||
>
|
>
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:id="@+id/swipe_refresh"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
android:id="@+id/root_view"
|
|
||||||
>
|
>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
android:id="@+id/list_order"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
tools:listitem="@layout/item_order"
|
android:id="@+id/root_view"
|
||||||
|
>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<ProgressBar
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/progress_bar"
|
android:id="@+id/list_order"
|
||||||
android:indeterminateTint="@color/primaryColor"
|
tools:listitem="@layout/item_order"
|
||||||
app:layout_constraintTop_toBottomOf="@id/list_order"
|
android:layout_width="match_parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
android:layout_width="wrap_content"
|
/>
|
||||||
android:layout_height="wrap_content"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
<ProgressBar
|
||||||
android:id="@+id/end_of_list_text"
|
android:id="@+id/progress_bar"
|
||||||
android:text="Đã hết"
|
android:indeterminateTint="@color/primaryColor"
|
||||||
android:fontFamily="@font/opensans"
|
app:layout_constraintTop_toBottomOf="@id/list_order"
|
||||||
android:textColor="@color/grayLight"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
android:visibility="gone"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/progress_bar"
|
android:layout_width="wrap_content"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
/>
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
android:layout_width="wrap_content"
|
<TextView
|
||||||
android:layout_height="wrap_content"
|
android:id="@+id/end_of_list_text"
|
||||||
/>
|
android:text="Đã hết"
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
android:fontFamily="@font/opensans"
|
||||||
</androidx.core.widget.NestedScrollView>
|
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.core.widget.NestedScrollView>
|
||||||
|
|
||||||
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/empty_layout"
|
android:id="@+id/empty_layout"
|
||||||
|
|||||||
@@ -7,51 +7,59 @@
|
|||||||
tools:context=".Fragment.Order.CompleteOrderFragment"
|
tools:context=".Fragment.Order.CompleteOrderFragment"
|
||||||
>
|
>
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:id="@+id/swipe_refresh"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
android:id="@+id/root_view"
|
|
||||||
>
|
>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
android:id="@+id/list_order"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
tools:listitem="@layout/item_order"
|
android:id="@+id/root_view"
|
||||||
|
>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<ProgressBar
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/progress_bar"
|
android:id="@+id/list_order"
|
||||||
android:indeterminateTint="@color/primaryColor"
|
tools:listitem="@layout/item_order"
|
||||||
app:layout_constraintTop_toBottomOf="@id/list_order"
|
android:layout_width="match_parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
android:layout_width="wrap_content"
|
/>
|
||||||
android:layout_height="wrap_content"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
<ProgressBar
|
||||||
android:id="@+id/end_of_list_text"
|
android:id="@+id/progress_bar"
|
||||||
android:text="Đã hết"
|
android:indeterminateTint="@color/primaryColor"
|
||||||
android:fontFamily="@font/opensans"
|
app:layout_constraintTop_toBottomOf="@id/list_order"
|
||||||
android:textColor="@color/grayLight"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
android:visibility="gone"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/progress_bar"
|
android:layout_width="wrap_content"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
/>
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
android:layout_width="wrap_content"
|
<TextView
|
||||||
android:layout_height="wrap_content"
|
android:id="@+id/end_of_list_text"
|
||||||
/>
|
android:text="Đã hết"
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
android:fontFamily="@font/opensans"
|
||||||
</androidx.core.widget.NestedScrollView>
|
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.core.widget.NestedScrollView>
|
||||||
|
|
||||||
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/empty_layout"
|
android:id="@+id/empty_layout"
|
||||||
|
|||||||
@@ -7,51 +7,59 @@
|
|||||||
tools:context=".Fragment.Order.PreparingFragment"
|
tools:context=".Fragment.Order.PreparingFragment"
|
||||||
>
|
>
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:id="@+id/swipe_refresh"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
android:id="@+id/root_view"
|
|
||||||
>
|
>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
android:id="@+id/list_order"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
tools:listitem="@layout/item_order"
|
android:id="@+id/root_view"
|
||||||
|
>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<ProgressBar
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/progress_bar"
|
android:id="@+id/list_order"
|
||||||
android:indeterminateTint="@color/primaryColor"
|
tools:listitem="@layout/item_order"
|
||||||
app:layout_constraintTop_toBottomOf="@id/list_order"
|
android:layout_width="match_parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
android:layout_width="wrap_content"
|
/>
|
||||||
android:layout_height="wrap_content"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
<ProgressBar
|
||||||
android:id="@+id/end_of_list_text"
|
android:id="@+id/progress_bar"
|
||||||
android:text="Đã hết"
|
android:indeterminateTint="@color/primaryColor"
|
||||||
android:fontFamily="@font/opensans"
|
app:layout_constraintTop_toBottomOf="@id/list_order"
|
||||||
android:textColor="@color/grayLight"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
android:visibility="gone"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/progress_bar"
|
android:layout_width="wrap_content"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
/>
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
android:layout_width="wrap_content"
|
<TextView
|
||||||
android:layout_height="wrap_content"
|
android:id="@+id/end_of_list_text"
|
||||||
/>
|
android:text="Đã hết"
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
android:fontFamily="@font/opensans"
|
||||||
</androidx.core.widget.NestedScrollView>
|
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.core.widget.NestedScrollView>
|
||||||
|
|
||||||
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/empty_layout"
|
android:id="@+id/empty_layout"
|
||||||
|
|||||||
@@ -7,51 +7,59 @@
|
|||||||
tools:context=".Fragment.Order.ProcessOderFragment"
|
tools:context=".Fragment.Order.ProcessOderFragment"
|
||||||
>
|
>
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:id="@+id/swipe_refresh"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
android:id="@+id/root_view"
|
|
||||||
>
|
>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
android:id="@+id/list_order"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
tools:listitem="@layout/item_order"
|
android:id="@+id/root_view"
|
||||||
|
>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<ProgressBar
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/progress_bar"
|
android:id="@+id/list_order"
|
||||||
android:indeterminateTint="@color/primaryColor"
|
tools:listitem="@layout/item_order"
|
||||||
app:layout_constraintTop_toBottomOf="@id/list_order"
|
android:layout_width="match_parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
android:layout_width="wrap_content"
|
/>
|
||||||
android:layout_height="wrap_content"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
<ProgressBar
|
||||||
android:id="@+id/end_of_list_text"
|
android:id="@+id/progress_bar"
|
||||||
android:text="Đã hết"
|
android:indeterminateTint="@color/primaryColor"
|
||||||
android:fontFamily="@font/opensans"
|
app:layout_constraintTop_toBottomOf="@id/list_order"
|
||||||
android:textColor="@color/grayLight"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
android:visibility="gone"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/progress_bar"
|
android:layout_width="wrap_content"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
/>
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
android:layout_width="wrap_content"
|
<TextView
|
||||||
android:layout_height="wrap_content"
|
android:id="@+id/end_of_list_text"
|
||||||
/>
|
android:text="Đã hết"
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
android:fontFamily="@font/opensans"
|
||||||
</androidx.core.widget.NestedScrollView>
|
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.core.widget.NestedScrollView>
|
||||||
|
|
||||||
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/empty_layout"
|
android:id="@+id/empty_layout"
|
||||||
@@ -81,5 +89,4 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -7,51 +7,59 @@
|
|||||||
tools:context=".Fragment.Order.ShipOrderFragment"
|
tools:context=".Fragment.Order.ShipOrderFragment"
|
||||||
>
|
>
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:id="@+id/swipe_refresh"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
android:id="@+id/root_view"
|
|
||||||
>
|
>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
android:id="@+id/list_order"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
tools:listitem="@layout/item_order"
|
android:id="@+id/root_view"
|
||||||
|
>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<ProgressBar
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/progress_bar"
|
android:id="@+id/list_order"
|
||||||
android:indeterminateTint="@color/primaryColor"
|
tools:listitem="@layout/item_order"
|
||||||
app:layout_constraintTop_toBottomOf="@id/list_order"
|
android:layout_width="match_parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
android:layout_width="wrap_content"
|
/>
|
||||||
android:layout_height="wrap_content"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
<ProgressBar
|
||||||
android:id="@+id/end_of_list_text"
|
android:id="@+id/progress_bar"
|
||||||
android:text="Đã hết"
|
android:indeterminateTint="@color/primaryColor"
|
||||||
android:fontFamily="@font/opensans"
|
app:layout_constraintTop_toBottomOf="@id/list_order"
|
||||||
android:textColor="@color/grayLight"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
android:visibility="gone"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/progress_bar"
|
android:layout_width="wrap_content"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
/>
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
android:layout_width="wrap_content"
|
<TextView
|
||||||
android:layout_height="wrap_content"
|
android:id="@+id/end_of_list_text"
|
||||||
/>
|
android:text="Đã hết"
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
android:fontFamily="@font/opensans"
|
||||||
</androidx.core.widget.NestedScrollView>
|
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.core.widget.NestedScrollView>
|
||||||
|
|
||||||
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/empty_layout"
|
android:id="@+id/empty_layout"
|
||||||
|
|||||||
Reference in New Issue
Block a user