diff --git a/app/src/main/java/monnethic/mobile/wallet/SelectWalletActivity.java b/app/src/main/java/monnethic/mobile/wallet/SelectWalletActivity.java index fe3a482..f37d770 100644 --- a/app/src/main/java/monnethic/mobile/wallet/SelectWalletActivity.java +++ b/app/src/main/java/monnethic/mobile/wallet/SelectWalletActivity.java @@ -36,7 +36,8 @@ public class SelectWalletActivity extends AppCompatActivity { } Log.i("SelectWalletActivity", "userWallets : "+userWallets); - ArrayAdapter adapter = new ArrayAdapter(this, R.layout.activity_select_wallet, userWallets); + WalletAdapter adapter = new WalletAdapter(this,userWallets); + //ArrayAdapter adapter = new ArrayAdapter(this, R.layout.activity_select_wallet, userWallets); listView.setAdapter(adapter); //TODO diff --git a/app/src/main/java/monnethic/mobile/wallet/WalletAdapter.java b/app/src/main/java/monnethic/mobile/wallet/WalletAdapter.java new file mode 100644 index 0000000..89191d1 --- /dev/null +++ b/app/src/main/java/monnethic/mobile/wallet/WalletAdapter.java @@ -0,0 +1,41 @@ +package monnethic.mobile.wallet; + +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 WalletAdapter extends ArrayAdapter { + public WalletAdapter(Context context, ArrayList wallets){ + super(context,0,wallets); + } + + @Override + public View getView(int position, View convertView, ViewGroup parent){ + Wallet wallet = getItem(position); + + if(convertView == null){ + convertView = LayoutInflater.from(getContext()).inflate(R.layout.wallet_view_template, parent, false); + } + + TextView wallet_hash = (TextView) convertView.findViewById(R.id.wallet_hash); + TextView wallet_type = (TextView) convertView.findViewById(R.id.wallet_type); + TextView wallet_balance = (TextView) convertView.findViewById(R.id.wallet_balance); + + ViewGroup.LayoutParams params = convertView.getLayoutParams(); + params.height = 300; + convertView.setLayoutParams(params); + + wallet_hash.setText(wallet.getWallet_hash()); + wallet_type.setText(wallet.getType()); + wallet_balance.setText(String.valueOf(wallet.getBalance())); + + return convertView; + } +} diff --git a/app/src/main/res/layout/activity_create_wallet.xml b/app/src/main/res/layout/activity_create_wallet.xml index 715e4ee..d18080d 100644 --- a/app/src/main/res/layout/activity_create_wallet.xml +++ b/app/src/main/res/layout/activity_create_wallet.xml @@ -1,60 +1,58 @@ - + + android:layout_marginStart="0dp" + android:layout_marginTop="0dp"> - + android:layout_gravity="center" + android:orientation="vertical"> - - -