Commit 2a3fce92 authored by fauzi's avatar fauzi

register

parents 64f8dc9a 65083371
<component name="ProjectCodeStyleConfiguration"> <component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173"> <code_scheme name="Project" version="173">
<DBN-PSQL>
<case-options enabled="true">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false" />
</DBN-PSQL>
<DBN-SQL>
<case-options enabled="true">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false">
<option name="STATEMENT_SPACING" value="one_line" />
<option name="CLAUSE_CHOP_DOWN" value="chop_down_if_statement_long" />
<option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" />
</formatting-settings>
</DBN-SQL>
<DBN-PSQL> <DBN-PSQL>
<case-options enabled="true"> <case-options enabled="true">
<option name="KEYWORD_CASE" value="lower" /> <option name="KEYWORD_CASE" value="lower" />
......
...@@ -20,9 +20,11 @@ ...@@ -20,9 +20,11 @@
android:roundIcon="@mipmap/ic_launcher_new_icon" android:roundIcon="@mipmap/ic_launcher_new_icon"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme.appbar"> android:theme="@style/AppTheme.appbar">
<activity <activity android:name=".MethodePayment"/>
android:name=".ForgotPasswordActivity" <activity android:name=".ScannerNfc"/>
android:windowSoftInputMode="adjustResize" /> <activity android:name=".TransactionDetail"/>
<activity android:name=".ForgotPasswordActivity"
android:windowSoftInputMode="adjustResize"></activity>
<activity android:name=".RegisterActivity" /> <activity android:name=".RegisterActivity" />
<activity android:name=".TransactionActivity" /> <activity android:name=".TransactionActivity" />
<activity <activity
......
...@@ -216,10 +216,10 @@ public class CartActivity extends AppCompatActivity { ...@@ -216,10 +216,10 @@ public class CartActivity extends AppCompatActivity {
Log.i("FROM_CHECKOUT_INTENT", "onClick: "+utils.convertGson(paymentsModelsIntent)); Log.i("FROM_CHECKOUT_INTENT", "onClick: "+utils.convertGson(paymentsModelsIntent));
if (paymentsModelsIntent != null){ if (paymentsModelsIntent != null){
Log.i("TAGAAAAA", "onClick: "+utils.convertGson(paymentsModelsIntent)); Log.i("TAGAAAAA", "onClick: "+utils.convertGson(paymentsModelsIntent));
startActivity(new Intent(CartActivity.this, PaymentActivity.class) startActivity(new Intent(CartActivity.this, MethodePayment.class)
.putExtra(CODE_SEND_CHECKOUT_HISTORY, paymentsModelsIntent)); .putExtra(CODE_SEND_CHECKOUT_HISTORY, paymentsModelsIntent));
}else{ }else{
startActivity(new Intent(CartActivity.this, PaymentActivity.class)); startActivity(new Intent(CartActivity.this, MethodePayment.class));
finish(); finish();
} }
} }
......
...@@ -4,9 +4,11 @@ import android.Manifest; ...@@ -4,9 +4,11 @@ import android.Manifest;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.ProgressDialog; import android.app.ProgressDialog;
import android.content.Context;
import android.content.CursorLoader; import android.content.CursorLoader;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences;
import android.database.Cursor; import android.database.Cursor;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
...@@ -78,6 +80,7 @@ public class FormProductActivity extends AppCompatActivity { ...@@ -78,6 +80,7 @@ public class FormProductActivity extends AppCompatActivity {
ProductModels productModelsIntent; ProductModels productModelsIntent;
List<Integer> categorySelect = new ArrayList<>(); List<Integer> categorySelect = new ArrayList<>();
FormCategory formCategory; FormCategory formCategory;
SharedPreferences sharedPreferences;
@RequiresApi(api = Build.VERSION_CODES.N) @RequiresApi(api = Build.VERSION_CODES.N)
@Override @Override
...@@ -92,6 +95,7 @@ public class FormProductActivity extends AppCompatActivity { ...@@ -92,6 +95,7 @@ public class FormProductActivity extends AppCompatActivity {
progressDialog = new ProgressDialog(FormProductActivity.this); progressDialog = new ProgressDialog(FormProductActivity.this);
progressDialog.setMessage("Loading..."); progressDialog.setMessage("Loading...");
progressDialog.show(); progressDialog.show();
sharedPreferences = getSharedPreferences(MainActivity.MY_SHARED_PREFERENCES, Context.MODE_PRIVATE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Window w = getWindow(); Window w = getWindow();
...@@ -101,6 +105,7 @@ public class FormProductActivity extends AppCompatActivity { ...@@ -101,6 +105,7 @@ public class FormProductActivity extends AppCompatActivity {
productModelsIntent = getIntent().getParcelableExtra(MainActivity.DATA_PRODUCT); productModelsIntent = getIntent().getParcelableExtra(MainActivity.DATA_PRODUCT);
formCategory = new FormCategory(); formCategory = new FormCategory();
MaterialToolbar toolbars = findViewById(R.id.topAppBarForm); MaterialToolbar toolbars = findViewById(R.id.topAppBarForm);
setSupportActionBar(toolbars); setSupportActionBar(toolbars);
...@@ -268,6 +273,7 @@ public class FormProductActivity extends AppCompatActivity { ...@@ -268,6 +273,7 @@ public class FormProductActivity extends AppCompatActivity {
.setPositiveButton("Oke", new DialogInterface.OnClickListener() { .setPositiveButton("Oke", new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialogInterface, int i) { public void onClick(DialogInterface dialogInterface, int i) {
MainActivity.status_update = false;
startActivity(new Intent(FormProductActivity.this, MainActivity.class)); startActivity(new Intent(FormProductActivity.this, MainActivity.class));
finish(); finish();
} }
......
...@@ -145,11 +145,6 @@ public class MainActivity extends AppCompatActivity { ...@@ -145,11 +145,6 @@ public class MainActivity extends AppCompatActivity {
productAdapterListener(); productAdapterListener();
categoryAdapterListener(); categoryAdapterListener();
formCategoryListener(); formCategoryListener();
punyaAbiCoba();
}
private void punyaAbiCoba() {
} }
private void toolbarSetOnItemClicked() { private void toolbarSetOnItemClicked() {
...@@ -159,17 +154,12 @@ public class MainActivity extends AppCompatActivity { ...@@ -159,17 +154,12 @@ public class MainActivity extends AppCompatActivity {
int id = item.getItemId(); int id = item.getItemId();
if (id == R.id.menu_cart) { if (id == R.id.menu_cart) {
if (checkout){ if (checkout){
startActivity(new Intent(getApplicationContext(), PaymentActivity.class)); startActivity(new Intent(getApplicationContext(), MethodePayment.class));
}else{ }else{
startActivity(new Intent(getApplicationContext(), CartActivity.class)); startActivity(new Intent(getApplicationContext(), CartActivity.class));
} }
}else if (id == R.id.update){ }else if (id == R.id.update){
status_update = true; status_update = true;
// binding.topAppBar.setVisibility(View.GONE);
// binding.tvCategory.setVisibility(View.GONE);
// binding.rvCategory.setVisibility(View.GONE);
// binding.appBarUpdate.setVisibility(View.VISIBLE);
MaterialToolbar toolbars = findViewById(R.id.topAppBar); MaterialToolbar toolbars = findViewById(R.id.topAppBar);
setSupportActionBar(toolbars); setSupportActionBar(toolbars);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
......
package com.yono.messeripos;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.nfc.NfcAdapter;
import android.os.Build;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.view.Window;
import android.view.WindowManager;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.card.MaterialCardView;
import com.yono.messeripos.models.PaymentsModels;
public class MethodePayment extends AppCompatActivity {
SharedPreferences sharedPreferences;
PaymentsModels paymentsModelsIntent, paymentsModels;
MaterialCardView mcCash, mcBank, mcNfc;
BottomSheets bottomSheet;
NfcAdapter nfcAdapter;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.methode_payment);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Window w = getWindow();
w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
}
nfcAdapter= NfcAdapter.getDefaultAdapter(this);
mcCash = findViewById(R.id.cvCash);
mcBank = findViewById(R.id.cvBankTransfer);
mcNfc = findViewById(R.id.cvNFC);
sharedPreferences = getSharedPreferences(MainActivity.MY_SHARED_PREFERENCES, Context.MODE_PRIVATE);
paymentsModelsIntent = getIntent().getParcelableExtra(CartActivity.CODE_SEND_CHECKOUT_HISTORY);
paymentsModels = new PaymentsModels();
MaterialToolbar toolbars = findViewById(R.id.appBarPaymentMethode);
setSupportActionBar(toolbars);
getSupportActionBar().setTitle("Methode Payment");
if (nfcAdapter == null){
mcNfc.setEnabled(false);
}else{
mcNfc.setEnabled(true);
}
mcCash.setOnClickListener(view -> cash());
mcBank.setOnClickListener(view -> bank());
mcNfc.setOnClickListener(view -> nfc());
}
private void nfc() {
startActivity(new Intent(MethodePayment.this, ScannerNfc.class));
}
private void bank() {
startActivity(new Intent(MethodePayment.this, PaymentActivity.class));
}
private void cash() {
if (paymentsModelsIntent == null){
bottomSheet = new BottomSheets(paymentsModels,0);
bottomSheet.setCancelable(true);
bottomSheet.show(getSupportFragmentManager(),
"ModalBottomSheet");
}else{
bottomSheet = new BottomSheets(paymentsModelsIntent,1);
bottomSheet.setCancelable(true);
bottomSheet.show(getSupportFragmentManager(),
"ModalBottomSheet");
}
}
}
...@@ -62,7 +62,6 @@ public class PaymentActivity extends AppCompatActivity { ...@@ -62,7 +62,6 @@ public class PaymentActivity extends AppCompatActivity {
private Utils utils = new Utils(); private Utils utils = new Utils();
private RecyclerView recyclerView; private RecyclerView recyclerView;
private CheckoutAdapter checkoutAdapter; private CheckoutAdapter checkoutAdapter;
private TextView grandTotal;
public static BottomSheets bottomSheet; public static BottomSheets bottomSheet;
public static PaymentCreated paymentCreated; public static PaymentCreated paymentCreated;
public static SharedPreferences sharedPreferences; public static SharedPreferences sharedPreferences;
...@@ -84,73 +83,79 @@ public class PaymentActivity extends AppCompatActivity { ...@@ -84,73 +83,79 @@ public class PaymentActivity extends AppCompatActivity {
w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
} }
recyclerView = findViewById(R.id.rvPayment);
sharedPreferences = getSharedPreferences(MainActivity.MY_SHARED_PREFERENCES, Context.MODE_PRIVATE); sharedPreferences = getSharedPreferences(MainActivity.MY_SHARED_PREFERENCES, Context.MODE_PRIVATE);
paymentsModelsIntent = getIntent().getParcelableExtra(CartActivity.CODE_SEND_CHECKOUT_HISTORY); paymentsModelsIntent = getIntent().getParcelableExtra(CartActivity.CODE_SEND_CHECKOUT_HISTORY);
paymentsModels = new PaymentsModels(); paymentsModels = new PaymentsModels();
checkoutAdapter = new CheckoutAdapter(); checkoutAdapter = new CheckoutAdapter();
recyclerView = findViewById(R.id.rvItem);
grandTotal = findViewById(R.id.grand_total);
progressDialog = new ProgressDialog(PaymentActivity.this); progressDialog = new ProgressDialog(PaymentActivity.this);
progressDialog.setMessage("Loading..."); progressDialog.setMessage("Loading...");
progressDialog.setCancelable(false); progressDialog.setCancelable(false);
MaterialToolbar toolbars = findViewById(R.id.appbar); MaterialToolbar toolbars = findViewById(R.id.appbar);
setSupportActionBar(toolbars); setSupportActionBar(toolbars);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setTitle("Bank Transfer");
toolbars.setNavigationOnClickListener(view -> onBackPressed());
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(this, DividerItemDecoration.VERTICAL); DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(this, DividerItemDecoration.VERTICAL);
mainViewModels = new ViewModelProvider(PaymentActivity.this).get(MainViewModelsCart.class); mainViewModels = new ViewModelProvider(PaymentActivity.this).get(MainViewModelsCart.class);
Log.i("IN_HISTORY", "onCreate: "+utils.convertGson(paymentsModelsIntent)); Log.i("IN_HISTORY", "onCreate: "+utils.convertGson(paymentsModelsIntent));
if (paymentsModelsIntent == null){ // if (paymentsModelsIntent == null){
mainViewModels.getCartById(sharedPreferences.getString(ORDER_ID, "")).observe(this, new Observer<List<ProductCartModels>>() { // mainViewModels.getCartById(sharedPreferences.getString(ORDER_ID, "")).observe(this, new Observer<List<ProductCartModels>>() {
@Override // @Override
public void onChanged(List<ProductCartModels> productCartModels) { // public void onChanged(List<ProductCartModels> productCartModels) {
String js = new Gson().toJson(productCartModels); // String js = new Gson().toJson(productCartModels);
Log.i("On payment", "onChanged: "+js); // Log.i("On payment", "onChanged: "+js);
//
for (ProductCartModels pd : productCartModels){ // for (ProductCartModels pd : productCartModels){
total = total + pd.getPrice_orders()*pd.getQuantity_orders(); // total = total + pd.getPrice_orders()*pd.getQuantity_orders();
} // }
//
if (productCartModels.size() !=0){ // if (productCartModels.size() !=0){
getSupportActionBar().setTitle(productCartModels.get(0).getId_orders()); // getSupportActionBar().setTitle(productCartModels.get(0).getId_orders());
paymentsModels.setOrderId(productCartModels.get(0).getId_orders()); // paymentsModels.setOrderId(productCartModels.get(0).getId_orders());
paymentsModels.setGrossAmount(total); // paymentsModels.setGrossAmount(total);
checkoutAdapter.setCheckoutAdapter(PaymentActivity.this, productCartModels); // checkoutAdapter.setCheckoutAdapter(PaymentActivity.this, productCartModels);
recyclerView.setLayoutManager(new LinearLayoutManager(PaymentActivity.this, RecyclerView.VERTICAL, false)); // recyclerView.setLayoutManager(new LinearLayoutManager(PaymentActivity.this, RecyclerView.VERTICAL, false));
recyclerView.setAdapter(checkoutAdapter); // recyclerView.setAdapter(checkoutAdapter);
recyclerView.addItemDecoration(dividerItemDecoration); // recyclerView.addItemDecoration(dividerItemDecoration);
grandTotal.setText(utils.convertPrice("Rp. ", total)); //// grandTotal.setText(utils.convertPrice("Rp. ", total));
} // }
} // }
}); // });
}else{ // }else{
mainViewModels.getCartById(paymentsModelsIntent.getOrderId()).observe(this, new Observer<List<ProductCartModels>>() { // mainViewModels.getCartById(paymentsModelsIntent.getOrderId()).observe(this, new Observer<List<ProductCartModels>>() {
@Override // @Override
public void onChanged(List<ProductCartModels> productCartModels) { // public void onChanged(List<ProductCartModels> productCartModels) {
String js = new Gson().toJson(productCartModels); // String js = new Gson().toJson(productCartModels);
Log.i("On Intent_CHANGE", "onChanged: "+paymentsModelsIntent.getOrderId()); // Log.i("On Intent_CHANGE", "onChanged: "+paymentsModelsIntent.getOrderId());
//
for (ProductCartModels pd : productCartModels){ // for (ProductCartModels pd : productCartModels){
total = total + pd.getPrice_orders()*pd.getQuantity_orders(); // total = total + pd.getPrice_orders()*pd.getQuantity_orders();
} // }
//
if (productCartModels.size() != 0){ // if (productCartModels.size() != 0){
getSupportActionBar().setTitle(productCartModels.get(0).getId_orders()); // getSupportActionBar().setTitle(productCartModels.get(0).getId_orders());
paymentsModelsIntent.setOrderId(productCartModels.get(0).getId_orders()); // paymentsModelsIntent.setOrderId(productCartModels.get(0).getId_orders());
paymentsModelsIntent.setGrossAmount(total); // paymentsModelsIntent.setGrossAmount(total);
checkoutAdapter.setCheckoutAdapter(PaymentActivity.this, productCartModels); // checkoutAdapter.setCheckoutAdapter(PaymentActivity.this, productCartModels);
recyclerView.setLayoutManager(new LinearLayoutManager(PaymentActivity.this, RecyclerView.VERTICAL, false)); // recyclerView.setLayoutManager(new LinearLayoutManager(PaymentActivity.this, RecyclerView.VERTICAL, false));
recyclerView.setAdapter(checkoutAdapter); // recyclerView.setAdapter(checkoutAdapter);
recyclerView.addItemDecoration(dividerItemDecoration); // recyclerView.addItemDecoration(dividerItemDecoration);
grandTotal.setText(utils.convertPrice("Rp. ", total)); //// grandTotal.setText(utils.convertPrice("Rp. ", total));
} // }
//
} // }
}); // });
} // }
bottomSheet = new BottomSheets(paymentsModels,0); bottomSheet = new BottomSheets(paymentsModels,0);
...@@ -159,11 +164,11 @@ public class PaymentActivity extends AppCompatActivity { ...@@ -159,11 +164,11 @@ public class PaymentActivity extends AppCompatActivity {
LinearLayoutManager llm = new LinearLayoutManager(this, RecyclerView.VERTICAL, false); LinearLayoutManager llm = new LinearLayoutManager(this, RecyclerView.VERTICAL, false);
rvPayment.setLayoutManager(llm); rvPayment.setLayoutManager(llm);
paymentResponses.add(new PaymentResponse("https://i.ibb.co/5c40mWX/cash-logo.png", "cash")); // paymentResponses.add(new PaymentResponse("https://i.ibb.co/5c40mWX/cash-logo.png", "cash"));
paymentResponses.add(new PaymentResponse("https://i.ibb.co/XCsdmmT/Bank-Mandiri-logo.png", "mandiri")); paymentResponses.add(new PaymentResponse("https://i.ibb.co/XCsdmmT/Bank-Mandiri-logo.png", "mandiri"));
paymentResponses.add(new PaymentResponse("https://i.ibb.co/2n65nCT/bca-bank-central-asia.png", "bca")); paymentResponses.add(new PaymentResponse("https://i.ibb.co/2n65nCT/bca-bank-central-asia.png", "bca"));
paymentResponses.add(new PaymentResponse("https://i.ibb.co/RjJQT9K/BNI-logo.png", "bni")); paymentResponses.add(new PaymentResponse("https://i.ibb.co/RjJQT9K/BNI-logo.png", "bni"));
paymentResponses.add(new PaymentResponse("https://i.ibb.co/n1V3ZCf/Whats-App-Image-2020-09-01-at-14-50-13.jpg", "nfc")); // paymentResponses.add(new PaymentResponse("https://i.ibb.co/n1V3ZCf/Whats-App-Image-2020-09-01-at-14-50-13.jpg", "nfc"));
PaymentAdapter adapter = new PaymentAdapter(paymentResponses, this); PaymentAdapter adapter = new PaymentAdapter(paymentResponses, this);
rvPayment.setAdapter(adapter); rvPayment.setAdapter(adapter);
...@@ -172,170 +177,164 @@ public class PaymentActivity extends AppCompatActivity { ...@@ -172,170 +177,164 @@ public class PaymentActivity extends AppCompatActivity {
adapter.setListener(paymentResponse -> { adapter.setListener(paymentResponse -> {
methodPay = paymentResponse.getBank(); methodPay = paymentResponse.getBank();
btnPay.setEnabled(true); startActivity(new Intent(PaymentActivity.this, TransactionDetail.class));
// btnPay.setEnabled(true);
}); });
btnPay.setOnClickListener(new View.OnClickListener() { // btnPay.setOnClickListener(new View.OnClickListener() {
@Override // @Override
public void onClick(View view) { // public void onClick(View view) {
if (methodPay.equals("cash")){ // if (methodPay.equals("cash")){
paymentsModels.setPaymentType("cash"); // paymentsModels.setPaymentType("cash");
paymentsModels.setTransactionStatus("success"); // paymentsModels.setTransactionStatus("success");
paymentsModels.setTransaction_id(utils.timeStamp()+"-MES"); // paymentsModels.setTransaction_id(utils.timeStamp()+"-MES");
paymentsModels.setTransaction_time(utils.timeStamp()); // paymentsModels.setTransaction_time(utils.timeStamp());
Log.i("CASH", "onClick: "+utils.convertGson(paymentsModels)); // Log.i("CASH", "onClick: "+utils.convertGson(paymentsModels));
//
if (paymentsModelsIntent == null){ // if (paymentsModelsIntent == null){
bottomSheet = new BottomSheets(paymentsModels,0); // bottomSheet = new BottomSheets(paymentsModels,0);
bottomSheet.setCancelable(true); // bottomSheet.setCancelable(true);
bottomSheet.show(getSupportFragmentManager(), // bottomSheet.show(getSupportFragmentManager(),
"ModalBottomSheet"); // "ModalBottomSheet");
}else{ // }else{
bottomSheet = new BottomSheets(paymentsModelsIntent,1); // bottomSheet = new BottomSheets(paymentsModelsIntent,1);
bottomSheet.setCancelable(true); // bottomSheet.setCancelable(true);
bottomSheet.show(getSupportFragmentManager(), // bottomSheet.show(getSupportFragmentManager(),
"ModalBottomSheet"); // "ModalBottomSheet");
} // }
//
}else{ // }else{
//
progressDialog.show();
progressDialog.setCancelable(false);
// bottomSheetBank.setState(BottomSheetBehavior.STATE_EXPANDED);
// progressDialog.show(); // progressDialog.show();
Client client = new Client(); // progressDialog.setCancelable(false);
paymentsModels.setPaymentType("bank_transfer"); //// bottomSheetBank.setState(BottomSheetBehavior.STATE_EXPANDED);
paymentsModels.setBank(methodPay); //// progressDialog.show();
paymentsModels.setOrderIdUpdate(sharedPreferences.getString(ORDER_ID,"")); // Client client = new Client();
paymentsModels.setOrderId(sharedPreferences.getString(ORDER_ID, "")); // paymentsModels.setPaymentType("bank_transfer");
paymentsModels.setTransactionStatus("success"); // paymentsModels.setBank(methodPay);
paymentsModels.setTransaction_id(utils.timeStamp()+"-MES"); // paymentsModels.setOrderIdUpdate(sharedPreferences.getString(ORDER_ID,""));
paymentsModels.setTransaction_time(utils.timeStamp()); // paymentsModels.setOrderId(sharedPreferences.getString(ORDER_ID, ""));
Log.i("BANK", "onClick: "+utils.convertGson(paymentsModels)); // paymentsModels.setTransactionStatus("success");
PaymentService paymentService = client.Client(PaymentService.class); // paymentsModels.setTransaction_id(utils.timeStamp()+"-MES");
// paymentsModels.setTransaction_time(utils.timeStamp());
if (paymentsModelsIntent == null){ // Log.i("BANK", "onClick: "+utils.convertGson(paymentsModels));
paymentService.postFromCart(paymentsModels).enqueue(new Callback<DataResponse<PaymentsModels<List<VaNumberModels>>>>() { // PaymentService paymentService = client.Client(PaymentService.class);
@Override //
public void onResponse(Call<DataResponse<PaymentsModels<List<VaNumberModels>>>> call, Response<DataResponse<PaymentsModels<List<VaNumberModels>>>> response) { // if (paymentsModelsIntent == null){
Log.i("Paymen_bank", "onResponse: "+utils.convertGson(response.body())); // paymentService.postFromCart(paymentsModels).enqueue(new Callback<DataResponse<PaymentsModels<List<VaNumberModels>>>>() {
// @Override
if (response.body() != null){ // public void onResponse(Call<DataResponse<PaymentsModels<List<VaNumberModels>>>> call, Response<DataResponse<PaymentsModels<List<VaNumberModels>>>> response) {
SharedPreferences.Editor editor = sharedPreferences.edit(); // Log.i("Paymen_bank", "onResponse: "+utils.convertGson(response.body()));
editor.putString(ORDER_ID, ""); //
editor.putBoolean(CHECKOUT, false); // if (response.body() != null){
progressDialog.dismiss(); // SharedPreferences.Editor editor = sharedPreferences.edit();
if (editor.commit()){ // editor.putString(ORDER_ID, "");
paymentCreated = new PaymentCreated(); // editor.putBoolean(CHECKOUT, false);
paymentCreated.setCancelable(false); // progressDialog.dismiss();
paymentCreated.show( // if (editor.commit()){
getSupportFragmentManager(), // paymentCreated = new PaymentCreated();
"paymentCreated" // paymentCreated.setCancelable(false);
); // paymentCreated.show(
} // getSupportFragmentManager(),
}else{ // "paymentCreated"
progressDialog.dismiss(); // );
new AlertDialog.Builder(PaymentActivity.this) // }
.setTitle("Payment Order") // }else{
.setMessage("Erorr save!").show(); // progressDialog.dismiss();
} // new AlertDialog.Builder(PaymentActivity.this)
} // .setTitle("Payment Order")
// .setMessage("Erorr save!").show();
@Override // }
public void onFailure(Call<DataResponse<PaymentsModels<List<VaNumberModels>>>> call, Throwable t) { // }
progressDialog.dismiss(); //
new AlertDialog.Builder(PaymentActivity.this) // @Override
.setCancelable(false) // public void onFailure(Call<DataResponse<PaymentsModels<List<VaNumberModels>>>> call, Throwable t) {
.setTitle("Payment Order") // progressDialog.dismiss();
.setMessage("Add new payment failed, try again!").show(); // new AlertDialog.Builder(PaymentActivity.this)
} // .setCancelable(false)
}); // .setTitle("Payment Order")
}else{ // .setMessage("Add new payment failed, try again!").show();
paymentService.postFromCartPending(paymentsModelsIntent.getOrderId(), paymentsModelsIntent).enqueue(new Callback<DataResponse>() { // }
@Override // });
public void onResponse(Call<DataResponse> call, // }else{
Response<DataResponse> response) { // paymentService.postFromCartPending(paymentsModelsIntent.getOrderId(), paymentsModelsIntent).enqueue(new Callback<DataResponse>() {
Log.i("Paymen_bank_sa", "onResponse: "+utils.convertGson(response.body())); // @Override
// public void onResponse(Call<DataResponse> call,
if (response.body() != null){ // Response<DataResponse> response) {
SharedPreferences.Editor editor = sharedPreferences.edit(); // Log.i("Paymen_bank_sa", "onResponse: "+utils.convertGson(response.body()));
editor.putString(ORDER_ID, ""); //
editor.putBoolean(CHECKOUT, false); // if (response.body() != null){
progressDialog.dismiss(); // SharedPreferences.Editor editor = sharedPreferences.edit();
if (editor.commit()){ // editor.putString(ORDER_ID, "");
paymentCreated = new PaymentCreated(); // editor.putBoolean(CHECKOUT, false);
paymentCreated.setCancelable(false); // progressDialog.dismiss();
paymentCreated.show( // if (editor.commit()){
getSupportFragmentManager(), // paymentCreated = new PaymentCreated();
"QRCode" // paymentCreated.setCancelable(false);
); // paymentCreated.show(
} // getSupportFragmentManager(),
}else{ // "QRCode"
progressDialog.dismiss(); // );
new AlertDialog.Builder(PaymentActivity.this) // }
.setTitle("Payment Order") // }else{
.setMessage("Erorr save!").show(); // progressDialog.dismiss();
} // new AlertDialog.Builder(PaymentActivity.this)
} // .setTitle("Payment Order")
// .setMessage("Erorr save!").show();
@Override // }
public void onFailure(Call<DataResponse> call, Throwable t) { // }
progressDialog.dismiss(); //
new AlertDialog.Builder(PaymentActivity.this) // @Override
.setCancelable(false) // public void onFailure(Call<DataResponse> call, Throwable t) {
.setTitle("Payment Order") // progressDialog.dismiss();
.setMessage("Add new payment failed, try again!").show(); // new AlertDialog.Builder(PaymentActivity.this)
} // .setCancelable(false)
}); // .setTitle("Payment Order")
} // .setMessage("Add new payment failed, try again!").show();
// }
} // });
} // }
}); //
// }
bottomSheet.setListener(new BottomSheets.CashListener() { // }
@Override // });
public void onCash(PaymentsModels paymentsModels) {
progressDialog.show(); // bottomSheet.setListener(new BottomSheets.CashListener() {
Client client = new Client(); // @Override
PaymentsModels paymentsModels1 = new PaymentsModels( // public void onCash(PaymentsModels paymentsModels) {
MainActivity.orderId, // progressDialog.show();
"cash", // Client client = new Client();
"none", // PaymentsModels paymentsModels1 = new PaymentsModels(
grossAmount // MainActivity.orderId,
); // "cash",
// "none",
PaymentService paymentService = client.Client(PaymentService.class); // grossAmount
paymentService.postFromCart(paymentsModels1).enqueue(new Callback<DataResponse<PaymentsModels<List<VaNumberModels>>>>() { // );
@Override //
public void onResponse(Call<DataResponse<PaymentsModels<List<VaNumberModels>>>> call, // PaymentService paymentService = client.Client(PaymentService.class);
Response<DataResponse<PaymentsModels<List<VaNumberModels>>>> response) { // paymentService.postFromCart(paymentsModels1).enqueue(new Callback<DataResponse<PaymentsModels<List<VaNumberModels>>>>() {
if (response.body() != null){ // @Override
progressDialog.dismiss(); // public void onResponse(Call<DataResponse<PaymentsModels<List<VaNumberModels>>>> call,
SharedPreferences.Editor editor = sharedPreferences.edit(); // Response<DataResponse<PaymentsModels<List<VaNumberModels>>>> response) {
editor.putBoolean(CHECKOUT, false); // if (response.body() != null){
editor.putString(orderId, ""); // progressDialog.dismiss();
if (editor.commit()){ // SharedPreferences.Editor editor = sharedPreferences.edit();
startActivity(new Intent(PaymentActivity.this, MainActivity.class)); // editor.putBoolean(CHECKOUT, false);
} // editor.putString(orderId, "");
} // if (editor.commit()){
} // startActivity(new Intent(PaymentActivity.this, MainActivity.class));
// }
@Override // }
public void onFailure(Call<DataResponse<PaymentsModels<List<VaNumberModels>>>> call, Throwable t) { // }
//
} // @Override
}); // public void onFailure(Call<DataResponse<PaymentsModels<List<VaNumberModels>>>> call, Throwable t) {
} //
}); // }
// });
} // }
// });
@Override
public void onBackPressed() {
super.onBackPressed();
startActivity(new Intent(PaymentActivity.this, MainActivity.class));
finish();
} }
public void savePaymentSuccess(){ public void savePaymentSuccess(){
......
...@@ -14,6 +14,7 @@ import android.text.TextWatcher; ...@@ -14,6 +14,7 @@ import android.text.TextWatcher;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
...@@ -44,6 +45,7 @@ import retrofit2.Response; ...@@ -44,6 +45,7 @@ import retrofit2.Response;
public class RegisterState extends BottomSheetDialogFragment { public class RegisterState extends BottomSheetDialogFragment {
private static final String TAG = "RegisterState"; private static final String TAG = "RegisterState";
private static String DEFAULT_REGISTER = "CREATE ACCOUNT";
BottomSheetBehavior sheetBehavior2; BottomSheetBehavior sheetBehavior2;
BottomSheetDialog sheetDialog2; BottomSheetDialog sheetDialog2;
RelativeLayout registerLayout; RelativeLayout registerLayout;
...@@ -53,10 +55,9 @@ public class RegisterState extends BottomSheetDialogFragment { ...@@ -53,10 +55,9 @@ public class RegisterState extends BottomSheetDialogFragment {
Context context; Context context;
MainViewModels mainViewModels; MainViewModels mainViewModels;
SharedPreferences sharedPreferences; SharedPreferences sharedPreferences;
ProgressBar pbReg;
Utils utils; Utils utils;
String busername,bemail,bpassword,brepassword;
public RegisterState(Context context, MainViewModels mainViewModels) { public RegisterState(Context context, MainViewModels mainViewModels) {
this.context = context; this.context = context;
this.mainViewModels = mainViewModels; this.mainViewModels = mainViewModels;
...@@ -79,6 +80,7 @@ public class RegisterState extends BottomSheetDialogFragment { ...@@ -79,6 +80,7 @@ public class RegisterState extends BottomSheetDialogFragment {
repassword = view.findViewById(R.id.ETRePasswordReg); repassword = view.findViewById(R.id.ETRePasswordReg);
registerButton = view.findViewById(R.id.MBRegister); registerButton = view.findViewById(R.id.MBRegister);
closeBtn = view.findViewById(R.id.ivclose); closeBtn = view.findViewById(R.id.ivclose);
pbReg = view.findViewById(R.id.progressReg);
// create session // create session
sharedPreferences = context.getSharedPreferences(SplashScreen.MY_SHARED_PREFERENCES, Context.MODE_PRIVATE); sharedPreferences = context.getSharedPreferences(SplashScreen.MY_SHARED_PREFERENCES, Context.MODE_PRIVATE);
...@@ -87,6 +89,7 @@ public class RegisterState extends BottomSheetDialogFragment { ...@@ -87,6 +89,7 @@ public class RegisterState extends BottomSheetDialogFragment {
utils = new Utils(); utils = new Utils();
sheetDialog2.setContentView(view); sheetDialog2.setContentView(view);
pbReg.setVisibility(View.GONE);
sheetBehavior2 = BottomSheetBehavior.from((View) (view.getParent())); sheetBehavior2 = BottomSheetBehavior.from((View) (view.getParent()));
...@@ -108,20 +111,20 @@ public class RegisterState extends BottomSheetDialogFragment { ...@@ -108,20 +111,20 @@ public class RegisterState extends BottomSheetDialogFragment {
@Override @Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
if (TextUtils.isEmpty(username.getText().toString()) && if (TextUtils.isEmpty(username.getText().toString()) &&
TextUtils.isEmpty(email.getText().toString()) && TextUtils.isEmpty(password.getText().toString()) && TextUtils.isEmpty(repassword.getText().toString())){ TextUtils.isEmpty(email.getText().toString()) && TextUtils.isEmpty(password.getText().toString()) && TextUtils.isEmpty(repassword.getText().toString())) {
username.setError("This field can't empty"); username.setError("This field can't empty");
email.setError("This field can't empty"); email.setError("This field can't empty");
password.setError("This field can't empty"); password.setError("This field can't empty");
repassword.setError("This field can't empty"); repassword.setError("This field can't empty");
}else if (TextUtils.isEmpty(username.getText().toString())){ } else if (TextUtils.isEmpty(username.getText().toString())) {
username.setError("This field can't empty"); username.setError("This field can't empty");
}else if (TextUtils.isEmpty(email.getText().toString())){ } else if (TextUtils.isEmpty(email.getText().toString())) {
email.setError("This field can't empty"); email.setError("This field can't empty");
}else if (TextUtils.isEmpty(password.getText().toString())){ } else if (TextUtils.isEmpty(password.getText().toString())) {
password.setError("This field can't empty"); password.setError("This field can't empty");
}else if (TextUtils.isEmpty(repassword.getText().toString())){ } else if (TextUtils.isEmpty(repassword.getText().toString())) {
repassword.setError("This field can't empty"); repassword.setError("This field can't empty");
}else if (!utils.isValidEmail(charSequence.toString())){ } else if (!utils.isValidEmail(charSequence.toString())) {
email.setError("Please enter the correct email format"); email.setError("Please enter the correct email format");
} }
...@@ -142,7 +145,14 @@ public class RegisterState extends BottomSheetDialogFragment { ...@@ -142,7 +145,14 @@ public class RegisterState extends BottomSheetDialogFragment {
@Override @Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
if (!utils.isValidPassword(charSequence.toString())){
if (TextUtils.isEmpty(username.getText().toString()) &&
TextUtils.isEmpty(email.getText().toString()) && TextUtils.isEmpty(password.getText().toString()) && TextUtils.isEmpty(repassword.getText().toString())) {
username.setError("This field can't empty");
email.setError("This field can't empty");
password.setError("This field can't empty");
repassword.setError("This field can't empty");
} else if (!utils.isValidPassword(charSequence.toString())) {
password.setError("Password Must Be 8 Character"); password.setError("Password Must Be 8 Character");
} }
} }
...@@ -159,27 +169,25 @@ public class RegisterState extends BottomSheetDialogFragment { ...@@ -159,27 +169,25 @@ public class RegisterState extends BottomSheetDialogFragment {
public void onClick(View view) { public void onClick(View view) {
mainViewModels.postRegis( mainViewModels.postRegis(
new UsersModels(username.getText().toString(), new UsersModels(username.getText().toString(),
email.getText().toString(),password.getText().toString(), email.getText().toString(), password.getText().toString(),
repassword.getText().toString())).observe(lifecycleOwner, new Observer<DataResponse<UsersModels>>() { repassword.getText().toString())).observe(lifecycleOwner, new Observer<DataResponse<UsersModels>>() {
@Override @Override
public void onChanged(DataResponse<UsersModels> usersModelsDataResponse) { public void onChanged(DataResponse<UsersModels> usersModelsDataResponse) {
/** /**
* TAMABHAKN RESPONSE DLUH AGAR ADA PROGRESS DIALOGNYA * RESPONSE AGAR ADA PROGRESS DIALOGNYA
* KETIKA RESPONNYA SUCCESS MAKA PROGRESS DIalog diSMISS * KETIKA RESPONNYA SUCCESS MAKA PROGRESS DIalog diSMISS
* DAN ALERT ACTIVATE MUNCUL * DAN ALERT ACTIVATE MUNCUL
* */ * */
setAllLayoutToFalse();
if (usersModelsDataResponse != null) {
final View customLayout = getLayoutInflater()
.inflate(R.layout.alert_dialog, null);
activateEmail(customLayout);
setAllLayoutToTrue();
}
} }
}); });
/**
* Jika tombol sign up ditekan
*
*
* kembali ke halaman login utama dengan Snackbar Cek Email
*
* Pakai bahasa inggris ya untuk responnya
*
* */
registerButton.setEnabled(false);
} }
}); });
...@@ -193,7 +201,36 @@ public class RegisterState extends BottomSheetDialogFragment { ...@@ -193,7 +201,36 @@ public class RegisterState extends BottomSheetDialogFragment {
return sheetDialog2; return sheetDialog2;
} }
<<<<<<< HEAD
private void activateEmail() { private void activateEmail() {
=======
private void
setAllLayoutToTrue() {
pbReg.setVisibility(View.GONE);
registerButton.setText(DEFAULT_REGISTER);
sheetDialog2.setCancelable(true);
username.setEnabled(true);
email.setEnabled(true);
password.setEnabled(true);
repassword.setEnabled(true);
registerButton.setEnabled(true);
closeBtn.setEnabled(true);
}
private void setAllLayoutToFalse() {
pbReg.setVisibility(View.VISIBLE);
registerButton.setText("");
sheetDialog2.setCancelable(false);
username.setEnabled(false);
password.setEnabled(false);
registerButton.setEnabled(false);
closeBtn.setEnabled(false);
}
private void activateEmail(View customLayout) {
>>>>>>> dev
utils = new Utils(); utils = new Utils();
utils.dialog(context, false, "Please Verifiy Email", utils.dialog(context, false, "Please Verifiy Email",
...@@ -203,7 +240,10 @@ public class RegisterState extends BottomSheetDialogFragment { ...@@ -203,7 +240,10 @@ public class RegisterState extends BottomSheetDialogFragment {
utils.setListener(new Utils.DialogListener() { utils.setListener(new Utils.DialogListener() {
@Override @Override
public void onClickDisimiss(AlertDialog alertDialog) { public void onClickDisimiss(AlertDialog alertDialog) {
alertDialog.dismiss(); alertDialog.dismiss();
sheetDialog2.dismiss();
} }
@Override @Override
...@@ -216,6 +256,4 @@ public class RegisterState extends BottomSheetDialogFragment { ...@@ -216,6 +256,4 @@ public class RegisterState extends BottomSheetDialogFragment {
} }
}); });
} }
} }
package com.yono.messeripos;
import android.app.PendingIntent;
import android.app.ProgressDialog;
import android.content.Intent;
import android.nfc.NdefMessage;
import android.nfc.NdefRecord;
import android.nfc.NfcAdapter;
import android.nfc.Tag;
import android.nfc.tech.MifareClassic;
import android.nfc.tech.MifareUltralight;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Parcelable;
import android.os.PersistableBundle;
import android.provider.Settings;
import android.util.Log;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ProgressBar;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.yono.messeripos.R;
import com.yono.messeripos.nfc.parser.NdefMessageParser;
import com.yono.messeripos.nfc.record.ParsedNdefRecord;
import com.yono.messeripos.utils.Utils;
import java.util.List;
public class ScannerNfc extends AppCompatActivity {
PendingIntent pendingIntent;
NfcAdapter nfcAdapter;
Utils utils = new Utils();
ProgressDialog progressDialog;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.nfc_scanner);
nfcAdapter = NfcAdapter.getDefaultAdapter(this);
progressDialog = new ProgressDialog(ScannerNfc.this);
progressDialog.setMessage("Loading...");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Window w = getWindow();
w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
}
pendingIntent = PendingIntent.getActivity(this, 0,
new Intent(this, this.getClass())
.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0);
}
@Override
protected void onResume() {
super.onResume();
if (nfcAdapter != null) {
if (!nfcAdapter.isEnabled())
showWirelessSettings();
nfcAdapter.enableForegroundDispatch(this, pendingIntent, null, null);
}
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
resolveIntent(intent);
}
private void resolveIntent(Intent intent) {
progressDialog.show();
String action = intent.getAction();
Log.i("StringAction", "resolveIntent: "+action);
if (NfcAdapter.ACTION_TAG_DISCOVERED.equals(action)
|| NfcAdapter.ACTION_TECH_DISCOVERED.equals(action)
|| NfcAdapter.ACTION_NDEF_DISCOVERED.equals(action)) {
Parcelable[] rawMsgs = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES);
NdefMessage[] msgs;
Log.i("StringAction", "resolveIntent: "+rawMsgs);
if (rawMsgs != null) {
msgs = new NdefMessage[rawMsgs.length];
for (int i = 0; i < rawMsgs.length; i++) {
Log.i("rawMsg", "resolveIntent: "+rawMsgs[i]);
msgs[i] = (NdefMessage) rawMsgs[i];
}
} else {
byte[] empty = new byte[0];
byte[] id = intent.getByteArrayExtra(NfcAdapter.EXTRA_ID);
Tag tag = (Tag) intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
Log.i("TAG", "resolveIntent: "+tag);
byte[] payload = dumpTagData(tag).getBytes();
NdefRecord record = new NdefRecord(NdefRecord.TNF_UNKNOWN, empty, id, payload);
NdefMessage msg = new NdefMessage(new NdefRecord[] {record});
msgs = new NdefMessage[] {msg};
Log.i("DUMPTAG", "resolveIntent: "+toDec(tag.getId()));
/**
* DISINI UNTUK SAVE KE DATABASE*/
progressDialog.dismiss();
}
Log.i("StringAction", "resolveIntent: "+msgs);
displayMsgs(msgs);
}
}
private void displayMsgs(NdefMessage[] msgs) {
if (msgs == null || msgs.length == 0)
return;
StringBuilder builder = new StringBuilder();
List<ParsedNdefRecord> records = NdefMessageParser.parse(msgs[0]);
final int size = records.size();
Log.i("StringAction", "resolveIntent: "+size);
for (int i = 0; i < size; i++) {
ParsedNdefRecord record = records.get(i);
String str = record.str();
Log.i("DIDALAM", "resolveIntent: "+str);
builder.append(str).append("\n");
}
// Log.i("StringAction", "resolveIntent: "+builder.toString());
// text.setText(builder.toString());
utils.toastMessage(ScannerNfc.this, builder.toString());
// new Handler(Looper.getMainLooper()).postDelayed(()->{
// progressDialog.dismiss();
// }, 1500);
}
private void showWirelessSettings() {
Toast.makeText(this, "You need to enable NFC", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(Settings.ACTION_WIRELESS_SETTINGS);
startActivity(intent);
}
private String dumpTagData(Tag tag) {
StringBuilder sb = new StringBuilder();
byte[] id = tag.getId();
Log.i("ID", "resolveIntent: "+id);
sb.append("ID (hex): ").append(toHex(id)).append('\n');
sb.append("ID (reversed hex): ").append(toReversedHex(id)).append('\n');
sb.append("ID (dec): ").append(toDec(id)).append('\n');
sb.append("ID (reversed dec): ").append(toReversedDec(id)).append('\n');
String prefix = "android.nfc.tech.";
sb.append("Technologies: ");
for (String tech : tag.getTechList()) {
sb.append(tech.substring(prefix.length()));
sb.append(", ");
}
sb.delete(sb.length() - 2, sb.length());
for (String tech : tag.getTechList()) {
if (tech.equals(MifareClassic.class.getName())) {
sb.append('\n');
String type = "Unknown";
try {
MifareClassic mifareTag = MifareClassic.get(tag);
switch (mifareTag.getType()) {
case MifareClassic.TYPE_CLASSIC:
type = "Classic";
break;
case MifareClassic.TYPE_PLUS:
type = "Plus";
break;
case MifareClassic.TYPE_PRO:
type = "Pro";
break;
}
sb.append("Mifare Classic type: ");
sb.append(type);
sb.append('\n');
sb.append("Mifare size: ");
sb.append(mifareTag.getSize() + " bytes");
sb.append('\n');
sb.append("Mifare sectors: ");
sb.append(mifareTag.getSectorCount());
sb.append('\n');
sb.append("Mifare blocks: ");
sb.append(mifareTag.getBlockCount());
} catch (Exception e) {
sb.append("Mifare classic error: " + e.getMessage());
}
}
if (tech.equals(MifareUltralight.class.getName())) {
sb.append('\n');
MifareUltralight mifareUlTag = MifareUltralight.get(tag);
String type = "Unknown";
switch (mifareUlTag.getType()) {
case MifareUltralight.TYPE_ULTRALIGHT:
type = "Ultralight";
break;
case MifareUltralight.TYPE_ULTRALIGHT_C:
type = "Ultralight C";
break;
}
sb.append("Mifare Ultralight type: ");
sb.append(type);
}
}
return sb.toString();
}
private String toHex(byte[] bytes) {
StringBuilder sb = new StringBuilder();
for (int i = bytes.length - 1; i >= 0; --i) {
int b = bytes[i] & 0xff;
if (b < 0x10)
sb.append('0');
sb.append(Integer.toHexString(b));
if (i > 0) {
sb.append(" ");
}
}
return sb.toString();
}
private String toReversedHex(byte[] bytes) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < bytes.length; ++i) {
if (i > 0) {
sb.append(" ");
}
int b = bytes[i] & 0xff;
if (b < 0x10)
sb.append('0');
sb.append(Integer.toHexString(b));
}
return sb.toString();
}
private long toDec(byte[] bytes) {
long result = 0;
long factor = 1;
for (int i = 0; i < bytes.length; ++i) {
long value = bytes[i] & 0xffl;
result += value * factor;
factor *= 256l;
}
return result;
}
private long toReversedDec(byte[] bytes) {
long result = 0;
long factor = 1;
for (int i = bytes.length - 1; i >= 0; --i) {
long value = bytes[i] & 0xffl;
result += value * factor;
factor *= 256l;
}
return result;
}
}
package com.yono.messeripos;
import android.os.Bundle;
import android.os.PersistableBundle;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
public class TransactionDetail extends AppCompatActivity {
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail_transaction);
}
}
...@@ -107,13 +107,6 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold ...@@ -107,13 +107,6 @@ public class PaymentAdapter extends RecyclerView.Adapter<PaymentAdapter.ViewHold
public void binData(PaymentResponse paymentResponse){ public void binData(PaymentResponse paymentResponse){
binding.setPayment(paymentResponse); binding.setPayment(paymentResponse);
binding.setLogo(paymentResponse.getUrl()); binding.setLogo(paymentResponse.getUrl());
if (nfcAdapter == null){
if (paymentResponse.getBank() == "nfc"){
binding.cvPayment.setVisibility(View.GONE);
}else{
binding.cvPayment.setVisibility(View.VISIBLE);
}
}
binding.cvPayment.setOnClickListener(view ->{ binding.cvPayment.setOnClickListener(view ->{
getPosition = getAdapterPosition(); getPosition = getAdapterPosition();
......
package com.yono.messeripos.api.service; package com.yono.messeripos.api.service;
import com.yono.messeripos.api.ApiHelper; import com.yono.messeripos.api.ApiHelper;
import com.yono.messeripos.models.ForgotPasswordModels;
import com.yono.messeripos.models.UsersModels; import com.yono.messeripos.models.UsersModels;
import com.yono.messeripos.response.DataResponse; import com.yono.messeripos.response.DataResponse;
...@@ -14,4 +15,7 @@ public interface UsersService { ...@@ -14,4 +15,7 @@ public interface UsersService {
@POST(ApiHelper.VERSI_API_1+"register") @POST(ApiHelper.VERSI_API_1+"register")
Call<DataResponse<UsersModels>> postRegister(@Body UsersModels usersModels); Call<DataResponse<UsersModels>> postRegister(@Body UsersModels usersModels);
@POST(ApiHelper.VERSI_API_1+"forgot-password")
Call<DataResponse> postForgotPassword(@Body ForgotPasswordModels forgotPasswordModels);
} }
package com.yono.messeripos.models;
import com.google.gson.annotations.SerializedName;
public class ForgotPasswordModels {
@SerializedName("email")
private String email;
@SerializedName("message")
private String message;
public ForgotPasswordModels() {
}
public ForgotPasswordModels(String email, String message) {
this.email = email;
this.message = message;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
...@@ -35,6 +35,7 @@ import java.time.ZoneId; ...@@ -35,6 +35,7 @@ import java.time.ZoneId;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.Date; import java.util.Date;
import java.util.Locale; import java.util.Locale;
import java.util.Random;
import java.util.TimeZone; import java.util.TimeZone;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
...@@ -394,4 +395,13 @@ public class Utils { ...@@ -394,4 +395,13 @@ public class Utils {
public int getWindowWidth() { public int getWindowWidth() {
return Resources.getSystem().getDisplayMetrics().widthPixels; return Resources.getSystem().getDisplayMetrics().widthPixels;
} }
public String getRandomNumberString() {
// It will generate 6 digit random Number.
// from 0 to 999999
Random rnd = new Random();
int number = rnd.nextInt(999999);
// this will convert any number sequence into 6 character.
return String.format("%06d", number);
}
} }
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<path
android:fillColor="#FF000000"
android:pathData="M32,454a10,10 0,0 0,0 20L224,474a10,10 0,0 0,0 -20h-6L218,361h6a10,10 0,0 0,10 -10L234,336a10,10 0,0 0,-4.453 -8.32l-96,-64a10,10 0,0 0,-11.094 0l-96,64A10,10 0,0 0,22 336v15a10,10 0,0 0,10 10h6v93ZM90,362h76v92L90,454ZM186,454L186,362h12v92ZM128,284.019 L213.472,341L42.528,341ZM58,362L70,362v92L58,454Z"/>
<path
android:fillColor="#FF000000"
android:pathData="M240,486H16a10,10 0,0 0,0 20H240a10,10 0,0 0,0 -20Z"/>
<path
android:fillColor="#FF000000"
android:pathData="M288,200a10,10 0,0 0,0 20L480,220a10,10 0,0 0,0 -20h-6L474,107h6a10,10 0,0 0,10 -10L490,82a10,10 0,0 0,-4.453 -8.32l-96,-64a10,10 0,0 0,-11.094 0l-96,64A10,10 0,0 0,278 82L278,97a10,10 0,0 0,10 10h6v93ZM346,108h76v92L346,200ZM442,200L442,108h12v92ZM384,30.019 L469.473,87L298.527,87ZM314,108h12v92L314,200Z"/>
<path
android:fillColor="#FF000000"
android:pathData="M496,232H272a10,10 0,0 0,0 20H496a10,10 0,0 0,0 -20Z"/>
<path
android:fillColor="#FF000000"
android:pathData="M429.129,289.2a10,10 0,0 0,-12.136 7.26A165.381,165.381 0,0 1,298.061 416.607l12.247,-22.894a10,10 0,0 0,-17.635 -9.434L270.031,426.6a10,10 0,0 0,4.285 13.631l42.8,21.76a10,10 0,1 0,9.065 -17.828l-18.6,-9.457A185.863,185.863 0,0 0,436.39 301.339,10 10,0 0,0 429.129,289.2Z"/>
<path
android:fillColor="#FF000000"
android:pathData="M82.872,222.8a9.984,9.984 0,0 0,12.135 -7.26A165.383,165.383 0,0 1,213.939 95.393l-12.247,22.894a10,10 0,1 0,17.635 9.434L241.969,85.4a10,10 0,0 0,-4.285 -13.631l-42.8,-21.76a10,10 0,1 0,-9.065 17.828l18.6,9.457A185.86,185.86 0,0 0,75.611 210.661,10 10,0 0,0 82.872,222.8Z"/>
</vector>
<vector android:height="24dp" android:tint="#808AC2"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M10,6L8.59,7.41 13.17,12l-4.58,4.59L10,18l6,-6z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="478.856dp"
android:height="478.856dp"
android:viewportWidth="478.856"
android:viewportHeight="478.856">
<path
android:fillColor="#FF000000"
android:pathData="M406.872,160.017c-0.005,0 -0.011,0 -0.016,0h-400c-3.782,-0.004 -6.852,3.058 -6.856,6.84c0,0.005 0,0.011 0,0.016v192c-0.004,3.782 3.058,6.852 6.84,6.856c0.005,0 0.011,0 0.016,0h272c3.786,0 6.856,-3.07 6.856,-6.856c0,-3.786 -3.07,-6.856 -6.856,-6.856H13.712V173.729H400v17.144c-0.004,3.782 3.058,6.852 6.84,6.856c0.005,0 0.011,0 0.016,0c3.782,0.004 6.852,-3.058 6.856,-6.84c0,-0.005 0,-0.011 0,-0.016v-24C413.716,163.091 410.654,160.022 406.872,160.017z"/>
<path
android:fillColor="#FF000000"
android:pathData="M360.36,128.185l-320,-72c-1.776,-0.397 -3.637,-0.075 -5.176,0.896c-1.537,0.979 -2.624,2.526 -3.024,4.304l-16,72c-0.822,3.698 1.51,7.362 5.208,8.184c3.698,0.822 7.362,-1.51 8.184,-5.208l14.504,-65.288l313.296,70.488c0.496,0.115 1.003,0.172 1.512,0.168c3.786,-0.007 6.85,-3.082 6.844,-6.868C365.702,131.66 363.482,128.89 360.36,128.185z"/>
<path
android:fillColor="#FF000000"
android:pathData="M321.504,88.513l-192,-80c-3.337,-1.391 -7.182,0.038 -8.8,3.272l-16,32c-1.807,3.342 -0.563,7.517 2.78,9.324c3.342,1.807 7.517,0.563 9.324,-2.78c0.071,-0.131 0.138,-0.265 0.2,-0.401v0.016l13.128,-26.272l186.072,77.528c3.504,1.462 7.53,-0.192 8.992,-3.696C326.662,94.002 325.008,89.976 321.504,88.513z"/>
<path
android:fillColor="#FF000000"
android:pathData="M326.352,192.017h-63.496c-3.786,0 -6.856,3.07 -6.856,6.856c0,3.786 3.07,6.856 6.856,6.856h63.496c3.786,0 6.856,-3.07 6.856,-6.856S330.138,192.017 326.352,192.017z"/>
<path
android:fillColor="#FF000000"
android:pathData="M198.856,192.473c-38.881,0 -70.4,31.519 -70.4,70.4c0.04,38.864 31.536,70.36 70.4,70.4c38.881,0 70.4,-31.519 70.4,-70.4S237.737,192.473 198.856,192.473zM198.856,320.473c-31.812,0 -57.6,-25.788 -57.6,-57.6c0.035,-31.797 25.803,-57.565 57.6,-57.6c31.812,0 57.6,25.788 57.6,57.6C256.456,294.685 230.668,320.473 198.856,320.473z"/>
<path
android:fillColor="#FF000000"
android:pathData="M390.856,214.873c-42.4,0 -88,10.016 -88,32v192c0,21.984 45.6,32 88,32c42.4,0 88,-10.016 88,-32v-192C478.856,224.889 433.256,214.873 390.856,214.873zM462.856,438.753c-1.208,4.44 -25.2,16.12 -72,16.12s-70.792,-11.68 -72,-16v-12.576c17.024,8.576 45.144,12.576 72,12.576c26.856,0 54.984,-4.04 72,-12.584V438.753zM462.856,406.753c-1.208,4.44 -25.2,16.12 -72,16.12s-70.792,-11.68 -72,-16v-12.576c17.024,8.576 45.144,12.576 72,12.576c26.856,0 54.984,-4.04 72,-12.584V406.753zM462.856,374.753c-1.208,4.44 -25.2,16.12 -72,16.12s-70.792,-11.68 -72,-16v-12.576c17.024,8.576 45.144,12.576 72,12.576c26.856,0 54.984,-4.04 72,-12.584V374.753zM462.856,342.753c-1.208,4.44 -25.2,16.12 -72,16.12s-70.792,-11.68 -72,-16v-12.576c17.024,8.576 45.144,12.576 72,12.576c26.856,0 54.984,-4.04 72,-12.584V342.753zM462.856,310.753c-1.208,4.44 -25.2,16.12 -72,16.12s-70.792,-11.68 -72,-16v-12.576c17.024,8.536 45.144,12.576 72,12.576c26.856,0 54.984,-4.04 72,-12.584V310.753zM462.856,278.753c-1.208,4.44 -25.2,16.12 -72,16.12s-70.792,-11.68 -72,-16v-12.576c17.024,8.536 45.144,12.576 72,12.576c26.856,0 54.984,-4.04 72,-12.584V278.753zM390.856,262.873c-46.728,0 -70.712,-11.648 -72,-15.856v-0.048c1.288,-4.456 25.272,-16.096 72,-16.096c46.4,0 70.4,11.472 72,16C461.256,251.401 437.256,262.873 390.856,262.873z"/>
<path
android:fillColor="#FF000000"
android:pathData="M134.856,320.009H74.384l-28.672,-31.36v-52l31.664,-30.92h57.48c3.786,0 6.856,-3.07 6.856,-6.856c0,-3.786 -3.07,-6.856 -6.856,-6.856H74.592c-1.792,-0.004 -3.515,0.694 -4.8,1.944l-35.736,34.856c-1.335,1.56 -2.067,3.547 -2.064,5.6v56.896c0,1.711 0.639,3.36 1.792,4.624l32.504,35.552c1.299,1.422 3.137,2.233 5.064,2.232h63.504c3.786,0 6.856,-3.07 6.856,-6.856C141.712,323.079 138.643,320.009 134.856,320.009z"/>
<path
android:fillColor="#FF000000"
android:pathData="M202.856,254.873h-8c-2.488,0 -4,-1.392 -4,-2c0,-0.608 1.512,-2 4,-2h20c4.418,0 8,-3.582 8,-8s-3.582,-8 -8,-8h-8c0,-4.418 -3.582,-8 -8,-8s-8,3.582 -8,8v0.36c-8.873,1.253 -15.595,8.648 -16,17.6c0.573,10.489 9.507,18.548 20,18.04h8c2.488,0 4,1.392 4,2c0,0.608 -1.512,2 -4,2h-20c-4.418,0 -8,3.582 -8,8s3.582,8 8,8h8c0,4.418 3.582,8 8,8s8,-3.582 8,-8v-0.36c8.873,-1.253 15.595,-8.648 16,-17.6C222.283,262.424 213.349,254.365 202.856,254.873z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="511dp"
android:height="511dp"
android:viewportWidth="511"
android:viewportHeight="511.99945">
<path
android:fillColor="#FF000000"
android:pathData="m485.988,347.5c-1.133,0 -2.285,-0.094 -3.438,-0.297 -10.887,-1.887 -18.176,-12.238 -16.289,-23.121 3.883,-22.406 5.973,-45.313 6.211,-68.082 -0.832,-80.363 -24.266,-158.191 -67.766,-225.098 -6.023,-9.258 -3.395,-21.648 5.863,-27.668 9.262,-6.02 21.648,-3.395 27.672,5.867 47.688,73.344 73.355,158.652 74.23,246.699v0.398c-0.25,24.988 -2.535,50.125 -6.801,74.719 -1.688,9.727 -10.137,16.582 -19.684,16.582zM438.242,502.898c15.469,-23.789 28.785,-49.168 39.586,-75.43 4.203,-10.215 -0.676,-21.902 -10.891,-26.102 -10.215,-4.203 -21.902,0.672 -26.102,10.887 -9.855,23.969 -22.012,47.129 -36.129,68.84 -6.023,9.262 -3.395,21.648 5.863,27.672 3.367,2.188 7.145,3.234 10.883,3.234 6.543,0 12.957,-3.207 16.789,-9.102zM341.07,450.773c38.602,-57.613 59.492,-124.875 60.41,-194.512 0.004,-0.176 0.004,-0.352 0,-0.527 -0.918,-69.637 -21.809,-136.898 -60.41,-194.508 -6.148,-9.176 -18.574,-11.633 -27.746,-5.484 -9.18,6.148 -11.633,18.57 -5.484,27.746 34.23,51.09 52.777,110.734 53.641,172.512 -0.863,61.773 -19.41,121.418 -53.641,172.508 -6.148,9.176 -3.691,21.598 5.484,27.746 3.418,2.293 7.285,3.387 11.113,3.387 6.445,0 12.773,-3.109 16.633,-8.867zM252.996,367.305c10.465,-3 18.984,-10.895 22.789,-21.109 11.02,-29.59 16.305,-60.066 15.707,-90.59 -0.957,-48.707 -16.504,-96.012 -44.957,-136.797 -6.32,-9.055 -18.789,-11.277 -27.848,-4.957 -9.059,6.32 -11.277,18.789 -4.957,27.848 23.91,34.27 36.969,73.93 37.77,114.691 0.453,23.035 -3.137,46.105 -10.672,68.691l-183.457,-141.055c-7.988,-6.145 -18.48,-7.941 -28.066,-4.816 -9.566,3.125 -16.961,10.75 -19.781,20.406 -4.117,14.082 -9.023,36.512 -9.023,63.379 0,47.34 27.066,89.641 28.215,91.418 6,9.254 18.344,11.883 27.609,5.91 9.27,-5.977 11.938,-18.348 5.98,-27.629 -0.215,-0.34 -21.805,-34.398 -21.805,-69.699 0,-14.758 1.793,-27.879 3.988,-38.418l178.109,136.941c6.117,4.699 13.379,7.145 20.82,7.145 3.188,0 6.406,-0.445 9.578,-1.359zM252.996,367.305"/>
</vector>
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
layout="@layout/app_bar"/> layout="@layout/app_bar"/>
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:id="@+id/methodePayment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/appbarDetail" app:layout_constraintTop_toBottomOf="@id/appbarDetail"
...@@ -49,4 +50,84 @@ ...@@ -49,4 +50,84 @@
</com.google.android.material.card.MaterialCardView> </com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/detailTransaksi"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/methodePayment"
app:cardElevation="2dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:padding="10dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_margin="10dp">
<TextView
android:id="@+id/titleDetail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:text="Transaction Detail"
android:textColor="@android:color/black"
android:textSize="18sp"/>
<ListView
android:id="@+id/lvDetail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/titleDetail"
android:layout_marginTop="10dp"/>
<TextView
android:id="@+id/txtAdminFee"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/lvDetail"
app:layout_constraintStart_toStartOf="parent"
android:text="Admin Fee"
android:textSize="12sp"
android:layout_marginTop="10dp"/>
<TextView
android:id="@+id/adminFee"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/lvDetail"
app:layout_constraintEnd_toEndOf="parent"
android:text="Admin Fee"
android:textSize="12sp"
android:layout_marginTop="10dp"
tools:ignore="DuplicateIds" />
<TextView
android:id="@+id/txtgrandTotal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/txtAdminFee"
app:layout_constraintStart_toStartOf="parent"
android:text="Gross Amount"
android:textSize="18sp"
android:layout_marginTop="10dp"/>
<TextView
android:id="@+id/txtgrandTotal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/adminFee"
app:layout_constraintEnd_toEndOf="parent"
android:text="Admin Fee"
android:textSize="18sp"
android:layout_marginTop="10dp"
tools:ignore="DuplicateIds" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
android:layout_width="@dimen/logo_w_h" android:layout_width="@dimen/logo_w_h"
android:layout_height="@dimen/logo_w_h" android:layout_height="@dimen/logo_w_h"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:src="@mipmap/ic_launcher" /> android:src="@drawable/ic_messer_primary" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
...@@ -14,17 +14,10 @@ ...@@ -14,17 +14,10 @@
android:id="@+id/appbar" android:id="@+id/appbar"
layout="@layout/app_bar" /> layout="@layout/app_bar" />
<include
android:layout_below="@id/appbar"
layout="@layout/activity_invoice"
android:id="@+id/cvInvoice"
android:layout_height="wrap_content"
android:layout_width="match_parent" />
<ScrollView <ScrollView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/cvInvoice" android:layout_below="@id/appbar"
android:layout_above="@id/btnPay" android:layout_above="@id/btnPay"
android:overScrollMode="never" android:overScrollMode="never"
android:scrollingCache="false" android:scrollingCache="false"
...@@ -38,32 +31,6 @@ ...@@ -38,32 +31,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:nestedScrollingEnabled="false"
android:layout_marginTop="20dp"
tools:layout_editor_absoluteX="10dp"
/>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Payment"
android:textSize="24sp"
android:textFontWeight="600"
android:textStyle="bold"
android:textColor="#202020"
android:layout_marginTop="20dp"
android:layout_marginBottom="0dp"
android:layout_marginStart="10dp"
android:layout_below="@id/rvItem"
/>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvPayment" android:id="@+id/rvPayment"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -71,7 +38,6 @@ ...@@ -71,7 +38,6 @@
android:layout_margin="10dp" android:layout_margin="10dp"
android:nestedScrollingEnabled="false" android:nestedScrollingEnabled="false"
tools:layout_editor_absoluteX="10dp" tools:layout_editor_absoluteX="10dp"
android:layout_below="@id/tvLabel"
tools:listitem="@layout/payment_list"/> tools:listitem="@layout/payment_list"/>
</RelativeLayout> </RelativeLayout>
</ScrollView> </ScrollView>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
android:id="@+id/appBarPaymentMethode"/> android:id="@+id/appBarPaymentMethode"/>
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:id="@+id/cvPayment" android:id="@+id/cvCash"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:checkable="true" android:checkable="true"
...@@ -27,19 +27,117 @@ ...@@ -27,19 +27,117 @@
<ImageView <ImageView
android:id="@+id/ivLogo" android:id="@+id/ivLogo"
android:layout_width="120dp" android:layout_width="80dp"
android:layout_height="0dp" android:layout_height="20dp"
android:src="@drawable/ic_bni_logo" android:src="@drawable/ic_money"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/> app:layout_constraintBottom_toBottomOf="parent"/>
<RadioButton <TextView
android:id="@+id/rbPayment"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:buttonTint="@color/colorPrimary" app:layout_constraintStart_toEndOf="@id/ivLogo"
android:enabled="false" android:text="Cash"
app:layout_constraintTop_toTopOf="parent"/>
<ImageView
android:id="@+id/ivRight"
android:layout_width="10dp"
android:layout_height="20dp"
android:src="@drawable/ic_baseline_chevron_right_24"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/cvBankTransfer"
android:clickable="true"
android:focusable="true"
android:checkable="true"
android:layout_height="wrap_content"
android:layout_width="match_parent"
app:layout_constraintTop_toBottomOf="@id/cvCash"
app:strokeWidth="1dp"
app:strokeColor="@color/color_stroke">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="15dp">
<ImageView
android:id="@+id/ivLogoBankTransfer"
android:layout_width="80dp"
android:layout_height="20dp"
android:src="@drawable/ic_bank_transfer"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toEndOf="@id/ivLogoBankTransfer"
android:text="Bank Transfer"
app:layout_constraintTop_toTopOf="parent"/>
<ImageView
android:id="@+id/ivRightBankTransfer"
android:layout_width="10dp"
android:layout_height="20dp"
android:src="@drawable/ic_baseline_chevron_right_24"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/cvNFC"
android:clickable="true"
android:focusable="true"
android:checkable="true"
android:layout_height="wrap_content"
android:layout_width="match_parent"
app:layout_constraintTop_toBottomOf="@id/cvBankTransfer"
app:strokeWidth="1dp"
app:strokeColor="@color/color_stroke">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="15dp">
<ImageView
android:id="@+id/ivLogoNFC"
android:layout_width="80dp"
android:layout_height="20dp"
android:src="@drawable/ic_nfc"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toEndOf="@id/ivLogoNFC"
android:text="Via NFC"
app:layout_constraintTop_toTopOf="parent"/>
<ImageView
android:id="@+id/ivRightNFC"
android:layout_width="10dp"
android:layout_height="20dp"
android:src="@drawable/ic_baseline_chevron_right_24"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/> app:layout_constraintBottom_toBottomOf="parent"/>
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/nfcgif"/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android" <layout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.coordinatorlayout.widget.CoordinatorLayout <androidx.coordinatorlayout.widget.CoordinatorLayout
...@@ -8,10 +9,10 @@ ...@@ -8,10 +9,10 @@
<RelativeLayout <RelativeLayout
android:id="@+id/RegisterLayout" android:id="@+id/RegisterLayout"
android:padding="20dp"
style="@style/Widget.Rounded.BottomSheet" style="@style/Widget.Rounded.BottomSheet"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:padding="20dp">
<ImageButton <ImageButton
android:id="@+id/ivclose" android:id="@+id/ivclose"
...@@ -21,14 +22,14 @@ ...@@ -21,14 +22,14 @@
android:backgroundTint="@android:color/transparent" android:backgroundTint="@android:color/transparent"
android:padding="10dp" android:padding="10dp"
android:src="@drawable/ic_close" android:src="@drawable/ic_close"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent" />
/>
<ScrollView <ScrollView
android:layout_below="@id/ivclose"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:layout_below="@id/ivclose"
android:scrollbars="none">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -38,97 +39,92 @@ ...@@ -38,97 +39,92 @@
android:id="@+id/ivMeserRegister" android:id="@+id/ivMeserRegister"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="213dp" android:layout_height="213dp"
android:src="@drawable/register_image" android:layout_centerHorizontal="true"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:layout_marginBottom="40dp" android:layout_marginBottom="40dp"
android:layout_centerHorizontal="true" /> android:src="@drawable/register_image" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:id="@+id/tvCreate" android:id="@+id/tvCreate"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/ivMeserRegister"
android:paddingLeft="12dp"
android:text="Create Your Account" android:text="Create Your Account"
android:textColor="@color/colorPrimary" android:textColor="@color/colorPrimary"
android:textFontWeight="600" android:textFontWeight="600"
android:textSize="16sp" android:textSize="16sp" />
android:layout_below="@id/ivMeserRegister"
android:paddingLeft="12dp"
/>
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/formUsernameReg" android:id="@+id/formUsernameReg"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/username"
android:layout_below="@id/tvCreate" android:layout_below="@id/tvCreate"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"> android:hint="@string/username">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/ETUsernameReg" android:id="@+id/ETUsernameReg"
android:layout_width="match_parent" android:layout_width="match_parent"
android:inputType="text"
android:imeOptions="actionNext"
android:layout_height="wrap_content" android:layout_height="wrap_content"
/> android:imeOptions="actionNext"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/formEmailReg" android:id="@+id/formEmailReg"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/email"
android:layout_marginTop="5dp"
android:layout_below="@id/formUsernameReg" android:layout_below="@id/formUsernameReg"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"> android:layout_marginTop="5dp"
android:hint="@string/email">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/ETEmailReg" android:id="@+id/ETEmailReg"
android:layout_width="match_parent" android:layout_width="match_parent"
android:inputType="textEmailAddress"
android:imeOptions="actionNext"
android:layout_height="wrap_content" android:layout_height="wrap_content"
/> android:imeOptions="actionNext"
android:inputType="textEmailAddress" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/FormPasswordReg" android:id="@+id/FormPasswordReg"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/password"
android:layout_below="@id/formEmailReg" android:layout_below="@id/formEmailReg"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"> android:hint="@string/password">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/ETPasswordReg" android:id="@+id/ETPasswordReg"
android:layout_width="match_parent" android:layout_width="match_parent"
android:inputType="textPassword"
android:imeOptions="actionNext"
android:layout_height="wrap_content" android:layout_height="wrap_content"
/> android:imeOptions="actionNext"
android:inputType="textPassword" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/FormRePasswordReg" android:id="@+id/FormRePasswordReg"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/password_Confirmation"
android:layout_below="@id/FormPasswordReg" android:layout_below="@id/FormPasswordReg"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"> android:hint="@string/password_Confirmation">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/ETRePasswordReg" android:id="@+id/ETRePasswordReg"
android:layout_width="match_parent" android:layout_width="match_parent"
android:inputType="textPassword"
android:imeOptions="actionDone|actionGo"
android:layout_height="wrap_content" android:layout_height="wrap_content"
/> android:imeOptions="actionDone|actionGo"
android:inputType="textPassword" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
...@@ -136,19 +132,41 @@ ...@@ -136,19 +132,41 @@
android:id="@+id/cbAgree" android:id="@+id/cbAgree"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="I Agree of terms of use"
android:textColor="@color/colorPrimary"
android:layout_below="@id/FormRePasswordReg" android:layout_below="@id/FormRePasswordReg"
android:layout_marginVertical="10dp" android:layout_marginVertical="10dp"
app:useMaterialThemeColors="true"/> android:text="I Agree of terms of use"
android:textColor="@color/colorPrimary"
app:useMaterialThemeColors="true" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintBtn"
android:layout_below="@id/cbAgree"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp">
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/MBRegister" android:id="@+id/MBRegister"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/cbAgree" android:paddingTop="20dp"
android:text="Create Account" android:text="Create Account"
android:layout_below="@id/cbAgree" tools:ignore="MissingConstraints" />
android:padding="20dp"/>
<ProgressBar
android:id="@+id/progressReg"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:elevation="2dp"
app:layout_constraintBottom_toBottomOf="@id/MBRegister"
app:layout_constraintTop_toTopOf="@id/MBRegister"
app:layout_constraintStart_toStartOf="@id/MBRegister"
app:layout_constraintEnd_toEndOf="@id/MBRegister"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout> </RelativeLayout>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment