Skip to content

Commit

Permalink
Merge pull request #1823 from cruiji/master
Browse files Browse the repository at this point in the history
#4 #1020 实验四和前几次实验报告修改
  • Loading branch information
zengsn authored May 12, 2018
2 parents 60dc995 + fe5f545 commit 2ce02b2
Show file tree
Hide file tree
Showing 17 changed files with 283 additions and 82 deletions.
38 changes: 29 additions & 9 deletions soft1614080902442/app/java/soft1614080902442main1Activity.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,44 @@
package edu.hzuapps.androidlabs.soft1614080902442;

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

public class soft1614080902442main1Activity extends AppCompatActivity implements View.OnClickListener{
import edu.hzuapps.androidlabs.soft1614080902442.soft1614080902442main1Activity;
import edu.hzuapps.androidlabs.soft1614080902442.R;

public class soft1614080902442main1Activity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_soft1614080902442main1);
Button bt1 = (Button)findViewById(R.id.button);
bt1.setOnClickListener(this);
}

@Override
public void onClick(View v) {
final Activity thisActivity = this;
final Button btnOpen1 = (Button) findViewById(R.id.button_open1);
final Button btnOpen2 = (Button) findViewById(R.id.button_open2);

btnOpen1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(v.equals(btnOpen1)) {
Intent intent = new Intent(thisActivity,soft1614080902442main2Activity.class);
thisActivity.startActivity(intent);
}
}
});

Intent intent = new Intent(this,soft1614080902442main2Activity.class);
startActivity(intent);
btnOpen2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(v.equals(btnOpen2)) {
Intent intent = new Intent(thisActivity,soft1614080902442main3Activity.class);
thisActivity.startActivity(intent);
}
}
});
}
}
12 changes: 5 additions & 7 deletions soft1614080902442/app/java/soft1614080902442main2Activity.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package edu.hzuapps.androidlabs.soft1614080902442;


import android.app.Activity;
import android.content.Intent;
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;
import android.widget.Button;


public class soft1614080902442main2Activity extends AppCompatActivity {

Expand All @@ -15,8 +15,6 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_soft1614080902442main2);



}

}
}
19 changes: 19 additions & 0 deletions soft1614080902442/app/java/soft1614080902442main3Activity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package edu.hzuapps.androidlabs.soft1614080902442;

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 soft1614080902442main3Activity extends AppCompatActivity {

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

}

}
6 changes: 5 additions & 1 deletion soft1614080902442/app/mainfests/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
<activity
android:name=".soft1614080902442main2Activity"
android:label="@string/title_activity_soft1614080902442main2"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".soft1614080902442main3Activity"
android:label="@string/title_activity_soft1614080902442main3"
android:theme="@style/AppTheme.NoActionBar"></activity>
</application>

</manifest>
</manifest>
Binary file removed soft1614080902442/app/res/drawable/sleeping.jpg
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,46 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".soft1614080902442main1Activity">
<TextView
android:id="@+id/textview-01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/sleep"
android:text="hello_world" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<Button
android:id="@+id/button"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#8079ec"
android:text="进入睡眠"
android:textSize="20dp"
tools:layout_editor_absoluteX="142dp"
tools:layout_editor_absoluteY="318dp"
tools:ignore="MissingConstraints" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp"
tools:ignore="MissingConstraints">

<TextView
android:id="@+id/textview-01"
android:layout_width="wrap_content"
android:layout_height="450dp"
android:drawableTop="@drawable/sleep"
android:text="hello_world"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#ffffff"
android:orientation="horizontal">

<Button
android:id="@+id/button_open1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="睡前小故事" />

<Button
android:id="@+id/button_open2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="助眠轻音乐" />


</LinearLayout>
</LinearLayout>

</android.support.constraint.ConstraintLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,43 @@
android:layout_height="match_parent"
tools:context=".soft1614080902442main2Activity">

