41 lines
1.3 KiB
Java
41 lines
1.3 KiB
Java
package monnethic.mobile.search;
|
|
|
|
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.util.ArrayList;
|
|
|
|
public class DisplayWalletAdapter extends ArrayAdapter<DisplayWallet> {
|
|
public DisplayWalletAdapter(Context context, ArrayList<DisplayWallet> dWallets){
|
|
super(context,0,dWallets);
|
|
}
|
|
|
|
@Override
|
|
public View getView(int position, View convertView, ViewGroup parent) {
|
|
DisplayWallet dWallet = getItem(position);
|
|
|
|
if(convertView == null){
|
|
convertView = LayoutInflater.from(getContext()).inflate(R.layout.wallet_search_template, parent, false);
|
|
}
|
|
|
|
TextView user_name = convertView.findViewById(R.id.userNameSearch);
|
|
TextView wallet_hash = convertView.findViewById(R.id.walletHashSearch);
|
|
|
|
ViewGroup.LayoutParams params = convertView.getLayoutParams();
|
|
params.height = 300;
|
|
convertView.setLayoutParams(params);
|
|
|
|
String userFullName = dWallet.getUser_name()+" "+dWallet.getUser_firstname();
|
|
user_name.setText(userFullName);
|
|
wallet_hash.setText(dWallet.getWallet_hash());
|
|
|
|
return convertView;
|
|
}
|
|
}
|