main
蒋婷湘 8 months ago
parent 75c9bc4c04
commit 083990216b

@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="17" />
</component>
</project>

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<value>
<entry key="MainActivity3">
<State />
</entry>
<entry key="app">
<State />
</entry>
</value>
</component>
</project>

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveExternalAnnotations" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectMigrations">
<option name="MigrateToGradleLocalJavaHome">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</component>
</project>

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
<component name="VisualizationToolProject">
<option name="state">
<ProjectState>
<option name="scale" value="0.6180048661800487" />
</ProjectState>
</option>
</component>
</project>

@ -0,0 +1,42 @@
plugins {
alias(libs.plugins.androidApplication)
}
android {
namespace 'com.example.app1'
compileSdk 34
defaultConfig {
applicationId "com.example.app1"
minSdk 21
targetSdk 34
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation libs.appcompat
implementation libs.material
implementation libs.activity
implementation libs.constraintlayout
testImplementation libs.junit
androidTestImplementation libs.ext.junit
androidTestImplementation libs.espresso.core
}

@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

@ -0,0 +1,26 @@
package com.example.app1;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.app1", appContext.getPackageName());
}
}

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Base.Theme.App1"
tools:targetApi="31">
<service
android:name=".MyService"
android:enabled="true"
android:exported="true" />
<activity android:name=".PlayMusicActivity" />
<activity
android:name=".MainActivity3"
android:exported="false" />
<activity
android:name=".personFragment"
android:exported="false" />
<activity
android:name=".MainActivity2"
android:exported="false" />
<meta-data
android:name="com.google.android.actions"
android:resource="@xml/user_login" />
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".IndexActivity"/>
</application>
</manifest>

@ -0,0 +1,88 @@
package com.example.app1;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
public class DBHelper extends SQLiteOpenHelper {
// 数据库名称和版本号
private static final String DATABASE_NAME = "user_db";
private static final int DATABASE_VERSION = 1;
// 表名和列名
private static final String TABLE_USERS = "users";
private static final String COLUMN_ID = "id";
private static final String COLUMN_USERNAME = "username";
private static final String COLUMN_PASSWORD = "password";
// 创建用户表的SQL语句
private static final String SQL_CREATE_TABLE_USERS =
"CREATE TABLE " + TABLE_USERS + " (" +
COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT," +
COLUMN_USERNAME + " TEXT," +
COLUMN_PASSWORD + " TEXT)";
// 构造方法
public DBHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
// 创建用户表
db.execSQL(SQL_CREATE_TABLE_USERS);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
// 数据库升级时执行的操作(暂不处理)
}
public List<User> getAllUsers() {
List<User> userList = new ArrayList<>();
String selectQuery = "SELECT * FROM " + TABLE_USERS;
SQLiteDatabase db = this.getWritableDatabase();
Cursor cursor = db.rawQuery(selectQuery, null);
// 用于记录已经显示的用户名和密码
HashSet<String> displayedUserData = new HashSet<>();
// 遍历游标,并将数据添加到用户列表中
if (cursor.moveToFirst()) {
do {
// 获取当前游标位置的用户名和密码
String username = cursor.getString(cursor.getColumnIndex(COLUMN_USERNAME));
String password = cursor.getString(cursor.getColumnIndex(COLUMN_PASSWORD));
// 生成用户数据字符串,用于检查是否重复
String userDataString = username + "_" + password;
// 如果该用户数据未在之前显示过,则将用户添加到列表中
if (!displayedUserData.contains(userDataString)) {
User user = new User();
user.setId(cursor.getInt(cursor.getColumnIndex(COLUMN_ID)));
user.setUsername(username);
user.setPassword(password);
userList.add(user);
// 将当前用户数据标记为已显示
displayedUserData.add(userDataString);
}
} while (cursor.moveToNext());
}
// 关闭游标和数据库连接
cursor.close();
db.close();
return userList;
}
}

@ -0,0 +1,82 @@
package com.example.app1;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
public class IndexActivity extends AppCompatActivity implements View.OnClickListener {
private LinearLayout musicLine, findLine, liveLine, personLine;
private TextView lastSelectedText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.index_daohan);
init();
switchFragment(new musicFragment());
setDefaultTextColor(findViewById(R.id.wenzi1)); // 设置默认选中项的文字颜色
lastSelectedText = findViewById(R.id.wenzi1);
}
// 初始化布局
private void init() {
musicLine = findViewById(R.id.gaohan1);
musicLine.setOnClickListener(this);
findLine = findViewById(R.id.gaohan2);
findLine.setOnClickListener(this);
liveLine = findViewById(R.id.gaohan3);
liveLine.setOnClickListener(this);
personLine = findViewById(R.id.gaohan4);
personLine.setOnClickListener(this);
}
// 设置默认选中项的文字颜色
private void setDefaultTextColor(TextView text) {
text.setTextColor(Color.parseColor("#FF4081"));
}
// 设置默认项的文字颜色为默认颜色
private void resetTextColor(TextView text) {
text.setTextColor(Color.parseColor("#000000"));
}
// 处理点击事件
@Override
public void onClick(View view) {
resetTextColor(lastSelectedText); // 恢复上一个选中项的文字颜色为默认颜色
if (view.getId() == R.id.gaohan1) {
switchFragment(new musicFragment());
lastSelectedText = findViewById(R.id.wenzi1);
setDefaultTextColor(lastSelectedText);
} else if (view.getId() == R.id.gaohan2) {
switchFragment(new findFragment());
lastSelectedText = findViewById(R.id.wenzi2);
setDefaultTextColor(lastSelectedText);
} else if (view.getId() == R.id.gaohan3) {
switchFragment(new liveFragment());
lastSelectedText = findViewById(R.id.wenzi3);
setDefaultTextColor(lastSelectedText);
} else if (view.getId() == R.id.gaohan4) {
switchFragment(new personFragment());
lastSelectedText = findViewById(R.id.wenzi4);
setDefaultTextColor(lastSelectedText);
}
}
// 切换Fragment
private void switchFragment(Fragment fragment) {
getSupportFragmentManager().beginTransaction().replace(R.id.gaohan, fragment).commit();
}
// 退出登录
public void tuichudenglu(View view) {
Intent intent = new Intent(IndexActivity.this, MainActivity.class);
startActivity(intent);
}
}

