Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
nofar authored Mar 1, 2019
1 parent 92a14c7 commit 8d27846
Show file tree
Hide file tree
Showing 8 changed files with 452 additions and 0 deletions.
54 changes: 54 additions & 0 deletions app/src/main/layout/activity_end_game.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/endGame"
android:background="@color/black"
tools:context="com.example.hp.battleship.EndGameActivity">


<ImageView
android:id="@+id/endGamePictureTop"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginTop="26dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />

<ImageView
android:id="@+id/endGamePictureDown"
android:layout_width="350dp"
android:layout_height="250dp"

android:layout_above="@+id/buttonRematch"
android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp" />


<ImageButton
android:id="@+id/buttonMainMenu"
android:layout_width="130dp"
android:layout_height="50dp"
android:text="@string/main_menu_button"
android:layout_marginBottom="14dp"
android:background="@drawable/button_main"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:onClick="goToMainMenu" />

<ImageButton
android:id="@+id/buttonRematch"
android:layout_width="130dp"
android:layout_height="50dp"
android:text="@string/play_again_button"
android:background="@drawable/button_rematch"
tools:layout_editor_absoluteX="135dp"
tools:layout_editor_absoluteY="483dp"
android:onClick="rematchGame"
android:layout_above="@+id/buttonMainMenu"
android:layout_centerHorizontal="true" />



</RelativeLayout>
100 changes: 100 additions & 0 deletions app/src/main/layout/activity_game.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/game_cover"
tools:context="com.example.hp.battleship.GameActivity">

<TextView
android:layout_width="match_parent"
android:layout_height="30dp"
android:id="@+id/player_turn"
android:text="@string/the_turn_text"
android:gravity="center"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:textSize="22dp"
android:fontFamily="sans-serif-smallcaps"
android:textColor="@color/white"
android:background="#FF0B2632"
/>


<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/enemy_fleet_text"
android:layout_below="@+id/player_turn"
android:text="@string/enemy_fleet_text"
android:gravity="center"
android:fontFamily="sans-serif-smallcaps"
android:layout_marginTop="5dp"
android:textColor="@color/white"
android:textSize="13dp"
/>

<GridView

android:layout_width="match_parent"
android:layout_height="300dp"
android:id="@+id/enemy_grid"
android:numColumns="10"
android:horizontalSpacing="-40dp"
android:columnWidth="140dp"
android:gravity="center"
android:layout_below="@+id/enemy_fleet_text"
android:layout_alignParentStart="true" />



<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/player_fleet_text"
android:layout_above="@+id/player_grid"
android:text="@string/my_fleet_text"
android:textColor="@color/white"
android:fontFamily="sans-serif-smallcaps"
android:gravity="center"
android:layout_marginBottom="3dp"
android:textSize="13dp"


/>

<GridView

android:layout_width="300dp"
android:layout_height="200dp"
android:id="@+id/player_grid"
android:numColumns="10"
android:layout_marginBottom="2dp"
android:horizontalSpacing="-90dp"
android:columnWidth="100dp"
android:gravity="center"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" />




<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@id/enemy_fleet_text"
android:id="@+id/progresss_bar"
android:layout_alignParentRight="true"
android:paddingRight="50dp"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:indeterminateTint="#ffffff"


/>


</RelativeLayout>



41 changes: 41 additions & 0 deletions app/src/main/layout/activity_instructions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?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:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="1"
android:background="@color/white"
tools:context="com.example.hp.battleship.InstructionsActivity">


<TextView
android:id="@+id/instructions_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.1"
android:textSize="50dp"
android:paddingTop="30dp"
android:textColor="#FF19797B"
android:fontFamily="serif"
android:gravity="center"
android:text="@string/instructions_header" />

<ScrollView
android:layout_width="match_parent"
android:layout_height="450dp"
android:layout_gravity="bottom"
android:layout_marginTop="20dp">

