Skip to content

Commit

Permalink
Merge pull request #471 from yjf2213939/master
Browse files Browse the repository at this point in the history
#90 #395 实验4
  • Loading branch information
zengsn committed Apr 27, 2016
2 parents 9eb5e91 + 5572577 commit 17335b0
Show file tree
Hide file tree
Showing 8 changed files with 516 additions and 0 deletions.
209 changes: 209 additions & 0 deletions app/src/main/res/layout/net1314080903138activity_game.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:orientation="vertical"
android:gravity="center_horizontal"
android:background="@drawable/net13140803138background"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".Net1314080903138Game">

<ImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:layout_marginBottom="10dp"
android:scaleType="fitXY"
android:src="@drawable/net13140803138topboard"/>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.5"
android:gravity="center"
android:orientation="horizontal"
android:layout_marginBottom="10dp">


<ImageView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:src="@drawable/net13140803138black_chess"
android:scaleType="fitCenter"
/>

<TextView
android:id="@+id/x1"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:textColor="#FF000000"
android:text="@string/X"
android:textSize="15sp"
android:gravity="center"
/>

<TextView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:textColor="#FF000000"
android:id="@+id/black_count"
android:textStyle="bold"
android:textSize="15sp"
android:gravity="center"
android:text="0"
/>


<ImageView
android:id="@+id/vs"
android:layout_width="0dp"
android:layout_weight="2"
android:layout_height="match_parent"
android:scaleType="fitCenter"
android:src="@drawable/net13140803138vs2"
/>


<ImageView
android:id="@+id/ivWhite"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:src="@drawable/net13140803138white_chess"
android:scaleType="fitCenter"
/>

<TextView
android:id="@+id/x2"
android:textSize="15sp"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:textColor="#FFFFFFFF"
android:text="@string/X"
android:gravity="center"
/>

<TextView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:textColor="#FFFFFFFF"
android:gravity="center"
android:id="@+id/white_count"
android:textSize="15sp"
android:text="0"
android:textStyle="bold"
/>
</LinearLayout>

<ImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginBottom="12dp"
android:scaleType="fitXY"
android:src="@drawable/net13140803138bar"/>


<edu.hzuapps.androidworks.homeworks.net1314080903138.Net1314080903138ChessBoard
android:id="@+id/ChessBoard"
android:columnCount="8"
android:rowCount="8"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="18"
>
</edu.hzuapps.androidworks.homeworks.net1314080903138.Net1314080903138ChessBoard>



<ImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginTop="5dp"
android:layout_marginBottom="10dp"
android:scaleType="fitXY"
android:src="@drawable/net13140803138bar"/>

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.5">

<TextView
android:id="@+id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:textColor="#FF000000"
android:textStyle="bold"
android:text="Current:"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:scaleType="fitCenter"
android:layout_toRightOf="@id/text1"
android:src="@drawable/net13140803138black_chess"
android:id="@+id/current_turn"
/>


<Chronometer
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textSize="15sp"
android:textStyle="bold"
android:textColor="#FF000000"
android:id="@+id/cosumed_time"
android:layout_alignParentRight="true"
/>

</RelativeLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:gravity="center_vertical"
android:layout_marginTop="8sp">

<ImageButton
android:layout_width="0dp"
android:background="#00000000"
android:layout_weight="1"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:id="@+id/retract"
android:src="@drawable/net13140803138retract"
/>

<ImageButton
android:id="@+id/new_game"
android:layout_width="0dp"
android:layout_weight="1.5"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:background="#00000000"
android:src="@drawable/net13140803138newgame"
/>

<ImageButton
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#00000000"
android:scaleType="fitXY"
android:src="@drawable/net13140803138hint"
android:id="@+id/ButtonHint"
/>


</LinearLayout>

</LinearLayout>
176 changes: 176 additions & 0 deletions app/src/main/res/layout/net1314080903138activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:background="@drawable/net13140803138background"
android:orientation="vertical"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".Net1314080903138MainActivity">


<ImageView
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="0dp"
android:scaleType="fitXY"
android:id="@+id/top1"
android:src="@drawable/net13140803138top"/>


<LinearLayout
android:layout_width="match_parent"
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:layout_height="0dp"
android:layout_weight="3">

<ImageView
android:layout_width="0dp"
android:layout_weight="2"
android:layout_height="match_parent"
android:scaleType="fitCenter"
android:src="@drawable/net13140803138daojian"
/>


