mirror of
https://github.com/Nezumi-2711/Foodify.git
synced 2026-09-22 13:38:41 +00:00
Improve UI
This commit is contained in:
@@ -29,7 +29,7 @@ public interface FoodApi {
|
||||
Gson gson = new GsonBuilder().setDateFormat("HH:mm:ss dd-MM-yyyy").setLenient().create();
|
||||
|
||||
FoodApi apiService = new Retrofit.Builder()
|
||||
.baseUrl("http://192.168.1.183:8080/api/").addConverterFactory(GsonConverterFactory.create(gson))
|
||||
.baseUrl("https://foodify-backend-production.up.railway.app/api/").addConverterFactory(GsonConverterFactory.create(gson))
|
||||
.build()
|
||||
.create(FoodApi.class);
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ public interface FoodApiToken {
|
||||
|
||||
FoodApiToken apiService = new Retrofit.Builder()
|
||||
.client(client)
|
||||
.baseUrl("http://192.168.1.183:8080/api/").addConverterFactory(GsonConverterFactory.create(gson))
|
||||
.baseUrl("https://foodify-backend-production.up.railway.app/api/").addConverterFactory(GsonConverterFactory.create(gson))
|
||||
.build()
|
||||
.create(FoodApiToken.class);
|
||||
|
||||
|
||||
@@ -197,8 +197,6 @@ public class OrderCheckOutActivity extends AppCompatActivity {
|
||||
disableAllInputAddressOption();
|
||||
|
||||
getDistanceAndCalculateShipCost(finalAddress);
|
||||
|
||||
progress_layout.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -221,6 +219,7 @@ public class OrderCheckOutActivity extends AppCompatActivity {
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
progress_layout.setVisibility(View.VISIBLE);
|
||||
|
||||
//Check address is null or not
|
||||
if(finalAddress != null){
|
||||
@@ -255,6 +254,8 @@ public class OrderCheckOutActivity extends AppCompatActivity {
|
||||
}
|
||||
})
|
||||
.show();
|
||||
|
||||
progress_layout.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
});
|
||||
@@ -267,6 +268,7 @@ public class OrderCheckOutActivity extends AppCompatActivity {
|
||||
.setMessage("Huỷ thanh toán thành công!")
|
||||
.setCancelable(true)
|
||||
.show();
|
||||
progress_layout.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -284,6 +286,7 @@ public class OrderCheckOutActivity extends AppCompatActivity {
|
||||
}
|
||||
})
|
||||
.show();
|
||||
progress_layout.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -293,6 +296,7 @@ public class OrderCheckOutActivity extends AppCompatActivity {
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(OrderCheckOutActivity.this, "Bạn chưa chọn địa chỉ!", Toast.LENGTH_SHORT).show();
|
||||
progress_layout.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -362,24 +362,22 @@ public class SignUpActivity extends AppCompatActivity {
|
||||
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);
|
||||
}
|
||||
|
||||
private void loading(){
|
||||
progressLayout.setVisibility(View.VISIBLE);
|
||||
signUpButton.setEnabled(false);
|
||||
}
|
||||
|
||||
private void loadCompleted() {
|
||||
progressLayout.setVisibility(View.GONE);
|
||||
signUpButton.setEnabled(true);
|
||||
}
|
||||
|
||||
private void getListDistrict() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.core.widget.NestedScrollView
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
@@ -7,6 +7,15 @@
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".Activity.SignUpActivity">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:clickable="false"
|
||||
>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
@@ -333,13 +342,17 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#80000000"
|
||||
android:id="@+id/progress_layout"
|
||||
android:visibility="gone"
|
||||
android:clickable="true"
|
||||
android:visibility="visible"
|
||||
>
|
||||
|
||||
<ProgressBar
|
||||
@@ -355,6 +368,4 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user