Open kittusster opened 5 years ago
package com.androidcodefinder.loginscreendemo.MakePayment;
import android.app.Activity; import android.content.Context; import android.content.SharedPreferences;
import android.graphics.Color; import android.text.Editable; import android.text.TextWatcher; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.CalendarView; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast;
import androidx.annotation.VisibleForTesting; import androidx.cardview.widget.CardView; import androidx.recyclerview.widget.RecyclerView;
import com.androidcodefinder.loginscreendemo.R; import com.androidcodefinder.loginscreendemo.RecyclerView.Paymentorgg; import com.jaredrummler.materialspinner.MaterialSpinner; import com.tsongkha.spinnerdatepicker.DatePicker; import com.tsongkha.spinnerdatepicker.DatePickerDialog; import com.tsongkha.spinnerdatepicker.SpinnerDatePickerDialogBuilder;
import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.GregorianCalendar; import java.util.Locale;
/**
public class CustomAdapter extends RecyclerView.Adapter
public static ArrayList<EditModel> editModelArrayList;
public CustomAdapter(Context ctx, ArrayList<EditModel> editModelArrayList){
inflater = LayoutInflater.from(ctx);
this.mContext=ctx; this.editModelArrayList = editModelArrayList; }
@Override
public CustomAdapter.MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = inflater.inflate(R.layout.rv_item, parent, false);
MyViewHolder holder = new MyViewHolder(view);
return holder;
}
@Override
public void onBindViewHolder(final CustomAdapter.MyViewHolder holder, final int position) {
holder.editText.setText(editModelArrayList.get(position).getEditTextValue());
holder.editTexts.setText(editModelArrayList.get(position).getEditttt());
holder.edchequedate.setText(editModelArrayList.get(current_item_position).getChequedate());
holder.edchequeamount.setText(editModelArrayList.get(position).getChequeamount());
holder.edchequeaccount.setText(editModelArrayList.get(position).getChequeaccount());
Log.d("print","yes");
holder.edchequedate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showDate(1980, 0, 1, R.style.DatePickerSpinner);
// holder.edchequedate.setText(dob);
}
});
}
@Override
public int getItemCount() {
return
editModelArrayList.size();
}
class MyViewHolder extends RecyclerView.ViewHolder{
protected EditText editText;
protected EditText editTexts;
protected TextView edchequedate;
protected EditText edchequeamount;
protected EditText edchequeaccount;
public MyViewHolder( View itemView) {
super(itemView);
L11 = (CardView) itemView.findViewById(R.id.L11);
L22 = (CardView) itemView.findViewById(R.id.L22);
L33 = (CardView) itemView.findViewById(R.id.L33);
editText = (EditText) itemView.findViewById(R.id.editidaaaaaa);
editTexts = (EditText) itemView.findViewById(R.id.editids);
edchequedate = (TextView) itemView.findViewById(R.id.edt_chqdate);
edchequeamount = (EditText) itemView.findViewById(R.id.edt_chequeamnt);
edchequeaccount = (EditText) itemView.findViewById(R.id.edt_chequaccount);
/*edchequedate.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { showDate(1980, 0, 1, R.style.DatePickerSpinner);
edchequedate.setText(dob);
editModelArrayList.get(getAdapterPosition()).setChequedate(dob);
}
Calendar c = Calendar.getInstance();
@VisibleForTesting
void showDate(int year, int monthOfYear, int dayOfMonth, int spinnerTheme) {
new SpinnerDatePickerDialogBuilder()
.context(itemView.getContext())
.callback(CustomAdapter.this)
.spinnerTheme(spinnerTheme)
.minDate(c.get(Calendar.YEAR), c.get(Calendar.MONTH - 2), c.get(Calendar.DAY_OF_MONTH))
.defaultDate(year, monthOfYear, dayOfMonth)
.build()
.show();
}}
);*/
L11.setVisibility(View.VISIBLE);
L22.setVisibility(View.GONE);
L33.setVisibility(View.GONE);
editText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
editModelArrayList.get(getAdapterPosition()).setEditTextValue(editText.getText().toString());
}
@Override
public void afterTextChanged(Editable editable) {
}
});
editTexts.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
editModelArrayList.get(getAdapterPosition()).setEditttt(editTexts.getText().toString());
}
@Override
public void afterTextChanged(Editable editable) {
}
});
edchequeamount.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
editModelArrayList.get(getAdapterPosition()).setChequeamount(edchequeamount.getText().toString());
}
@Override
public void afterTextChanged(Editable editable) {
}
});
edchequeaccount.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
editModelArrayList.get(getAdapterPosition()).setChequeaccount(edchequeaccount.getText().toString());
}
@Override
public void afterTextChanged(Editable editable) {
}
});
//edchequedate.setText(dob);
}}
@Override
public void onDateSet(com.tsongkha.spinnerdatepicker.DatePicker view, int year, int monthOfYear, int dayOfMonth) {
Calendar calendar = new GregorianCalendar(year, monthOfYear, dayOfMonth);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy", Locale.US);
dob = simpleDateFormat.format(calendar.getTime());
editModelArrayList.get(current_item_position).setChequedate(dob);
notifyItemChanged(current_item_position);;
}
public void showDate(int year, int monthOfYear, int dayOfMonth, int spinnerTheme) {
Calendar c = Calendar.getInstance();
new SpinnerDatePickerDialogBuilder()
.context((Paymentorgg)mContext)
.callback(CustomAdapter.this)
.spinnerTheme(spinnerTheme)
.minDate(c.get(Calendar.YEAR), c.get(Calendar.MONTH - 2), c.get(Calendar.DAY_OF_MONTH))
.defaultDate(year, monthOfYear, dayOfMonth)
.build()
.show();
}
}
package com.androidcodefinder.loginscreendemo.RecyclerView
import android.app.DatePickerDialog import android.content.Context import androidx.annotation.RequiresApi import androidx.appcompat.app.AppCompatActivity
import android.content.SharedPreferences import android.graphics.Color import android.os.Build import android.os.Bundle import android.util.Log import android.view.View import android.widget.* import androidx.annotation.VisibleForTesting import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import com.android.volley.DefaultRetryPolicy import com.android.volley.Request import com.android.volley.Response import com.android.volley.toolbox.StringRequest import com.android.volley.toolbox.Volley import com.androidcodefinder.loginscreendemo.Login.invoke import com.androidcodefinder.loginscreendemo.MakePayment.CustomAdapter import com.androidcodefinder.loginscreendemo.MakePayment.EditModel import com.androidcodefinder.loginscreendemo.R import com.androidcodefinder.loginscreendemo.UrlConstants
import com.google.android.material.snackbar.Snackbar import com.jaredrummler.materialspinner.MaterialSpinner import com.tsongkha.spinnerdatepicker.SpinnerDatePickerDialogBuilder import kotlinx.android.synthetic.main.activity_change_password. import kotlinx.android.synthetic.main.user_make_payment. import java.nio.charset.StandardCharsets import java.security.MessageDigest import java.security.NoSuchAlgorithmException import java.text.SimpleDateFormat import java.util.*
class Paymentorgg : AppCompatActivity() , DatePickerDialog.OnDateSetListener, com.tsongkha.spinnerdatepicker.DatePickerDialog.OnDateSetListener { var selection = String() var requestBody=String() var spinnernumber= String() var spinnerdrawer= String() var paytypea = String()
var nn= String()
var closingbracket= String()
var name = String()
var cardno = String()
var currenbalance = String()
var sessioid = String()
var searchtoken = String()
lateinit var dateTextView: TextView
private var recyclerView: RecyclerView? = null
private var customAdapter: CustomAdapter? = null
var editModelArrayList = ArrayList
internal lateinit var debtorname: TextView
internal lateinit var cardnum: TextView
internal lateinit var currentbalance: TextView
internal lateinit var debtid: String
internal lateinit var pdc: EditText
lateinit var recamount: EditText
lateinit var et_receipt_id: EditText
var flag=0;
override fun onDateSet(view: com.tsongkha.spinnerdatepicker.DatePicker?, year: Int, monthOfYear: Int, dayOfMonth: Int) {
val calendar = GregorianCalendar(year, monthOfYear, dayOfMonth)
if (flag==2) {
var dateTextView = findViewById<View>(com.androidcodefinder.loginscreendemo.R.id.et_receiptdate) as TextView
val simpleDateFormat = SimpleDateFormat("dd/MM/yyyy", Locale.US)
dob = simpleDateFormat.format(calendar.time)
dateTextView.text = dob
dateTextView.setTextColor(Color.BLACK)
dateTextView.visibility = View.VISIBLE
}else
{ if (flag==1)
{
var etchq = findViewById<View>(com.androidcodefinder.loginscreendemo.R.id.et_chequedate) as TextView
val simpleDateFormat = SimpleDateFormat("dd/MM/yyyy", Locale.US)
dobc = simpleDateFormat.format(calendar.time)
etchq.text = dobc
etchq.setTextColor(Color.BLACK)
etchq.visibility = View.VISIBLE
}
}
}
var c = Calendar.getInstance()
@VisibleForTesting
internal fun showDate(year: Int, monthOfYear: Int, dayOfMonth: Int, spinnerTheme: Int) {
SpinnerDatePickerDialogBuilder()
.context(this@Paymentorgg as Context)
.callback(this@Paymentorgg)
.spinnerTheme(spinnerTheme)
//.maxDate(c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH))
.minDate(c.get(Calendar.YEAR), c.get(Calendar.MONTH - 2), c.get(Calendar.DAY_OF_MONTH))
.defaultDate(year, monthOfYear, dayOfMonth)
.build()
.show()
}
override fun onDateSet(view: DatePicker?, year: Int, month: Int, dayOfMonth: Int) {
val calendar = GregorianCalendar(year, month, dayOfMonth)
var dateTextView = findViewById<View>(com.androidcodefinder.loginscreendemo.R.id.et_receiptdate) as TextView
val simpleDateFormat = SimpleDateFormat("dd/MM/yyyy", Locale.US)
dob = simpleDateFormat.format(calendar.time) + " (DOB)"
dateTextView.text = dob
dateTextView.visibility = View.VISIBLE
// Toast.makeText(this, (EtCardnumber as TextInputEditText).text, Toast.LENGTH_SHORT).show()
// Toast.makeText(this, (Etpincode as TextInputEditText).text, Toast.LENGTH_SHORT).show()
}
internal var tvnsme: TextView? = null
internal var tvcardno: TextView? = null
internal var tvourref: TextView? = null
internal var tvcurrentba: TextView? = null
var status = String()
var dob = String()
var dobc= String()
internal lateinit var prefs: SharedPreferences
@RequiresApi(api = Build.VERSION_CODES.N)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.user_make_payment)
val prefs = getSharedPreferences("MYPREFS", Context.MODE_PRIVATE)
searchtoken = prefs.getString("searchtoken", null)
sessioid = prefs.getString("ssessionid", null)
val intent = intent
name = intent.getStringExtra("name")
cardno = intent.getStringExtra("cardno")
currenbalance = intent.getStringExtra("currenbalance")
debtid = intent.getStringExtra("debtid")
pdc = findViewById<View>(R.id.et_pdcc) as EditText
recamount = findViewById<View>(R.id.et_amount) as EditText
et_receipt_id = findViewById<View>(R.id.et_receipt_id) as EditText
tv_debname.setText(name);
tv_cardno.setText(cardno)
tv_current_balance.setText(currenbalance)
dateTextView = findViewById<View>(com.androidcodefinder.loginscreendemo.R.id.et_receiptdate) as TextView
dateTextView.setOnClickListener {
flag=2
showDate(1970, 0, 1, com.androidcodefinder.loginscreendemo.R.style.DatePickerSpinner)
}
et_chequedate.setOnClickListener{
flag=1 showDate(1970, 0, 1, com.androidcodefinder.loginscreendemo.R.style.DatePickerSpinner)
}
val restoredText = prefs.getString("dpst", null)
var agentarray: ArrayList<String> = ArrayList()
agentarray = restoredText.split(",") as ArrayList<String>
agentarray.toTypedArray()
recyclerView = findViewById<View>(R.id.recycler) as RecyclerView
customAdapter = CustomAdapter(this, editModelArrayList)
recyclerView!!.adapter = customAdapter
recyclerView!!.layoutManager = LinearLayoutManager(applicationContext, LinearLayoutManager.VERTICAL, false)
val spinner = findViewById(R.id.et_amounts) as MaterialSpinner
spinner.setItems("Cheque", "Cash", "DD", "MO");
spinner.setOnItemSelectedListener(object: MaterialSpinner.OnItemSelectedListener<String> {
override fun onItemSelected(view:MaterialSpinner, position:Int, id:Long, item:String) {
Snackbar.make(view, "Clicked " + item, Snackbar.LENGTH_LONG).show()
if (position==0)
//Cheque
{
selection="Cheque";
DD.visibility=View.GONE
Bankname.visibility=View.GONE
MO.visibility=View.GONE
Issue.visibility=View.GONE
et_dd.visibility=View.GONE
et_bank_name.visibility=View.GONE
et_Mo.visibility=View.GONE
et_poissue.visibility=View.GONE
tvcheque.visibility=View.VISIBLE
tvchequedate.visibility=View.VISIBLE
ChequeAmount.visibility=View.VISIBLE
Drawr.visibility=View.VISIBLE
chequeaccount.visibility=View.VISIBLE
et_cheque_drawer.visibility=View.VISIBLE
et_cheque_number.visibility=View.VISIBLE
et_chequedate.visibility=View.VISIBLE
et_chequeamount.visibility=View.VISIBLE
et_cheque_account.visibility=View.VISIBLE
et_dd.setText("")
et_bank_name.setText("")
et_Mo.setText("")
et_poissue.setText("")
}else if (position==1)
//Cash
{
selection="Cash";
DD.visibility=View.GONE
Bankname.visibility=View.GONE
MO.visibility=View.GONE
Issue.visibility=View.GONE
et_dd.visibility=View.GONE
et_bank_name.visibility=View.GONE
et_Mo.visibility=View.GONE
et_poissue.visibility=View.GONE
tvcheque.visibility=View.GONE
tvchequedate.visibility=View.GONE
ChequeAmount.visibility=View.GONE
Drawr.visibility=View.GONE
chequeaccount.visibility=View.GONE
et_cheque_drawer.visibility=View.GONE
et_cheque_number.visibility=View.GONE
et_chequedate.visibility=View.GONE
et_chequeamount.visibility=View.GONE
et_cheque_account.visibility=View.GONE
et_dd.setText("")
et_bank_name.setText("")
et_Mo.setText("")
et_poissue.setText("")
et_cheque_drawer.setText("")
et_cheque_number.setText("")
et_chequedate.setText("")
et_chequeamount.setText("")
et_cheque_account.setText("")
}else if (position==2)
//DD
{
selection="Dd";
tvcheque.visibility=View.GONE
tvchequedate.visibility=View.GONE
ChequeAmount.visibility=View.GONE
/* et_cheque.visibility=View.GONE
et_cheque_date.visibility=View.GONE
et_cheqamount.visibility=View.GONE*/
DD.visibility=View.VISIBLE
Bankname.visibility=View.VISIBLE
et_dd.visibility=View.VISIBLE
et_bank_name.visibility=View.VISIBLE
MO.visibility=View.GONE
Issue.visibility=View.GONE
et_Mo.visibility=View.GONE
et_poissue.visibility=View.GONE
chequeaccount.visibility=View.GONE
et_cheque_drawer.visibility=View.GONE
et_cheque_number.visibility=View.GONE
et_chequedate.visibility=View.GONE
et_chequeamount.visibility=View.GONE
et_cheque_account.visibility=View.GONE
Drawr.visibility=View.GONE
et_Mo.setText("")
et_poissue.setText("")
et_cheque_drawer.setText("")
et_cheque_number.setText("")
et_chequedate.setText("")
et_chequeamount.setText("")
et_cheque_account.setText("")
}else if (position==3)
//MO
{
selection="MO"
tvcheque.visibility=View.GONE
tvchequedate.visibility=View.GONE
ChequeAmount.visibility=View.GONE
/* et_cheque.visibility=View.GONE
et_cheque_date.visibility=View.GONE
et_cheqamount.visibility=View.GONE*/
DD.visibility=View.GONE
Bankname.visibility=View.GONE
et_dd.visibility=View.GONE
et_bank_name.visibility=View.GONE
MO.visibility=View.VISIBLE
Issue.visibility=View.VISIBLE
et_Mo.visibility=View.VISIBLE
et_poissue.visibility=View.VISIBLE
chequeaccount.visibility=View.GONE
Drawr.visibility=View.GONE
et_cheque_drawer.visibility=View.GONE
et_cheque_number.visibility=View.GONE
et_chequedate.visibility=View.GONE
et_chequeamount.visibility=View.GONE
et_cheque_account.visibility=View.GONE
et_cheque_drawer.setText("")
et_cheque_number.setText("")
et_chequedate.setText("")
et_chequeamount.setText("")
et_cheque_account.setText("")
et_dd.setText("")
et_bank_name.setText("")
}
}
})
val btn = findViewById<View>(R.id.btn) as ImageView
val btnadd = findViewById<View>(R.id.button) as ImageButton
btnadd.setOnClickListener {
count += 1
arrayadd()
}
btn.setOnClickListener {
Webservice()
}
}
private fun arrayadd() {
// Only add the difference of the count and the length
// the loop will only occur once since count increment is 1
for (i in 0 until count - editModelArrayList.size) {
val editModel = EditModel()
editModel.editTextValue = ""
editModel.editttt = ""
editModel.chequedate = ""
editModel.chequeamount = ""
editModel.chequeaccount = ""
editModelArrayList.add(editModel)
println("edddddddddd$editModelArrayList")
}
customAdapter!!.notifyDataSetChanged()
}
private fun Webservice() {
sha1convertor()
val stringRequest = object : StringRequest(Request.Method.POST, UrlConstants.SUBMIT_PAYMENT + sessioid,
Response.Listener {
response -> Log.d("resposelogin", response)
if (response.contains("True")){ Toast.makeText(applicationContext,"Payment added successfully",Toast.LENGTH_LONG).show()} finish() }, Response.ErrorListener {
error ->
Toast.makeText(application, error.toString(), Toast.LENGTH_LONG).show()
finish()
}) {
override fun getBody(): ByteArray? {
var tokencap = sb.toString().toUpperCase()
val recdate = "10/11/2019"
if (selection.contains("Cheque"))
{
paytypea="Cheque"
spinnernumber= et_cheque_number.text.toString()
spinnerdrawer=et_cheque_drawer.text.toString()
}else if(selection.contains("Cash"))
{
paytypea="Cash"
spinnernumber=""
spinnerdrawer=""
} else if(selection.contains("Dd")){
paytypea="Dd"
spinnernumber=et_dd.text.toString()
spinnerdrawer=et_bank_name.text.toString()
} else if(selection.contains("MO")){
paytypea="MO"
spinnernumber=et_Mo.text.toString()
spinnerdrawer=et_poissue.text.toString()
}
requestBody = "{\"tknid\":\"" + tokencap + "\"," +
"\"debtid\":\"" + debtid + "\"," +
"\"recdate\":\"" + dob + "\"," +
"\"recptid\":\"" + et_receipt_id.getText().toString() + "\"," +
"\"recamount\":\"" + recamount.getText().toString() + "\"," +
"\"#pdc\":\"" + pdc.getText().toString() + "\","+
"\"paytype\":\"" + paytypea + "\","+
"\"#num\":\"" + spinnernumber+"\"," +
"\"drawer\":\"" +spinnerdrawer + "\"," +
"\"chqdate\":\"" + dobc+"\"," +
"\"amount\":\"" + et_chequeamount.text + "\","+
"\"#account\":\"" + et_cheque_account.text + "\",";
// var b = requestBody.toByteArray()
val builder = StringBuilder()
builder.append(requestBody)
for (i in 0 until count) {
var date = "date" + (i+1);
var num = "#num" +(i+1);
var drawer = "drawer" +(i+1);
var amount = "amount" + (i+1);
var account = "#account" +(i+1);
if (i!=count-1){
builder.append("\""+num +"\":\"" + CustomAdapter.editModelArrayList.get(i).getEditTextValue() + "\",")
.append("\""+drawer +"\":\"" + CustomAdapter.editModelArrayList.get(i).getEditttt() + "\",")
.append("\""+date +"\":\"" + CustomAdapter.editModelArrayList.get(i).getChequedate() + "\",")
.append("\""+amount +"\":\"" + CustomAdapter.editModelArrayList.get(i).getChequeamount() + "\"," )
.append("\""+account +"\":\"" + CustomAdapter.editModelArrayList.get(i).getChequeaccount() + "\",")
}else
{
builder.append("\""+num +"\":\"" + CustomAdapter.editModelArrayList.get(i).getEditTextValue() + "\",")
.append("\""+drawer+"\":\"" + CustomAdapter.editModelArrayList.get(i).getEditttt() + "\",")
.append("\""+date +"\":\"" + CustomAdapter.editModelArrayList.get(i).getChequedate() + "\",")
.append("\""+amount +"\":\"" + CustomAdapter.editModelArrayList.get(i).getChequeamount() + "\"," )
.append("\""+account +"\":\"" + CustomAdapter.editModelArrayList.get(i).getChequeaccount() + "\"}")
}
System.out.println("reeeeeeeee" + builder.toString());
nn = builder.toString()
}
System.out.println("tttttttttttttttttttttttttttttt"+nn);
return nn.toByteArray()
}
override fun getBodyContentType(): String {
// return "application/json; charset=ISO-8859-1";
return "application/json,charset=utf-8";
}
}
val requestQueue = Volley.newRequestQueue(this)
requestQueue(
0,
DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT)
requestQueue.add(stringRequest)
/* private fun sha1convertor() { searchtoken = (searchtoken!!.substring(0, 3)
searchtoken!!.substring(3)) // Toast.makeText(getApplicationContext(),newpassword,Toast.LENGTH_LONG).show(); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// var md: MessageDigest? = null try { md = MessageDigest.getInstance("SHA-1") } catch (e: NoSuchAlgorithmException) { e.printStackTrace() }
var hashInBytes = ByteArray(0)
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
hashInBytes = md!!.digest(searchtoken!!.toByteArray(StandardCharsets.UTF_8))
}
// bytes to hex
sb = StringBuilder()
for (b in hashInBytes) {
sb.append(String.format("%02x", b))
}
// Toast.makeText(getApplicationContext(),sb,Toast.LENGTH_LONG).show();
Log.d(sb.toString(), "sha1enc")
println(sb.toString())
}*/
/* private fun arrayadd() {
// Only add the difference of the count and the length
// the loop will only occur once since count increment is 1
for (i in 0 until count - editModelArrayList.size) {
val editModel = EditModel()
editModel.editTextValue = ""
editModel.editttt = ""
editModel.chequedate = ""
editModel.chequeamount = ""
editModel.chequeaccount = ""
editModel.dd = ""
editModel.ddbankname = ""
editModel.dddate = ""
editModel.ddamount = ""
editModel.ddaccount = ""
editModel.mo = ""
editModel.mObankname = ""
editModel.mOdate = ""
editModel.mOamount = ""
editModel.moaccount = ""
editModelArrayList.add(editModel)
println("edddddddddd$editModelArrayList")
}
customAdapter!!.notifyDataSetChanged()
}
*/
}
private fun sha1convertor() { searchtoken = (searchtoken!!.substring(0, 3)
searchtoken!!.substring(3)) // Toast.makeText(getApplicationContext(),newpassword,Toast.LENGTH_LONG).show(); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// var md: MessageDigest? = null try { md = MessageDigest.getInstance("SHA-1") } catch (e: NoSuchAlgorithmException) { e.printStackTrace() }
var hashInBytes = ByteArray(0)
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
hashInBytes = md!!.digest(searchtoken!!.toByteArray(StandardCharsets.UTF_8))
}
// bytes to hex
sb = StringBuilder()
for (b in hashInBytes) {
sb.append(String.format("%02x", b))
}
// Toast.makeText(getApplicationContext(),sb,Toast.LENGTH_LONG).show();
Log.d(sb.toString(), "sha1enc")
println(sb.toString())
}
/* tvnsme = findViewById<View>(R.id.tv_debname) as TextView
tvcardno = findViewById<View>(R.id.tv_cardno) as TextView
tvcurrentba = findViewById<View>(R.id.tv_current_balance) as TextView
*/
/* intent = intent val name = intent.getStringExtra("name") val cardno = intent.getStringExtra("cardno") val currenbalance = intent.getStringExtra("currenbalance")
tvnsme!!.text = name
tvcardno!!.text = cardno
tvcurrentba!!.text = currenbalance
*/
}
private fun Any.add(b: ByteArray) {
}
private fun MaterialSpinner.setOnItemSelectedListener(any: Any) {
}
private fun MaterialSpinner.setItems(s: String, s1: String, s2: String, s3: String, s4: String) {
}
implementation 'com.google.android.material:material:1.0.0'
testCompile 'junit:junit:4.12'
implementation 'com.github.drawers:SpinnerDatePicker:2.0.1'
implementation 'android.arch.navigation:navigation-fragment-ktx:1.0.0'
implementation 'android.arch.navigation:navigation-ui-ktx:1.0.0'
implementation 'com.android.support:support-v4:28.8.0'
implementation("com.squareup.okhttp3:logging-interceptor:4.0.1")
implementation 'com.squareup.okio:okio:2.2.2'
implementation 'com.jaredrummler:material-spinner:1.3.1'
implementation 'com.android.volley:volley:1.1.1'
<?xml version="1.0" encoding="utf-8"?> <ScrollView android:layout_width="fill_parent" android:layout_height="match_parent" android:id="@+id/scrollView" xmlns:android="http://schemas.android.com/apk/res/android"> <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"
<androidx.core.widget.NestedScrollView xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true" xmlns:android="http://schemas.android.com/apk/res/android">
<androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="match_parent"
<androidx.appcompat.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/toolbar_colour"
android:minHeight="?attr/actionBarSize"
app:layout_constraintEnd_toEndOf="parent"
tools:ignore="MissingConstraints">
<TextView
android:id="@+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="COSMOS LITE"
android:textColor="@color/white"
android:textStyle="bold" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="COSMOS LITE"
android:textStyle="bold"
android:src="@drawable/ic_check_black_24dp"
android:textColor="@color/white"
android:layout_gravity="right"
android:layout_marginRight="20dp"
android:id="@+id/btn"
/>
</androidx.appcompat.widget.Toolbar>
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_begin="40dp" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_begin="40dp" />
<TextView
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="@dimen/user_search_contact_space"
android:text="@string/debitor_name"
android:textColor="@android:color/background_dark"
app:layout_constraintStart_toStartOf="@+id/guideline"
app:layout_constraintTop_toTopOf="@+id/guideline3" />
<TextView
android:id="@+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="@dimen/user_search_contact_space"
android:text="@string/card_no"
android:textColor="@android:color/background_dark"
app:layout_constraintStart_toStartOf="@+id/guideline"
app:layout_constraintTop_toBottomOf="@+id/textView7" />
<TextView
android:id="@+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="@dimen/user_search_contact_space"
android:text="@string/current_balance"
android:textColor="@android:color/background_dark"
app:layout_constraintStart_toStartOf="@+id/guideline"
app:layout_constraintTop_toBottomOf="@+id/textView8" />
<TextView
android:id="@+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="@dimen/user_search_contact_space"
android:text="@string/receipt_id"
android:textColor="@android:color/background_dark"
app:layout_constraintStart_toStartOf="@+id/guideline"
app:layout_constraintTop_toBottomOf="@+id/textView10" />
<TextView
android:id="@+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="@dimen/user_search_contact_space"
android:textColor="@android:color/background_dark"
android:text="@string/amount"
app:layout_constraintStart_toStartOf="@+id/guideline"
app:layout_constraintTop_toBottomOf="@+id/textView11" />
<TextView
android:id="@+id/tv_moblenos"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:textColor="@android:color/background_dark"
android:layout_marginTop="@dimen/user_search_contact_space"
android:text="@string/receipt_date"
app:layout_constraintStart_toStartOf="@+id/guideline"
app:layout_constraintTop_toBottomOf="@+id/textView12" />
<TextView
android:id="@+id/tv_pdc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="@dimen/user_search_contact_space"
android:text="#PDC"
android:textColor="@android:color/background_dark"
app:layout_constraintStart_toStartOf="@+id/guideline"
app:layout_constraintTop_toBottomOf="@+id/tv_moblenos" />
<TextView
android:id="@+id/textView14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="65dp"
android:textColor="@android:color/background_dark"
android:text="@string/payment_type"
app:layout_constraintStart_toStartOf="@+id/guideline"
app:layout_constraintTop_toBottomOf="@+id/tv_moblenos" />
<TextView
android:id="@+id/Drawr"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="29dp"
android:text="@string/drawer"
android:textColor="@android:color/background_dark"
app:layout_constraintStart_toStartOf="@+id/guideline"
app:layout_constraintTop_toBottomOf="@+id/textView14" />
<TextView
android:id="@+id/tvcheque"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="@dimen/user_search_contact_space"
android:text="@string/cheque"
android:textColor="@android:color/background_dark"
app:layout_constraintStart_toStartOf="@+id/guideline"
app:layout_constraintTop_toBottomOf="@+id/Drawr" />
<TextView
android:id="@+id/tvchequedate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:textColor="@android:color/background_dark"
android:layout_marginTop="@dimen/user_search_contact_space"
android:text="@string/cheque_date"
app:layout_constraintStart_toStartOf="@+id/guideline"
app:layout_constraintTop_toBottomOf="@+id/tvcheque" />
<TextView
android:id="@+id/ChequeAmount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="@dimen/user_search_contact_space"
android:text="@string/cheque_amount"
android:textColor="@android:color/background_dark"
app:layout_constraintStart_toStartOf="@+id/guideline"
app:layout_constraintTop_toBottomOf="@+id/tvchequedate" />
<TextView
android:id="@+id/chequeaccount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="@dimen/user_search_contact_space"
android:textColor="@android:color/background_dark"
android:text="Account number"
app:layout_constraintStart_toStartOf="@+id/guideline"
app:layout_constraintTop_toBottomOf="@+id/ChequeAmount" />
<TextView
android:id="@+id/DD"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="@dimen/user_search_contact_space"
android:textColor="@android:color/background_dark"
android:text="DD#"
android:visibility="invisible"
app:layout_constraintStart_toStartOf="@+id/guideline"
app:layout_constraintTop_toBottomOf="@+id/ChequeAmount" />
<TextView
android:id="@+id/Bankname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:visibility="gone"
android:textColor="@android:color/background_dark"
android:layout_marginTop="@dimen/user_search_contact_space"
android:text="BankName"
app:layout_constraintStart_toStartOf="@+id/guideline"
app:layout_constraintTop_toBottomOf="@+id/DD" />
<TextView
android:id="@+id/MO"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="@dimen/user_search_contact_space"
android:visibility="gone"
android:textColor="@android:color/background_dark"
android:text="MO#"
app:layout_constraintStart_toStartOf="@+id/guideline"
app:layout_constraintTop_toBottomOf="@+id/Bankname" />
<TextView
android:id="@+id/Issue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:visibility="gone"
android:textColor="@android:color/background_dark"
android:layout_marginTop="@dimen/user_search_contact_space"
android:text="P/O of issue"
app:layout_constraintStart_toStartOf="@+id/guideline"
app:layout_constraintTop_toBottomOf="@+id/MO" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_begin="194dp" />
<TextView
android:id="@+id/tv_debname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:text="TextView"
android:textColor="@android:color/background_dark"
app:layout_constraintStart_toStartOf="@+id/guideline2"
app:layout_constraintTop_toTopOf="@+id/guideline3" />
<TextView
android:id="@+id/tv_cardno"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:text="TextView"
android:textColor="@android:color/background_dark"
app:layout_constraintStart_toStartOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/tv_debname" />
<TextView
android:id="@+id/tv_current_balance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:text="TextView"
android:textColor="@android:color/background_dark"
app:layout_constraintStart_toStartOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/tv_cardno" />
<EditText
android:id="@+id/et_receipt_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="19dp"
android:ems="10"
android:inputType="number"
android:background="@null"
android:hint="0"
app:layout_constraintStart_toStartOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/tv_current_balance" />
<EditText
android:id="@+id/et_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="19dp"
android:ems="10"
android:inputType="numberDecimal"
android:background="@null"
android:hint="0"
app:layout_constraintStart_toStartOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/et_receipt_id" />
<TextView
android:id="@+id/et_receiptdate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="19dp"
android:ems="10"
android:background="@null"
android:hint="click to set date"
app:layout_constraintStart_toStartOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/et_amount" />
<EditText
android:id="@+id/et_pdcc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="19dp"
android:ems="10"
android:inputType="number"
android:background="@null"
android:hint="0"
app:layout_constraintStart_toStartOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/et_receiptdate" />
<com.jaredrummler.materialspinner.MaterialSpinner
android:id="@+id/et_amounts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:background="@null"
android:ems="10"
android:layout_marginTop="55dp"
android:inputType="number"
app:ms_hint="payment type"
app:layout_constraintStart_toStartOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/et_receiptdate" />
<EditText
android:id="@+id/et_cheque_drawer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="15dp"
android:ems="10"
android:background="@null"
android:hint="0"
app:layout_constraintStart_toStartOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/et_amounts" />
<EditText
android:id="@+id/et_cheque_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="15dp"
android:ems="10"
android:inputType="number"
android:background="@null"
android:hint="0"
app:layout_constraintStart_toStartOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/et_cheque_drawer" />
<TextView
android:id="@+id/et_chequedate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="15dp"
android:ems="10"
android:hint="click to set date"
android:inputType="date"
android:background="@null"
app:layout_constraintStart_toStartOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/et_cheque_number" />
<EditText
android:id="@+id/et_chequeamount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="28dp"
android:ems="10"
android:inputType="number"
android:background="@null"
android:hint="0"
app:layout_constraintStart_toStartOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/et_chequedate" />
<EditText
android:id="@+id/et_cheque_account"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="15dp"
android:ems="10"
android:inputType="number"
android:background="@null"
android:hint="0"
app:layout_constraintStart_toStartOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/et_chequeamount" />
<EditText
android:id="@+id/et_dd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="20dp"
android:ems="10"
android:inputType="number"
android:background="@null"
android:visibility="gone"
android:hint="0"
app:layout_constraintStart_toStartOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/et_cheque_account" />
<EditText
android:id="@+id/et_bank_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:visibility="gone"
android:layout_marginTop="19dp"
android:ems="10"
android:inputType="number"
android:background="@null"
android:hint="0"
app:layout_constraintStart_toStartOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/et_dd" />
<EditText
android:id="@+id/et_Mo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="19dp"
android:ems="10"
android:inputType="number"
android:visibility="gone"
android:background="@null"
android:hint="0"
app:layout_constraintStart_toStartOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/et_bank_name" />
<EditText
android:id="@+id/et_poissue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="19dp"
android:ems="10"
android:visibility="gone"
android:inputType="number"
android:background="@null"
android:hint="0"
app:layout_constraintStart_toStartOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/et_Mo" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
<ImageButton
android:id="@+id/button"
android:layout_width="wrap_content"
android:src="@drawable/ic_add"
android:layout_gravity="right"
android:layout_height="wrap_content"
android:text="Button" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="15dp"/>
<!-- <Button
android:id="@+id/btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Pass All EditText value to Next Activity" />-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" xmlns:app="http://schemas.android.com/apk/res-auto" android:paddingBottom="16dp" android:paddingLeft="16dp" android:paddingRight="16dp" android:background="@color/colorAccent"
<com.jaredrummler.materialspinner.MaterialSpinner android:id="@+id/et_amounts" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@null" android:ems="10" android:visibility="gone" android:layout_marginTop="55dp"
android:hint="selct mode"
android:inputType="number"/>
<com.google.android.material.card.MaterialCardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="0dp"
android:id="@+id/L11"
android:visibility="visible"
android:layout_marginRight="0dp"
android:layout_marginTop="100dp"
card_view:cardCornerRadius="4dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:textColor="#000"
android:text="Cheque"/>
<EditText
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/editidaaaaaa"
android:inputType="number"
android:layout_marginTop="10dp"
android:paddingLeft="10dp"
android:textColor="#000"
android:text="hello"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_marginTop="80dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:textColor="#000"
android:text="Drawer"/>
<EditText
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/editids"
android:layout_marginTop="10dp"
android:paddingLeft="10dp"
android:textColor="#000"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/datetext"
android:layout_marginTop="10dp"
android:paddingLeft="10dp"
android:visibility="gone"
android:textColor="#000"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_marginTop="160dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:textColor="#000"
android:text="chequedate"/>
<EditText
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/edt_chqdate"
android:layout_marginTop="10dp"
android:inputType="date"
android:hint="click to set date" android:gravity="center" android:paddingLeft="10dp" android:textColor="#000" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_marginTop="240dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:textColor="#000"
android:text="chequeamount"/>
<EditText
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/edt_chequeamnt"
android:layout_marginTop="10dp"
android:inputType="numberDecimal"
android:paddingLeft="10dp"
android:textColor="#000"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_marginTop="320dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:textColor="#000"
android:text="accountnumber" />
<EditText
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/edt_chequaccount"
android:layout_marginTop="10dp"
android:paddingLeft="10dp"
android:textColor="#000"
/>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="gone"
android:layout_marginLeft="0dp"
android:id="@+id/L22"
android:layout_marginRight="0dp"
android:layout_marginTop="100dp"
card_view:cardCornerRadius="4dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:textColor="#000"
android:text="DD#"/>
<EditText
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/editDd"
android:layout_marginTop="10dp"
android:paddingLeft="10dp"
android:textColor="#000"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_marginTop="80dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:textColor="#000"
android:text="Bank Name"/>
<EditText
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/edit_bank_name"
android:layout_marginTop="10dp"
android:paddingLeft="10dp"
android:textColor="#000"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:visibility="gone"
android:layout_marginTop="160dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:textColor="#000"
android:text="Dddate"/>
<EditText
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/editdddate"
android:layout_marginTop="10dp"
android:paddingLeft="10dp"
android:textColor="#000"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_marginTop="240dp"
android:visibility="gone"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:textColor="#000"
android:text="Ddamount"/>
<EditText
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/edit_ddamount"
android:layout_marginTop="10dp"
android:paddingLeft="10dp"
android:textColor="#000"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:visibility="gone"
android:layout_marginTop="320dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:textColor="#000"
android:text="Ddaccount"/>
<EditText
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/edit_dd_account"
android:layout_marginTop="10dp"
android:paddingLeft="10dp"
android:textColor="#000"
/>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="0dp"
android:id="@+id/L33"
android:visibility="gone"
android:layout_marginRight="0dp"
android:layout_marginTop="100dp"
card_view:cardCornerRadius="4dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:textColor="#000"
android:text="MO#"/>
<EditText
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/edit_MO"
android:layout_marginTop="10dp"
android:paddingLeft="10dp"
android:textColor="#000"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_marginTop="80dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:textColor="#000"
android:text="Purpose of issue"/>
<EditText
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/edit_mo_issue"
android:layout_marginTop="10dp"
android:paddingLeft="10dp"
android:textColor="#000"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:visibility="gone"
android:layout_marginTop="160dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:textColor="#000"
android:text="MOdate"/>
<EditText
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/edit_mo_date"
android:layout_marginTop="10dp"
android:paddingLeft="10dp"
android:textColor="#000"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_marginTop="240dp"
android:visibility="gone"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:textColor="#000"
android:text="MOamount"/>
<EditText
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/edit_mo_amount"
android:layout_marginTop="10dp"
android:paddingLeft="10dp"
android:textColor="#000"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:visibility="gone"
android:layout_marginTop="320dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:textColor="#000"
android:text="MOaccount"/>
<EditText
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/edt_mo_account"
android:layout_marginTop="10dp"
android:paddingLeft="10dp"
android:textColor="#000"
/>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
https://proandroiddev.com/configuring-retrofit-2-client-in-android-130455eaccbd