-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
9 changed files
with
133 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
app/src/main/java/edu/hzuapps/androidworks/homeworks/com1314080901238/MainActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.example.yaoyiyao; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
import android.widget.Button; | ||
|
||
public class MainActivity extends Activity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
Button button1=(Button)findViewById(R.id.button); | ||
Button button2=(Button)findViewById(R.id.button2); | ||
button1.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
Intent i=new Intent(); | ||
i.setClass(MainActivity.this,Shark.class); | ||
startActivity(i); | ||
} | ||
}); | ||
button2.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
MainActivity.this.finish(); | ||
} | ||
}); | ||
} | ||
|
||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?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: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=".MainActivity" | ||
android:background="@drawable/base_bg"> | ||
|
||
|
||
<Button | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="开始游戏" | ||
android:id="@+id/button" | ||
android:textSize="30dp" | ||
android:textColor="#FFFFFF" | ||
android:layout_alignParentTop="true" | ||
android:layout_centerHorizontal="true" | ||
android:layout_marginTop="149dp" | ||
android:background="#00000000"/> | ||
|
||
<Button | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="结束游戏" | ||
android:id="@+id/button2" | ||
android:textSize="30dp" | ||
android:textColor="#FFFFFF" | ||
android:layout_below="@+id/button" | ||
android:layout_centerHorizontal="true" | ||
android:layout_marginTop="101dp" | ||
android:background="#00000000"/> | ||
</RelativeLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="#000000" | ||
android:orientation="vertical" > | ||
<RelativeLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" > | ||
<!--摇一摇下面的背景图--> | ||
<ImageView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_centerInParent="true" | ||
android:src="@drawable/me" | ||
/> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:layout_centerInParent="true" | ||
android:gravity="center" | ||
android:orientation="vertical" > | ||
|
||
<LinearLayout | ||
android:id="@+id/shake_top_layout" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:gravity="center_horizontal|bottom" | ||
android:orientation="vertical" > | ||
|
||
<ImageView | ||
android:layout_width="wrap_content" | ||
android:layout_height="100dp" | ||
android:src="@drawable/shake_top" /> | ||
|
||
<ImageView | ||
android:id="@+id/shake_top_line" | ||
android:layout_width="match_parent" | ||
android:layout_height="5dp" | ||
android:background="@drawable/shake_top_line" /> | ||
</LinearLayout> | ||
|
||
<LinearLayout | ||
android:id="@+id/shake_bottom_layout" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:gravity="center_horizontal|bottom" | ||
android:orientation="vertical" > | ||
|
||
<ImageView | ||
android:id="@+id/shake_bottom_line" | ||
android:layout_width="match_parent" | ||
android:layout_height="5dp" | ||
android:background="@drawable/shake_bottom_line" /> | ||
|
||
<ImageView | ||
android:layout_width="wrap_content" | ||
android:layout_height="100dp" | ||
android:src="@drawable/shake_bottom" /> | ||
</LinearLayout> | ||
</LinearLayout> | ||
</RelativeLayout> | ||
|
||
</LinearLayout> | ||
|