Skip to content

Commit

Permalink
Merge pull request #2395 from LakersChampion/master
Browse files Browse the repository at this point in the history
#3 #273 第三次实验及报告
  • Loading branch information
zengsn authored May 29, 2018
2 parents 8a84bb6 + b71b7ff commit 0794084
Show file tree
Hide file tree
Showing 14 changed files with 375 additions and 0 deletions.
50 changes: 50 additions & 0 deletions soft1614080902108/ app/ src/ test/ res/activity_main1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.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"
tools:context=".MainActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/textview_01"
android:layout_width="wrap_content"
android:layout_height="528dp"
android:drawableTop="@drawable/lbh"
android:text="hello_world"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp" />

<Button
android:id="@+id/bt_dial"
android:layout_width="178dp"
android:layout_height="53dp"
android:text="歌手请点击此"
tools:layout_editor_absoluteX="103dp"
tools:layout_editor_absoluteY="16dp" />

<Button
android:id="@+id/bt_dial"
android:layout_width="191dp"
android:layout_height="63dp"
android:text="待审核歌手请点击此"
tools:layout_editor_absoluteX="97dp"
tools:layout_editor_absoluteY="79dp" />

<Button
android:id="@+id/bt_dial"
android:layout_width="300dp"
android:layout_height="52dp"
android:text="导师请点击此"
tools:layout_editor_absoluteX="42dp"
tools:layout_editor_absoluteY="151dp" />
</android.support.constraint.ConstraintLayout>
50 changes: 50 additions & 0 deletions soft1614080902108/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.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"
tools:context=".MainActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/textview_01"
android:layout_width="wrap_content"
android:layout_height="528dp"
android:drawableTop="@drawable/lbh"
android:text="hello_world"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp" />

<Button
android:id="@+id/bt_dial"
android:layout_width="178dp"
android:layout_height="53dp"
android:text="歌手请点击此"
tools:layout_editor_absoluteX="103dp"
tools:layout_editor_absoluteY="16dp" />

<Button
android:id="@+id/bt_dial"
android:layout_width="191dp"
android:layout_height="63dp"
android:text="待审核歌手请点击此"
tools:layout_editor_absoluteX="97dp"
tools:layout_editor_absoluteY="79dp" />

<Button
android:id="@+id/bt_dial"
android:layout_width="300dp"
android:layout_height="52dp"
android:text="导师请点击此"
tools:layout_editor_absoluteX="42dp"
tools:layout_editor_absoluteY="151dp" />
</android.support.constraint.ConstraintLayout>
Binary file added soft1614080902108/app/lbh3.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions soft1614080902108/app/src/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.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"
tools:context=".MainActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/textview_01"
android:layout_width="wrap_content"
android:layout_height="528dp"
android:drawableTop="@drawable/lbh"
android:text="hello_world"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp" />

<Button
android:id="@+id/bt_dial"
android:layout_width="178dp"
android:layout_height="53dp"
android:text="歌手请点击此"
tools:layout_editor_absoluteX="103dp"
tools:layout_editor_absoluteY="16dp" />

<Button
android:id="@+id/bt_dial"
android:layout_width="191dp"
android:layout_height="63dp"
android:text="待审核歌手请点击此"
tools:layout_editor_absoluteX="97dp"
tools:layout_editor_absoluteY="79dp" />

<Button
android:id="@+id/bt_dial"
android:layout_width="300dp"
android:layout_height="52dp"
android:text="导师请点击此"
tools:layout_editor_absoluteX="42dp"
tools:layout_editor_absoluteY="151dp" />
</android.support.constraint.ConstraintLayout>
50 changes: 50 additions & 0 deletions soft1614080902108/app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.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"
tools:context=".MainActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/textview_01"
android:layout_width="wrap_content"
android:layout_height="528dp"
android:drawableTop="@drawable/lbh"
android:text="hello_world"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp" />

<Button
android:id="@+id/bt_dial"
android:layout_width="178dp"
android:layout_height="53dp"
android:text="歌手请点击此"
tools:layout_editor_absoluteX="103dp"
tools:layout_editor_absoluteY="16dp" />

<Button
android:id="@+id/bt_dial"
android:layout_width="191dp"
android:layout_height="63dp"
android:text="待审核歌手请点击此"
tools:layout_editor_absoluteX="97dp"
tools:layout_editor_absoluteY="79dp" />

<Button
android:id="@+id/bt_dial"
android:layout_width="300dp"
android:layout_height="52dp"
android:text="导师请点击此"
tools:layout_editor_absoluteX="42dp"
tools:layout_editor_absoluteY="151dp" />
</android.support.constraint.ConstraintLayout>
24 changes: 24 additions & 0 deletions soft1614080902108/app/src/test/res/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="androidlabs.hzuapps.edu.soft1614080902108">

