Skip to content

Commit

Permalink
hzuapps#4 Music_Player
Browse files Browse the repository at this point in the history
  • Loading branch information
Demanding committed May 9, 2018
1 parent ac438b0 commit f574415
Show file tree
Hide file tree
Showing 5 changed files with 197 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,27 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_soft1614080902422);
Button bt1 = (Button) findViewById(R.id.b1);
Button bt2 = (Button) findViewById(R.id.b2);

bt1.setOnClickListener(this);
bt2.setOnClickListener(this);
}




@Override
public void onClick(View v) {

Intent intent = new Intent(this,Soft1614080902422Activity_01.class);
startActivity(intent);
switch (v.getId()){
case R.id.b1:
Intent i1 = new Intent(this,Soft1614080902422Activity_01.class);
startActivity(i1);
break;
case R.id.b2:
Intent i2 = new Intent(this,Soft1614080902422Activity_02.class);
startActivity(i2);
break;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@



public class Soft1614080902422Activity_01 extends AppCompatActivity {
public class Soft1614080902422Activity_01 extends AppCompatActivity implements View.OnClickListener{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_soft1614080902422_01);


View t1 = (View) findViewById(R.id.textview_02);
t1.setOnClickListener(this);

}

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

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package edu.hzuapps.androidlabs.soft1614080902422;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class Soft1614080902422Activity_02 extends AppCompatActivity implements View.OnClickListener {
public Intent i1;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_soft1614080902422_02);
Button bt1 = (Button) findViewById(R.id.m_1);
Button bt2 = (Button) findViewById(R.id.m_2);
Button bt3 = (Button) findViewById(R.id.m_3);
Button bt4 = (Button) findViewById(R.id.m_4);
Button bt5 = (Button) findViewById(R.id.m_5);
Button bt6 = (Button) findViewById(R.id.m_6);
Button bt7 = (Button) findViewById(R.id.m_7);
Button bt8 = (Button) findViewById(R.id.m_8);
Button bt9 = (Button) findViewById(R.id.m_9);
Button bt10 = (Button) findViewById(R.id.m_10);
bt1.setOnClickListener(this);
bt2.setOnClickListener(this);
bt3.setOnClickListener(this);
bt4.setOnClickListener(this);
bt5.setOnClickListener(this);
bt6.setOnClickListener(this);
bt7.setOnClickListener(this);
bt8.setOnClickListener(this);
bt9.setOnClickListener(this);
bt10.setOnClickListener(this);
}

@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.m_1:
i1 = new Intent(this, Soft1614080902422Activity.class);
startActivity(i1);
break;
case R.id.m_2:
i1 = new Intent(this, Soft1614080902422Activity.class);
startActivity(i1);
break;
case R.id.m_3:
i1 = new Intent(this, Soft1614080902422Activity.class);
startActivity(i1);
break;
case R.id.m_4:
i1 = new Intent(this, Soft1614080902422Activity.class);
startActivity(i1);
break;
case R.id.m_5:
i1 = new Intent(this, Soft1614080902422Activity.class);
startActivity(i1);
break;
case R.id.m_6:
i1 = new Intent(this, Soft1614080902422Activity.class);
startActivity(i1);
break;
case R.id.m_7:
i1 = new Intent(this, Soft1614080902422Activity.class);
startActivity(i1);
break;
case R.id.m_8:
i1 = new Intent(this, Soft1614080902422Activity.class);
startActivity(i1);
break;
case R.id.m_9:
i1 = new Intent(this, Soft1614080902422Activity.class);
startActivity(i1);
break;
case R.id.m_10:
i1 = new Intent(this, Soft1614080902422Activity.class);
startActivity(i1);
break;
}
}
}
6 changes: 4 additions & 2 deletions Soft1614080902422/manifests/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.hzuapps.androidlabs.soft1614080902422">

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
Expand All @@ -16,8 +18,8 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Soft1614080902422Activity_01">
</activity>
<activity android:name=".Soft1614080902422Activity_01" />
<activity android:name=".Soft1614080902422Activity_02"></activity>
</application>

</manifest>
86 changes: 86 additions & 0 deletions Soft1614080902422/res/layout/activity_soft1614080902422_02.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?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=".Soft1614080902422Activity_02">

<LinearLayout
android:layout_width="344dp"
android:layout_height="495dp"
android:orientation="vertical"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="8dp">

<Button
android:id="@+id/m_1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="红颜旧-刘涛" />

<Button
android:id="@+id/m_2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="小幸运-田馥甄" />

<Button
android:id="@+id/m_3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="喜欢你-邓紫棋" />

<Button
android:id="@+id/m_4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="童话镇-陈一发儿" />

<Button
android:id="@+id/m_5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="遇见-孙燕姿" />

<Button
android:id="@+id/m_6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="trouble is a friend-lenka" />

<Button
android:id="@+id/m_7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="暗香-沙宝亮" />

<Button
android:id="@+id/m_8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="Button" />

<Button
android:id="@+id/m_9"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="告白气球-周杰伦" />

<Button
android:id="@+id/m_10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="有点甜-汪苏泷" />
</LinearLayout>
</android.support.constraint.ConstraintLayout>

0 comments on commit f574415

Please sign in to comment.