Skip to content

Commit

Permalink
Merge pull request #1811 from HHuangF/master
Browse files Browse the repository at this point in the history
#4 #991 第四次实验报告修改版
  • Loading branch information
zengsn authored May 12, 2018
2 parents 610b899 + fa238e3 commit a77b48c
Show file tree
Hide file tree
Showing 10 changed files with 218 additions and 0 deletions.
Binary file added soft1614080902440/Fourth/Soft1614080902440p1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added soft1614080902440/Fourth/Soft1614080902440p2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added soft1614080902440/Fourth/Soft1614080902440p3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added soft1614080902440/Fourth/Soft1614080902440p4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions soft1614080902440/Fourth/java/Soft1614080902440Activity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package edu.androidlabs.soft1614080902440;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class Soft1614080902440Activity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_soft1614080902440);
final Activity thisActivity = this;

Button btnOpen = (Button) findViewById(R.id.button_open);
btnOpen.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(thisActivity,Soft1614080902440Activity1.class);
thisActivity.startActivity(intent);

}
});
}
}
34 changes: 34 additions & 0 deletions soft1614080902440/Fourth/java/Soft1614080902440Activity1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package edu.androidlabs.soft1614080902440;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class Soft1614080902440Activity1 extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity1_soft1614080902440);
final EditText mUserName=(EditText)this.findViewById(R.id.login_username);
final EditText mPassWord=(EditText)this.findViewById(R.id.login_password);
Button mSubmit=(Button)this.findViewById(R.id.login_submit);
final TextView mResult=(TextView) this.findViewById(R.id.login_result);
mSubmit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String userName=mUserName.getText().toString();
String password=mPassWord.getText().toString();
//默认登陆账号为:admin;密码为:123456
if("admin".equals(userName)&&"123456".equals(password)){
mResult.setText("恭喜你,登陆成功!");
}else{
mResult.setText("登陆失败,请重新输入!");
}
}
});
}
}
22 changes: 22 additions & 0 deletions soft1614080902440/Fourth/mainfests/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.androidlabs.soft1614080902440">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".Soft1614080902440Activity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Soft1614080902440Activity1"></activity>
</application>

</manifest>
58 changes: 58 additions & 0 deletions soft1614080902440/Fourth/report4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# 实验四实验报告

## 实验目的

### 1、Android界面设计编程

## 实验要求

### 1、根据选题要求设计界面布局及控件使用;

### 2、布局xml及界面控制操作代码提交并截图;

### 3、将应用运行结果截图。

## 实验内容

### 1、使用RelativeLayout布局方式,设计求职与招聘管理系统封的登陆界面;

### 2、通过控件ID获取界面对象,执行相关操作;

### 3、实现界面控件的事件处理,例如点击按钮跳转到另一个界面;

## 实验步骤

### 1、阅读实验要求:https://github.com/hzuapps/android-labs-2018/labels/Lab;

### 2、在电脑上Android Studio编写代码

#### ①、运行Android studio;

#### ②、在实验三的基础上修改activity1_soft1614080902440.xml,增加RelativeLayout布局方式,增加三个EditText控件和一个Button控件等进行登陆界面的设计;

#### ③、在Soft1614080902440Activity1.java中获得三个EditText控件和一个Button控件的UI对象,最后设置按钮点击后的事件处理。

### 3、使用Git将代码提交到自己的库中:https://github.com/HHuangF/android-labs-2018;
$ git pull
$ git add soft1614080902440/*
$ git commit "#4 #991 第四次实验 "
$ git push
### 4、在自己的GitHub库上创建和发送Pull Request;
### 5、在GitHub中使用Markdown文件编写实验报告(report4.md);

## 实验结果

### 打开界面和跳转到的登陆界面:

![运行截图](https://github.com/HHuangF/android-labs-2018/blob/master/soft1614080902440/Fourth/Soft1614080902440p1.png)
![运行截图](https://github.com/HHuangF/android-labs-2018/blob/master/soft1614080902440/Fourth/Soft1614080902440p2.png)

### 登陆成功和失败的提示:

![运行截图](https://github.com/HHuangF/android-labs-2018/blob/master/soft1614080902440/Fourth/Soft1614080902440p3.png)
![运行截图](https://github.com/HHuangF/android-labs-2018/blob/master/soft1614080902440/Fourth/Soft1614080902440p4.png)

## 实验体会

### 这次实验可以说是上一个实验的延续,上次只是进行从一个Activity跳转到另一个Activity,而这次就是进行跳转后界面的设计并实现界面控件的事件处理。
52 changes: 52 additions & 0 deletions soft1614080902440/Fourth/res/activity1_soft1614080902440.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?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"
tools:context=".Soft1614080902440Activity1"
android:background="@drawable/login_background"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<EditText
android:id="@+id/login_username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@color/white"
android:hint="Username..."
android:text=""

/>

<EditText
android:id="@+id/login_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/login_username"
android:background="@color/white"
android:hint="Passward..."
android:text=""

/>

<Button
android:id="@+id/login_submit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="登陆"
android:layout_below="@id/login_password"
android:layout_centerInParent="true"
/>

<TextView
android:id="@+id/login_result"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="用于显示登陆的结果"
android:layout_below="@id/login_submit"
/>
</RelativeLayout>
</RelativeLayout>
25 changes: 25 additions & 0 deletions soft1614080902440/Fourth/res/activity_soft1614080902440.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
tools:context=".Soft1614080902440Activity">

<TextView
android:id="@+id/textview_01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/jiajiao_logo" />

<Button
android:id="@+id/button_open"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="点击登陆"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="328dp"
android:layout_below="@id/textview_01"
/>

</RelativeLayout>

0 comments on commit a77b48c

Please sign in to comment.