Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit fd2d1de

Browse files
author
chenyouwei
committed
feat: ui 整理
1 parent df78a4e commit fd2d1de

File tree

6 files changed

+57
-32
lines changed

6 files changed

+57
-32
lines changed

‎app/src/main/assets/alipay.mp3‎

139 KB
Binary file not shown.

‎app/src/main/java/com/hugh/audiofun/FmodActivity.java‎

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
public class FmodActivity extends Activity {
3434
private CommonAdapter<Item> mAdapter;
3535
String path = "file:///android_asset/lightlesson_excellent.mp3";
36+
String path2 = "file:///android_asset/alipay.mp3";
3637

3738
@Override
3839
protected void onCreate(Bundle savedInstanceState) {
@@ -51,6 +52,12 @@ public BaseViewHolder<Item> createViewHolder(int type) {
5152
return new ItemVH();
5253
}
5354
};
55+
findViewById(R.id.iv_back).setOnClickListener(new View.OnClickListener() {
56+
@Override
57+
public void onClick(View v) {
58+
finish();
59+
}
60+
});
5461
listView.setAdapter(mAdapter);
5562
listView.setOnItemClickListener((parent, view, position, id) -> {
5663
Item item = mAdapter.getItem(position);
@@ -80,50 +87,30 @@ public BaseViewHolder<Item> createViewHolder(int type) {
8087
case TYPE_PLAY_8:
8188
playSound(path, TYPE_TREMOLO);
8289
break;
83-
case TYPE_GO:
84-
Intent intent = new Intent(FmodActivity.this, SoundTouchActivity.class);
85-
startActivity(intent);
86-
break;
87-
case TYPE_GO_WEBRTC:
88-
startActivity(new Intent(FmodActivity.this, RtcActivity.class));
89-
break;
90-
case TYPE_GO_FUN_AUDIO:
91-
startActivity(new Intent(FmodActivity.this, AudioFunHomeActivity.class));
92-
break;
93-
case TYPE_GO_WEBRTC2:
94-
startActivity(new Intent(FmodActivity.this, RtcFileActivity.class));
95-
break;
90+
9691
default:
9792
break;
9893
}
9994
}
10095
});
10196

102-
// goToSoundTouch();
10397
}
10498

105-
private void goToSoundTouch() {
106-
Intent intent = new Intent(FmodActivity.this, SoundTouchActivity.class);
107-
startActivity(intent);
108-
}
99+
109100

110101
private void play3D(String path) {
111102
FmodSound.play3DSound(path);
112103
}
113104

114105
enum Item {
115-
TYPE_GO("进入soundTouch"),
116106
TYPE_PLAY_1("播放普通"),
117107
TYPE_PLAY_2("播放萝莉"),
118108
TYPE_PLAY_3("播放大叔"),
119109
TYPE_PLAY_4("播放惊悚"),
120110
TYPE_PLAY_5("播放搞怪"),
121111
TYPE_PLAY_6("播放空灵"),
122112
TYPE_PLAY_7("播放合唱团"),
123-
TYPE_PLAY_8("播放颤音"),
124-
TYPE_GO_WEBRTC("进入webRtc"),
125-
TYPE_GO_WEBRTC2("进入webRtc2"),
126-
TYPE_GO_FUN_AUDIO("进入录音调节页面");
113+
TYPE_PLAY_8("播放颤音");
127114

128115

129116
private String title;
190 Bytes
Loading[フレーム]
5.62 KB
Loading[フレーム]

‎app/src/main/res/layout/activity_fmod.xml‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,30 @@
55
android:layout_height="match_parent"
66
android:orientation="vertical">
77

8+
9+
<RelativeLayout
10+
android:layout_width="match_parent"
11+
android:layout_height="44dp">
12+
13+
<ImageView
14+
android:id="@+id/iv_back"
15+
android:layout_width="25dp"
16+
android:layout_height="25dp"
17+
android:src="@drawable/ic_back_grey"
18+
android:layout_centerVertical="true"
19+
android:layout_marginLeft="10dp"/>
20+
21+
<TextView
22+
android:layout_centerInParent="true"
23+
android:text="FMOD 播放页面"
24+
android:textSize="22sp"
25+
android:textColor="#000000"
26+
android:textStyle="bold"
27+
android:layout_width="wrap_content"
28+
android:layout_height="wrap_content"/>
29+
30+
</RelativeLayout>
31+
832
<ListView
933
android:id="@+id/lv_main"
1034
android:layout_width="match_parent"
Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
3-
android:id="@+id/tv_item"
4-
android:layout_width="match_parent"
5-
android:layout_height="45dp"
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
63
xmlns:tools="http://schemas.android.com/tools"
7-
android:gravity="center"
8-
android:textSize="16sp"
9-
android:textColor="@color/colorPrimary"
4+
android:layout_width="match_parent"
5+
android:layout_height="wrap_content"
106
android:background="@android:color/white"
11-
tools:text="item">
7+
android:gravity="center"
8+
android:orientation="horizontal">
9+
10+
<TextView
11+
android:id="@+id/tv_item"
12+
android:layout_width="wrap_content"
13+
android:layout_height="45dp"
14+
android:layout_marginRight="5dp"
15+
android:gravity="center"
16+
android:textColor="@color/colorPrimary"
17+
android:textSize="16sp"
18+
tools:text="item">
19+
20+
</TextView>
1221

13-
</TextView>
22+
<ImageView
23+
android:layout_width="20dp"
24+
android:layout_height="20dp"
25+
android:layout_marginLeft="5dp"
26+
android:src="@drawable/ic_home_play" />
27+
</LinearLayout>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /