Merge branch 'features/history' into develop
This commit is contained in:
commit
1432957dfc
Binary file not shown.
|
@ -41,7 +41,8 @@
|
||||||
<activity android:name="monnethic.mobile.wallet.CreateWalletActivity" />
|
<activity android:name="monnethic.mobile.wallet.CreateWalletActivity" />
|
||||||
<activity android:name="monnethic.mobile.wallet.SelectWalletActivity" />
|
<activity android:name="monnethic.mobile.wallet.SelectWalletActivity" />
|
||||||
<activity android:name="monnethic.mobile.search.SearchUser" />
|
<activity android:name="monnethic.mobile.search.SearchUser" />
|
||||||
<activity android:name="monnethic.mobile.search.DisplayWalletSearch"></activity>
|
<activity android:name="monnethic.mobile.search.DisplayWalletSearch" />
|
||||||
|
<activity android:name="monnethic.mobile.history.HistoryActivity"></activity>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
|
@ -10,6 +10,10 @@ public class Transaction {
|
||||||
private String transactionUnit;
|
private String transactionUnit;
|
||||||
|
|
||||||
//Constructors
|
//Constructors
|
||||||
|
public Transaction(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public Transaction(String transactionFrom, String transactionTo, String transactionHash, Double transactionAmount, String transactionUnit) {
|
public Transaction(String transactionFrom, String transactionTo, String transactionHash, Double transactionAmount, String transactionUnit) {
|
||||||
this.transactionFrom = transactionFrom;
|
this.transactionFrom = transactionFrom;
|
||||||
this.transactionTo = transactionTo;
|
this.transactionTo = transactionTo;
|
||||||
|
|
202
app/src/main/java/monnethic/mobile/history/HistoryActivity.java
Normal file
202
app/src/main/java/monnethic/mobile/history/HistoryActivity.java
Normal file
|
@ -0,0 +1,202 @@
|
||||||
|
package monnethic.mobile.history;
|
||||||
|
|
||||||
|
import android.app.DatePickerDialog;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.AsyncTask;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.CompoundButton;
|
||||||
|
import android.widget.DatePicker;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.ListView;
|
||||||
|
import android.widget.Spinner;
|
||||||
|
import android.widget.Switch;
|
||||||
|
import android.widget.Toast;
|
||||||
|
import com.example.monnthic.monnethicmobile.R;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import monnethic.mobile.database.Transaction;
|
||||||
|
import monnethic.mobile.restApi.Config;
|
||||||
|
import monnethic.mobile.restApi.TransactionApiHandler;
|
||||||
|
import monnethic.mobile.transaction.TransactionAdapter;
|
||||||
|
|
||||||
|
public class HistoryActivity extends AppCompatActivity {
|
||||||
|
private String wallet_hash;
|
||||||
|
private String user_hash;
|
||||||
|
private String user_password;
|
||||||
|
private String session_id;
|
||||||
|
|
||||||
|
final Calendar calendar1 = Calendar.getInstance();
|
||||||
|
final Calendar calendar2 = Calendar.getInstance();
|
||||||
|
private Button btnSearchTransactions;
|
||||||
|
private EditText inputSize;
|
||||||
|
private EditText fromDate;
|
||||||
|
private EditText toDate;
|
||||||
|
private Spinner spinner;
|
||||||
|
private Switch aSwitch;
|
||||||
|
private ListView listView;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_history);
|
||||||
|
|
||||||
|
getIntentValue();
|
||||||
|
initView();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getIntentValue(){
|
||||||
|
Intent intent = getIntent();
|
||||||
|
user_hash = intent.getStringExtra("USER_HASH");
|
||||||
|
user_password = intent.getStringExtra("USER_PWD");
|
||||||
|
session_id = intent.getStringExtra("SESSION_ID");
|
||||||
|
wallet_hash = intent.getStringExtra("WALLET_HASH");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initView(){
|
||||||
|
dateInit();
|
||||||
|
buttonInit();
|
||||||
|
switchInit();
|
||||||
|
spinnerInit();
|
||||||
|
listViewHandler();
|
||||||
|
inputSize = findViewById(R.id.inputSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void dateInit(){
|
||||||
|
DatePickerDialog.OnDateSetListener fromDatePicker = new DatePickerDialog.OnDateSetListener() {
|
||||||
|
@Override
|
||||||
|
public void onDateSet(DatePicker datePicker, int year, int monthOfYear, int dayOfMonth) {
|
||||||
|
calendar1.set(Calendar.YEAR, year);
|
||||||
|
calendar1.set(Calendar.MONTH, monthOfYear);
|
||||||
|
calendar1.set(Calendar.DAY_OF_MONTH, dayOfMonth);
|
||||||
|
updateLabel(0);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
fromDate = findViewById(R.id.fromDate);
|
||||||
|
fromDate.setEnabled(false);
|
||||||
|
fromDate.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
new DatePickerDialog(HistoryActivity.this, fromDatePicker, calendar1.get(Calendar.YEAR),
|
||||||
|
calendar1.get(Calendar.MONTH), calendar1.get(Calendar.DAY_OF_MONTH)).show();
|
||||||
|
//Toast.makeText(HistoryActivity.this,"Clicked fromDate",Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
DatePickerDialog.OnDateSetListener toDatePicker = new DatePickerDialog.OnDateSetListener() {
|
||||||
|
@Override
|
||||||
|
public void onDateSet(DatePicker datePicker, int year, int monthOfYear, int dayOfMonth) {
|
||||||
|
calendar2.set(Calendar.YEAR, year);
|
||||||
|
calendar2.set(Calendar.MONTH, monthOfYear);
|
||||||
|
calendar2.set(Calendar.DAY_OF_MONTH, dayOfMonth);
|
||||||
|
updateLabel(1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
toDate = findViewById(R.id.toDate);
|
||||||
|
toDate.setEnabled(false);
|
||||||
|
toDate.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
new DatePickerDialog(HistoryActivity.this, toDatePicker, calendar2.get(Calendar.YEAR),
|
||||||
|
calendar2.get(Calendar.MONTH), calendar2.get(Calendar.DAY_OF_MONTH)).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateLabel(int idDate){
|
||||||
|
String myFormat = "dd-MM-yyyy";
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat(myFormat, Locale.FRANCE);
|
||||||
|
if(idDate==0){
|
||||||
|
fromDate.setText(sdf.format(calendar1.getTime()));
|
||||||
|
}else {
|
||||||
|
toDate.setText(sdf.format(calendar2.getTime()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void buttonInit(){
|
||||||
|
btnSearchTransactions = findViewById(R.id.buttonSearchTransaction);
|
||||||
|
btnSearchTransactions.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
Toast.makeText(HistoryActivity.this,"Spinner :"+String.valueOf(spinner.getSelectedItem()),Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void switchInit(){
|
||||||
|
aSwitch = findViewById(R.id.switchDate);
|
||||||
|
aSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
|
||||||
|
if(aSwitch.isChecked()){
|
||||||
|
fromDate.setEnabled(true);
|
||||||
|
toDate.setEnabled(true);
|
||||||
|
}else{
|
||||||
|
fromDate.setEnabled(false);
|
||||||
|
toDate.setEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void spinnerInit(){
|
||||||
|
spinner = findViewById(R.id.spinner);
|
||||||
|
|
||||||
|
List<String> listOptions = new ArrayList<>();
|
||||||
|
listOptions.add("All");
|
||||||
|
listOptions.add("Received");
|
||||||
|
listOptions.add("Sent");
|
||||||
|
ArrayAdapter<String> adapterOptions = new ArrayAdapter<>(this,android.R.layout.simple_spinner_dropdown_item,listOptions);
|
||||||
|
adapterOptions.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||||
|
spinner.setAdapter(adapterOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void listViewHandler(){
|
||||||
|
listView = findViewById(R.id.listViewTransactions);
|
||||||
|
ArrayList<Transaction> transactions = new ArrayList<>();
|
||||||
|
try{
|
||||||
|
transactions = new getTransactionTask().execute(Config.TRANSACTION_LATEST,wallet_hash).get();
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
TransactionAdapter adapter = new TransactionAdapter(this,transactions,wallet_hash);
|
||||||
|
listView.setAdapter(adapter);
|
||||||
|
|
||||||
|
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
|
||||||
|
Transaction t = (Transaction) listView.getItemAtPosition(i);
|
||||||
|
Toast.makeText(HistoryActivity.this,"TxID: "+t.getTransactionHash(),Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private class getTransactionTask extends AsyncTask<String,ArrayList<Transaction>,ArrayList<Transaction>> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ArrayList<Transaction> doInBackground(String... strings) {
|
||||||
|
ArrayList<Transaction> transactionsList = new ArrayList<>();
|
||||||
|
try{
|
||||||
|
TransactionApiHandler transactionApiHandler = new TransactionApiHandler();
|
||||||
|
transactionsList = transactionApiHandler.getTransactions(strings[0],strings[1]);
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return transactionsList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -25,7 +25,7 @@ public class Config {
|
||||||
//TRANSACTION
|
//TRANSACTION
|
||||||
static public String TRANSACTION_SEND = BASE_URL_TRANSACTION+"send";
|
static public String TRANSACTION_SEND = BASE_URL_TRANSACTION+"send";
|
||||||
static public String TRANSACTION_GET = BASE_URL_TRANSACTION+"get";
|
static public String TRANSACTION_GET = BASE_URL_TRANSACTION+"get";
|
||||||
static public String TRANSACTION_LATEST = BASE_URL_TRANSACTION+"getLatest";
|
static public String TRANSACTION_LATEST = BASE_URL_TRANSACTION+"/get/latest";
|
||||||
static public String TRANSACTION_ALL = BASE_URL_TRANSACTION+"getAll";
|
static public String TRANSACTION_ALL = BASE_URL_TRANSACTION+"getAll";
|
||||||
static public String TRANSACTION_SENT = BASE_URL_TRANSACTION+"sent";
|
static public String TRANSACTION_SENT = BASE_URL_TRANSACTION+"sent";
|
||||||
static public String TRANSACTION_RECEIVED = BASE_URL_TRANSACTION+"received";
|
static public String TRANSACTION_RECEIVED = BASE_URL_TRANSACTION+"received";
|
||||||
|
|
|
@ -41,6 +41,8 @@ public class HttpCallHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String postHttp(URL url, Map<String,String> params) throws Exception {
|
public String postHttp(URL url, Map<String,String> params) throws Exception {
|
||||||
String returnValue=null;
|
String returnValue=null;
|
||||||
HttpURLConnection urlConnection = null;
|
HttpURLConnection urlConnection = null;
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
package monnethic.mobile.restApi;
|
package monnethic.mobile.restApi;
|
||||||
|
|
||||||
|
import org.json.JSONArray;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import monnethic.mobile.database.Transaction;
|
||||||
import monnethic.mobile.transaction.SendingTransaction;
|
import monnethic.mobile.transaction.SendingTransaction;
|
||||||
|
|
||||||
public class TransactionApiHandler {
|
public class TransactionApiHandler {
|
||||||
|
@ -27,4 +31,35 @@ public class TransactionApiHandler {
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ArrayList<Transaction> getTransactions(String url, String wallet_hash){
|
||||||
|
ArrayList<Transaction> transactionsList = new ArrayList<>();
|
||||||
|
HttpCallHandler httpCallHandler = new HttpCallHandler();
|
||||||
|
try{
|
||||||
|
url = url+"?wallet_hash="+wallet_hash;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String response = httpCallHandler.getHttp(new URL(url));
|
||||||
|
JSONArray jsonArray = new JSONArray(response);
|
||||||
|
|
||||||
|
for(int i=0; i<jsonArray.length(); i++){
|
||||||
|
Transaction transaction = new Transaction();
|
||||||
|
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||||
|
|
||||||
|
transaction.setTransactionDate(Long.parseLong(jsonObject.getString("transaction_date")));
|
||||||
|
transaction.setTransactionFrom(jsonObject.getString("transaction_from"));
|
||||||
|
transaction.setTransactionTo(jsonObject.getString("transaction_to"));
|
||||||
|
transaction.setTransactionHash(jsonObject.getString("transaction_hash"));
|
||||||
|
transaction.setTransactionAmount(jsonObject.getDouble("transaction_amount"));
|
||||||
|
transaction.setTransactionUnit(jsonObject.getString("transaction_unit"));
|
||||||
|
|
||||||
|
transactionsList.add(transaction);
|
||||||
|
}
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return transactionsList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,64 @@
|
||||||
|
package monnethic.mobile.transaction;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.example.monnthic.monnethicmobile.R;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import monnethic.mobile.database.Transaction;
|
||||||
|
|
||||||
|
public class TransactionAdapter extends ArrayAdapter<Transaction> {
|
||||||
|
private String wallet_hash;
|
||||||
|
|
||||||
|
public TransactionAdapter(Context context, ArrayList<Transaction> transactions, String wallet_hash){
|
||||||
|
super(context,0,transactions);
|
||||||
|
this.wallet_hash = wallet_hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getView(int position, View convertView, ViewGroup parent){
|
||||||
|
Transaction transaction = getItem(position);
|
||||||
|
|
||||||
|
if(convertView == null){
|
||||||
|
convertView = LayoutInflater.from(getContext()).inflate(R.layout.transaction_view_template, parent, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
TextView txID = convertView.findViewById(R.id.displayTxId);
|
||||||
|
TextView date = convertView.findViewById(R.id.displayTxDate);
|
||||||
|
TextView type = convertView.findViewById(R.id.displayTxType);
|
||||||
|
TextView amount = convertView.findViewById(R.id.displayTxAmount);
|
||||||
|
|
||||||
|
|
||||||
|
ViewGroup.LayoutParams params = convertView.getLayoutParams();
|
||||||
|
params.height = 250;
|
||||||
|
convertView.setLayoutParams(params);
|
||||||
|
|
||||||
|
String myFormat = "dd-MM-yyyy HH:mm:ss";
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat(myFormat, Locale.FRANCE);
|
||||||
|
Date dateTransaction = new Date(transaction.getTransactionDate());
|
||||||
|
|
||||||
|
String typeOfTransaction;
|
||||||
|
if(transaction.getTransactionFrom().equals(wallet_hash)){
|
||||||
|
typeOfTransaction="Sent";
|
||||||
|
}else{
|
||||||
|
typeOfTransaction="Received";
|
||||||
|
}
|
||||||
|
|
||||||
|
txID.setText(transaction.getTransactionHash());
|
||||||
|
date.setText(sdf.format(dateTransaction));
|
||||||
|
type.setText(typeOfTransaction);
|
||||||
|
amount.setText(String.valueOf(transaction.getTransactionAmount()));
|
||||||
|
|
||||||
|
return convertView;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -10,6 +10,7 @@ import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import com.example.monnthic.monnethicmobile.R;
|
import com.example.monnthic.monnethicmobile.R;
|
||||||
|
|
||||||
|
import monnethic.mobile.history.HistoryActivity;
|
||||||
import monnethic.mobile.restApi.SessionApiHandler;
|
import monnethic.mobile.restApi.SessionApiHandler;
|
||||||
import monnethic.mobile.restApi.WalletApiHandler;
|
import monnethic.mobile.restApi.WalletApiHandler;
|
||||||
import monnethic.mobile.transaction.MakePayementActivity;
|
import monnethic.mobile.transaction.MakePayementActivity;
|
||||||
|
@ -32,6 +33,7 @@ public class UserAccountActivity extends AppCompatActivity {
|
||||||
Button buttonReceive = findViewById(R.id.buttonReceive);
|
Button buttonReceive = findViewById(R.id.buttonReceive);
|
||||||
Button buttonSettings = findViewById(R.id.buttonSettings);
|
Button buttonSettings = findViewById(R.id.buttonSettings);
|
||||||
Button buttonRefresh = findViewById(R.id.buttonRefreshBalance);
|
Button buttonRefresh = findViewById(R.id.buttonRefreshBalance);
|
||||||
|
Button buttonHistory = findViewById(R.id.goToHistory);
|
||||||
|
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
user_hash = intent.getStringExtra("USER_HASH");
|
user_hash = intent.getStringExtra("USER_HASH");
|
||||||
|
@ -69,6 +71,12 @@ public class UserAccountActivity extends AppCompatActivity {
|
||||||
new GetUserBalanceTask().execute(wallet_hash);
|
new GetUserBalanceTask().execute(wallet_hash);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
buttonHistory.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
history();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
String[] params = {wallet_hash};
|
String[] params = {wallet_hash};
|
||||||
new GetUserBalanceTask().execute(params);
|
new GetUserBalanceTask().execute(params);
|
||||||
|
@ -94,6 +102,15 @@ public class UserAccountActivity extends AppCompatActivity {
|
||||||
Toast.makeText(this, "Coming soon", Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "Coming soon", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void history(){
|
||||||
|
Intent historyIntent = new Intent(UserAccountActivity.this, HistoryActivity.class);
|
||||||
|
historyIntent.putExtra("USER_HASH",user_hash);
|
||||||
|
historyIntent.putExtra("USER_PWD",user_password);
|
||||||
|
historyIntent.putExtra("WALLET_HASH",wallet_hash);
|
||||||
|
historyIntent.putExtra("SESSION_ID",session_id);
|
||||||
|
UserAccountActivity.this.startActivity(historyIntent);
|
||||||
|
}
|
||||||
|
|
||||||
public class GetUserBalanceTask extends AsyncTask<String,String,Double>
|
public class GetUserBalanceTask extends AsyncTask<String,String,Double>
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
|
|
99
app/src/main/res/layout/activity_history.xml
Normal file
99
app/src/main/res/layout/activity_history.xml
Normal file
|
@ -0,0 +1,99 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context="monnethic.mobile.history.HistoryActivity">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="35dp"
|
||||||
|
android:layout_marginLeft="3dp"
|
||||||
|
android:layout_marginTop="3dp"
|
||||||
|
android:layout_marginRight="3dp">
|
||||||
|
|
||||||
|
<Switch
|
||||||
|
android:id="@+id/switchDate"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="35dp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/fromDate"
|
||||||
|
android:layout_width="130dp"
|
||||||
|
android:layout_height="35dp"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_marginStart="30dp"
|
||||||
|
android:layout_marginTop="0dp"
|
||||||
|
android:layout_toEndOf="@+id/switchDate"
|
||||||
|
android:clickable="true"
|
||||||
|
android:editable="false"
|
||||||
|
android:ems="10"
|
||||||
|
android:hint="From"
|
||||||
|
android:inputType="none"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/toDate"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="35dp"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_marginStart="30dp"
|
||||||
|
android:layout_marginTop="0dp"
|
||||||
|
android:layout_marginEnd="25dp"
|
||||||
|
android:layout_toEndOf="@+id/fromDate"
|
||||||
|
android:clickable="true"
|
||||||
|
android:editable="false"
|
||||||
|
android:ems="10"
|
||||||
|
android:hint="To"
|
||||||
|
android:inputType="none"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_marginLeft="3dp"
|
||||||
|
android:layout_marginRight="3dp">
|
||||||
|
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/spinner"
|
||||||
|
android:layout_width="120dp"
|
||||||
|
android:layout_height="40dp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/inputSize"
|
||||||
|
android:layout_width="65dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:layout_marginTop="0dp"
|
||||||
|
android:layout_toEndOf="@+id/spinner"
|
||||||
|
android:ems="10"
|
||||||
|
android:hint="Size"
|
||||||
|
android:inputType="number"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/buttonSearchTransaction"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_marginTop="0dp"
|
||||||
|
android:layout_marginEnd="5dp"
|
||||||
|
android:text="Search"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<ListView
|
||||||
|
android:id="@+id/listViewTransactions"
|
||||||
|
android:layout_marginLeft="3dp"
|
||||||
|
android:layout_marginRight="3dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:dividerHeight="5dp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
|
@ -25,27 +25,27 @@
|
||||||
android:id="@+id/buttonPayement"
|
android:id="@+id/buttonPayement"
|
||||||
android:layout_width="200dp"
|
android:layout_width="200dp"
|
||||||
android:layout_height="45dp"
|
android:layout_height="45dp"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_above="@+id/buttonReceive"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_marginBottom="250dp"
|
android:layout_marginBottom="20dp"
|
||||||
android:text="Payement" />
|
android:text="Payement" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/buttonReceive"
|
android:id="@+id/buttonReceive"
|
||||||
android:layout_width="200dp"
|
android:layout_width="200dp"
|
||||||
android:layout_height="45dp"
|
android:layout_height="45dp"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_above="@+id/buttonRefreshBalance"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_marginBottom="180dp"
|
android:layout_marginBottom="20dp"
|
||||||
android:text="Receive" />
|
android:text="Receive" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/buttonRefreshBalance"
|
android:id="@+id/buttonRefreshBalance"
|
||||||
android:layout_width="200dp"
|
android:layout_width="200dp"
|
||||||
android:layout_height="45dp"
|
android:layout_height="45dp"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_above="@+id/goToHistory"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_marginBottom="115dp"
|
android:layout_marginBottom="20dp"
|
||||||
android:text="Refresh" />
|
android:text="Refresh" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -83,5 +83,14 @@
|
||||||
android:textIsSelectable="true"
|
android:textIsSelectable="true"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/goToHistory"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="45dp"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginBottom="55dp"
|
||||||
|
android:text="History" />
|
||||||
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
109
app/src/main/res/layout/transaction_view_template.xml
Normal file
109
app/src/main/res/layout/transaction_view_template.xml
Normal file
|
@ -0,0 +1,109 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<android.support.constraint.ConstraintLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView5"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="3dp"
|
||||||
|
android:layout_weight="0.01"
|
||||||
|
android:text="TxID:"
|
||||||
|
android:textSize="10sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/displayTxId"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="3dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:textSize="10sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView6"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="3dp"
|
||||||
|
android:layout_weight="0.01"
|
||||||
|
android:text="Date:"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/displayTxDate"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginLeft="3dp"
|
||||||
|
android:layout_marginRight="3dp"
|
||||||
|
android:textSize="11sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView7"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0.01"
|
||||||
|
android:text="Type:"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/displayTxType"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="3dp"
|
||||||
|
android:layout_marginRight="3dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView8"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0.01"
|
||||||
|
android:text="Amount:"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/displayTxAmount"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="3dp"
|
||||||
|
android:layout_marginRight="3dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</android.support.constraint.ConstraintLayout>
|
Loading…
Reference in a new issue