@ -0,0 +1,38 @@
package com.example.app1;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//获取按钮
Button button = (Button) findViewById(R.id.button);
//按钮进行监听
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//监听按钮,如果点击,就跳转
Intent intent = new Intent();
//前一个MainActivity.this是目前页面后面一个是要跳转的下一个页面
intent.setClass(MainActivity.this,MainActivity2.class);
startActivity(intent);
}
});
}
}

@ -0,0 +1,150 @@
package com.example.app1;
import android.annotation.SuppressLint;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import java.util.List;
public class MainActivity2 extends AppCompatActivity {
private EditText username;
private EditText password;
private Button login,lookButton;
private Button startServiceButton;
private boolean isServiceRunning = false;
private DBHelper dbHelper; // 数据库助手类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.user_login);
//初始化视图
username = findViewById(R.id.username);
password = findViewById(R.id.password);
login = findViewById(R.id.login);
startServiceButton = findViewById(R.id.btnStartService);// 开始时间推送服务按钮
lookButton = findViewById(R.id.look); // 查看用户数据按钮
// 创建通知渠道
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel channel = new NotificationChannel("channel_id", "Channel Name", NotificationManager.IMPORTANCE_DEFAULT);
NotificationManager notificationManager = getSystemService(NotificationManager.class);
notificationManager.createNotificationChannel(channel);
}
// 初始化数据库助手类
dbHelper = new DBHelper(MainActivity2.this);
// 启动服务按钮点击事件
startServiceButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!isServiceRunning) {
startMyService();
isServiceRunning = true;
}
}
});
// 登录按钮点击事件
login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String strUsername = username.getText().toString().trim();
String strPassword = password.getText().toString().trim();
// 获取所有用户数据
List<User> userList = dbHelper.getAllUsers();
// 检查是否有用户数据
if (!userList.isEmpty()) {
// 遍历用户数据列表
for (User user : userList) {
String savedUsername = user.getUsername();
String savedPassword = user.getPassword();
// 检查用户名和密码是否匹配
if (strUsername.equals(savedUsername) && strPassword.equals(savedPassword)) {
Toast.makeText(MainActivity2.this, "恭喜,登录成功!", Toast.LENGTH_SHORT).show();
Intent intent1 = new Intent(MainActivity2.this, IndexActivity.class);
startActivity(intent1);
return; // 如果匹配成功,则直接返回,不再继续循环
}
}
// 如果循环结束仍未匹配成功,则提示用户名或密码错误
Toast.makeText(MainActivity2.this, "用户名或密码错误!", Toast.LENGTH_SHORT).show();
} else {
// 如果用户数据列表为空,则提示用户名或密码错误
Toast.makeText(MainActivity2.this, "用户名或密码错误!", Toast.LENGTH_SHORT).show();
}
}
});
// 查看用户数据按钮点击事件
lookButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// 获取所有用户数据
List<User> userList = dbHelper.getAllUsers();
// 创建对话框来显示用户数据
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity2.this);
builder.setTitle("用户数据");
// 构建用户数据字符串
StringBuilder userData = new StringBuilder();
for (User user : userList) {
userData.append("ID: ").append(user.getId()).append(", ")
.append("用户名: ").append(user.getUsername()).append(", ")
.append("密码: ").append(user.getPassword()).append("\n");
}
// 将用户数据设置到对话框中
builder.setMessage(userData.toString());
// 设置对话框的按钮
builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// 点击确定按钮的逻辑
dialog.dismiss(); // 关闭对话框
}
});
// 创建并显示对话框
AlertDialog dialog = builder.create();
dialog.show();
}
});
}
//开始时间推送服务
private void startMyService() {
Intent serviceIntent = new Intent(this, MyService.class);
startService(serviceIntent);
}
//点击注册按钮时,跳转到注册界面
public void zhuce(View view) {
Intent intent2 = new Intent(MainActivity2.this, MainActivity3.class);
startActivity(intent2);
}
}

@ -0,0 +1,109 @@
package com.example.app1;
import android.content.ContentValues;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
public class MainActivity3 extends AppCompatActivity implements View.OnClickListener {
private TextView reg_username;
private TextView reg_password;
private TextView reg_sure_password;
private RadioGroup radiogroup;
private CheckBox ah1, ah2, ah3, ah4;
private String sex = "男";
private String aihao1 = "", aihao2 = "", aihao3 = "", aihao4 = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.user_register);
//初始化
reg_username = findViewById(R.id.reg_username);
reg_password = findViewById(R.id.reg_password);
reg_sure_password = findViewById(R.id.reg_sure_password);
findViewById(R.id.reg_register).setOnClickListener(this);
radiogroup = findViewById(R.id.rp);
radiogroup.setOnCheckedChangeListener((group, checkedId) -> {
if (checkedId == R.id.man) {
sex = "男";
} else if (checkedId == R.id.woman) {
sex = "女";
}
});
ah1 = findViewById(R.id.chang);
ah2 = findViewById(R.id.tiao);
ah3 = findViewById(R.id.rap);
ah4 = findViewById(R.id.basketball);
ah1.setOnCheckedChangeListener((buttonView, isChecked) -> {
aihao1 = isChecked ? "唱" : "";
});
ah2.setOnCheckedChangeListener((buttonView, isChecked) -> {
aihao2 = isChecked ? "跳" : "";
});
ah3.setOnCheckedChangeListener((buttonView, isChecked) -> {
aihao3 = isChecked ? "rap" : "";
});
ah4.setOnCheckedChangeListener((buttonView, isChecked) -> {
aihao4 = isChecked ? "篮球" : "";
});
}
@Override
public void onClick(View view) {
String username = reg_username.getText().toString().trim();
String password = reg_password.getText().toString().trim();
String surepassword = reg_sure_password.getText().toString().trim();
if (username.isEmpty() || password.isEmpty() || surepassword.isEmpty()) {
Toast.makeText(MainActivity3.this, "用户名或密码不能为空!", Toast.LENGTH_SHORT).show();
return;
}
if (!password.equals(surepassword)) {
Toast.makeText(MainActivity3.this, "两次输入密码不一致!", Toast.LENGTH_SHORT).show();
return;
}
// 保存用户名和密码到数据库
DBHelper dbHelper = new DBHelper(MainActivity3.this);
SQLiteDatabase db = null;
try {
db = dbHelper.getWritableDatabase();
ContentValues values = new ContentValues();
values.put("username", username);
values.put("password", password);
long result = db.insert("users", null, values);
if (result == -1) {
Toast.makeText(MainActivity3.this, "注册失败!", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(MainActivity3.this, "注册成功!", Toast.LENGTH_SHORT).show();
// 如果一切正常,跳转到下一个页面
Intent intent1 = new Intent(this, MainActivity2.class);
startActivity(intent1);
}
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(MainActivity3.this, "注册失败!", Toast.LENGTH_SHORT).show();
} finally {
if (db != null) {
db.close(); // 关闭数据库连接
}
}
}
// 返回按钮点击事件
public void fanhui(View view) {
Intent intent5 = new Intent(MainActivity3.this, MainActivity2.class);
startActivity(intent5);
}
}

@ -0,0 +1,85 @@
package com.example.app1;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.Binder;
import android.os.Handler;
import android.os.IBinder;
import androidx.core.app.NotificationCompat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
public class MyService extends Service {
private static final int NOTIFICATION_ID = 1;
private final IBinder binder = new LocalBinder();
private Handler handler;
private Runnable runnable;
public MyService() {
}
@Override
public IBinder onBind(Intent intent) {
return binder;
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
startForeground(NOTIFICATION_ID, createNotification());
handler = new Handler();
runnable = new Runnable() {
@Override
public void run() {
showNotification();
handler.postDelayed(this, 60 * 1000); // 每隔一分钟发送通知
}
};
handler.post(runnable);
return START_STICKY;
}
@Override
public void onDestroy() {
super.onDestroy();
handler.removeCallbacks(runnable);
}
private void showNotification() {
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = createNotification();
notificationManager.notify(NOTIFICATION_ID, notification);
}
private Notification createNotification() {
// 获取当前时间
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss", Locale.getDefault());
Date date = new Date(System.currentTimeMillis());
// 创建通知点击时要启动的意图
Intent notificationIntent = new Intent(this, MainActivity2.class);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
// 创建通知
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "channel_id")
.setContentTitle("提醒系统当前时间")
.setContentText("系统当前时间为:" + formatter.format(date)) // 在通知文本中显示当前时间
.setSmallIcon(R.drawable.ic_launcher_background)
.setContentIntent(pendingIntent)
.setPriority(NotificationCompat.PRIORITY_DEFAULT);
return builder.build();
}
public class LocalBinder extends Binder {
MyService getService() {
return MyService.this;
}
}
}

@ -0,0 +1,94 @@
package com.example.app1;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.LinearInterpolator;
import android.widget.Button;
import android.widget.ImageView;
import androidx.appcompat.app.AppCompatActivity;
public class PlayMusicActivity extends AppCompatActivity{
private MediaPlayer mediaPlayer;
private Button playButton, pauseButton, stopButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_play_music);
// 初始化旋转的图片并设置动画
ImageView iv = findViewById(R.id.rotating_image);
Animation animation = AnimationUtils.loadAnimation(this, R.anim.img_animation);
LinearInterpolator linearInterpolator = new LinearInterpolator();
animation.setInterpolator(linearInterpolator);
iv.startAnimation(animation);
// 创建MediaPlayer并设置音乐资源启用循环播放并开始播放音乐
mediaPlayer = MediaPlayer.create(this, R.raw.music1);
mediaPlayer.setLooping(true);
mediaPlayer.start();
// 初始化按钮并设置点击监听器
playButton = findViewById(R.id.play_button);
pauseButton = findViewById(R.id.pause_button);
stopButton = findViewById(R.id.stop_button);
playButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
playMusic();
}
});
pauseButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
pauseMusic();
}
});
stopButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
stopMusic();
}
});
}
// 播放音乐
private void playMusic() {
if (!mediaPlayer.isPlaying()) {
mediaPlayer.start();
}
}
// 暂停音乐
private void pauseMusic() {
if (mediaPlayer.isPlaying()) {
mediaPlayer.pause();
}
}
// 停止音乐
private void stopMusic() {
mediaPlayer.pause();
mediaPlayer.seekTo(0); // 将音乐回到开头
}
// 销毁资源
@Override
protected void onDestroy() {
super.onDestroy();
if (mediaPlayer != null) {
mediaPlayer.release();
mediaPlayer = null;
}
// 清除动画
ImageView iv = findViewById(R.id.rotating_image);
iv.clearAnimation();
}
}

