-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #784 from 410898194/master
#3 提交实验三代码
- Loading branch information
Showing
8 changed files
with
425 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
students/soft1714080902127/实验3/app/src/main/AndroidManifest.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,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="edu.hzuapps.androidlabs.soft1714080902127"> | ||
|
||
<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=".Soft1714080902127Show2Activity"></activity> | ||
<activity android:name=".Soft1714080902127Show1Activity" /> | ||
<activity android:name=".Soft1714080902127MainActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
48 changes: 48 additions & 0 deletions
48
...rc/main/java/edu/hzuapps/androidlabs/soft1714080902127/Soft1714080902127MainActivity.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,48 @@ | ||
package edu.hzuapps.androidlabs.soft1714080902127; | ||
|
||
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.EditText; | ||
import android.widget.Toast; | ||
|
||
public class Soft1714080902127MainActivity extends AppCompatActivity implements View.OnClickListener{ | ||
|
||
private EditText editText; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.soft_1714080902127_mainactivity); | ||
Button button =(Button) findViewById(R.id.button); | ||
|
||
button.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
Intent intent=new Intent(Soft1714080902127MainActivity.this,Soft1714080902127Show1Activity.class); | ||
startActivity(intent); | ||
} | ||
}); | ||
|
||
|
||
} | ||
|
||
|
||
@Override | ||
public void onClick(View v) { | ||
switch (v.getId()){ | ||
case R.id.button: | ||
String inputText =editText.getText().toString(); | ||
Toast.makeText(Soft1714080902127MainActivity.this,inputText, | ||
Toast.LENGTH_SHORT).show(); | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
|
||
|
||
|
||
} |
13 changes: 13 additions & 0 deletions
13
...c/main/java/edu/hzuapps/androidlabs/soft1714080902127/Soft1714080902127Show1Activity.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,13 @@ | ||
package edu.hzuapps.androidlabs.soft1714080902127; | ||
|
||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
|
||
public class Soft1714080902127Show1Activity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.soft_1714080902127_show1activity); | ||
} | ||
} |
Binary file added
BIN
+257 KB
students/soft1714080902127/实验3/app/src/main/res/drawable-xhdpi/img_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
BIN
+457 KB
students/soft1714080902127/实验3/app/src/main/res/drawable-xhdpi/img_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions
60
students/soft1714080902127/实验3/app/src/main/res/layout/soft_1714080902127_mainactivity.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,60 @@ | ||
<?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" | ||
android:orientation="vertical" | ||
|
||
tools:context=".Soft1714080902127MainActivity"> | ||
|
||
<TextView | ||
android:id="@+id/text_view" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="16dp" | ||
android:gravity="center" | ||
android:text="精品菜单" | ||
android:textColor="#006400" | ||
android:textSize="24sp" | ||
android:textStyle="bold" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0.0" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<Button | ||
android:id="@+id/button" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="304dp" | ||
android:text="点击进入" | ||
android:textSize="20sp" | ||
android:textStyle="bold" | ||
android:textAllCaps="false" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0.0" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="@+id/text_view" /> | ||
|
||
|
||
<ImageView | ||
android:id="@+id/image_view" | ||
android:layout_width="match_parent" | ||
android:layout_height="312dp" | ||
android:layout_marginTop="12dp" | ||
android:src="@drawable/img_1" | ||
app:layout_constraintStart_toStartOf="@+id/text_view" | ||
app:layout_constraintTop_toTopOf="@+id/text_view" /> | ||
|
||
<ImageView | ||
android:id="@+id/image_view1" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="196dp" | ||
android:src="@drawable/img_2" | ||
app:layout_constraintStart_toStartOf="@+id/text_view" | ||
app:layout_constraintTop_toTopOf="@+id/text_view" /> | ||
|
||
|
||
</android.support.constraint.ConstraintLayout> |
Oops, something went wrong.