<TextView
android:id="@+id/instructions_text"
android:layout_width="match_parent"
android:layout_height="155dp"
android:layout_weight="0.8"
android:paddingLeft="20dp"
android:scrollbars="vertical"
android:textColor="@color/black"
android:textSize="20dp" />
</ScrollView>

</LinearLayout>
82 changes: 82 additions & 0 deletions app/src/main/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?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:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/main"
android:backgroundTint="@color/blackTint"
android:backgroundTintMode="src_over"
tools:context="com.example.hp.battleship.MainActivity">

<TextView
android:id="@+id/diff_text_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="200dp"
android:fontFamily="sans-serif"
android:layout_centerInParent="true"
android:text="@string/choose_difficulty"
android:textColor="@color/white"
android:textSize="20dp" />


<NumberPicker
android:id="@+id/difficultyPickerPicker"
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_marginTop="30dp"
android:gravity="center"
android:descendantFocusability="blocksDescendants" />


<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">


<ImageButton
android:id="@+id/startButton"
android:layout_width="131dp"
android:layout_height="55dp"
android:layout_above="@+id/scoreButton"
android:layout_centerHorizontal="true"
android:layout_marginBottom="35dp"
android:background="@drawable/b_start"
android:clickable="true"
android:onClick="startGame"
android:padding="10dip"
android:scaleType="center" />


<ImageButton
android:id="@+id/instructions_button"
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_gravity="right"
android:background="@drawable/information"
android:clickable="true"
android:gravity="center"
android:padding="10dip"
android:onClick="goToInstructions" />

<ImageButton
android:id="@+id/scoreButton"
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_alignParentBottom="true"
android:layout_gravity="right"
android:layout_toLeftOf="@+id/instructions_button"
android:background="@drawable/score_icon"
android:clickable="true"
android:padding="10dip"
android:gravity="center"
android:onClick="showHighScore" />

</RelativeLayout>


</LinearLayout>
87 changes: 87 additions & 0 deletions app/src/main/layout/activity_score.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/ScoresListActivity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/loss"

tools:context="com.example.hp.battleship.ScoresListActivity"
tools:ignore="MissingDefaultResource">


<ImageView
android:id="@+id/score_logo_id"
android:layout_width="match_parent"
android:layout_height="43dp"
android:layout_marginTop="4dp"
android:src="@drawable/scores" />

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="25dp"
android:layout_gravity="center"
android:orientation="horizontal">

<Button
android:id="@+id/easy_button_id"
android:layout_width="wrap_content"
android:layout_height="60dp"
android:clickable="true"
android:enabled="true"
android:layout_gravity="center"
android:onClick="easyButtonPressed"
android:text="@string/d_easy"
android:textAlignment="center"
android:textSize="8dp"
android:textStyle="bold" />

<Button
android:id="@+id/medium_button_id"
android:layout_width="wrap_content"
android:layout_height="60dp"
android:layout_gravity="center"
android:clickable="true"
android:onClick="mediumButtonPressed"
android:text="@string/d_medium"
android:textAlignment="center"
android:textSize="8dp"
android:textStyle="bold" />

<Button
android:id="@+id/hard_button_id"
android:layout_width="wrap_content"
android:layout_height="60dp"
android:layout_gravity="center"
android:clickable="true"
android:onClick="hardButtonPressed"
android:text="@string/d_hard"
android:textAlignment="center"
android:textSize="8dp"
android:textStyle="bold" />
</LinearLayout>

<LinearLayout
android:id="@+id/score_layout_id"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_marginTop="5dp"
android:layout_height="180dp"
android:layout_marginBottom="20dp"/>

<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginRight="20dp"
android:layout_marginLeft="20dp"
android:layout_marginBottom="10dp"
tools:context="com.example.hp.battleship.ScoreMapFragment" />

</LinearLayout>
Loading

0 comments on commit 8d27846

Please sign in to comment.