@ -0,0 +1,45 @@
package com.example.app1;
// 用户类
public class User {
private int id; // 用户ID
private String username; // 用户名
private String password; // 密码
// 默认构造函数
public User() {
}
// 带参数的构造函数
public User(int id, String username, String password) {
this.id = id;
this.username = username;
this.password = password;
}
// Getter 和 Setter 方法
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}

@ -0,0 +1,122 @@
package com.example.app1;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import androidx.fragment.app.Fragment;
public class findFragment extends Fragment {
private ListView listView;
private TextView contentText;
private LinearLayout ll2;
private ListView playlistView;
private int lastClickedPosition = -1; // 记录上次点击的位置
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
View view = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_find, container, false);
init(view);
// 默认显示热搜榜内容
String[] defaultPlaylist = getPlaylistForItem(0);
ArrayAdapter<String> defaultPlaylistAdapter = new ArrayAdapter<>(requireContext(),
android.R.layout.simple_list_item_1, defaultPlaylist);
playlistView.setAdapter(defaultPlaylistAdapter);
return view;
}
private void init(View view) {
// 初始化列表和内容显示区域
listView = view.findViewById(R.id.list_view);
contentText = view.findViewById(R.id.content_text);
playlistView = view.findViewById(R.id.playlist_view);
ll2 = view.findViewById(R.id.ll2);
ll2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getContext(), PlayMusicActivity.class); // 创建启动本地音乐播放页面的Intent
startActivity(intent); // 启动新的Activity
}
});
// 列表项
final String[] listItems = {"热搜榜", "儿童热门榜", "影视热搜", "国风热搜", "外语热搜", "情歌热搜", "纯音乐热搜", "综艺热搜"};
ArrayAdapter<String> adapter = new ArrayAdapter<>(requireContext(),
android.R.layout.simple_list_item_1, listItems);
listView.setAdapter(adapter);
// 默认显示热搜榜项的背景颜色为粉色
listView.post(new Runnable() {
@Override
public void run() {
View hotSearchView = listView.getChildAt(0);
hotSearchView.setBackgroundColor(Color.parseColor("#FBBCDC")); // 粉色
}
});
// 记录上次点击的位置
lastClickedPosition = 0;
// 点击列表项更新内容显示区域的内容和右侧的歌单内容
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// 恢复上一个点击项的背景颜色
if (lastClickedPosition != -1) {
View lastClickedView = parent.getChildAt(lastClickedPosition);
lastClickedView.setBackgroundColor(Color.TRANSPARENT); // 恢复默认背景色
}
// 获取点击的视图
View clickedView = parent.getChildAt(position);
// 修改背景颜色为粉色
clickedView.setBackgroundColor(Color.parseColor("#FBBCDC")); // 粉色
// 更新上次点击的位置
lastClickedPosition = position;
// 更新右侧歌单内容
String[] playlist = getPlaylistForItem(position);
ArrayAdapter<String> playlistAdapter = new ArrayAdapter<>(requireContext(),
android.R.layout.simple_list_item_1, playlist);
playlistView.setAdapter(playlistAdapter);
}
});
}
// 根据位置返回相应的歌单内容
private String[] getPlaylistForItem(int position) {
switch (position) {
case 0:
return new String[]{"无名的人", "落", "如果可以","若月亮没有来","梨花香","下辈子早点相遇","如果爱忘了","离别开出花","dadada","别爱太满别睡太晚","我把故事酿成酒","梦驼铃","安河桥","你"};
case 1:
return new String[]{"贝乐虎儿歌", "宝宝巴士", "睡前故事晚安宝贝","寓言故事","黑猫警长救援队","兔小贝睡前故事","宝宝巴士儿歌","迷你特工队","咕力律动儿歌","冰雪奇缘","海绵宝宝","海底小纵队儿歌","一千零一夜睡前故事","熊出没"};
case 2:
return new String[]{"与凤行", "花间令", "热辣滚烫","繁花","烈焰","追风者","别对我动心","谢谢你温暖我","南来北往","在暴雪时分","小日子","大理寺少卿游","祈今朝","周处除三害"};
case 3:
return new String[]{"霜雪千年", "青花瓷", "红昭愿","上春山","卜卦","天下","桃花诺","画心","红尘客栈","年轮","牵丝戏","若梦","赤伶","武家坡"};
case 4:
return new String[]{"fate", "magnetic", "call of silence","see you again","back seat","swag","love story","repeat","hey oh","sheesh","wake","any song","heaven","doar cu tine"};
case 5:
return new String[]{"紫荆花盛开", "不如见一面", "悬溺","你冷落我我就放弃你","谁","犯错","你把爱情给了谁","负我不负她","霜雪千年","沉溺","打歌妹","浴室","爱情转移","把回忆拼好给你"};
case 6:
return new String[]{"daydream", "碧苍战歌", "瞬间的永恒","daylight","windy hill","夜空的寂静","神明无止","误入迷失森林","秋的思念","诀别书","水墨兰亭","城南花已开","summer","引忘川"};
case 7:
return new String[]{"就是爱你", "谈恋爱", "慢冷","流沙","暖暖","小宇","桃花运","挚友","问","一眼","怎样","想你时风起","我的美丽","分飞"};
default:
return new String[]{};
}
}
}

@ -0,0 +1,34 @@
package com.example.app1;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;
public class liveFragment extends Fragment {
private RecyclerView horizontalRecyclerView;
private LinearLayout ll3;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_live, container, false);
ll3 = view.findViewById(R.id.ll3);
ll3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getContext(), PlayMusicActivity.class); // 创建启动本地音乐播放页面的Intent
startActivity(intent); // 启动新的Activity
}
});
return view;
}
}

