total review
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.example.quiz;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
import android.content.Intent;
|
||||
@@ -373,30 +374,30 @@ public class BetValidation extends Fragment {
|
||||
});
|
||||
|
||||
binding.betValidateBtn.setOnClickListener(v->{
|
||||
if (ActivityCompat.checkSelfPermission(getContext(), android.Manifest.permission.BLUETOOTH_CONNECT) != PackageManager.PERMISSION_GRANTED) {
|
||||
// TODO: Consider calling
|
||||
// ActivityCompat#requestPermissions
|
||||
// here to request the missing permissions, and then overriding
|
||||
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
|
||||
// int[] grantResults)
|
||||
// to handle the case where the user grants the permission. See the documentation
|
||||
// for ActivityCompat#requestPermissions for more details.
|
||||
return;
|
||||
}
|
||||
int paperStatus = Printama.with(getContext()).checkPaperStatus();
|
||||
Log.d("PAPER_STATUS", String.valueOf(paperStatus));
|
||||
switch (paperStatus){
|
||||
case 2 :{
|
||||
MessageDialog.showError(getContext(), "Le papier d'impression est vide");
|
||||
return;
|
||||
}
|
||||
case 1:{
|
||||
MessageDialog.showError(getContext(), "Le papier d'impression est presque vide");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// Log.d("PAPER_STATUS", String.valueOf(ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.BLUETOOTH_CONNECT))+" "+String.valueOf(PackageManager.PERMISSION_GRANTED));
|
||||
// if (ActivityCompat.checkSelfPermission(getContext(), android.Manifest.permission.BLUETOOTH_CONNECT)
|
||||
// != PackageManager.PERMISSION_GRANTED) {
|
||||
// // TODO: Consider calling
|
||||
// // ActivityCompat#requestPermissions
|
||||
// // here to request the missing permissions, and then overriding
|
||||
// // public void onRequestPermissionsResult(int requestCode, String[] permissions,
|
||||
// // int[] grantResults)
|
||||
// // to handle the case where the user grants the permission. See the documentation
|
||||
// // for ActivityCompat#requestPermissions for more details.
|
||||
// return;
|
||||
// }
|
||||
// int paperStatus = Printama.with(getContext()).checkPaperStatus();
|
||||
// switch (paperStatus){
|
||||
// case 2 :{
|
||||
// MessageDialog.showError(getContext(), "Le papier d'impression est vide");
|
||||
// return;
|
||||
// }
|
||||
// case 1:{
|
||||
// MessageDialog.showError(getContext(), "Le papier d'impression est presque vide");
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
if(binding.paymentType.getSelectedItem().toString().equals("Orange Money") && binding.phoneNumber.getText().toString().isEmpty()){
|
||||
MessageDialog.showError(getContext(), "Veuillez saisir le numéro de téléphone");
|
||||
return;
|
||||
@@ -593,8 +594,8 @@ public class BetValidation extends Fragment {
|
||||
case SUCCESS:
|
||||
try {
|
||||
loader.dismiss();
|
||||
logsViewModel.insertLog(prefsHelper.get("id"), "BET", "Création du pari "+pariResult.data.getNumeroTicket()+", type de paris: "+pariResult.data.getTypesParisMises().get(0).getTypePari()+", combinaison:"+selectedHorses.getValue().stream().map(String::valueOf).collect(Collectors.joining("-")), System.currentTimeMillis());
|
||||
printPari(pariResult.data);
|
||||
logsViewModel.insertLog(prefsHelper.get("id"), "BET", "Création du pari "+pariResult.data.getNumeroTicket()+" type de paris: "+pariResult.data.getTypesParisMises().get(0).getTypePari(), System.currentTimeMillis());
|
||||
dialog.dismiss();
|
||||
MessageDialog.showSuccess(getContext(), "Pari créé avec succès");
|
||||
} catch (WriterException e) {
|
||||
|
||||
Reference in New Issue
Block a user