</LinearLayout>


<RelativeLayout
android:layout_width="match_parent"
android:layout_weight="7"
android:layout_height="0dp">

<GridLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:rowCount="3"
android:columnCount="4"
android:layout_centerInParent="true"
>

<ImageView
android:id="@+id/iv1"
android:layout_width="@dimen/width_of_chess1" android:layout_margin="@dimen/chess_margin1"
android:layout_height="@dimen/width_of_chess1"
android:scaleType="fitCenter"
android:src="@drawable/net13140803138white_chess"/>

<ImageView
android:id="@+id/iv2"
android:layout_width="@dimen/width_of_chess1" android:layout_margin="@dimen/chess_margin1"
android:scaleType="fitCenter"
android:layout_height="@dimen/width_of_chess1"
android:src="@drawable/net13140803138black_chess"
/>

<ImageView
android:id="@+id/iv3"
android:layout_width="@dimen/width_of_chess1" android:layout_margin="@dimen/chess_margin1"
android:scaleType="fitCenter"
android:layout_height="@dimen/width_of_chess1"
android:src="@drawable/net13140803138black_chess"
/>

<ImageView
android:id="@+id/iv4"
android:layout_width="@dimen/width_of_chess1" android:layout_margin="@dimen/chess_margin1"
android:scaleType="fitCenter"
android:src="@drawable/net13140803138white_chess"
android:layout_height="@dimen/width_of_chess1" />

<ImageView
android:id="@+id/iv5"
android:layout_width="@dimen/width_of_chess1" android:layout_margin="@dimen/chess_margin1"
android:scaleType="fitCenter"
android:layout_height="@dimen/width_of_chess1"
android:src="@drawable/net13140803138black_chess"/>

<ImageView
android:id="@+id/iv6"
android:layout_width="@dimen/width_of_chess1" android:layout_margin="@dimen/chess_margin1"
android:scaleType="fitCenter"
android:layout_height="@dimen/width_of_chess1"
android:src="@drawable/net13140803138white_chess"
/>

<ImageView
android:id="@+id/iv7"
android:layout_width="@dimen/width_of_chess1" android:layout_margin="@dimen/chess_margin1"
android:scaleType="fitCenter"
android:layout_height="@dimen/width_of_chess1"
android:src="@drawable/net13140803138white_chess"
/>

<ImageView
android:id="@+id/iv8"
android:layout_width="@dimen/width_of_chess1" android:layout_margin="@dimen/chess_margin1"
android:scaleType="fitCenter"
android:src="@drawable/net13140803138black_chess"
android:layout_height="@dimen/width_of_chess1" />

<ImageView
android:id="@+id/iv9"
android:layout_width="@dimen/width_of_chess1" android:layout_margin="@dimen/chess_margin1"
android:scaleType="fitCenter"
android:layout_height="@dimen/width_of_chess1"
android:src="@drawable/net13140803138black_chess"/>

<ImageView
android:id="@+id/iv10"
android:layout_width="@dimen/width_of_chess1" android:layout_margin="@dimen/chess_margin1"
android:scaleType="fitCenter"
android:layout_height="@dimen/width_of_chess1"
android:src="@drawable/net13140803138white_chess"
/>

<ImageView
android:id="@+id/iv11"
android:scaleType="fitCenter"
android:layout_width="@dimen/width_of_chess1" android:layout_margin="@dimen/chess_margin1"
android:layout_height="@dimen/width_of_chess1"
android:src="@drawable/net13140803138black_chess"
/>

<ImageView
android:id="@+id/iv12"
android:layout_width="@dimen/width_of_chess1" android:layout_margin="@dimen/chess_margin1"
android:scaleType="fitCenter"
android:src="@drawable/net13140803138white_chess"
android:layout_height="@dimen/width_of_chess1" />


</GridLayout>

</RelativeLayout>



<RelativeLayout
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_height="wrap_content">

<CheckBox
android:id="@+id/soundSwitch"
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sound"
android:textColor="#FF000000"/>

</RelativeLayout>

<ImageButton
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:contentDescription="@string/app_name"
android:id="@+id/startButton"
android:src="@drawable/net13140803138start"
android:scaleType="fitXY"
android:background="#00000000"
android:layout_marginBottom="6dp"/>

</LinearLayout>
Loading

0 comments on commit 17335b0

Please sign in to comment.