@ -0,0 +1,148 @@
package com.example.app1;
import android.content.Intent;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import androidx.fragment.app.Fragment;
import java.io.IOException;
public class musicFragment extends Fragment {
private ImageButton playButton1, playButton2, playButton3; // 播放按钮
private Button button4, button5, button6; // 页面跳转按钮
private LinearLayout ll1;
private MediaPlayer mediaPlayer; // 媒体播放器
private String musicUrl1 = "https://t3.kugou.com/song.html?id=bmzyP1dCNV2"; // 第一首音乐链接
private String musicUrl2 = "https://t4.kugou.com/song.html?id=bn05n53CNV2"; // 第二首音乐链接
private String musicUrl4 = "https://www.kugou.com/yy/special/index/1-5-0.html"; // 音乐排行榜链接
private String musicUrl5 = "https://www.kugou.com/yy/html/rank.html"; // 音乐排行榜链接
private String musicUrl6 = "https://www.kugou.com/yy/html/singer.html"; // 歌手页面链接
// 创建视图并返回
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_music, container, false);
init(view); // 初始化界面
return view;
}
// 初始化界面
private void init(View view) {
playButton1 = view.findViewById(R.id.ib1);
playButton2 = view.findViewById(R.id.ib2);
playButton3 = view.findViewById(R.id.ib3);
button5 = view.findViewById(R.id.phb);
button4 = view.findViewById(R.id.tjgd);
button6 = view.findViewById(R.id.rmgs);
ll1 = view.findViewById(R.id.ll1);
mediaPlayer = new MediaPlayer(); // 初始化媒体播放器
// 点击第一个播放按钮,播放第一首音乐
playButton1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
playMusic(musicUrl1);
}
});
// 点击第二个播放按钮,播放第二首音乐
playButton2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
playMusic(musicUrl2);
}
});
// 点击本地播放按钮,跳转到本地音乐播放页面
playButton3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
playLocalMusic();
}
});
ll1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getContext(), PlayMusicActivity.class); // 创建启动本地音乐播放页面的Intent
startActivity(intent); // 启动新的Activity
}
});
// 点击排行榜按钮,打开音乐排行榜页面
button5.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openRankingPage1();
}
});
// 点击推荐歌单按钮,打开推荐歌单页面
button4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openRankingPage2();
}
});
// 点击热门歌手按钮,打开热门歌手页面
button6.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openRankingPage3();
}
});
}
// 播放在线音乐
private void playMusic(String musicUrl) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(musicUrl)); // 创建打开链接的Intent
startActivity(intent); // 启动Intent打开对应链接
}
// 播放本地音乐
private void playLocalMusic() {
Intent intent = new Intent(getContext(), PlayMusicActivity.class); // 创建启动本地音乐播放页面的Intent
startActivity(intent); // 启动新的Activity
}
// 打开音乐排行榜页面
private void openRankingPage1() {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(musicUrl5)); // 创建打开音乐排行榜链接的Intent
startActivity(intent); // 启动Intent打开对应链接
}
// 打开推荐歌单页面
private void openRankingPage2() {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(musicUrl4)); // 创建打开推荐歌单链接的Intent
startActivity(intent); // 启动Intent打开对应链接
}
// 打开热门歌手页面
private void openRankingPage3() {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(musicUrl6)); // 创建打开热门歌手链接的Intent
startActivity(intent); // 启动Intent打开对应链接
}
// 销毁Fragment时释放媒体播放器资源
@Override
public void onDestroy() {
super.onDestroy();
if (mediaPlayer != null) {
mediaPlayer.release(); // 释放媒体播放器资源
mediaPlayer = null;
}
}
}

