Skip to content

Commit

Permalink
Merge pull request #784 from 410898194/master
Browse files Browse the repository at this point in the history
#3 提交实验三代码
  • Loading branch information
zengsn authored Mar 19, 2019
2 parents c6a07e5 + 496f1db commit 419189e
Show file tree
Hide file tree
Showing 8 changed files with 425 additions and 0 deletions.
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>
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;
}
}



}
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);
}
}
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.
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>
Loading

0 comments on commit 419189e

Please sign in to comment.