Skip to content

Commit

Permalink
Merge pull request #1907 from as05071/master
Browse files Browse the repository at this point in the history
#4 提交实验四代码
  • Loading branch information
zengsn authored May 20, 2019
2 parents 4c9a900 + 7c58a91 commit 2372ea9
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package edu.hzuapps.androidlabs.soft1714080902218;

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

public class NewActivity extends Activity {

private Button button3 ;

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

getWindow().setBackgroundDrawableResource(R.drawable.cloud);

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


//绑定监听器
button3.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View arg0) {
Intent intent = new Intent(NewActivity.this,Soft1714080902218Activity.class) ;
startActivity(intent) ;
}

});


}
}
62 changes: 62 additions & 0 deletions students/soft1714080902218/res/layout/newone.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?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"
tools:context=".NewActivity">

<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/colorPrimaryDark"
android:text="排行榜"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="43dp"
android:layout_marginBottom="155dp"
android:background="@color/colorAccent"
android:text="进入书库"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="99dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:srcCompat="@tools:sample/avatars[3]" />

<Button
android:id="@+id/button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="41dp"
android:layout_marginLeft="41dp"
android:background="@android:color/holo_blue_bright"
android:text="今日推荐"
app:layout_constraintBaseline_toBaselineOf="@+id/button2"
app:layout_constraintStart_toStartOf="parent" />

<Button
android:id="@+id/button5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="30dp"
android:layout_marginRight="30dp"
android:background="@android:color/holo_blue_bright"
android:text="随机打开书籍"
app:layout_constraintBaseline_toBaselineOf="@+id/button2"
app:layout_constraintEnd_toEndOf="parent" />
</android.support.constraint.ConstraintLayout>

0 comments on commit 2372ea9

Please sign in to comment.