mirror of
https://github.com/Nezumi-2711/PRM392.git
synced 2026-09-22 13:48:29 +00:00
Fix UI
This commit is contained in:
@@ -10,7 +10,7 @@ android {
|
||||
minSdk 23
|
||||
targetSdk 30
|
||||
versionCode 1
|
||||
versionName "90.0"
|
||||
versionName "93.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RelativeLayout;
|
||||
@@ -310,43 +311,46 @@ public class Cart extends AppCompatActivity implements RecyclerItemTouchHelperLi
|
||||
alertDialog.setView(order_address_comment);
|
||||
alertDialog.setIcon(R.drawable.ic_baseline_shopping_cart_24);
|
||||
|
||||
alertDialog.setPositiveButton("Đặt", new DialogInterface.OnClickListener() {
|
||||
alertDialog.setPositiveButton("Đặt", null);
|
||||
alertDialog.setNegativeButton("Thoát", null);
|
||||
|
||||
AlertDialog d = alertDialog.create();
|
||||
|
||||
d.setOnShowListener(new DialogInterface.OnShowListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
public void onShow(DialogInterface dialog) {
|
||||
Button order = d.getButton(AlertDialog.BUTTON_POSITIVE);
|
||||
|
||||
if (TextUtils.isEmpty(edtAddress.getText().toString())) {
|
||||
Toast.makeText(Cart.this, "Vui lòng nhập địa chỉ giao hàng!", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
//Create new Request
|
||||
Request request = new Request(
|
||||
Common.currentUser.getPhone(),
|
||||
Common.currentUser.getName(),
|
||||
edtAddress.getText().toString(),
|
||||
txtTotalPrice.getText().toString(),
|
||||
"0",
|
||||
edtComment.getText().toString(),
|
||||
"0",
|
||||
cart
|
||||
);
|
||||
|
||||
//Pass object to another activity!
|
||||
Intent intent = new Intent(Cart.this, OrderDetail.class);
|
||||
intent.putExtra("requests", request);
|
||||
startActivity(intent);
|
||||
order.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (TextUtils.isEmpty(edtAddress.getText().toString())) {
|
||||
edtAddress.setError("Vui lòng nhập địa chỉ giao hàng!");
|
||||
} else {
|
||||
//Create new Request
|
||||
Request request = new Request(
|
||||
Common.currentUser.getPhone(),
|
||||
Common.currentUser.getName(),
|
||||
edtAddress.getText().toString(),
|
||||
txtTotalPrice.getText().toString(),
|
||||
"0",
|
||||
edtComment.getText().toString(),
|
||||
"0",
|
||||
cart
|
||||
);
|
||||
|
||||
//Pass object to another activity!
|
||||
Intent intent = new Intent(Cart.this, OrderDetail.class);
|
||||
intent.putExtra("requests", request);
|
||||
startActivity(intent);
|
||||
d.dismiss();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
alertDialog.setNegativeButton("Thoát", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
alertDialog.show();
|
||||
d.show();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@ public class Home extends AppCompatActivity implements NavigationView.OnNavigati
|
||||
.showNotification(false)
|
||||
.showBgdToast(false)
|
||||
.apkVersionName(Common.versionAppNewest + ".0 ")
|
||||
.apkDescription("1. Sửa lỗi đặt hàng!\n2. Cải thiện hiệu suất\n3. Tối ưu giao diện\n4. Cập nhật thư viện app.")
|
||||
.apkDescription("-Sửa lỗi giao diện!")
|
||||
.dialogProgressBarColor(0xFFFF5353)
|
||||
.jumpInstallPage(false)
|
||||
.build();
|
||||
@@ -270,12 +270,7 @@ public class Home extends AppCompatActivity implements NavigationView.OnNavigati
|
||||
}
|
||||
|
||||
private void alertDialogNewest() {
|
||||
// AlertDialog alertDialog = new AlertDialog.Builder(Home.this)
|
||||
// .setTitle("Thông báo!")
|
||||
// .setMessage("Bạn đã cập nhật phiên bản mới nhất!")
|
||||
// .setPositiveButton("Tôi biết rồi", null)
|
||||
// .create();
|
||||
// alertDialog.show();
|
||||
|
||||
final Dialog dialog = new Dialog(Home.this);
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
android:id="@+id/food_price"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:text="1,000"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:fontFamily="@font/regular"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
@@ -110,7 +110,8 @@
|
||||
android:layout_marginRight="12dp"
|
||||
android:layout_marginBottom="18dp"
|
||||
app:textSize="8sp"
|
||||
app:backGroundColor="@color/purple_500"
|
||||
app:textColor="@color/purple_500"
|
||||
app:backGroundColor="@color/white"
|
||||
app:initialNumber="1"
|
||||
app:finalNumber="20"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user