@ -0,0 +1,155 @@
package com.example.app1;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;
import androidx.fragment.app.Fragment;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.List;
public class personFragment extends Fragment {
private ListView listNew;
private TextView clockTextView;
private LinearLayout ll4;
private final Handler handler = new Handler(Looper.getMainLooper());
private List<Map<String,Object>> lists;
private SimpleAdapter adapter;
private int[][] iv={{R.drawable.gequ1,R.drawable.gequ2,R.drawable.gequ3,R.drawable.gequ4,R.drawable.gequ5},
{R.drawable.zhibo1,R.drawable.zhibo2,R.drawable.zhibo3,R.drawable.zhibo4,R.drawable.zhibo5},
{R.drawable.zhibo6,R.drawable.zhibo7,R.drawable.zhibo8,R.drawable.gequ1,R.drawable.gequ2},
{R.drawable.gequ4,R.drawable.zhibo8,R.drawable.zhibo3,R.drawable.gequ5,R.drawable.zhibo2}};
private String[][] zuopin={{"若月亮没来","Whataya Want from Me","诺言(经典版)","How Sweet","最后一页"},
{"Bubble Gum","HeroExplicit","金风玉露","同途知己","人生如戏"},
{"火力全开","俺不想上班","连理枝","缺氧","听说你"},
{"Outlaws of Love","小雨","氧化氢","行走的鱼","致爱人"}};
private String[][]zuozhe={{"王宇宙Leto","Adam Lambert","NewJeans","en","NewJeans"},
{"Charlie Puth","杨宗纬","张碧晨","说理哥","郭有才"},
{"王力宏","Ciyo","花町馆长","野哥","彭宇昕"},
{"Adam Lambert","万妮达Vinida Weng","白一莎","宝石Gem","SING-宗思雨"}};
Button button1,button2,button3,button4;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// 使用布局文件fragment_person创建视图
View view = inflater.inflate(R.layout.fragment_person, container, false);
init(view); // 初始化视图
// 绑定 TextView
clockTextView = view.findViewById(R.id.clockTextView);
// 启动时钟更新线程
updateClock();
return view;
}
// 更新时钟的方法
private void updateClock() {
Thread thread = new Thread() {
@Override
public void run() {
try {
while (!isInterrupted()) {
long currentTimeMillis = System.currentTimeMillis();
SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss", Locale.getDefault());
String currentTime = timeFormat.format(new Date(currentTimeMillis));
// 通过 handler 更新 UI 线程中的时钟文本
handler.post(() -> clockTextView.setText(currentTime));
Thread.sleep(1000);
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
};
thread.start();
}
// 初始化视图的方法
private void init(View view) {
listNew = view.findViewById(R.id.list_new);
button1 = view.findViewById(R.id.bu1);
button2 = view.findViewById(R.id.bu2);
button3 = view.findViewById(R.id.bu3);
button4 = view.findViewById(R.id.bu4);
ll4 = view.findViewById(R.id.ll4);
ll4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getContext(), PlayMusicActivity.class); // 创建启动本地音乐播放页面的Intent
startActivity(intent); // 启动新的Activity
}
});
// 设置按钮的点击监听器
button1.setOnClickListener(v -> updateListView(getDataFromView(v)));
button2.setOnClickListener(v -> updateListView(getDataFromView(v)));
button3.setOnClickListener(v -> updateListView(getDataFromView(v)));
button4.setOnClickListener(v -> updateListView(getDataFromView(v)));
updateListView(0); // 初始化列表视图显示
}
// 从视图中获取数据的方法
public int getDataFromView(View view) {
if (view.getId() == R.id.bu1) {
return onClick(view);
} else if (view.getId() == R.id.bu2) {
return onClick(view);
} else if (view.getId() == R.id.bu3) {
return onClick(view);
} else if (view.getId() == R.id.bu4) {
return onClick(view);
}
return 0;
}
// 更新列表视图的方法
public void updateListView(int data) {
lists = new ArrayList<>();
for (int i = 0; i < zuopin[data].length; i++) {
Map<String, Object> map = new HashMap<>();
map.put("iv", iv[data][i]);
map.put("zuopin", zuopin[data][i]);
map.put("zuozhe", zuozhe[data][i]);
lists.add(map);
}
adapter = new SimpleAdapter(requireContext(), lists, R.layout.item_person,
new String[]{"iv", "zuopin", "zuozhe"},
new int[]{R.id.iv, R.id.zuopin, R.id.zuozhe});
listNew.setAdapter(adapter);
}
// 处理按钮点击事件的方法
@SuppressLint("ResourceAsColor")
public int onClick(View view) {
if (view.getId() == R.id.bu1) {
return 0;
} else if (view.getId() == R.id.bu2) {
return 1;
} else if (view.getId() == R.id.bu3) {
return 2;
} else if (view.getId() == R.id.bu4) {
return 3;
}
return 0; // 默认返回0
}
}

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<rotate
android:duration="5000"
android:fromDegrees="0"
android:toDegrees="360"
android:pivotX="50%"
android:pivotY="50%"
android:repeatMode="restart"
android:repeatCount="-1"/>
</set>

@ -0,0 +1,30 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>

@ -0,0 +1,31 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:startY="49.59793"
android:startX="42.9492"
android:endY="92.4963"
android:endX="85.84757"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:strokeWidth="1"
android:strokeColor="#00000000"/>
</vector>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 577 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 895 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

@ -0,0 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M20,1v3h3v2h-3v3h-2L18,6h-3L15,4h3L18,1h2zM12,13c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM14,3.25L14,7h3v3h2.92c0.05,0.39 0.08,0.79 0.08,1.2 0,3.32 -2.67,7.25 -8,11.8 -5.33,-4.55 -8,-8.48 -8,-11.8C4,6.22 7.8,3 12,3c0.68,0 1.35,0.08 2,0.25z"/>
</vector>

@ -0,0 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M9,11.75c-0.69,0 -1.25,0.56 -1.25,1.25s0.56,1.25 1.25,1.25 1.25,-0.56 1.25,-1.25 -0.56,-1.25 -1.25,-1.25zM15,11.75c-0.69,0 -1.25,0.56 -1.25,1.25s0.56,1.25 1.25,1.25 1.25,-0.56 1.25,-1.25 -0.56,-1.25 -1.25,-1.25zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8 0,-0.29 0.02,-0.58 0.05,-0.86 2.36,-1.05 4.23,-2.98 5.21,-5.37C11.07,8.33 14.05,10 17.42,10c0.78,0 1.53,-0.09 2.25,-0.26 0.21,0.71 0.33,1.47 0.33,2.26 0,4.41 -3.59,8 -8,8z"/>
</vector>

@ -0,0 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM12,17c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2zM15.1,8L8.9,8L8.9,6c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2z"/>
</vector>

@ -0,0 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M12,3v10.55c-0.59,-0.34 -1.27,-0.55 -2,-0.55 -2.21,0 -4,1.79 -4,4s1.79,4 4,4 4,-1.79 4,-4V7h4V3h-6z"/>
</vector>

@ -0,0 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M12.65,10C11.83,7.67 9.61,6 7,6c-3.31,0 -6,2.69 -6,6s2.69,6 6,6c2.61,0 4.83,-1.67 5.65,-4H17v4h4v-4h2v-4H12.65zM7,14c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2z"/>
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
</selector>

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="false">
<shape>
<solid android:color="#000000"/>
<corners android:radius="5dp"/>
</shape>
</item>
<item android:state_pressed="true">
<shape>
<solid android:color="#000000"/>
<corners android:radius="5dp"/>
</shape>
</item>
</selector>

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="false">
<shape>
<solid android:color="#006400"/>
<corners android:radius="5dp"/>
</shape>
</item>
<item android:state_pressed="true">
<shape>
<solid android:color="#c0c0c0"/>
<corners android:radius="5dp"/>
</shape>
</item>
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 945 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 857 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@android:color/white" />
<corners android:radius="8dp" />
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/baseline_music_note_24"/>
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 B

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/pink"/>
<corners android:radius="20dp" /> <!-- Adjust the radius to change the amount of rounding -->
<stroke
android:color="@android:color/white"
android:width="1dp" />
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 950 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 KiB

@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillAlpha="0.3" android:fillColor="@android:color/white" android:pathData="M9,8m-2,0a2,2 0,1 1,4 0a2,2 0,1 1,-4 0" android:strokeAlpha="0.3"/>
<path android:fillAlpha="0.3" android:fillColor="@android:color/white" android:pathData="M14.48,16.34C13.29,15.73 11.37,15 9,15c-2.37,0 -4.29,0.73 -5.48,1.34C3.2,16.5 3,16.84 3,17.22V18h12v-0.78C15,16.84 14.8,16.5 14.48,16.34z" android:strokeAlpha="0.3"/>
<path android:fillColor="@android:color/white" android:pathData="M9,12c2.21,0 4,-1.79 4,-4c0,-2.21 -1.79,-4 -4,-4S5,5.79 5,8C5,10.21 6.79,12 9,12zM9,6c1.1,0 2,0.9 2,2c0,1.1 -0.9,2 -2,2S7,9.1 7,8C7,6.9 7.9,6 9,6z"/>
<path android:fillColor="@android:color/white" android:pathData="M20,9l0,-3l-2,0l0,3l-3,0l0,2l3,0l0,3l2,0l0,-3l3,0l0,-2z"/>
<path android:fillColor="@android:color/white" android:pathData="M15.39,14.56C13.71,13.7 11.53,13 9,13c-2.53,0 -4.71,0.7 -6.39,1.56C1.61,15.07 1,16.1 1,17.22V20h16v-2.78C17,16.1 16.39,15.07 15.39,14.56zM15,18H3v-0.78c0,-0.38 0.2,-0.72 0.52,-0.88C4.71,15.73 6.63,15 9,15c2.37,0 4.29,0.73 5.48,1.34C14.8,16.5 15,16.84 15,17.22V18z"/>
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:background="@color/pink">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Pink"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<android.widget.Button
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/one"
android:textSize="45dp"
android:gravity="top|center"
android:paddingTop="100dp"
android:textStyle="bold"
android:textColor="@color/palevioletred1"
android:layout_centerHorizontal="true"
android:text="HelloKitty 音乐"
tools:ignore="MissingConstraints,UnknownId"
android:background="@drawable/fengmianbackground"/>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity3">
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/tupianbackground3">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="6">
<ImageView
android:id="@+id/rotating_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="40dp"
android:src="@drawable/tuijian4"
android:layout_gravity="center"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
android:gravity="center">
<Button
android:layout_margin="5dp"
android:id="@+id/play_button"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="20sp"
android:text="播放"/>
<Button
android:layout_margin="5dp"
android:id="@+id/pause_button"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="20sp"
android:text="暂停"/>
<Button
android:layout_margin="5dp"
android:id="@+id/stop_button"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="20sp"
android:text="停止"/>
</LinearLayout>
</LinearLayout>

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<!--首页-->
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:id="@+id/gaohan1">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:src="@drawable/music"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="音乐"
android:id="@+id/wenzi1"
android:textColor="@color/black"
android:textSize="18sp"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:id="@+id/gaohan2">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:src="@drawable/find"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="发现"
android:id="@+id/wenzi2"
android:textColor="@color/black"
android:textSize="18sp"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:id="@+id/gaohan3">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:src="@drawable/live"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="直播"
android:id="@+id/wenzi3"
android:textColor="@color/black"
android:textSize="18sp"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:id="@+id/gaohan4">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="2dp"
android:src="@drawable/person"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="主页"
android:id="@+id/wenzi4"
android:textColor="@color/black"
android:textSize="18sp"/>
</LinearLayout>
</LinearLayout>

@ -0,0 +1,178 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/tupianbackground8">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="9"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="15dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="搜索"
android:textSize="18sp"
android:textColor="@color/palevioletred"
android:layout_gravity="center"
android:layout_marginRight="10dp"/>
<EditText
android:id="@+id/search"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="45"
android:gravity="center"
android:hint="猜你想搜青花瓷"
android:background="@drawable/rounded_corner"
android:layout_marginRight="10dp"/>
<ImageButton
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:onClick="sousuo"
android:background="@drawable/sousuo"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:padding="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginRight="10dp">
<Button
android:id="@+id/b1"
android:onClick="ritui"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="10sp"
android:textColor="@color/white"
android:text="歌手分类" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginRight="10dp">
<Button
android:id="@+id/b2"
android:onClick="paihang"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="10sp"
android:textColor="@color/white"
android:text="排行榜" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginLeft="10dp">
<Button
android:id="@+id/b3"
android:onClick="xihuan"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="10sp"
android:textColor="@color/white"
android:text="听歌识曲" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginLeft="10dp">
<Button
android:id="@+id/b4"
android:onClick="xihuan"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="10sp"
android:textColor="@color/white"
android:text="自助发歌" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<!-- 列表 -->
<ListView
android:id="@+id/list_view"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:divider="@android:color/darker_gray"
android:dividerHeight="1dp"/>
<!-- 右侧内容显示区域 -->
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2">
<!-- 歌单列表 -->
<ListView
android:id="@+id/playlist_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<TextView
android:id="@+id/content_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center" />
</FrameLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/ll2"
android:layout_width="match_parent"
android:layout_height="0dp"
android:gravity="center"
android:layout_weight="1"
android:orientation="horizontal"
android:background="@color/pink"
android:padding="10dp">
<ImageButton
android:layout_width="60dp"
android:layout_height="60dp"
android:background="@drawable/tuijian3"
android:layout_marginRight="10dp"/>
<TextView
android:layout_width="180dp"
android:layout_height="wrap_content"
android:text="好想爱这个世界啊"
android:gravity="center"
android:textSize="18sp"
android:textColor="@color/white"
android:layout_marginRight="10dp"/>
<ImageButton
android:layout_width="70dp"
android:layout_height="70dp"
android:background="@drawable/bofanganniu"
android:layout_marginRight="10dp"/>
<ImageButton
android:layout_width="55dp"
android:layout_height="55dp"
android:background="@drawable/liebiao2"/>
</LinearLayout>
</LinearLayout>

@ -0,0 +1,308 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/lightpink1">
<!-- 文字提示 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="这里有你想看、爱看的直播"
android:textSize="20sp"
android:gravity="center"
android:textColor="@color/palevioletred"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_margin="1dp"
android:textSize="12sp"
android:textColor="@color/white"
android:text="热门" />
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_margin="1dp"
android:textSize="12sp"
android:textColor="@color/white"
android:text="附近" />
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_margin="1dp"
android:textSize="12sp"
android:textColor="@color/white"
android:text="音乐" />
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_margin="1dp"
android:textSize="12sp"
android:textColor="@color/white"
android:text="情感" />
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_margin="1dp"
android:textSize="12sp"
android:textColor="@color/white"
android:text="校园" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="16"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="4"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_margin="5dp"
android:background="@drawable/zhibo1">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="130dp"
android:text="潇潇 9.3万热度"
android:textSize="15sp"
android:textColor="@color/palevioletred"
android:background="@color/lightpink"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="1"
android:layout_margin="5dp"
android:background="@drawable/zhibo5">
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginBottom="100dp"
android:layout_marginRight="135dp"
android:text="闪亮新星"
android:textSize="15sp"
android:textColor="@color/blue2"
android:background="@color/blue1"/>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:text="mua 389.4万热度"
android:textSize="15sp"
android:textColor="@color/palevioletred"
android:background="@color/lightpink"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="4"
android:orientation="horizontal"
android:gravity="center">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_margin="5dp"
android:background="@drawable/zhibo3">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="130dp"
android:text="打工人 6.3万热度"
android:textSize="15sp"
android:textColor="@color/palevioletred"
android:background="@color/lightpink"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="1"
android:layout_margin="5dp"
android:alpha="0.9"
android:background="@drawable/zhibo4">
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginBottom="100dp"
android:layout_marginRight="135dp"
android:text="今日推荐"
android:textSize="15sp"
android:textColor="@color/yellow1"
android:background="@color/yellow"/>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:text="瑶瑶 389.4万热度"
android:textSize="15sp"
android:textColor="@color/palevioletred"
android:background="@color/lightpink"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="4"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_margin="5dp"
android:alpha="0.9"
android:background="@drawable/zhibo2">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="130dp"
android:text="安安 23.8万热度"
android:textSize="15sp"
android:textColor="@color/palevioletred"
android:background="@color/lightpink"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="bottom"
android:layout_margin="5dp"
android:alpha="0.9"
android:background="@drawable/zhibo6">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="130dp"
android:text="酥酥 10.9万热度"
android:textSize="15sp"
android:textColor="@color/palevioletred"
android:background="@color/lightpink"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="4"
android:orientation="horizontal"
android:gravity="center">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="1"
android:layout_margin="5dp"
android:background="@drawable/zhibo7">
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginBottom="100dp"
android:layout_marginRight="135dp"
android:text="周年庆典"
android:textSize="15sp"
android:textColor="@color/green1"
android:background="@color/green"/>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:text="咪咪 69.8万热度"
android:textSize="15sp"
android:textColor="@color/palevioletred"
android:background="@color/lightpink"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="1"
android:layout_margin="5dp"
android:background="@drawable/zhibo8">
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginBottom="100dp"
android:layout_marginRight="135dp"
android:text="热门主播"
android:textSize="15sp"
android:textColor="@color/deeppink"
android:background="@color/pink"/>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:text="粥粥 340.6万热度"
android:textSize="15sp"
android:textColor="@color/palevioletred"
android:background="@color/lightpink"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/ll3"
android:layout_width="match_parent"
android:layout_height="0dp"
android:gravity="center"
android:layout_weight="2"
android:orientation="horizontal"
android:background="@color/pink"
android:padding="10dp">
<ImageButton
android:layout_width="60dp"
android:layout_height="60dp"
android:background="@drawable/tuijian3"
android:layout_marginRight="10dp"/>
<TextView
android:layout_width="180dp"
android:layout_height="wrap_content"
android:text="好想爱这个世界啊"
android:gravity="center"
android:textSize="18sp"
android:textColor="@color/white"
android:layout_marginRight="10dp"/>
<ImageButton
android:layout_width="70dp"
android:layout_height="70dp"
android:background="@drawable/bofanganniu"
android:layout_marginRight="10dp"/>
<ImageButton
android:layout_width="55dp"
android:layout_height="55dp"
android:background="@drawable/liebiao2"/>
</LinearLayout>
</LinearLayout>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save