How do you notice the Android field?



  • It's right to mark the game field, or how it's usually done. And how to tie this mark to the code. There is a need for the bottom of the screen to be buttons, upstream supporting information, in the middle of the game. It might be easier to explain rightly than trying to fix what's already in place.

    This is my first gambling app. I was trying to make a mark like this:

    1. Upper panel - LinearLayout
    2. In the middle of the game field. It is a class Roundwhich is expanding LinearLayout♪ It will be the main drawing of the annex.
    3. Downstairs with buttons-- LinearLayout
      Class GameProcessView expanding. LinearLayout, he's responsible for the periodical refill.

    Some problems have begun:
    In the Round class, I need to get his boundaries, but they're all nils (if they get in the designer). The problem seems to be solved when I overloaded the method. onSizeChanged(...), but when drawing at the borders obtained, they've checked them, they're right, nothing's coming out. If the designer writes:

    setBackgroundColor(Color.CYAN);
    

    The sketch is happening, but as expected, the background figure is painted.

    <com.pos.GameProcessView 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/gameView"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/game_wall_paper"
    android:gravity="center_horizontal"
    android:orientation="vertical" >
    

    <LinearLayout
    android:id="@+id/topPanel"
    android:layout_width="fill_parent"
    android:layout_height="50dp"
    android:orientation="vertical" >
    </LinearLayout>

    <com.pos.Round
    android:id="@+id/gameField"
    android:layout_width="fill_parent"
    android:layout_height="50dp"
    android:layout_weight="0.28"
    android:gravity="bottom"
    android:orientation="horizontal" >
    </com.pos.Round>

    <LinearLayout
    android:id="@+id/bottomPanel"
    android:layout_width="fill_parent"
    android:layout_height="50dp"
    android:gravity="center|clip_horizontal"
    android:orientation="horizontal" >

    &lt;ImageButton android:id="@+id/var1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/square"
        android:background="@color/buttonBackground"&gt;
    &lt;requestFocus /&gt;
    &lt;/ImageButton&gt;
    
    &lt;ImageButton android:id="@+id/var2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/square"
        android:background="@color/buttonBackground"&gt;
    &lt;/ImageButton&gt;
    

    </LinearLayout>
    </com.pos.GameProcessView>



  • It's actually a code, not a... This is where you need to call ItemMenu from the Menu button.

    http://dajver.blogspot.com/2012/01/android-1-surfaceview.html and how the menu is made http://developer.alexanderklimov.ru/android/menu.php




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2