Skip to content

Commit

Permalink
Merge pull request #2000 from Zhenghizhong/master
Browse files Browse the repository at this point in the history
#4 #916 第四次实验+报告
  • Loading branch information
zengsn authored May 19, 2018
2 parents f27abfd + 0c8876c commit 399d0ff
Show file tree
Hide file tree
Showing 14 changed files with 237 additions and 0 deletions.
Binary file added soft1614080902215/test4/4.1.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 soft1614080902215/test4/4.2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions soft1614080902215/test4/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="androidlabs.hzuapps.edu.soft1614080902215">

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

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

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package androidlabs.hzuapps.edu.soft1614080902215;

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.*;
public class SecondActivity extends AppCompatActivity {

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

}

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

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import org.w3c.dom.Text;
public class soft1614080902215MainActivity extends AppCompatActivity {

private Button Button;

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

Button=(Button)findViewById(R.id.button);

Button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(soft1614080902215MainActivity.this,SecondActivity.class);
startActivity(intent);
}
});
}
}
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
@@ -0,0 +1,69 @@
<?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="androidlabs.hzuapps.edu.soft1614080902215.SecondActivity">


<Button
android:id="@+id/科学计算器"
android:layout_width="185dp"
android:layout_height="250dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:text="科学计算器"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp" />

<Button
android:id="@+id/时间转换"
android:layout_width="180dp"
android:layout_height="250dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:text="时间转换"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="208dp"
tools:layout_editor_absoluteY="0dp" />

<Button
android:id="@+id/长度转换"
android:layout_width="420dp"
android:layout_height="120dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/科学计算器"
android:text="长度转换"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="257dp" />

<Button
android:id="@+id/汇率计算"
android:layout_width="185dp"
android:layout_height="250dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:text="汇率计算"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="382dp" />

<Button
android:id="@+id/房贷计算"
android:layout_width="180dp"
android:layout_height="250dp"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:text="房贷计算"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="204dp"
tools:layout_editor_absoluteY="382dp" />
</RelativeLayout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?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:orientation="vertical"
android:layout_height="match_parent"
tools:context="androidlabs.hzuapps.edu.soft1614080902215.soft1614080902215MainActivity">

<Button
android:id="@+id/button"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="12dp"
android:text="Enter the calculator" />

<TextView
android:id="@+id/textview_01"
android:layout_width="wrap_content"
android:layout_height="607dp"
android:layout_alignBottom="@+id/button"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="25dp"
android:drawableTop="@drawable/calc2" />

</RelativeLayout>
6 changes: 6 additions & 0 deletions soft1614080902215/test4/app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
</resources>
3 changes: 3 additions & 0 deletions soft1614080902215/test4/app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<dimen name="fab_margin">16dp</dimen>
</resources>
5 changes: 5 additions & 0 deletions soft1614080902215/test4/app/src/main/res/values/ids.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item name="toolbar" type="id" />
<item name="fab" type="id" />
</resources>
4 changes: 4 additions & 0 deletions soft1614080902215/test4/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<resources>
<string name="app_name">soft1614080902215</string>
<string name="title_activity_second">SecondActivity</string>
</resources>
20 changes: 20 additions & 0 deletions soft1614080902215/test4/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>

<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>

<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

</resources>
27 changes: 27 additions & 0 deletions soft1614080902215/test4/report4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 第四次实验

## 1.实验目标
(1)根据自选题目设计界面布局;

(2)布局xml以及界面控制操作代码提交并截图;

(3)调试,将应用运行并截图。

## 2.实验步骤
(1)打开已建好的项目

(2)在各个xml文件中添加RelativeLayout布局

(3)构思界面布局,添加相应的控件

(4)调试应用,运行成功并截图

(5)使用git上传本次实验文件

## 3.实验结果
![image](https://github.com/Zhenghizhong/android-labs-2018/blob/master/soft1614080902215/test4/4.1.png)
![image](https://github.com/Zhenghizhong/android-labs-2018/blob/master/soft1614080902215/test4/4.2.png)

## 4.实验体会

通过本次实验,我了解到了各种布局的使用规律,由于对各种布局方式的不了解,我花费了很长的时间在挑选布局实现我自己想要的布局格式上,在之后的实验中,我会更加深入地了解各种布局的使用方法。

0 comments on commit 399d0ff

Please sign in to comment.