Skip to content

Commit

Permalink
Merge pull request #1748 from BoyJDG/master
Browse files Browse the repository at this point in the history
#3 #891 第三次实验
  • Loading branch information
zengsn authored May 11, 2018
2 parents ab4d635 + 0d84206 commit e3d22a6
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 4 deletions.
Binary file added soft1614080902124/QQ图片20180510091034.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 soft1614080902124/QQ图片20180510091047.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions soft1614080902124/report3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 第三次实验

Android资源使用编程

## 1.实验目标

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

## 2.实验步骤

1.在界面上显示至少一张图片(按照自己的题目添加);

2.提交res/drawable及图片使用的代码;

3.提交res/values, res/layout等其他代码;

3.将应用运行结果截图,放到实验报告中;

4.点击图片(或按钮)时,打开另一个Activity。

// 保存在自己的文件夹下
## 3.实验结果

![image](https://github.com/BoyJDG/android-labs-2018/blob/master/soft1614080902124/QQ%E5%9B%BE%E7%89%8720180510091047.jpg)

![image](https://github.com/BoyJDG/android-labs-2018/blob/master/soft1614080902124/QQ%E5%9B%BE%E7%89%8720180510091034.jpg)

## 4.实验体会
本次实验使用Android Studio编写代码,实现了两个activity,通过此次实验我了解了android一些控件和布局的
使用,初步了解了控件点击事件的编写。
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Soft1614080902124Activity_2"
android:label=""
></activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
package edu.hzuapps.androidlabs.soft1614080902124;

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


public class Soft1614080902124Activity extends AppCompatActivity {

Button button = null;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_soft1614080902124);

button = (Button)findViewById(R.id.button1);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.setClass(Soft1614080902124Activity.this,Soft1614080902124Activity_2.class);
startActivity(intent);
}
});


}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package edu.hzuapps.androidlabs.soft1614080902124;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class Soft1614080902124Activity_2 extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_soft1614080902124_2);
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="edu.hzuapps.androidlabs.soft1614080902124.Soft1614080902124Activity">
tools:context=".Soft1614080902124Activity">

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

</android.support.constraint.ConstraintLayout>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="打开"/>

</android.support.constraint.ConstraintLayout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?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=".Soft1614080902124Activity_2">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="照片浏览器"
android:textSize="50dp" />

</android.support.constraint.ConstraintLayout>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">照片浏览器soft1614080902124</string>
<string name="app_name"></string>
</resources>

0 comments on commit e3d22a6

Please sign in to comment.