Skip to content

Commit

Permalink
Merge pull request #976 from KasenBob/master
Browse files Browse the repository at this point in the history
#4 第四次实验
  • Loading branch information
zengsn authored Mar 26, 2019
2 parents ddb74ba + 552585d commit ab6e96b
Show file tree
Hide file tree
Showing 11 changed files with 345 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,39 @@
package edu.hzuapps.androidlabs.soft1714080902216;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;

public class Soft1714080902216DataActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_soft1714080902216_data);
Button inputLogin=(Button) findViewById(R.id.inputLogin);
Button Comeback=(Button) findViewById(R.id.Comeback);
inputLogin.setOnClickListener(new Soft1714080902216DataActivity.MyButton());
Comeback.setOnClickListener(new Soft1714080902216DataActivity.MyButton());
}

private class MyButton implements View.OnClickListener
{
@Override
public void onClick(View v)
{
Intent intent;
switch(v.getId())
{
case R.id.inputLogin:
break;
case R.id.Comeback:
intent=new Intent(Soft1714080902216DataActivity.this,Soft1714080902216MainActivity.class);
startActivity(intent);
break;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,45 @@
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;

public class Soft1714080902216MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button Record=(Button) findViewById(R.id.button1);
ImageButton User= (ImageButton) findViewById(R.id.imageButton);
Button Data=(Button) findViewById(R.id.button2);
Record.setOnClickListener(new MyButton());
User.setOnClickListener(new MyButton());
Data.setOnClickListener(new MyButton());
}

public void Record(View view)
private class MyButton implements View.OnClickListener
{
Intent intent=new Intent(this,Soft1714080902216RecordActivity.class);
startActivity(intent);
@Override
public void onClick(View v)
{
Intent intent;
switch(v.getId())
{
case R.id.button1:
intent=new Intent(Soft1714080902216MainActivity.this,Soft1714080902216RecordActivity.class);
startActivity(intent);
break;
case R.id.button2:
intent=new Intent(Soft1714080902216MainActivity.this,Soft1714080902216DataActivity.class);
startActivity(intent);
break;
case R.id.imageButton:
intent=new Intent(Soft1714080902216MainActivity.this,Soft1714080902216UserActivity.class);
startActivity(intent);
break;
}
}
}

public void User(View view)
{
Intent intent=new Intent(this,Soft1714080902216UserActivity.class);
startActivity(intent);
}

public void Data(View view)
{
Intent intent=new Intent(this,Soft1714080902216DataActivity.class);
startActivity(intent);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,40 @@
package edu.hzuapps.androidlabs.soft1714080902216;

public class Soft1714080902216RecordActivity {
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;

import static edu.hzuapps.androidlabs.soft1714080902216.R.*;

public class Soft1714080902216RecordActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_soft1714080902216_record);
Button inputLogin = (Button) findViewById(R.id.inputLogin);
Button Comeback = (Button) findViewById(R.id.Comeback);
inputLogin.setOnClickListener(new Soft1714080902216RecordActivity.MyButton());
Comeback.setOnClickListener(new Soft1714080902216RecordActivity.MyButton());
}

private class MyButton implements View.OnClickListener {
@Override
public void onClick(View v) {
Intent intent;
switch (v.getId()) {
case R.id.inputLogin:
break;
case R.id.Comeback:
intent = new Intent(Soft1714080902216RecordActivity.this, Soft1714080902216MainActivity.class);
startActivity(intent);
break;
}
}
}
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package edu.hzuapps.androidlabs.soft1714080902216;

public class Soft1714080902216Remind {
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,43 @@
package edu.hzuapps.androidlabs.soft1714080902216;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;

public class Soft1714080902216UserActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_soft1714080902216_user);
Button denglu=(Button) findViewById(R.id.denglu);
Button zhuce= (Button) findViewById(R.id.zhuce);
Button back=(Button) findViewById(R.id.back);
denglu.setOnClickListener(new Soft1714080902216UserActivity.myButton());
zhuce.setOnClickListener(new Soft1714080902216UserActivity.myButton());
back.setOnClickListener(new Soft1714080902216UserActivity.myButton());
}

private class myButton implements View.OnClickListener
{
@Override
public void onClick(View v)
{
Intent intent;
switch(v.getId())
{
case R.id.button1:
break;
case R.id.button2:
break;
case R.id.imageButton:
intent=new Intent(Soft1714080902216UserActivity.this,Soft1714080902216MainActivity.class);
startActivity(intent);
break;
}
}
}
}
30 changes: 13 additions & 17 deletions students/soft1714080902216/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--suppress ALL -->
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<AbsoluteLayout 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"
Expand All @@ -12,34 +12,30 @@
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="304dp"
android:layout_x="134dp"
android:layout_y="252dp"
android:onClick="Record"
android:text="记录"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent" />
android:text="记录" />


<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="180dp"
android:layout_x="134dp"
android:layout_y="331dp"
android:onClick="Data"
android:text="管理"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent" />
android:text="管理" />


<ImageButton
android:id="@+id/imageButton"
android:layout_width="128dp"
android:layout_height="125dp"
android:layout_x="115dp"
android:layout_y="55dp"
android:background="@drawable/b4"
android:onClick="User"
tools:layout_editor_absoluteX="16dp"
tools:layout_editor_absoluteY="72dp"
tools:srcCompat="@tools:sample/avatars[1]" />
android:onClick="User" />

</android.support.constraint.ConstraintLayout>
</AbsoluteLayout>
Original file line number Diff line number Diff line change
@@ -1,9 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<AbsoluteLayout 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="@drawable/b5"
tools:context=".Soft1714080902216DataActivity">

</android.support.constraint.ConstraintLayout>
<TextView
android:id="@+id/Tellname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="0dp"
android:layout_y="96dp"
android:text="请输入姓名:"
android:textColor="#000000"
android:textSize="20sp" />

<EditText
android:id="@+id/Inputname_name"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_x="0dp"
android:layout_y="124dp"
android:hint="Name"
android:maxLines="1" />

<TextView
android:id="@+id/Telldata"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="0dp"
android:layout_y="274dp"
android:text="生日为:"
android:textColor="#000000"
android:textSize="20sp" />
/>

<EditText
android:id="@+id/inputdata"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_x="0dp"
android:layout_y="303dp"
android:hint="birthday"
android:maxLines="1" />

<Button
android:id="@+id/inputLogin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_x="118dp"
android:layout_y="201dp"
android:text="查询"
android:textSize="30sp" />

<Button
android:id="@+id/Comeback"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_x="122dp"
android:layout_y="382dp"
android:text="返回"
android:textSize="30sp"
android:onClick="back"/>

</AbsoluteLayout>
Loading

0 comments on commit ab6e96b

Please sign in to comment.