This repository has been archived by the owner on Feb 1, 2024. It is now read-only.
-
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.
Merge pull request #1532 from zcjzzf/master
- Loading branch information
Showing
4 changed files
with
392 additions
and
7 deletions.
There are no files selected for viewing
33 changes: 30 additions & 3 deletions
33
students/net1814080903214/app/src/main/java/edu/hzuapps/androidlabs/ResetActivity.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 |
---|---|---|
@@ -1,14 +1,41 @@ | ||
package edu.hzuapp.androidlabs; | ||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
import android.widget.Button; | ||
|
||
public class ResetActivity extends AppCompatActivity { | ||
public class HistoryScoreActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_reset); | ||
setContentView(R.layout.activity_history_score); | ||
|
||
Button returnToGame = (Button)findViewById(R.id.returnToGame); | ||
returnToGame.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
Intent intent = new Intent(); | ||
intent.setClass(HistoryScoreActivity.this, GameActivity.class); | ||
startActivity(intent); | ||
} | ||
} | ||
); | ||
|
||
Button returnToMain = (Button)findViewById(R.id.returnToMain); | ||
returnToMain.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
Intent intent = new Intent(); | ||
intent.setClass(HistoryScoreActivity.this, Net1814080903106Activity.class); | ||
startActivity(intent); | ||
} | ||
} | ||
); | ||
|
||
} | ||
|
||
} |
22 changes: 18 additions & 4 deletions
22
students/net1814080903214/app/src/main/java/edu/hzuapps/androidlabs/StartActivity.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 |
---|---|---|
@@ -1,14 +1,28 @@ | ||
package edu.hzuapp.androidlabs; | ||
|
||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
import android.widget.Button; | ||
|
||
public class StartActivity extends AppCompatActivity { | ||
public class GameActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_start); | ||
setContentView(R.layout.activity_game); | ||
|
||
Button toHistoryScore = (Button)findViewById(R.id.toHistoryScore); | ||
toHistoryScore.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
Intent intent = new Intent(); | ||
intent.setClass(GameActivity.this, HistoryScoreActivity.class); | ||
startActivity(intent); | ||
} | ||
} | ||
); | ||
|
||
|
||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
students/net1814080903214/src/main/res/layout/reset_activity.xml
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,56 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="#3498db" | ||
tools:context=".ResetActivity"> | ||
|
||
<TextView | ||
android:id="@+id/textView" | ||
android:layout_width="180dp" | ||
android:layout_height="80dp" | ||
android:layout_marginStart="50dp" | ||
android:layout_marginLeft="50dp" | ||
android:layout_marginTop="150dp" | ||
android:text="历史最高:" | ||
android:textSize="30dp" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/returnToGame" /> | ||
|
||
<TextView | ||
android:id="@+id/textView2" | ||
android:layout_width="120dp" | ||
android:layout_height="40dp" | ||
android:layout_marginTop="150dp" | ||
android:text="4096" | ||
android:textSize="30dp" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0.183" | ||
app:layout_constraintStart_toEndOf="@+id/textView" | ||
app:layout_constraintTop_toBottomOf="@+id/returnToMain" /> | ||
|
||
<Button | ||
android:id="@+id/returnToGame" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="50dp" | ||
android:text="重玩" | ||
app:layout_constraintEnd_toStartOf="@+id/returnToMain" | ||
app:layout_constraintHorizontal_bias="0.266" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<Button | ||
android:id="@+id/returnToMain" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="50dp" | ||
android:layout_marginEnd="40dp" | ||
android:layout_marginRight="40dp" | ||
android:text="返回" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
Oops, something went wrong.