<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=".Soft1614080902108Activity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Soft1614080902108Activity2" />
<activity android:name="edu.hzuapps.androidlabs.soft1614080902110.Soft1614080902108Activity3" />
<activity android:name=".Soft1614080902108Activity3"></activity>
</application>

</manifest>
26 changes: 26 additions & 0 deletions soft1614080902108/app/src/test/res/Soft1614080902108Activity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package androidlabs.hzuapps.edu.soft1614080902108;

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


public class Soft1614080902110Activity extends AppCompatActivity {
private TextView textView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_soft1614080902110);

textView=(TextView)findViewById(R.id.text_view);
textView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(Soft1614080902110Activity.this,Soft1614080902110Activity2.class);
startActivity(intent);
}
});
}
}
65 changes: 65 additions & 0 deletions soft1614080902108/app/src/test/res/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.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"
tools:context=".MainActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/textview_01"
android:layout_width="wrap_content"
android:layout_height="528dp"
android:drawableTop="@drawable/lbh"
android:text="hello_world"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp" />

<Button
android:id="@+id/bt_dial"
android:layout_width="178dp"
android:layout_height="53dp"
<<<<<<< HEAD
android:text="歌手请点击此"
=======
android:text="姝屾墜璇风偣鍑绘"
>>>>>>> 0846e9cf95599438d0f756a1e23f769300c5e2c2
tools:layout_editor_absoluteX="103dp"
tools:layout_editor_absoluteY="16dp" />

<Button
android:id="@+id/bt_dial"
android:layout_width="191dp"
android:layout_height="63dp"
<<<<<<< HEAD
android:text="待审核歌手请点击此"
=======
android:text="寰呭鏍告瓕鎵嬭鐐瑰嚮姝�"
>>>>>>> 0846e9cf95599438d0f756a1e23f769300c5e2c2
tools:layout_editor_absoluteX="97dp"
tools:layout_editor_absoluteY="79dp" />

<Button
android:id="@+id/bt_dial"
android:layout_width="300dp"
android:layout_height="52dp"
<<<<<<< HEAD
android:text="导师请点击此"
tools:layout_editor_absoluteX="42dp"
tools:layout_editor_absoluteY="151dp" />
</android.support.constraint.ConstraintLayout>
=======
android:text="瀵煎笀璇风偣鍑绘"
tools:layout_editor_absoluteX="42dp"
tools:layout_editor_absoluteY="151dp" />
</android.support.constraint.ConstraintLayout>
>>>>>>> 0846e9cf95599438d0f756a1e23f769300c5e2c2
17 changes: 17 additions & 0 deletions soft1614080902108/app/src/test/res/activity_soft1614080902108.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.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"
tools:context=".Soft1614080902108Activity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/main"
android:id="@+id/text_view"
tools:layout_editor_absoluteY="0dp"
tools:layout_editor_absoluteX="5dp" />

</android.support.constraint.ConstraintLayout>
Binary file added soft1614080902108/lbh.jpg
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 soft1614080902108/lbh1.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 soft1614080902108/lbh2.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 soft1614080902108/lbh3.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions soft1614080902108/report4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

# 第三次实验报告

## 1、实验目标

(1)掌握在Android的应用中使用图片等资源的方法。

(2)在界面上面至少显示一张图片

(3)实现Activity的转换(利用点击图片或则按钮时的事件实现)

## 2、实验步骤

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

(2)在电脑使用Android Studio编写代码,建立需要使用另外的Activity

(3)在主Activity的xml文件中添加文本、图片、Button等内容。注意图片是保存在res文件下的drawable文件夹中。

(4)在主Activity中加设一个BUTTON变量,添加鼠标单击事件,执行startActivity(intent)

(5)使用Git将代码、截图、报告提交到自己的库中:https://github.com/YOUR_NAME/android-labs-2018

$ git pull

$ git add学号目录/

$ git commit "#3 #940第三次实验 "

$ git push

在自己的GitHub库中创建并发送Pull Requset(合并请求),注意是否只改变自己的文件夹。

在GitHub中使用Markdown文件编写实验报告。

## 3,实验结果

![Activity1](https://github.com/LakersChampion/android-labs-2018/blob/master/soft1614080902108/lbh1.PNG)

![Activity2](https://github.com/LakersChampion/android-labs-2018/blob/master/soft1614080902108/lbh2.png)
## 4,实验体会

通过这次实验,我大概了解了如何在android stdio中插入和使用图片以及按钮的运用,虽然在做的过程中出现了不少问题,但总算还是解决了

0 comments on commit 0794084

Please sign in to comment.