Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1532 from zcjzzf/master
Browse files Browse the repository at this point in the history
#4 #407 第四次实验
  • Loading branch information
zengsn authored Jan 1, 2021
2 parents f3603b9 + aad4564 commit 19757d4
Show file tree
Hide file tree
Showing 4 changed files with 392 additions and 7 deletions.
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);
}
}
);

}

}
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 students/net1814080903214/src/main/res/layout/reset_activity.xml
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>
Loading

0 comments on commit 19757d4

Please sign in to comment.