Skip to content

Commit

Permalink
Merge pull request #1500 from heyingsen/master
Browse files Browse the repository at this point in the history
#3 #984 第三次实验
  • Loading branch information
zengsn authored May 4, 2018
2 parents 4ecbb4a + 9bf72fb commit 2d53bff
Show file tree
Hide file tree
Showing 10 changed files with 219 additions and 0 deletions.
28 changes: 28 additions & 0 deletions soft1614080902302/Third/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.hzuapps.androidlabs.soft1614080902302">

<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=".Soft1614080902302Activity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Soft1614080902302Activity2"
android:label="@string/title_activity_soft16140809023022"
android:theme="@style/AppTheme.NoActionBar"></activity>
</application>

</manifest>
Binary file added soft1614080902302/Third/aaa.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 58 additions & 0 deletions soft1614080902302/Third/activity_soft1614080902302.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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=".Soft1614080902302Activity">

<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">

<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />

</android.support.design.widget.AppBarLayout>

<include layout="@layout/content_soft1614080902302" />

<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@android:drawable/ic_dialog_email" />
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="edu.hzuapps.androidworks.examples.ActivityBasicActivity">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="仅用于演示打开和关闭活动."/>

<Button
android:id="@+id/button_open"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="打开"/>

</LinearLayout>


</android.support.design.widget.CoordinatorLayout>
39 changes: 39 additions & 0 deletions soft1614080902302/Third/activity_soft16140809023022.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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=".Soft1614080902302Activity2">

<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">

<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />

</android.support.design.widget.AppBarLayout>

<include layout="@layout/content_soft16140809023022" />

<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@android:drawable/ic_dialog_email" />

<TextView
android:id="@+id/textview_01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/aaa"
android:text="hello_world" />
</android.support.design.widget.CoordinatorLayout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package edu.hzuapps.androidlabs.soft1614080902302;

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


public class Soft1614080902302Activity extends AppCompatActivity {

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

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,Soft1614080902302Activity2.class);
thisActivity.startActivity(intent);
//thisActivity.startActivityForResult(intent, 2016);
}
});

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

import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;

public class Soft1614080902302Activity2 extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_soft16140809023022);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);

FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
}

}
29 changes: 29 additions & 0 deletions soft1614080902302/Third/report3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 第三次实验

## 1.实验目标
掌握在Android应用中使用图片等资源的方法。

## 2.实验步骤
阅读实验要求:https://github.com/hzuapps/android-labs-2018/labels/Lab

在电脑上Android Studio编写代码

// 代码要可以运行!
使用Git将代码提交到自己的库中:https://github.com/YOUR_NAME/android-labs-2018
$ git pull
$ git add 学号目录/*
$ git commit "#12345678 "
$ git push
在自己的GitHub库上创建和发送Pull Request(注意查看Changed files)
// 是否只修改了自己的文件?
在GitHub中使用Markdown文件编写实验报告(report1.md, report2.md)
// 保存在自己的文件夹下

## 3.实验结果

![image](https://github.com/heyingsen/android-labs-2018/blob/master/soft1614080902302/Third/tupian1.png)

![image](https://github.com/heyingsen/android-labs-2018/blob/master/soft1614080902302/Third/tupian2.png)

## 4.实验体会
这次实验对我来说很困难,上网学习了如何从一个Activity打开另外的一个Activity
5 changes: 5 additions & 0 deletions soft1614080902302/Third/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<resources>
<string name="app_name">Soft1614080902302快递查询系统</string>
<string name="action_settings">Settings</string>
<string name="title_activity_soft16140809023022">Soft1614080902302Activity2</string>
</resources>
Binary file added soft1614080902302/Third/tupian1.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 soft1614080902302/Third/tupian2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2d53bff

Please sign in to comment.