mirror of
https://github.com/Nezumi-2711/Foodify-Shipper.git
synced 2026-09-22 13:38:42 +00:00
Update new version
This commit is contained in:
+1
-1
@@ -19,7 +19,7 @@ android {
|
|||||||
minSdk 26
|
minSdk 26
|
||||||
targetSdk 30
|
targetSdk 30
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "0.5.1"
|
versionName "0.5.2"
|
||||||
|
|
||||||
configurations.all {
|
configurations.all {
|
||||||
resolutionStrategy {
|
resolutionStrategy {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"filters": [],
|
"filters": [],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 1,
|
"versionCode": 1,
|
||||||
"versionName": "0.5.1",
|
"versionName": "0.5.2",
|
||||||
"outputFile": "app-release.apk"
|
"outputFile": "app-release.apk"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -58,6 +58,8 @@ import com.google.android.gms.location.SettingsClient;
|
|||||||
import com.google.android.gms.maps.model.LatLng;
|
import com.google.android.gms.maps.model.LatLng;
|
||||||
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.firebase.database.DatabaseReference;
|
||||||
|
import com.google.firebase.database.FirebaseDatabase;
|
||||||
import com.sjapps.library.customdialog.BasicDialog;
|
import com.sjapps.library.customdialog.BasicDialog;
|
||||||
import com.sjapps.library.customdialog.DialogButtonEvents;
|
import com.sjapps.library.customdialog.DialogButtonEvents;
|
||||||
import com.sjapps.library.customdialog.SJDialog;
|
import com.sjapps.library.customdialog.SJDialog;
|
||||||
@@ -119,7 +121,6 @@ public class OrderDetailActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
initComponent();
|
initComponent();
|
||||||
initData();
|
initData();
|
||||||
|
|
||||||
getFCMTokenUser();
|
getFCMTokenUser();
|
||||||
|
|
||||||
|
|
||||||
@@ -142,7 +143,8 @@ public class OrderDetailActivity extends AppCompatActivity {
|
|||||||
btn_shipping.setOnClickListener(new View.OnClickListener() {
|
btn_shipping.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (Common.CURRENT_ORDER == null) {
|
|
||||||
|
startLocationService();
|
||||||
|
|
||||||
//Change order status
|
//Change order status
|
||||||
FoodApiToken.apiService.changeStatusOrder(order.getUser().getId(), order.getId(), "SHIPPING").enqueue(new Callback<CustomResponse>() {
|
FoodApiToken.apiService.changeStatusOrder(order.getUser().getId(), order.getId(), "SHIPPING").enqueue(new Callback<CustomResponse>() {
|
||||||
@@ -156,7 +158,7 @@ public class OrderDetailActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
Common.CURRENT_ORDER = order;
|
Common.CURRENT_ORDER = order;
|
||||||
|
|
||||||
startLocationService();
|
|
||||||
|
|
||||||
Intent intent = new Intent(Intent.ACTION_VIEW,
|
Intent intent = new Intent(Intent.ACTION_VIEW,
|
||||||
Uri.parse("google.navigation:q=" + order.getLat() + "," + order.getLng() + "&mode=l"));
|
Uri.parse("google.navigation:q=" + order.getLat() + "," + order.getLng() + "&mode=l"));
|
||||||
@@ -164,7 +166,7 @@ public class OrderDetailActivity extends AppCompatActivity {
|
|||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
} else {
|
} else {
|
||||||
//If error
|
//If error
|
||||||
Toast.makeText(OrderDetailActivity.this, "", Toast.LENGTH_SHORT).show();
|
Toast.makeText(OrderDetailActivity.this, "Đã có lỗi xảy ra! Mã lỗi: " + response.code(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,9 +175,6 @@ public class OrderDetailActivity extends AppCompatActivity {
|
|||||||
Toast.makeText(OrderDetailActivity.this, Common.ERROR_CONNECT_SERVER, Toast.LENGTH_SHORT).show();
|
Toast.makeText(OrderDetailActivity.this, Common.ERROR_CONNECT_SERVER, Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else{
|
|
||||||
Common.showErrorDialog(OrderDetailActivity.this, "Không thể lấy được thông tin đơn, vui lòng thử lại sau!");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -305,6 +304,14 @@ public class OrderDetailActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
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){
|
||||||
|
|
||||||
|
//Remove position on database
|
||||||
|
FirebaseDatabase database = FirebaseDatabase.getInstance();
|
||||||
|
DatabaseReference orderDatabase = database.getReference("Order");
|
||||||
|
|
||||||
|
orderDatabase.child(order.getOrderTrackingNumber()).removeValue();
|
||||||
|
|
||||||
|
//Show notification
|
||||||
new AestheticDialog.Builder(OrderDetailActivity.this, DialogStyle.TOASTER, DialogType.SUCCESS)
|
new AestheticDialog.Builder(OrderDetailActivity.this, DialogStyle.TOASTER, DialogType.SUCCESS)
|
||||||
.setTitle("THÔNG BÁO!")
|
.setTitle("THÔNG BÁO!")
|
||||||
.setMessage("Đã thay đổi trạng thái đơn thành công!")
|
.setMessage("Đã thay đổi trạng thái đơn thành công!")
|
||||||
@@ -587,6 +594,8 @@ public class OrderDetailActivity extends AppCompatActivity {
|
|||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
|
stopLocationService();
|
||||||
|
|
||||||
if(Common.CURRENT_LOCATION != null){
|
if(Common.CURRENT_LOCATION != null){
|
||||||
changeLayoutButton(Common.CURRENT_LOCATION.getLatitude(), Common.CURRENT_LOCATION.getLongitude());
|
changeLayoutButton(Common.CURRENT_LOCATION.getLatitude(), Common.CURRENT_LOCATION.getLongitude());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ import retrofit2.Response;
|
|||||||
public class CancelOrder extends Fragment {
|
public class CancelOrder extends Fragment {
|
||||||
private static int CURRENT_PAGE = 0;
|
private static int CURRENT_PAGE = 0;
|
||||||
private static final int PAGE_SIZE = 8;
|
private static final int PAGE_SIZE = 8;
|
||||||
private static final String SORT_BY = "id";
|
private static final String SORT_BY = "orderTime";
|
||||||
private static final String SORT_DIR = "asc";
|
private static final String SORT_DIR = "desc";
|
||||||
private static boolean LAST_PAGE = false;
|
private static boolean LAST_PAGE = false;
|
||||||
private final List<Order> listOrders = new ArrayList<>();
|
private final List<Order> listOrders = new ArrayList<>();
|
||||||
RecyclerView recyclerView;
|
RecyclerView recyclerView;
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ import retrofit2.Response;
|
|||||||
public class CompletedOrder extends Fragment {
|
public class CompletedOrder extends Fragment {
|
||||||
private static int CURRENT_PAGE = 0;
|
private static int CURRENT_PAGE = 0;
|
||||||
private static final int PAGE_SIZE = 8;
|
private static final int PAGE_SIZE = 8;
|
||||||
private static final String SORT_BY = "id";
|
private static final String SORT_BY = "orderTime";
|
||||||
private static final String SORT_DIR = "asc";
|
private static final String SORT_DIR = "desc";
|
||||||
private static boolean LAST_PAGE = false;
|
private static boolean LAST_PAGE = false;
|
||||||
private final List<Order> listOrders = new ArrayList<>();
|
private final List<Order> listOrders = new ArrayList<>();
|
||||||
RecyclerView recyclerView;
|
RecyclerView recyclerView;
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ import retrofit2.Response;
|
|||||||
public class ConfirmedOrder extends Fragment {
|
public class ConfirmedOrder extends Fragment {
|
||||||
private static int CURRENT_PAGE = 0;
|
private static int CURRENT_PAGE = 0;
|
||||||
private static final int PAGE_SIZE = 8;
|
private static final int PAGE_SIZE = 8;
|
||||||
private static final String SORT_BY = "id";
|
private static final String SORT_BY = "orderTime";
|
||||||
private static final String SORT_DIR = "asc";
|
private static final String SORT_DIR = "desc";
|
||||||
private static boolean LAST_PAGE = false;
|
private static boolean LAST_PAGE = false;
|
||||||
private final List<Order> listOrders = new ArrayList<>();
|
private final List<Order> listOrders = new ArrayList<>();
|
||||||
RecyclerView recyclerView;
|
RecyclerView recyclerView;
|
||||||
|
|||||||
Reference in New Issue
Block a user