// Path: saltedge-library/src/main/java/com/saltedge/sdk/model/SETransaction.java
// public class SETransaction extends BaseModel {
// 
//     @SerializedName(SEConstants.KEY_DUPLICATED)
//     private boolean duplicated;
// 
//     @SerializedName(SEConstants.KEY_MODE)
//     private String mode;
// 
//     @SerializedName(SEConstants.KEY_STATUS)
//     private String status;
// 
//     @SerializedName(SEConstants.KEY_MADE_ON)
//     private String madeOn;
// 
//     @SerializedName(SEConstants.KEY_AMOUNT)
//     private double amount;
// 
//     @SerializedName(SEConstants.KEY_CURRENCY_CODE)
//     private String currencyCode;
// 
//     @SerializedName(SEConstants.KEY_DESCRIPTION)
//     private String description;
// 
//     @SerializedName(SEConstants.KEY_CATEGORY)
//     private String category;
// 
//     @SerializedName(SEConstants.KEY_ACCOUNT_ID)
//     private String accountId;
// 
//     @SerializedName(SEConstants.KEY_EXTRA)
//     private JSONObject extra;
// 
// // GETTER AND SETTERS
// 
//     public boolean isDuplicated() {
//         return duplicated;
//     }
// 
//     public void setDuplicated(boolean duplicated) {
//         this.duplicated = duplicated;
//     }
// 
//     public String getMode() {
//         return mode;
//     }
// 
//     public void setMode(String mode) {
//         this.mode = mode;
//     }
// 
//     public String getStatus() {
//         return status;
//     }
// 
//     public void setStatus(String status) {
//         this.status = status;
//     }
// 
//     public String getMadeOn() {
//         return madeOn;
//     }
// 
//     public Date getMadeOnDate() {
//         return SEDateTools.parseShortStringToDate(madeOn);
//     }
// 
//     public void setMadeOn(String madeOn) {
//         this.madeOn = madeOn;
//     }
// 
//     public double getAmount() {
//         return amount;
//     }
// 
//     public void setAmount(double amount) {
//         this.amount = amount;
//     }
// 
//     public String getCurrencyCode() {
//         return currencyCode;
//     }
// 
//     public void setCurrencyCode(String currencyCode) {
//         this.currencyCode = currencyCode;
//     }
// 
//     public String getDescription() {
//         return description;
//     }
// 
//     public void setDescription(String description) {
//         this.description = description;
//     }
// 
//     public String getCategory() {
//         return category;
//     }
// 
//     public void setCategory(String category) {
//         this.category = category;
//     }
// 
//     public void setAccountId(String accountId) {
//         this.accountId = accountId;
//     }
// 
//     public String getAccountId() {
//         return accountId;
//     }
// 
//     public JSONObject getExtra() {
//         return extra;
//     }
// 
//     public void setExtra(JSONObject extra) {
//         this.extra = extra;
//     }
// }
// 
// Path: app/src/main/java/com/saltedge/sdk/sample/utils/DateTools.java
// public class DateTools {
// 
//     public static String formatDateToString(Date date) {
//         SimpleDateFormat sdf = new SimpleDateFormat("MMM dd, yyyy", Locale.getDefault());
//         try {
//             return sdf.format(date);
//         } catch (NullPointerException e) {
//             e.printStackTrace();
//         }
//         return "";
//     }
// }


