I'm writing the GUI for an Android app that plays a trading card game. I have code for a battlefield layout using several views. I need to make an object that represents the deck, and also an object to represent a card in your hand/on the battlefield. The cards, when long-tapped need to bring up a menu of options (attack, defend, etc), or when double tapped in the hand area (green) need to move to the battlefield (blue). I'm not sure what kind of xml object I can use to do this, since it needs to happen dynamically and get data from the back-end code (card name, image). For now I'm just trying to create the objects to appear as black rectangle placeholders before it is incorporated with the game code. Does anybody have any suggestions as to where to start?
Here is the current code for the battlefield layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:background="@color/blue_default">
<View
android:id="@+id/hand"
android:background="@color/green_default"
android:layout_width="fill_parent"
android:layout_height="70dp"
android:layout_alignParentBottom="true"
/>
<View
android:id="@+id/sidebar"
android:background="@color/gray_default"
android:layout_width="60dp"
android:layout_height="fill_parent"
/>
<View
android:id="@+id/graveyard"
android:background="@color/red_default"
android:layout_width="60dp"
android:layout_height="fill_parent"
android:layout_toRightOf="@id/sidebar"
/>
</RelativeLayout>
Here is what it currently looks like:
Here is an example of what I would like it to look like: