diff --git a/app/src/main/java/cy/agorise/crystalwallet/views/TransactionListView.java b/app/src/main/java/cy/agorise/crystalwallet/views/TransactionListView.java index 6a7f4a0..7a8369b 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/views/TransactionListView.java +++ b/app/src/main/java/cy/agorise/crystalwallet/views/TransactionListView.java @@ -5,6 +5,7 @@ import android.arch.paging.PagedListAdapter; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.util.AttributeSet; +import android.view.LayoutInflater; import android.view.View; import android.widget.ListView; import android.widget.RelativeLayout; @@ -21,15 +22,34 @@ import cy.agorise.crystalwallet.viewmodels.TransactionListViewModel; public class TransactionListView extends RelativeLayout { + LayoutInflater mInflater; + View rootView; RecyclerView listView; TransactionListAdapter listAdapter; TransactionListViewModel transactionListViewModel; + public TransactionListView(Context context){ + super(context); + this.mInflater = LayoutInflater.from(context); + init(); + } + public TransactionListView(Context context, AttributeSet attrs) { super(context, attrs); - rootView = inflate(context, R.layout.transaction_list, this); + this.mInflater = LayoutInflater.from(context); + init(); + } + + public TransactionListView(Context context, AttributeSet attrs, int defStyle){ + super(context, attrs, defStyle); + this.mInflater = LayoutInflater.from(context); + init(); + } + + public void init(){ + rootView = mInflater.inflate(R.layout.transaction_list, this, true); this.listView = rootView.findViewById(R.id.transactionListView); } diff --git a/app/src/main/res/layout/transaction_list.xml b/app/src/main/res/layout/transaction_list.xml index 59e8e71..6f02e45 100644 --- a/app/src/main/res/layout/transaction_list.xml +++ b/app/src/main/res/layout/transaction_list.xml @@ -3,7 +3,7 @@ android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> -