-
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 #1907 from as05071/master
#4 提交实验四代码
- Loading branch information
Showing
2 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
students/soft1714080902218/java/edu/hzuapps/androidlabs/soft1714080902218/NewActivity.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,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) ; | ||
} | ||
|
||
}); | ||
|
||
|
||
} | ||
} |
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,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> |