import com.saltedge.sdk.model.SETransaction;
import com.saltedge.sdk.sample.R;
import com.saltedge.sdk.sample.utils.DateTools;
import java.util.ArrayList;
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 androidx.annotation.NonNull;
/*
Copyright © 2019 Salt Edge. https://saltedge.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
package com.saltedge.sdk.sample.adapters;





public class TransactionsAdapter extends ArrayAdapter<SETransaction> {

    public TransactionsAdapter(Context context, ArrayList<SETransaction> transactions) {
        super(context, 0, transactions);
    }

    @NonNull
    @Override
    public View getView(int position, View convertView, @NonNull ViewGroup parent) {
        SETransaction transaction = getItem(position);
        // Check if an existing view is being reused, otherwise inflate the view
        if (convertView == null) {
            convertView = LayoutInflater.from(getContext()).inflate(R.layout.list_item_transaction, parent, false);
        }
        // Lookup view for data population
        TextView dateLabel = convertView.findViewById(R.id.dateLabel);
        TextView amountLabel = convertView.findViewById(R.id.amountLabel);
        TextView descriptionLabel = convertView.findViewById(R.id.description);
        // Populate the data into the template view using the data object
        String dateText = "Invalid entry";
        String amountText = "";
        String descriptionText = "";
        if (transaction != null) {
// Path: saltedge-library/src/main/java/com/saltedge/sdk/model/SETransaction.java
// public class SETransaction extends BaseModel {
// 
//     @SerializedName(SEConstants.KEY_DUPLICATED)
//     private boolean duplicated;
// 
//     @SerializedName(SEConstants.KEY_MODE)
//     private String mode;
// 
//     @SerializedName(SEConstants.KEY_STATUS)
//     private String status;
// 
//     @SerializedName(SEConstants.KEY_MADE_ON)
//     private String madeOn;
// 
//     @SerializedName(SEConstants.KEY_AMOUNT)
//     private double amount;
// 
//     @SerializedName(SEConstants.KEY_CURRENCY_CODE)
//     private String currencyCode;
// 
//     @SerializedName(SEConstants.KEY_DESCRIPTION)
//     private String description;
// 
//     @SerializedName(SEConstants.KEY_CATEGORY)
//     private String category;
// 
//     @SerializedName(SEConstants.KEY_ACCOUNT_ID)
//     private String accountId;
// 
//     @SerializedName(SEConstants.KEY_EXTRA)
//     private JSONObject extra;
// 
// // GETTER AND SETTERS
// 
//     public boolean isDuplicated() {
//         return duplicated;
//     }
// 
//     public void setDuplicated(boolean duplicated) {
//         this.duplicated = duplicated;
//     }
// 
//     public String getMode() {
//         return mode;
//     }
// 
//     public void setMode(String mode) {
//         this.mode = mode;
//     }
// 
//     public String getStatus() {
//         return status;
//     }
// 
//     public void setStatus(String status) {
//         this.status = status;
//     }
// 
//     public String getMadeOn() {
//         return madeOn;
//     }
// 
//     public Date getMadeOnDate() {
//         return SEDateTools.parseShortStringToDate(madeOn);
//     }
// 
//     public void setMadeOn(String madeOn) {
//         this.madeOn = madeOn;
//     }
// 
//     public double getAmount() {
//         return amount;
//     }
// 
//     public void setAmount(double amount) {
//         this.amount = amount;
//     }
// 
//     public String getCurrencyCode() {
//         return currencyCode;
//     }
// 
//     public void setCurrencyCode(String currencyCode) {
//         this.currencyCode = currencyCode;
//     }
// 
//     public String getDescription() {
//         return description;
//     }
// 
//     public void setDescription(String description) {
//         this.description = description;
//     }
// 
//     public String getCategory() {
//         return category;
//     }
// 
//     public void setCategory(String category) {
//         this.category = category;
//     }
// 
//     public void setAccountId(String accountId) {
//         this.accountId = accountId;
//     }
// 
//     public String getAccountId() {
//         return accountId;
//     }
// 
//     public JSONObject getExtra() {
//         return extra;
//     }
// 
//     public void setExtra(JSONObject extra) {
//         this.extra = extra;
//     }
// }
// 
// Path: app/src/main/java/com/saltedge/sdk/sample/utils/DateTools.java
// public class DateTools {
// 
//     public static String formatDateToString(Date date) {
//         SimpleDateFormat sdf = new SimpleDateFormat("MMM dd, yyyy", Locale.getDefault());
//         try {
//             return sdf.format(date);
//         } catch (NullPointerException e) {
//             e.printStackTrace();
//         }
//         return "";
//     }
// }


// Path: app/src/main/java/com/saltedge/sdk/sample/adapters/TransactionsAdapter.java
import com.saltedge.sdk.model.SETransaction;
import com.saltedge.sdk.sample.R;
import com.saltedge.sdk.sample.utils.DateTools;
import java.util.ArrayList;
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 androidx.annotation.NonNull;

/*
Copyright © 2019 Salt Edge. https://saltedge.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
package com.saltedge.sdk.sample.adapters;





public class TransactionsAdapter extends ArrayAdapter<SETransaction> {

    public TransactionsAdapter(Context context, ArrayList<SETransaction> transactions) {
        super(context, 0, transactions);
    }

    @NonNull
    @Override
    public View getView(int position, View convertView, @NonNull ViewGroup parent) {
        SETransaction transaction = getItem(position);
        // Check if an existing view is being reused, otherwise inflate the view
        if (convertView == null) {
            convertView = LayoutInflater.from(getContext()).inflate(R.layout.list_item_transaction, parent, false);
        }
        // Lookup view for data population
        TextView dateLabel = convertView.findViewById(R.id.dateLabel);
        TextView amountLabel = convertView.findViewById(R.id.amountLabel);
        TextView descriptionLabel = convertView.findViewById(R.id.description);
        // Populate the data into the template view using the data object
        String dateText = "Invalid entry";
        String amountText = "";
        String descriptionText = "";
        if (transaction != null) {
            dateText = DateTools.formatDateToString(transaction.getMadeOnDate());