<android.support.design.widget.AppBarLayout


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

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
android:layout_height="match_parent"
android:orientation="vertical"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp">


<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"

<ImageButton
android:id="@+id/imageButton2"
android:layout_width="80dp"
android:layout_height="wrap_content"
app:srcCompat="@android:drawable/ic_search_category_default" />

<ListView
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
android:layout_height="200dp" />

</android.support.design.widget.AppBarLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">

<include layout="@layout/content_soft1614080902442main2" />
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="每日推荐" />

</LinearLayout>
</LinearLayout>

<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_02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/sleeping"
android:text="hello_world" />

</android.support.design.widget.CoordinatorLayout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?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=".soft1614080902442main3Activity">



<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp">


<ImageButton
android:id="@+id/imageButton2"
android:layout_width="80dp"
android:layout_height="wrap_content"
app:srcCompat="@android:drawable/ic_search_category_default" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal"
android:background="#ffffff">

<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_weight="1"
android:gravity="center"
android:text="热门搜索:" />

</LinearLayout>

<ListView
android:layout_width="match_parent"
android:layout_height="200dp" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">

<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="每日推荐" />
</LinearLayout>

</LinearLayout>

</android.support.design.widget.CoordinatorLayout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?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"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".soft1614080902442main3Activity"
tools:showIn="@layout/activity_soft1614080902442main3">

</android.support.constraint.ConstraintLayout>
7 changes: 5 additions & 2 deletions soft1614080902442/app/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<resources>
<string name="app_name">soft1614080902442睡眠大师</string>
<resources>
<string name="app_name">soft16140809024421睡眠大师</string>
<string name="title_activity_soft1614080902442main2">soft1614080902442main2Activity</string>

<string name="title_activity_soft1614080902442main3">soft1614080902442main3Activity</string>

</resources>
7 changes: 6 additions & 1 deletion soft1614080902442/report1.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@
## 二.实验步骤
1.加入Git项目(Fork),将项目克隆(Clone)到自己帐号下; $ git clone https://github.com/cruiji/android-labs-2018.git

2.创建以学号命名的个人实验目录: Soft1614080902442 3.运行Android Studio并截图
2.创建以学号命名的个人实验目录: soft1614080902442

3.运行Android Studio并截图

4. 创建一个Java类:edu.hzuapps.androidlabs.Soft1614080902442.Soft1614080902442Activity.java。

5. 将截图上穿到github,运行gitbash $ git add Soft1614080902442/Soft1614080902442.png

$ git commit -m "#1 #环境搭建截图"
$ git push

6.将图片贴到report1

## 三.实验截图
Expand Down
16 changes: 12 additions & 4 deletions soft1614080902442/report2.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
# 第二次实验

## 1.实验目标

(1)在Issues中创建自己的选题:https://github.com/hzuapps/android-labs-2018/issues

(2)根据自选题目,编写一个或多个Activity(所有均带上学号前缀,放到自己的Java包下);

(3)将标题设置为自己的学号+对应的功能或题目;

(4)根据自己选择的题目实现Activity中导航、调用等功能(选做)

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

(2)在电脑上Android Studio编写代码// 代码要可以运行!

(3)使用Git将代码提交到自己的库中:https://github.com/cruiji/android-labs-2018
$ git pull
$ git add 学号目录/*
   首先将目录转到master文件
  $ git pull //同步
  $ git add * //将文件添加
  $ git commit -m "#2 #1020 第二次实验 "
$ git push

(4)在自己的GitHub库上创建和发送Pull Request(注意查看Changed files)
// 是否只修改了自己的文件?

(5)在GitHub中使用Markdown文件编写实验报告(report2.md)
// 保存在自己的文件夹下

## 3.实验体会
本次实验后,对Android Studio有了更多了解;
知道如何创建个人的issues
Expand Down
Loading

0 comments on commit 2ce02b2

Please sign in to comment.