forked from hzuapps/android-labs-2018
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
220 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 24 additions & 9 deletions
33
...204/app/src/main/java/com/example/gwl20/soft1614080902204/soft1614080902204BActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,44 @@ | ||
package com.example.gwl20.soft1614080902204; | ||
|
||
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 soft1614080902204BActivity extends AppCompatActivity { | ||
|
||
private Button bu,jiandao,shitou; | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_soft1614080902204_b); | ||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); | ||
setSupportActionBar(toolbar); | ||
|
||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); | ||
fab.setOnClickListener(new View.OnClickListener() { | ||
bu=(Button)findViewById(R.id.button_bu); | ||
jiandao=(Button)findViewById(R.id.button_jiandao); | ||
shitou=(Button)findViewById(R.id.button_shitou); | ||
bu.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
Intent intent=new Intent(soft1614080902204BActivity.this,soft1614080902204CActivity.class); | ||
startActivity(intent); | ||
} | ||
}); | ||
jiandao.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(); | ||
public void onClick(View v) { | ||
Intent intent=new Intent(soft1614080902204BActivity.this,soft1614080902204CActivity.class); | ||
startActivity(intent); | ||
} | ||
}); | ||
shitou.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
Intent intent=new Intent(soft1614080902204BActivity.this,soft1614080902204CActivity.class); | ||
startActivity(intent); | ||
} | ||
}); | ||
} | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
...204/app/src/main/java/com/example/gwl20/soft1614080902204/soft1614080902204CActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.example.gwl20.soft1614080902204; | ||
|
||
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 soft1614080902204CActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_soft1614080902204_c); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
soft1614080902204/app/src/main/res/layout/activity_soft1614080902204_c.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?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=".soft1614080902204CActivity"> | ||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" | ||
tools:ignore="MissingConstraints" | ||
tools:layout_editor_absoluteX="0dp" | ||
tools:layout_editor_absoluteY="0dp" | ||
android:background="#FFFADC"> | ||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="你赢了!" | ||
android:textStyle="bold" | ||
android:textSize="100sp"/> | ||
</LinearLayout> | ||
|
||
</android.support.design.widget.CoordinatorLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<resources> | ||
<string name="app_name">soft1614080902204</string> | ||
<string name="title_activity_soft1614080902204_b">soft1614080902204BActivity</string> | ||
<string name="title_activity_soft1614080902204_c">soft1614080902204CActivity</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# 第4次实验 | ||
|
||
## 1、实验目的 | ||
|
||
(1)根据选题要求设计界面布局及控件使用; | ||
|
||
(2)布局xml及界面控制操作代码提交并截图; | ||
|
||
(3)将应用运行结果截图。 | ||
|
||
|
||
## 2、实验环境 | ||
|
||
windows、Android studio | ||
|
||
## 3、实验目的 | ||
|
||
(1)打开已建好的项目soft1614080902204 | ||
|
||
(2)新建activity:soft1614080902233CActivity | ||
|
||
(3)在xml文件中运用LinerLayout布局和TextView等进行我想象中的布局设置好 | ||
|
||
(4)在activity中写入相应的监听器代码 | ||
|
||
(5)打包成apk文件运行成功 | ||
|
||
|
||
## 5、实验结果 | ||
|
||
![实验截图](https://github.com/545072985/android-labs-2018/blob/master/soft1614080902204/sy4/tupian4.1.png) | ||
|
||
![实验结果](https://github.com/545072985/android-labs-2018/blob/master/soft1614080902204/sy4/tupian4.2.png) | ||
|
||
![实验结果](https://github.com/545072985/android-labs-2018/blob/master/soft1614080902204/sy4/tupian4.3.png) | ||
|
||
## 6、实验总结 | ||
|
||
经过此次实验,我学会使用相应布局代码来进行xml文件布局,得到自己想要的模样,很开心。 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.