修改主页UI配置

This commit is contained in:
muqing 2023-12-09 15:05:16 +08:00
parent 5e3cbe6002
commit 08c50983aa
57 changed files with 842 additions and 357 deletions

View File

@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK" /> <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK" />
<component name="VisualizationToolProject"> <component name="VisualizationToolProject">
<option name="state"> <option name="state">
<ProjectState> <ProjectState>
<option name="scale" value="0.75" /> <option name="scale" value="0.3309002433090024" />
</ProjectState> </ProjectState>
</option> </option>
</component> </component>

View File

@ -18,7 +18,7 @@ android {
//noinspection OldTargetApi //noinspection OldTargetApi
targetSdk 31 targetSdk 31
versionCode 1 versionCode 1
versionName "1.7.1" versionName "1.7.5"
} }
compileOptions { compileOptions {

View File

@ -12,8 +12,8 @@
"filters": [], "filters": [],
"attributes": [], "attributes": [],
"versionCode": 1, "versionCode": 1,
"versionName": "1.7.1", "versionName": "1.7.5",
"outputFile": "Cloud_music-debug-v1.7.1.apk" "outputFile": "Cloud_music-debug-v1.7.5.apk"
} }
], ],
"elementType": "File" "elementType": "File"

View File

@ -29,7 +29,7 @@ public class MediaPlayer {
public Runnable updateSeekBar = new Runnable() { public Runnable updateSeekBar = new Runnable() {
@Override @Override
public void run() { public void run() {
if (build != null && build.isPlaying() && Media.getlrcView() != null) { if (build != null && build.isPlaying() && Media.lrcview != null) {
long position = build.getCurrentPosition(); long position = build.getCurrentPosition();
Media.setProgress((int) position); Media.setProgress((int) position);
} }
@ -169,9 +169,7 @@ public class MediaPlayer {
Media.setzz(zz); Media.setzz(zz);
bfq_an.islike(); bfq_an.islike();
} }
bfq_db.setname(name); bfq_db.setname(name+"/"+zz);
bfq_db.setzz(zz);
if (com.muqingbfq.fragment.mp3.lbspq != null) { if (com.muqingbfq.fragment.mp3.lbspq != null) {
com.muqingbfq.fragment.mp3.lbspq.notifyDataSetChanged(); com.muqingbfq.fragment.mp3.lbspq.notifyDataSetChanged();
} }

View File

@ -26,7 +26,7 @@ import com.google.android.flexbox.FlexboxLayoutManager;
import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.muqingbfq.databinding.ActivitySearchBinding; import com.muqingbfq.databinding.ActivitySearchBinding;
import com.muqingbfq.fragment.search; import com.muqingbfq.fragment.search;
import com.muqingbfq.mq.ActivityToolbar; import com.muqingbfq.mq.FragmentActivity;
import com.muqingbfq.mq.gj; import com.muqingbfq.mq.gj;
import com.muqingbfq.mq.wj; import com.muqingbfq.mq.wj;
import com.muqingbfq.mq.wl; import com.muqingbfq.mq.wl;
@ -38,7 +38,7 @@ import org.json.JSONObject;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class activity_search extends ActivityToolbar { public class activity_search extends FragmentActivity {
private EditText editText; private EditText editText;
private ArrayAdapter<String> adapter; private ArrayAdapter<String> adapter;
private SearchRecordAdapter recordAdapter; private SearchRecordAdapter recordAdapter;

View File

@ -0,0 +1,151 @@
package com.muqingbfq.api;
import android.Manifest;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.Context;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.os.Build;
import android.os.Environment;
import androidx.core.app.ActivityCompat;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import com.mpatric.mp3agic.ID3v2;
import com.mpatric.mp3agic.InvalidDataException;
import com.mpatric.mp3agic.Mp3File;
import com.mpatric.mp3agic.UnsupportedTagException;
import com.muqingbfq.R;
import com.muqingbfq.mq.gj;
import com.muqingbfq.mq.wj;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
public class FileDownloader {
private static final String CHANNEL_ID = "download_channel";
private static final int NOTIFICATION_ID = 3;
public static void downloadFile(Context context, String url,com.muqingbfq.xm x) {
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url(url)
.build();
// 创建通知渠道仅适用于Android 8.0及以上版本
createNotificationChannel(context);
// 发起请求
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
e.printStackTrace();
// 下载失败处理
}
@Override
public void onResponse(Call call, Response response) throws IOException {
if (!response.isSuccessful()) {
// 下载失败处理
return;
}
File outputFile = new File(wj.mp3, "nihao");
File parentFile = outputFile.getParentFile();
if (!parentFile.isDirectory()) {
parentFile.mkdirs();
}
InputStream inputStream = null;
FileOutputStream outputStream = null;
try {
byte[] buffer = new byte[4096];
long fileSize = response.body().contentLength();
long fileSizeDownloaded = 0;
inputStream = response.body().byteStream();
outputStream = new FileOutputStream(outputFile);
int read;
while ((read = inputStream.read(buffer)) != -1) {
outputStream.write(buffer, 0, read);
fileSizeDownloaded += read;
// 更新通知栏进度
updateNotificationProgress(context, fileSize, fileSizeDownloaded);
}
try {
Mp3File mp3file = new Mp3File(outputFile);
if (mp3file.hasId3v2Tag()) {
ID3v2 id3v2Tag = mp3file.getId3v2Tag();
// 设置新的ID值
id3v2Tag.setTitle(x.name);
id3v2Tag.setArtist(x.zz);
id3v2Tag.setAlbum(x.zz);
id3v2Tag.setUrl(x.picurl.toString());
mp3file.save(wj.mp3 + x.id);
outputFile.delete();
}
// 保存修改后的音乐文件删除原来的文件
} catch (Exception e) {
gj.sc(e);
}
// 下载完成处理
} catch (IOException e) {
e.printStackTrace();
// 下载失败处理
} finally {
if (inputStream != null) {
inputStream.close();
}
if (outputStream != null) {
outputStream.close();
}
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
notificationManager.cancel(NOTIFICATION_ID);
}
}
});
}
private static void createNotificationChannel(Context context) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
CharSequence name = "Download Channel";
String description = "Channel for file download";
int importance = NotificationManager.IMPORTANCE_LOW;
NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);
channel.setDescription(description);
channel.setShowBadge(false);
channel.enableLights(true);
channel.setLightColor(Color.BLUE);
NotificationManager notificationManager = context.getSystemService(NotificationManager.class);
notificationManager.createNotificationChannel(channel);
}
}
private static void updateNotificationProgress(Context context, long fileSize,
long fileSizeDownloaded) {
int progress = (int) ((fileSizeDownloaded * 100) / fileSize);
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, CHANNEL_ID)
.setSmallIcon(R.drawable.icon)
.setContentTitle("Downloading File")
.setContentText(progress + "% downloaded")
.setProgress(100, progress, false)
.setOngoing(true)
.setOnlyAlertOnce(true);
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
if (ActivityCompat.checkSelfPermission(context, Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED) {
return;
}
notificationManager.notify(NOTIFICATION_ID, builder.build());
}
}

View File

@ -27,6 +27,8 @@ public class playlist extends Thread {
return playlist.hq_xz(list); return playlist.hq_xz(list);
} else if (uid.equals("mp3_like.json")) { } else if (uid.equals("mp3_like.json")) {
return playlist.hq_like(list); return playlist.hq_like(list);
} else if (uid.equals("mp3_hc.json")) {
return hq_hc(list);
} }
list.clear(); list.clear();
try { try {
@ -105,4 +107,24 @@ public class playlist extends Thread {
} }
return false; return false;
} }
public static boolean hq_hc(List<xm> list) {
list.clear();
try {
File file = new File(wj.filesdri + "hc");
File[] files = file.listFiles();
for (int i = 0; i < files.length; i++) {
ID3v2 mp3File = new Mp3File(files[i]).getId3v2Tag();
String id = files[i].getName();
String name = mp3File.getTitle();
String zz = mp3File.getArtist();
String picUrl = mp3File.getUrl();
list.add(new xm(id, name, zz, picUrl));
}
return true;
} catch (Exception e) {
gj.sc("失败的错误 " + e);
wj.sc(wj.mp3_xz);
}
return false;
}
} }

View File

@ -3,8 +3,6 @@ package com.muqingbfq.api;
import android.text.TextUtils; import android.text.TextUtils;
import com.muqingbfq.R; import com.muqingbfq.R;
import com.muqingbfq.main;
import com.muqingbfq.start;
import com.muqingbfq.mq.gj; import com.muqingbfq.mq.gj;
import com.muqingbfq.mq.wj; import com.muqingbfq.mq.wj;
import com.muqingbfq.mq.wl; import com.muqingbfq.mq.wl;
@ -77,9 +75,9 @@ public class resource {
} }
public static void 下载(List<xm> list) { public static void 下载(List<xm> list) {
// list.add(new xm("hc.json", "缓存", R.drawable.icon, true));
list.add(new xm("mp3_like.json", "喜欢", R.mipmap.like, true)); list.add(new xm("mp3_like.json", "喜欢", R.mipmap.like, true));
list.add(new xm("mp3_xz.json", "下载", R.drawable.icon, true)); list.add(new xm("mp3_xz.json", "下载", R.drawable.icon, true));
list.add(new xm("mp3_hc.json", "缓存", R.drawable.icon, true));
try { try {
JSONObject date = new JSONObject(wj.dqwb(wj.gd_xz)); JSONObject date = new JSONObject(wj.dqwb(wj.gd_xz));
for (Iterator<String> it = date.keys(); it.hasNext(); ) { for (Iterator<String> it = date.keys(); it.hasNext(); ) {

View File

@ -1,5 +1,7 @@
package com.muqingbfq.api; package com.muqingbfq.api;
import com.mpatric.mp3agic.ID3v2;
import com.mpatric.mp3agic.Mp3File;
import com.muqingbfq.fragment.Media; import com.muqingbfq.fragment.Media;
import com.muqingbfq.mq.gj; import com.muqingbfq.mq.gj;
import com.muqingbfq.mq.wj; import com.muqingbfq.mq.wj;
@ -11,6 +13,16 @@ import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import okhttp3.Call;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.ResponseBody;
public class url extends Thread { public class url extends Thread {
public static String api = "/song/url/v1"; public static String api = "/song/url/v1";
xm x; xm x;
@ -21,12 +33,12 @@ public class url extends Thread {
} }
public static String hq(xm x) { public static String hq(xm x) {
if (Media.getlrcView() != null) { if (Media.lrcview != null) {
gc(x.id); gc(x.id);
} }
try { try {
if (wj.cz(wj.mp3 + x.id)) { if (wj.cz(wj.filesdri + "hc/" + x.id)) {
return wj.mp3 ; return wj.filesdri + "hc/" + x.id;
} }
String level = "standard"; String level = "standard";
boolean wiFiConnected = gj.isWiFiConnected(); boolean wiFiConnected = gj.isWiFiConnected();
@ -43,7 +55,65 @@ public class url extends Thread {
JSONObject jsonObject = data.getJSONObject(0); JSONObject jsonObject = data.getJSONObject(0);
String url = jsonObject.getString("url"); String url = jsonObject.getString("url");
if (wiFiConnected) { if (wiFiConnected) {
new wl.xz(url, x); new Thread() {
@Override
public void run() {
super.run();
try {
if (new File(wj.filesdri + "hc").isDirectory()) {
File[] aa = new File(wj.filesdri + "hc").listFiles();
if (aa.length >= 30) {
aa[0].delete();
}
}
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
//访问路径
.url(url)
.build();
Call call = client.newCall(request);
Response response = call.execute();
if (response.isSuccessful()) {
ResponseBody body = response.body();
if (body != null) {
File file = new File(wj.filesdri + "hc", x.id + ".mp3");
if (!file.getParentFile().exists()) {
file.getParentFile().mkdirs();
}
File parentFile = file.getParentFile();
if (!parentFile.isDirectory()) {
parentFile.mkdirs();
}
InputStream inputStream = body.byteStream();
FileOutputStream fileOutputStream =
new FileOutputStream(file);
// 替换为实际要保存的文件路径
byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) {
fileOutputStream.write(buffer, 0, bytesRead);
}
fileOutputStream.close();
inputStream.close();
Mp3File mp3file = new Mp3File(file);
if (mp3file.hasId3v2Tag()) {
ID3v2 id3v2Tag = mp3file.getId3v2Tag();
// 设置新的ID值
id3v2Tag.setTitle(x.name);
id3v2Tag.setArtist(x.zz);
id3v2Tag.setAlbum(x.zz);
id3v2Tag.setUrl(x.picurl.toString());
mp3file.save(wj.filesdri + "hc/" + x.id);
file.delete();
// 保存修改后的音乐文件删除原来的文件
}
}
}
} catch (Exception e) {
gj.sc("wl xz " + e);
}
}
}.start();
} }
return url; return url;
} catch (JSONException e) { } catch (JSONException e) {
@ -61,12 +131,11 @@ public class url extends Thread {
public static void gc(String id) { public static void gc(String id) {
String lrc = null, tlyric = null; String lrc = null, tlyric = null;
JSONObject jsonObject;
try { try {
jsonObject = new JSONObject(wl.hq("/lyric?id=" + id)); JSONObject jsonObject = new JSONObject(wl.hq("/lyric?id=" + id));
lrc = jsonObject.getJSONObject("lrc").getString("lyric"); lrc = jsonObject.getJSONObject("lrc").getString("lyric");
tlyric = jsonObject.getJSONObject("tlyric").getString("lyric"); tlyric = jsonObject.getJSONObject("tlyric").getString("lyric");
} catch (JSONException e) { } catch (Exception e) {
gj.sc("url gc(int id) lrc: " + e); gj.sc("url gc(int id) lrc: " + e);
} }
Media.loadLyric(lrc, tlyric); Media.loadLyric(lrc, tlyric);

View File

@ -12,7 +12,6 @@ import android.os.Bundle;
import android.util.TypedValue; import android.util.TypedValue;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
@ -21,9 +20,16 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import com.muqingbfq.api.FileDownloader;
import com.muqingbfq.api.url;
import com.muqingbfq.databinding.ActivityBfqBinding; import com.muqingbfq.databinding.ActivityBfqBinding;
import com.muqingbfq.fragment.Media; import com.muqingbfq.fragment.Media;
import com.muqingbfq.mq.gj;
import com.muqingbfq.mq.wj;
import com.muqingbfq.mq.wl;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
public class bfq extends AppCompatActivity { public class bfq extends AppCompatActivity {
@ -95,8 +101,37 @@ public class bfq extends AppCompatActivity {
Media.setzz(bfqkz.xm.zz); Media.setzz(bfqkz.xm.zz);
bfq_an.islike(); bfq_an.islike();
} }
inflate.download.setOnClickListener(view -> {
if (wj.cz(wj.mp3 + bfqkz.xm.id)) {
gj.ts(this, "你已经下载过这首歌曲了");
return;
}
if (bfqkz.xm != null) {
new Thread(){
@Override
public void run() {
super.run();
xm x = bfqkz.xm;
String hq = wl.hq(url.api + "?id=" + x.id + "&level=exhigh" + "&cookie=" + wl.Cookie);
if (hq == null) {
return;
}
try {
JSONObject json = new JSONObject(hq);
JSONArray data = json.getJSONArray("data");
JSONObject jsonObject = data.getJSONObject(0);
String url = jsonObject.getString("url");
FileDownloader.downloadFile(bfq.this, url, bfqkz.xm);
} catch (JSONException e) {
throw new RuntimeException(e);
}
}
}.start();
}
});
} }
public static Bitmap bitmap; public static Bitmap bitmap;
public static void start(Context context) { public static void start(Context context) {

View File

@ -1,12 +1,14 @@
package com.muqingbfq.clean; package com.muqingbfq.clean;
import android.annotation.SuppressLint;
import android.os.Bundle; import android.os.Bundle;
import android.text.format.Formatter; import android.text.format.Formatter;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.CheckBox; import android.widget.CheckBox;
import android.widget.LinearLayout;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
@ -14,7 +16,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.muqingbfq.R; import com.muqingbfq.R;
import com.muqingbfq.databinding.CleanBinding; import com.muqingbfq.databinding.CleanBinding;
import com.muqingbfq.mq.ActivityToolbar; import com.muqingbfq.mq.FragmentActivity;
import com.muqingbfq.mq.gj; import com.muqingbfq.mq.gj;
import com.muqingbfq.mq.wj; import com.muqingbfq.mq.wj;
@ -22,16 +24,24 @@ import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class fragment_clean extends ActivityToolbar { public class fragment_clean extends FragmentActivity {
List<String[]> list = new ArrayList<>(); List<String[]> list = new ArrayList<>();
List<String> list_box = new ArrayList<>();
CleanBinding binding;
@Override @Override
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
list.add(new String[]{"音乐", wj.mp3}); binding = CleanBinding.inflate(getLayoutInflater());
list.add(new String[]{"歌单",wj.gd});
CleanBinding binding = CleanBinding.inflate(getLayoutInflater());
binding.toolbar.setTitle("储存清理");
setContentView(binding.getRoot()); setContentView(binding.getRoot());
UI();
}
private void UI() {
list.clear();
list.add(new String[]{"下载的音乐", wj.mp3});
list.add(new String[]{"下载的歌单",wj.gd});
list.add(new String[]{"缓存的音乐",wj.filesdri+"hc"});
binding.toolbar.setTitle("储存清理");
binding.recyclerview.setAdapter(adapter); binding.recyclerview.setAdapter(adapter);
} }
@ -44,19 +54,79 @@ public class fragment_clean extends ActivityToolbar {
return new VH(inflate); return new VH(inflate);
} }
@SuppressLint("ClickableViewAccessibility")
@Override @Override
public void onBindViewHolder(@NonNull VH holder, int position) { public void onBindViewHolder(@NonNull VH holder, int position) {
String[] s = list.get(position); String[] s = list.get(position);
File file = new File(s[1]); File file = new File(s[1]);
long leng = 0; long leng = 0;
int size = 0;
if (file.isDirectory()) { if (file.isDirectory()) {
gj.sc(file.toString()); gj.sc(file.toString());
for (File a : file.listFiles()) { for (File a : file.listFiles()) {
leng += a.length(); leng += a.length();
size++;
} }
} else {
holder.checkBox.setEnabled(false);
} }
/* GestureDetector gestureDetector=new GestureDetector(fragment_clean.this,
new GestureDetector.OnGestureListener() {
@Override
public boolean onDown(@NonNull MotionEvent motionEvent) {
return true;
}
@Override
public void onShowPress(@NonNull MotionEvent motionEvent) {
}
@Override
public boolean onSingleTapUp(@NonNull MotionEvent motionEvent) {
return false;
}
@Override
public boolean onScroll(@Nullable MotionEvent motionEvent, @NonNull MotionEvent motionEvent1, float v, float v1) {
return false;
}
@Override
public void onLongPress(@NonNull MotionEvent motionEvent) {
}
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
// 计算水平方向滑动的距离
float deltaX = e2.getX() - e1.getX();
holder.checkBox.setX(deltaX);
// 判断是否是从左向右滑动并且滑动距离超过一定阈值
if (deltaX > 0 && Math.abs(deltaX) > 100) {
// 执行删除操作
gj.sc("sc");
return true;
}
return true;
}
});*/
String s1 = Formatter.formatFileSize(fragment_clean.this, leng); String s1 = Formatter.formatFileSize(fragment_clean.this, leng);
holder.checkBox.setText(s[0] + ":" + s1); holder.checkBox.setText(s[0] + ":" + s1 + " 共计:" + size+" 个文件");
/* holder.checkBox.setOnTouchListener((view, motionEvent) ->
gestureDetector.onTouchEvent(motionEvent));*/
holder.checkBox.setOnCheckedChangeListener((compoundButton, b) -> {
if (b) {
list_box.add(file.toString());
}else {
list_box.remove(file.toString());
}
if (list_box.size() > 0) {
menu_deleat.setVisible(true);
} else {
menu_deleat.setVisible(false);
}
});
} }
@Override @Override
@ -72,4 +142,31 @@ public class fragment_clean extends ActivityToolbar {
checkBox = itemView.findViewById(R.id.box); checkBox = itemView.findViewById(R.id.box);
} }
} }
MenuItem menu_deleat;
@Override
public boolean onCreateOptionsMenu(Menu menu) {
menu_deleat = menu.add("删除");
menu_deleat.setIcon(R.drawable.deleat);
menu_deleat.setTitle("删除");
menu_deleat.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
menu_deleat.setVisible(false);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
finish();
} else if (item == menu_deleat) {
for (int i = 0; i < list_box.size(); i++) {
File s= new File(list_box.get(i));
wj.sc(s);
}
list_box.clear();
menu_deleat.setVisible(false);
UI();
}
return super.onOptionsItemSelected(item);
}
} }

View File

@ -44,7 +44,7 @@ public class Media extends Fragment {
private static TextView time_a, time_b; private static TextView time_a, time_b;
@SuppressLint("StaticFieldLeak") @SuppressLint("StaticFieldLeak")
private static SeekBar tdt; private static SeekBar tdt;
private static LrcView lrcview; public static LrcView lrcview;
public static void setTime_a(String str) { public static void setTime_a(String str) {
if (time_a == null) { if (time_a == null) {
@ -94,6 +94,10 @@ public class Media extends Fragment {
view = inflate.getRoot(); view = inflate.getRoot();
inflate.cardview.addView(home.imageView); inflate.cardview.addView(home.imageView);
LinearLayout.LayoutParams layoutParams =
new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT,2);
inflate.linearlayout.addView(lrcview,layoutParams);
tdt = inflate.tdt; tdt = inflate.tdt;
tdt.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { tdt.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override @Override
@ -118,7 +122,6 @@ public class Media extends Fragment {
time_a = inflate.timeA; time_a = inflate.timeA;
time_b = inflate.timeB; time_b = inflate.timeB;
//初始化歌词组件 //初始化歌词组件
lrcview = getlrcView();
lrcview.setDraggable(true, (view, time) -> { lrcview.setDraggable(true, (view, time) -> {
bfqkz.mt.build.seekTo(Math.toIntExact(time)); bfqkz.mt.build.seekTo(Math.toIntExact(time));
return false; return false;
@ -160,14 +163,10 @@ public class Media extends Fragment {
Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE; Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
} }
public static LrcView getlrcView() {
if (view == null) {
return null;
}
return view.findViewById(R.id.gc);
}
public static void loadLyric(String a, String b) { public static void loadLyric(String a, String b) {
if (lrcview == null || a == null) {
return;
}
lrcview.loadLrc(a, b); lrcview.loadLrc(a, b);
} }

View File

@ -20,7 +20,6 @@ import com.muqingbfq.xm;
import com.muqingbfq.yc; import com.muqingbfq.yc;
public class bflb_db extends BottomSheetDialog { public class bflb_db extends BottomSheetDialog {
public static String gdid;
public static RecyclerView.Adapter<MyViewHoder> adapter; public static RecyclerView.Adapter<MyViewHoder> adapter;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {

View File

@ -18,6 +18,7 @@ import com.muqingbfq.bfq;
import com.muqingbfq.bfq_an; import com.muqingbfq.bfq_an;
import com.muqingbfq.bfqkz; import com.muqingbfq.bfqkz;
import com.muqingbfq.home; import com.muqingbfq.home;
import com.muqingbfq.mq.wj;
import com.muqingbfq.xm; import com.muqingbfq.xm;
import java.lang.reflect.Type; import java.lang.reflect.Type;
@ -25,7 +26,8 @@ import java.util.List;
public class bfq_db extends Fragment { public class bfq_db extends Fragment {
@SuppressLint("StaticFieldLeak") @SuppressLint("StaticFieldLeak")
private static View view; public static View view;
@Override @Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { Bundle savedInstanceState) {
@ -35,25 +37,26 @@ public class bfq_db extends Fragment {
if (jsonList != null) { if (jsonList != null) {
Type type = new TypeToken<List<xm>>() { Type type = new TypeToken<List<xm>>() {
}.getType(); }.getType();
bfqkz.list = new com.google.gson.Gson().fromJson(jsonList, type); // JSON 字符串转换回列表数据 bfqkz.list = new com.google.gson.Gson().fromJson(jsonList, type);
// JSON 字符串转换回列表数据
} }
} }
view = inflater.inflate(R.layout.fragment_bfq_db, container, false); view = inflater.inflate(R.layout.fragment_bfq_db, container, false);
TextView name = view.findViewById(R.id.name); TextView name = view.findViewById(R.id.name);
TextView zz = view.findViewById(R.id.zz);
view.findViewById(R.id.kg).setOnClickListener(new bfq_an.kz()); view.findViewById(R.id.kg).setOnClickListener(new bfq_an.kz());
view.findViewById(R.id.txb).setOnClickListener(view -> bflb_db.start(getContext())); view.findViewById(R.id.txb).setOnClickListener(view -> bflb_db.start(getContext()));
view.setOnClickListener(vw -> bfq.start(home.appCompatActivity)); view.setOnClickListener(vw -> bfq.start(home.appCompatActivity));
// 恢复列表数据 // 恢复列表数据
if (bfqkz.xm != null) { if (bfqkz.xm != null) {
name.setText(bfqkz.xm.name); name.setText(bfqkz.xm.name + "/" + bfqkz.xm.zz);
zz.setText(bfqkz.xm.zz);
} }
if (bfqkz.mt != null) { if (bfqkz.mt != null) {
Media.setbf(bfqkz.mt.isPlaying()); Media.setbf(bfqkz.mt.isPlaying());
} }
return view; return view;
} }
private static <T extends View> T findViewById(int id) { private static <T extends View> T findViewById(int id) {
return view.findViewById(id); return view.findViewById(id);
} }
@ -75,11 +78,4 @@ public class bfq_db extends Fragment {
textView.setText(str); textView.setText(str);
} }
} }
public static void setzz(String str) {
if (view != null) {
TextView textView = findViewById(R.id.zz);
textView.setText(str);
}
}
} }

View File

@ -2,8 +2,10 @@ package com.muqingbfq.fragment;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Bundle; import android.os.Bundle;
import android.util.TypedValue;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -13,65 +15,94 @@ import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager2.adapter.FragmentStateAdapter;
import androidx.viewpager2.widget.ViewPager2;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.request.RequestOptions;
import com.google.android.material.card.MaterialCardView; import com.google.android.material.card.MaterialCardView;
import com.google.android.material.tabs.TabLayout;
import com.muqingbfq.R; import com.muqingbfq.R;
import com.muqingbfq.api.playlist; import com.muqingbfq.api.playlist;
import com.muqingbfq.api.resource; import com.muqingbfq.api.resource;
import com.muqingbfq.bfq_an; import com.muqingbfq.bfq_an;
import com.muqingbfq.bfqkz; import com.muqingbfq.bfqkz;
import com.muqingbfq.databinding.FragmentGdBinding;
import com.muqingbfq.list.list_gd; import com.muqingbfq.list.list_gd;
import com.muqingbfq.main; import com.muqingbfq.main;
import com.muqingbfq.mq.gj;
import com.muqingbfq.mq.wj; import com.muqingbfq.mq.wj;
import com.muqingbfq.xm; import com.muqingbfq.xm;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects;
public class gd extends Fragment { public class gd extends Fragment {
public static String gdid; public static String gdid;
public static RecyclerView.Adapter<VH> lbspq;
public List<xm> list = new ArrayList<>();
public static JSONObject like = new JSONObject(); public static JSONObject like = new JSONObject();
RecyclerView gridView; FragmentGdBinding binding;
@Override
public void onResume() {
super.onResume();
getActivity().getSupportFragmentManager().beginTransaction()
.replace(R.id.bfq_db, new bfq_db())
.commit();
}
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_gd, container, false); binding = FragmentGdBinding.inflate(inflater, container, false);
lbspq = new baseadapter(view.getContext(),list); binding.viewPager.setAdapter(new FragmentStateAdapter(getActivity()) {
gridView = view.findViewById(R.id.wgbj); @NonNull
int k = (int) (main.k / getResources().getDisplayMetrics().density + 0.5f);
GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(), k / 120);
gridView.setLayoutManager(gridLayoutManager);
gridView.setAdapter(lbspq);
TabLayout tabLayout = view.findViewById(R.id.tablayout);
for (String name : new String[]{"推荐", "排行榜", "下载"}) {
TabLayout.Tab tab = tabLayout.newTab();
tab.setText(name);
tabLayout.addTab(tab);
}
new thread("推荐");
tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override @Override
public void onTabSelected(TabLayout.Tab tab) { public Fragment createFragment(int position) {
new thread(tab.getText().toString()); switch (position) {
case 0:
return new gd_adapter();
case 1:
return new gd_adapter.paihangbang();
case 2:
return new gd_adapter.wuode();
default:
return new Fragment();
}
} }
@Override @Override
public void onTabUnselected(TabLayout.Tab tab) { public int getItemCount() {
return 3;
} }
});
// ViewPager2 绑定到 TabLayout
binding.tablayout.setOnItemSelectedListener(item -> {
int itemId = item.getItemId();
if (itemId == R.id.a) {
binding.viewPager.setCurrentItem(0);
} else if (itemId == R.id.b) {
binding.viewPager.setCurrentItem(1);
} else if (itemId == R.id.c) {
binding.viewPager.setCurrentItem(2);
}
return true;
});binding.viewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
@Override @Override
public void onTabReselected(TabLayout.Tab tab) { public void onPageSelected(int position) {
switch (position) {
case 0:
binding.tablayout.setSelectedItemId(R.id.a);
break;
case 1:
binding.tablayout.setSelectedItemId(R.id.b);
break;
case 2:
binding.tablayout.setSelectedItemId(R.id.c);
break;
}
} }
}); });
try { try {
@ -79,18 +110,19 @@ public class gd extends Fragment {
like = new JSONObject(wj.dqwb(wj.mp3_like)); like = new JSONObject(wj.dqwb(wj.mp3_like));
} }
} catch (JSONException e) { } catch (JSONException e) {
throw new RuntimeException(e); gj.sc(e);
} }
return view; return binding.getRoot();
} }
public static class baseadapter extends RecyclerView.Adapter<VH> { public static class baseadapter extends RecyclerView.Adapter<VH> {
Context context; Context context;
List<xm> list; List<xm> list;
public baseadapter(Context context, List<xm> list) { public baseadapter(Context context, List<xm> list) {
this.context = context; this.context = context;
this.list = list; this.list = list;
} }
@NonNull @NonNull
@Override @Override
public VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { public VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
@ -106,7 +138,7 @@ public class gd extends Fragment {
@Override @Override
public void onBindViewHolder(@NonNull VH holder, int position) { public void onBindViewHolder(@NonNull VH holder, int position) {
xm xm = list.get(position); xm xm = list.get(position);
list_gd gd = new list_gd(xm); list_gd gd = new list_gd(xm,this);
holder.cardView.setOnClickListener(gd); holder.cardView.setOnClickListener(gd);
holder.cardView.setOnLongClickListener(gd); holder.cardView.setOnLongClickListener(gd);
holder.textView.setText(xm.name); holder.textView.setText(xm.name);
@ -126,7 +158,7 @@ public class gd extends Fragment {
main.edit.commit(); main.edit.commit();
gdid = xm.id; gdid = xm.id;
} }
com.muqingbfq.fragment.gd.lbspq.notifyDataSetChanged(); notifyDataSetChanged();
}); });
} }
}.start(); }.start();
@ -160,33 +192,4 @@ public class gd extends Fragment {
kg = itemView.findViewById(R.id.kg); kg = itemView.findViewById(R.id.kg);
} }
} }
class thread extends Thread {
String name;
public thread(String name) {
this.name = name;
list.clear();
start();
}
@SuppressLint("NotifyDataSetChanged")
@Override
public void run() {
super.run();
switch (name) {
case "推荐":
resource.recommend(list);
break;
case "下载":
resource.下载(list);
break;
case "排行榜":
resource.排行榜(list);
break;
}
main.handler.post(() -> lbspq.notifyDataSetChanged());
}
}
} }

View File

@ -0,0 +1,123 @@
package com.muqingbfq.fragment;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.muqingbfq.R;
import com.muqingbfq.api.resource;
import com.muqingbfq.main;
import com.muqingbfq.xm;
import java.util.ArrayList;
import java.util.List;
public class gd_adapter extends Fragment {
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
FrameLayout layout = new FrameLayout(getContext());
List<xm> list = new ArrayList<>();
RecyclerView recyclerView = new RecyclerView(layout.getContext());
int k = (int) (main.k / getResources().getDisplayMetrics().density + 0.5f);
GridLayoutManager gridLayoutManager = new GridLayoutManager(layout.getContext(), k / 120);
recyclerView.setLayoutManager(gridLayoutManager);
layout.addView(recyclerView);
gd.baseadapter baseadapter = new gd.baseadapter(getContext(), list);
recyclerView.setAdapter(baseadapter);
new Thread() {
@SuppressLint("NotifyDataSetChanged")
@Override
public void run() {
super.run();
resource.recommend(list);
main.handler.postDelayed(new sx(baseadapter),500);
}
}.start();
return layout;
}
public static class paihangbang extends Fragment {
List<xm> list = new ArrayList<>();
gd.baseadapter baseadapter;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
FrameLayout layout = new FrameLayout(getContext());
RecyclerView recyclerView = new RecyclerView(layout.getContext());
int k = (int) (main.k / getResources().getDisplayMetrics().density + 0.5f);
GridLayoutManager gridLayoutManager = new GridLayoutManager(layout.getContext(), k / 120);
recyclerView.setLayoutManager(gridLayoutManager);
layout.addView(recyclerView);
baseadapter = new gd.baseadapter(getContext(), list);
recyclerView.setAdapter(baseadapter);
new Thread() {
@SuppressLint("NotifyDataSetChanged")
@Override
public void run() {
super.run();
resource.排行榜(list);
main.handler.postDelayed(new sx(baseadapter),500);
}
}.start();
return layout;
}
}
public static class wuode extends Fragment {
List<xm> list = new ArrayList<>();
gd.baseadapter baseadapter;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
FrameLayout layout = new FrameLayout(getContext());
RecyclerView recyclerView = new RecyclerView(layout.getContext());
int k = (int) (main.k / getResources().getDisplayMetrics().density + 0.5f);
GridLayoutManager gridLayoutManager = new GridLayoutManager(layout.getContext(), k / 120);
recyclerView.setLayoutManager(gridLayoutManager);
layout.addView(recyclerView);
baseadapter = new gd.baseadapter(getContext(), list);
recyclerView.setAdapter(baseadapter);
new Thread() {
@SuppressLint("NotifyDataSetChanged")
@Override
public void run() {
super.run();
resource.下载(list);
main.handler.postDelayed(new sx(baseadapter),500);
}
}.start();
return layout;
}
}
private static class sx implements Runnable {
gd.baseadapter baseadapter;
public sx(gd.baseadapter baseadapter) {
this.baseadapter = baseadapter;
}
@SuppressLint("NotifyDataSetChanged")
@Override
public void run() {
baseadapter.notifyDataSetChanged();
}
}
}

View File

@ -5,14 +5,11 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
@ -23,15 +20,15 @@ import com.muqingbfq.api.url;
import com.muqingbfq.bfq; import com.muqingbfq.bfq;
import com.muqingbfq.bfqkz; import com.muqingbfq.bfqkz;
import com.muqingbfq.databinding.FragmentMp3Binding; import com.muqingbfq.databinding.FragmentMp3Binding;
import com.muqingbfq.home;
import com.muqingbfq.list.MyViewHoder; import com.muqingbfq.list.MyViewHoder;
import com.muqingbfq.main; import com.muqingbfq.main;
import com.muqingbfq.mq.FragmentActivity;
import com.muqingbfq.xm; import com.muqingbfq.xm;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class mp3 extends com.muqingbfq.mq.ActivityToolbar { public class mp3 extends FragmentActivity {
private final List<xm> list = new ArrayList<>(); private final List<xm> list = new ArrayList<>();
public static RecyclerView.Adapter<MyViewHoder> lbspq; public static RecyclerView.Adapter<MyViewHoder> lbspq;
@ -40,7 +37,8 @@ public class mp3 extends com.muqingbfq.mq.ActivityToolbar {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
FragmentMp3Binding inflate = FragmentMp3Binding.inflate(getLayoutInflater()); FragmentMp3Binding inflate = FragmentMp3Binding.inflate(getLayoutInflater());
Intent intent = getIntent(); Intent intent = getIntent();
inflate.toolbar.setTitle(intent.getStringExtra("name")); inflate.title.setText(intent.getStringExtra("name"));
// inflate.toolbar.setTitle(intent.getStringExtra("name"));
setContentView(inflate.getRoot()); setContentView(inflate.getRoot());
lbspq = new spq(); lbspq = new spq();
RecyclerView lb = findViewById(R.id.lb); RecyclerView lb = findViewById(R.id.lb);
@ -48,6 +46,8 @@ public class mp3 extends com.muqingbfq.mq.ActivityToolbar {
lb.setLayoutManager(layoutManager); lb.setLayoutManager(layoutManager);
lb.setAdapter(lbspq); lb.setAdapter(lbspq);
String id = intent.getStringExtra("id"); String id = intent.getStringExtra("id");
// inflate.bfqDb.setBackground(gd.color);
new start(id); new start(id);
} }

View File

@ -161,7 +161,7 @@ public class search extends Fragment {
} }
private void gd() { private void gd() {
String hq = wl.hq("/search?keywords=" + name + "&limit=" + (k * k) + "&type=1000"); String hq = wl.hq("/search?keywords=" + name + "&limit=" + (k * 3) + "&type=1000");
try { try {
JSONArray jsonArray = new JSONObject(hq).getJSONObject("result") JSONArray jsonArray = new JSONObject(hq).getJSONObject("result")
.getJSONArray("playlists"); .getJSONArray("playlists");

View File

@ -5,6 +5,8 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.widget.ImageView; import android.widget.ImageView;
@ -14,12 +16,14 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import androidx.drawerlayout.widget.DrawerLayout; import androidx.drawerlayout.widget.DrawerLayout;
import com.google.android.material.card.MaterialCardView;
import com.google.android.material.navigation.NavigationView; import com.google.android.material.navigation.NavigationView;
import com.muqingbfq.fragment.Media; import com.muqingbfq.fragment.Media;
import com.muqingbfq.fragment.bfq_db; import com.muqingbfq.fragment.bfq_db;
import com.muqingbfq.fragment.gd;
import com.muqingbfq.mq.gj; import com.muqingbfq.mq.gj;
import me.wcy.lrcview.LrcView;
public class home extends AppCompatActivity { public class home extends AppCompatActivity {
@SuppressLint("StaticFieldLeak") @SuppressLint("StaticFieldLeak")
public static AppCompatActivity appCompatActivity; public static AppCompatActivity appCompatActivity;
@ -28,11 +32,13 @@ public class home extends AppCompatActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
appCompatActivity = this;
setTheme(R.style.Theme_muqing); setTheme(R.style.Theme_muqing);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home); setContentView(R.layout.activity_home);
appCompatActivity = this; DisplayMetrics dm = getResources().getDisplayMetrics();
new start(); main.k = dm.widthPixels;
main.g = dm.heightPixels;
if (imageView == null) { if (imageView == null) {
imageView = new ImageView(this); imageView = new ImageView(this);
imageView.setScaleType(ImageView.ScaleType.FIT_XY); imageView.setScaleType(ImageView.ScaleType.FIT_XY);
@ -42,6 +48,20 @@ public class home extends AppCompatActivity {
Media.setImageBitmap(); Media.setImageBitmap();
} }
} }
if (Media.lrcview == null) {
// 在合适的位置初始化LrcView
Media.lrcview = new LrcView(this);
// 请将Context替换为实际的上下文对象
// 设置LrcView的属性
Media.lrcview.setCurrentColor(getResources().getColor(R.color.text));
Media.lrcview.setLabel(getString(R.string.app_name));
Media.lrcview.setCurrentTextSize(TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_SP, 16, getResources().getDisplayMetrics()));
// lrcView.setLrcPadding(16);
Media.lrcview.setCurrentTextSize(TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_SP, 20, getResources().getDisplayMetrics()));
Media.lrcview.setTimelineTextColor(getResources().getColor(R.color.text_tm));
}
try { try {
//初始化工具栏 //初始化工具栏
Toolbar toolbar = findViewById(R.id.toolbar); Toolbar toolbar = findViewById(R.id.toolbar);
@ -66,6 +86,7 @@ public class home extends AppCompatActivity {
} }
//检测更新 //检测更新
new gj.jianchagengxin(this); new gj.jianchagengxin(this);
} catch (Exception e) { } catch (Exception e) {
yc.tc(this, e); yc.tc(this, e);
} }
@ -85,12 +106,6 @@ public class home extends AppCompatActivity {
editor.apply(); editor.apply();
} }
@Override
protected void onResume() {
super.onResume();
getSupportFragmentManager().beginTransaction()
.add(R.id.bfq_db, new bfq_db()).commit();
}
private long time; private long time;

View File

@ -23,22 +23,20 @@ import java.util.Objects;
public class list_gd implements View.OnClickListener, View.OnLongClickListener { public class list_gd implements View.OnClickListener, View.OnLongClickListener {
xm xm; xm xm;
gd.baseadapter adaper;
public list_gd(com.muqingbfq.xm xm) { public list_gd(com.muqingbfq.xm xm,gd.baseadapter baseadapter) {
this.xm = xm; this.xm = xm;
this.adaper = baseadapter;
} }
@SuppressLint("NotifyDataSetChanged") @SuppressLint("NotifyDataSetChanged")
@Override @Override
public void onClick(View view) { public void onClick(View view) {
// if (!gd.gdid.equals(xm.id)) {
// gd.gdid = xm.id;
Context context = view.getContext(); Context context = view.getContext();
Intent intent = new Intent(context, com.muqingbfq.fragment.mp3.class); Intent intent = new Intent(context, com.muqingbfq.fragment.mp3.class);
intent.putExtra("id", xm.id); intent.putExtra("id", xm.id);
intent.putExtra("name", xm.name); intent.putExtra("name", xm.name);
context.startActivity(intent); context.startActivity(intent);
// mp3.startactivity(view.getContext(),xm.id);
} }
@ -84,7 +82,7 @@ public class list_gd implements View.OnClickListener, View.OnLongClickListener {
gj.sc(e); gj.sc(e);
} }
} }
main.handler.post(() -> gd.lbspq.notifyDataSetChanged()); main.handler.post(() -> adaper.notifyDataSetChanged());
} }
}.start(); }.start();
// 在这里处理菜单项的点击事件 // 在这里处理菜单项的点击事件

View File

@ -9,7 +9,7 @@ import androidx.annotation.Nullable;
import com.muqingbfq.R; import com.muqingbfq.R;
import com.muqingbfq.main; import com.muqingbfq.main;
import com.muqingbfq.mq.ActivityToolbar; import com.muqingbfq.mq.FragmentActivity;
import com.muqingbfq.mq.gj; import com.muqingbfq.mq.gj;
import com.muqingbfq.mq.wl; import com.muqingbfq.mq.wl;
@ -17,7 +17,7 @@ import org.json.JSONObject;
import java.util.Objects; import java.util.Objects;
public class cookie extends ActivityToolbar { public class cookie extends FragmentActivity {
View view_a, view_b; View view_a, view_b;
TextView textView; TextView textView;

View File

@ -9,14 +9,14 @@ import android.view.inputmethod.InputMethodManager;
import android.widget.EditText; import android.widget.EditText;
import com.muqingbfq.R; import com.muqingbfq.R;
import com.muqingbfq.mq.ActivityToolbar; import com.muqingbfq.mq.FragmentActivity;
import com.muqingbfq.mq.gj; import com.muqingbfq.mq.gj;
import com.muqingbfq.mq.wl; import com.muqingbfq.mq.wl;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
public class enroll extends ActivityToolbar { public class enroll extends FragmentActivity {
EditText edit_account, edit_username, EditText edit_account, edit_username,
edit_password, edit_email; edit_password, edit_email;

View File

@ -10,7 +10,6 @@ import android.os.Bundle;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.AutoCompleteTextView;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageView; import android.widget.ImageView;
@ -26,7 +25,7 @@ import com.muqingbfq.R;
import com.muqingbfq.databinding.ActivityUserEditingBinding; import com.muqingbfq.databinding.ActivityUserEditingBinding;
import com.muqingbfq.fragment.sz; import com.muqingbfq.fragment.sz;
import com.muqingbfq.main; import com.muqingbfq.main;
import com.muqingbfq.mq.ActivityToolbar; import com.muqingbfq.mq.FragmentActivity;
import com.muqingbfq.mq.gj; import com.muqingbfq.mq.gj;
import org.json.JSONException; import org.json.JSONException;
@ -44,7 +43,7 @@ import okhttp3.Request;
import okhttp3.RequestBody; import okhttp3.RequestBody;
import okhttp3.Response; import okhttp3.Response;
public class user_editing extends ActivityToolbar { public class user_editing extends FragmentActivity {
//头像用户名签名性别背景 //头像用户名签名性别背景
ImageView imageViewa; ImageView imageViewa;
EditText edit_name, edit_qianming; EditText edit_name, edit_qianming;

View File

@ -30,9 +30,11 @@ public class main extends Application {
@Override @Override
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();
if (wj.filesdri == null) {
new wj(this);
}
application = this; application = this;
// UUID.randomUUID().toString(); // UUID.randomUUID().toString();
new wj(this);
sp = getSharedPreferences("Set_up", MODE_PRIVATE); sp = getSharedPreferences("Set_up", MODE_PRIVATE);
edit = sp.edit(); edit = sp.edit();
boolean bj = false; boolean bj = false;

View File

@ -1,16 +1,14 @@
package com.muqingbfq.mq; package com.muqingbfq.mq;
import android.os.Bundle;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import com.muqingbfq.R; import com.muqingbfq.R;
public class ActivityToolbar extends AppCompatActivity { public class FragmentActivity extends AppCompatActivity {
@Override @Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) { public boolean onOptionsItemSelected(@NonNull MenuItem item) {
if (item.getItemId() == android.R.id.home) { if (item.getItemId() == android.R.id.home) {

View File

@ -8,7 +8,11 @@ import java.io.BufferedReader;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.OutputStream;
import java.nio.file.Files;
import java.security.MessageDigest; import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
@ -133,4 +137,23 @@ public class wj {
} }
return null; return null;
} }
public static void fz(String sourceFilePath, String targetFilePath) {
File sourceFile = new File(sourceFilePath);
File targetFile = new File(targetFilePath);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
try (InputStream in = Files.newInputStream(sourceFile.toPath());
OutputStream out = Files.newOutputStream(targetFile.toPath())) {
byte[] buf = new byte[1024];
int bytesRead;
while ((bytesRead = in.read(buf)) > 0) {
out.write(buf, 0, bytesRead);
}
// 文件复制完成
} catch (IOException e) {
e.printStackTrace();
}
}
}
} }

View File

@ -1,37 +1,18 @@
package com.muqingbfq.mq; package com.muqingbfq.mq;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.ContentValues;
import android.media.MediaMetadataRetriever;
import android.media.MediaScannerConnection;
import android.net.Uri;
import android.nfc.Tag;
import android.provider.MediaStore;
import com.mpatric.mp3agic.ID3v2;
import com.mpatric.mp3agic.InvalidDataException;
import com.mpatric.mp3agic.Mp3File;
import com.mpatric.mp3agic.UnsupportedTagException;
import com.muqingbfq.home;
import com.muqingbfq.main; import com.muqingbfq.main;
import com.muqingbfq.xm; import com.muqingbfq.xm;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream;
import okhttp3.Call;
import okhttp3.FormBody; import okhttp3.FormBody;
import okhttp3.OkHttpClient; import okhttp3.OkHttpClient;
import okhttp3.Request; import okhttp3.Request;
import okhttp3.Response; import okhttp3.Response;
import okhttp3.ResponseBody;
public class wl { public class wl {
public static String Cookie; public static String Cookie;
@ -114,63 +95,6 @@ public class wl {
start(); start();
} }
@Override
public void run() {
super.run();
try {
if (new File(wj.mp3).isDirectory()) {
File[] aa = new File(wj.mp3).listFiles();
if (aa.length >= 30) {
aa[0].delete();
}
}
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
//访问路径
.url(url)
.build();
Call call = client.newCall(request);
Response response = call.execute();
if (response.isSuccessful()) {
ResponseBody body = response.body();
if (body != null) {
File file = new File(wj.mp3, x.id+".mp3");
if (!file.getParentFile().exists()) {
file.getParentFile().mkdirs();
}
File parentFile = file.getParentFile();
if (!parentFile.isDirectory()) {
parentFile.mkdirs();
}
InputStream inputStream = body.byteStream();
FileOutputStream fileOutputStream =
new FileOutputStream(file);
// 替换为实际要保存的文件路径
byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) {
fileOutputStream.write(buffer, 0, bytesRead);
}
fileOutputStream.close();
inputStream.close();
Mp3File mp3file = new Mp3File(file);
if (mp3file.hasId3v2Tag()) {
ID3v2 id3v2Tag = mp3file.getId3v2Tag();
// 设置新的ID值
id3v2Tag.setTitle(x.name);
id3v2Tag.setArtist(x.zz);
id3v2Tag.setAlbum(x.zz);
id3v2Tag.setUrl(x.picurl.toString());
mp3file.save(wj.mp3 + x.id);
file.delete();
// 保存修改后的音乐文件删除原来的文件
}
}
}
} catch (Exception e) {
gj.sc("wl xz " + e);
}
}
} }
} }

View File

@ -1,16 +0,0 @@
package com.muqingbfq;
import android.util.DisplayMetrics;
import com.muqingbfq.mq.wj;
public class start {
public start() {
DisplayMetrics dm = home.appCompatActivity.getResources().getDisplayMetrics();
main.k = dm.widthPixels;
main.g = dm.heightPixels;
if (wj.filesdri == null) {
new wj(home.appCompatActivity);
}
}
}

View File

@ -1,6 +0,0 @@
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="0"
android:toXDelta="-100%"
android:duration="300" />
</set>

View File

@ -1,6 +0,0 @@
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="0"
android:toXDelta="100%"
android:duration="300" />
</set>

View File

@ -1,10 +1,12 @@
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<vector xmlns:android="http://schemas.android.com/apk/res/android" <item android:state_pressed="true">
android:width="80dp" <shape android:shape="rectangle">
android:height="80dp" <solid android:color="#80F2ECF6" />
android:viewportWidth="80" </shape>
android:viewportHeight="80"> </item>
<path <item>
android:fillColor="@color/bj" <shape android:shape="rectangle">
android:pathData="M0,0h80v80h-80z" /> <solid android:color="@color/bj" />
</vector> </shape>
</item>
</selector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M490.7,644.3L490.7,469.3h85.3v174.9l46.9,-46.9 59.7,59.7 -68.3,68.3h132.3c59.7,-8.5 106.7,-64 106.7,-128 0,-72.5 -55.5,-128 -128,-128 -17.1,0 -29.9,4.3 -42.7,8.5L682.7,469.3c0,-93.9 -76.8,-170.7 -170.7,-170.7s-170.7,76.8 -170.7,170.7c0,17.1 4.3,29.9 4.3,46.9 -8.5,-4.3 -17.1,-4.3 -25.6,-4.3C260.3,512 213.3,558.9 213.3,618.7S260.3,725.3 320,725.3h132.3L384,657.1l59.7,-59.7 46.9,46.9zM614.4,725.3l-81.1,81.1 -81.1,-81.1L405.3,725.3v85.3h-85.3C213.3,810.7 128,725.3 128,618.7c0,-85.3 55.5,-157.9 128,-183.5C273.1,311.5 379.7,213.3 512,213.3c110.9,0 209.1,72.5 243.2,170.7 102.4,12.8 183.5,102.4 183.5,213.3s-85.3,200.5 -192,213.3h-85.3v-85.3h-46.9z"
android:fillColor="#444444"/>
</vector>

View File

@ -1,8 +0,0 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 背景 Drawable -->
<item android:drawable="@drawable/background" />
<!-- 图标 Drawable -->
<item
android:gravity="center"
android:drawable="@drawable/icon" />
</layer-list>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M544,661.3a32,32 0,0 1,-64 0L480,362.7a32,32 0,0 1,64 0v298.7zM704,661.3a32,32 0,0 1,-64 0L640,490.7a32,32 0,0 1,64 0v170.7zM384,661.3a32,32 0,0 1,-64 0L320,448a32,32 0,0 1,64 0v213.3zM202.7,138.7h618.7c64.8,0 117.3,52.5 117.3,117.3v512c0,64.8 -52.5,117.3 -117.3,117.3L202.7,885.3c-64.8,0 -117.3,-52.5 -117.3,-117.3L85.3,256c0,-64.8 52.5,-117.3 117.3,-117.3zM202.7,202.7a53.3,53.3 0,0 0,-53.3 53.3v512a53.3,53.3 0,0 0,53.3 53.3h618.7a53.3,53.3 0,0 0,53.3 -53.3L874.7,256a53.3,53.3 0,0 0,-53.3 -53.3L202.7,202.7z"
android:fillColor="#000000"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:fillColor="#FF000000"
android:pathData="M512,558.5c-142,0 -256,-125.4 -256,-279.3S370,0 512,0s256,125.4 256,279.3 -114,279.3 -256,279.3zM93.1,826.2A197.8,197.8 0,0 1,290.9 628.4h442.2a197.8,197.8 0,1 1,0 395.6h-442.2A198.1,198.1 0,0 1,93.1 826.2z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="201dp"
android:height="200dp"
android:viewportWidth="1029"
android:viewportHeight="1024">
<path
android:fillColor="#FF000000"
android:pathData="M1001.4,494.6q21.5,20.5 22.5,45.1t-16.4,41q-19.5,17.4 -45.1,16.4t-41,-14.3q-5.1,-4.1 -31.2,-28.7t-62.5,-58.9 -77.8,-73.7 -78.3,-74.2 -63.5,-60.4 -33.8,-31.7q-32.8,-29.7 -64.5,-28.7t-62.5,28.7q-10.2,9.2 -38.4,35.3t-65,60.9 -77.8,72.7 -75.8,70.7 -59.9,55.8 -30.2,27.1q-15.4,12.3 -41,13.3t-44,-15.4q-20.5,-18.4 -19.5,-44.5t17.4,-41.5q6.1,-6.1 37.9,-35.8t75.8,-70.7 94.7,-88.1 94.2,-88.1 74.8,-70.1 36.4,-34.3q38.9,-37.9 84,-38.4t76.8,30.2q6.1,5.1 25.6,24.1t47.6,46.1 63,60.9 70.7,68.1 70.1,68.1 63,60.9 48.1,46.6zM447.4,346.1q25.6,-23.6 61.4,-25.1t64.5,25.1q3.1,3.1 18.4,17.4l38.9,35.8q22.5,21.5 50.7,48.1t57.9,53.2q68.6,63.5 153.6,142.3l0,194.6q0,22.5 -16.9,39.9t-45.6,18.4l-193.5,0 0,-158.7q0,-33.8 -31.7,-33.8l-195.6,0q-17.4,0 -24.1,10.2t-6.7,23.6q0,6.1 -0.5,31.2t-0.5,53.8l0,73.7 -187.4,0q-29.7,0 -47.1,-13.3t-17.4,-37.9l0,-203.8q84,-76.8 152.6,-139.3 28.7,-26.6 57.3,-52.7t52.2,-47.6 39.4,-36.4 20,-18.9z"/>
</vector>

View File

@ -6,7 +6,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<androidx.appcompat.widget.Toolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -36,7 +36,7 @@
android:text="@string/zz" android:text="@string/zz"
android:textSize="20sp" /> android:textSize="20sp" />
</LinearLayout> </LinearLayout>
</androidx.appcompat.widget.Toolbar> </com.google.android.material.appbar.MaterialToolbar>
<androidx.fragment.app.FragmentContainerView <androidx.fragment.app.FragmentContainerView
android:id="@+id/fragment_bfq" android:id="@+id/fragment_bfq"
@ -49,9 +49,10 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:paddingStart="16dp"
android:layout_marginEnd="16dp" android:paddingEnd="16dp"
android:layout_marginBottom="16dp" android:paddingBottom="16dp"
android:background="@color/bj"
android:baselineAligned="false" android:baselineAligned="false"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
@ -69,6 +70,15 @@
android:background="?android:attr/selectableItemBackgroundBorderless" android:background="?android:attr/selectableItemBackgroundBorderless"
android:src="@drawable/mt_sx" android:src="@drawable/mt_sx"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/download"
android:layout_width="36dp"
android:layout_height="36dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
app:srcCompat="@drawable/download"
app:tint="@color/text"
android:layout_marginEnd="26dp"
tools:ignore="ContentDescription" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout

View File

@ -25,20 +25,9 @@
app:cardCornerRadius="16dp" app:cardCornerRadius="16dp"
app:cardUseCompatPadding="true" /> app:cardUseCompatPadding="true" />
</LinearLayout> </LinearLayout>
<me.wcy.lrcview.LrcView
android:id="@+id/gc"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
app:lrcCurrentTextColor="@color/text"
app:lrcLabel="@string/app_name"
app:lrcNormalTextSize="16sp"
app:lrcPadding="16dp"
app:lrcTextSize="20sp"
app:lrcTimelineTextColor="@color/text_tm"
tools:ignore="MissingConstraints" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:background="@color/bj"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical" android:gravity="center_vertical"

View File

@ -7,7 +7,7 @@
android:orientation="vertical" android:orientation="vertical"
tools:context=".activity_about_software"> tools:context=".activity_about_software">
<androidx.appcompat.widget.Toolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@ -6,7 +6,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<androidx.appcompat.widget.Toolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -36,7 +36,7 @@
android:text="@string/zz" android:text="@string/zz"
android:textSize="20sp" /> android:textSize="20sp" />
</LinearLayout> </LinearLayout>
</androidx.appcompat.widget.Toolbar> </com.google.android.material.appbar.MaterialToolbar>
<androidx.fragment.app.FragmentContainerView <androidx.fragment.app.FragmentContainerView
android:id="@+id/fragment_bfq" android:id="@+id/fragment_bfq"
@ -46,10 +46,10 @@
android:layout_weight="1" android:layout_weight="1"
tools:layout="@layout/fragment_bfq" /> tools:layout="@layout/fragment_bfq" />
<LinearLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:background="@color/bj"
android:paddingStart="16dp" android:paddingStart="16dp"
android:paddingEnd="16dp"> android:paddingEnd="16dp">
@ -59,9 +59,22 @@
android:layout_height="36dp" android:layout_height="36dp"
android:background="?android:attr/selectableItemBackgroundBorderless" android:background="?android:attr/selectableItemBackgroundBorderless"
android:src="@mipmap/like" android:src="@mipmap/like"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:tint="@color/text" app:tint="@color/text"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
</LinearLayout>
<ImageView
android:id="@+id/download"
android:layout_width="36dp"
android:layout_height="36dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:src="@drawable/download"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:tint="@color/text"
tools:ignore="ContentDescription" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -69,6 +82,7 @@
android:gravity="center" android:gravity="center"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingStart="20dp" android:paddingStart="20dp"
android:background="@color/bj"
android:paddingEnd="20dp" android:paddingEnd="20dp"
android:paddingBottom="26dp"> android:paddingBottom="26dp">

View File

@ -5,7 +5,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"> android:orientation="vertical">
<androidx.appcompat.widget.Toolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@ -7,7 +7,7 @@
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
android:orientation="vertical"> android:orientation="vertical">
<androidx.appcompat.widget.Toolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@ -14,34 +14,30 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.appbar.MaterialToolbar <com.google.android.material.appbar.AppBarLayout
android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:minHeight="?attr/actionBarSize" <com.google.android.material.appbar.MaterialToolbar
app:layout_constraintTop_toTopOf="parent" /> android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"/>
</com.google.android.material.appbar.AppBarLayout>
<androidx.fragment.app.FragmentContainerView <androidx.fragment.app.FragmentContainerView
android:id="@+id/gd" android:id="@+id/gd"
android:name="com.muqingbfq.fragment.gd" android:name="com.muqingbfq.fragment.gd"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/bfq_db" android:layout_weight="1"
app:layout_constraintTop_toBottomOf="@+id/toolbar"
tools:layout="@layout/fragment_gd" /> tools:layout="@layout/fragment_gd" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.fragment.app.FragmentContainerView
android:id="@+id/bfq_db"
android:name="com.muqingbfq.fragment.bfq_db"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
tools:layout="@layout/fragment_bfq_db" />
</androidx.constraintlayout.widget.ConstraintLayout>
<com.google.android.material.navigation.NavigationView <com.google.android.material.navigation.NavigationView
android:id="@+id/chb" android:id="@+id/chb"

View File

@ -3,7 +3,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<androidx.appcompat.widget.Toolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />

View File

@ -6,7 +6,7 @@
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
android:orientation="vertical" android:orientation="vertical"
tools:context=".activity_search"> tools:context=".activity_search">
<androidx.appcompat.widget.Toolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
@ -24,7 +24,7 @@
android:paddingStart="3dp" android:paddingStart="3dp"
android:paddingEnd="3dp" android:paddingEnd="3dp"
tools:ignore="TextContrastCheck,VisualLintTextFieldSize" /> tools:ignore="TextContrastCheck,VisualLintTextFieldSize" />
</androidx.appcompat.widget.Toolbar> </com.google.android.material.appbar.MaterialToolbar>
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
@ -79,6 +79,7 @@
android:id="@+id/bfq_db" android:id="@+id/bfq_db"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:backgroundTint="@color/bj"
android:name="com.muqingbfq.fragment.bfq_db" android:name="com.muqingbfq.fragment.bfq_db"
tools:layout="@layout/fragment_bfq_db" /> tools:layout="@layout/fragment_bfq_db" />

View File

@ -7,7 +7,7 @@
android:orientation="vertical" android:orientation="vertical"
tools:context=".sz"> tools:context=".sz">
<androidx.appcompat.widget.Toolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@ -6,7 +6,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<androidx.appcompat.widget.Toolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@ -6,7 +6,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<androidx.appcompat.widget.Toolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@ -7,11 +7,11 @@
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:id="@+id/linearlayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="1"
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout <RelativeLayout
android:id="@+id/kp1" android:id="@+id/kp1"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -26,18 +26,6 @@
app:cardCornerRadius="16dp" /> app:cardCornerRadius="16dp" />
</RelativeLayout> </RelativeLayout>
<me.wcy.lrcview.LrcView
android:id="@+id/gc"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
app:lrcCurrentTextColor="@color/text"
app:lrcLabel="@string/app_name"
app:lrcNormalTextSize="16sp"
app:lrcPadding="16dp"
app:lrcTextSize="20sp"
app:lrcTimelineTextColor="@color/text_tm"
tools:ignore="MissingConstraints" />
</LinearLayout> </LinearLayout>
@ -46,6 +34,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:background="@color/bj"
android:paddingStart="3dp" android:paddingStart="3dp"
android:paddingEnd="3dp"> android:paddingEnd="3dp">

View File

@ -1,38 +1,30 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
app:cardUseCompatPadding="true" android:background="@drawable/background">
app:cardCornerRadius="16dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical" android:gravity="center_vertical"
android:baselineAligned="false" android:baselineAligned="false"
android:padding="6dp" android:paddingStart="10dp"
android:paddingBottom="6dp"
android:paddingEnd="10dp"
android:orientation="horizontal"> android:orientation="horizontal">
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/name" android:id="@+id/name"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:text="@string/name" android:text="@string/name"
android:textSize="16sp" /> android:textSize="26sp" />
<TextView
android:id="@+id/zz"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:text="@string/zz" />
</LinearLayout> </LinearLayout>
@ -60,4 +52,4 @@
android:src="@drawable/cd" /> android:src="@drawable/cd" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</com.google.android.material.card.MaterialCardView> </FrameLayout>

View File

@ -2,15 +2,24 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"> android:orientation="vertical">
<com.google.android.material.tabs.TabLayout <androidx.viewpager2.widget.ViewPager2
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
<androidx.fragment.app.FragmentContainerView
android:id="@+id/bfq_db"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:layout="@layout/fragment_bfq_db" />
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/tablayout" android:id="@+id/tablayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:contentDescription="@string/Playlist" /> android:contentDescription="@string/Playlist"
<androidx.recyclerview.widget.RecyclerView app:menu="@menu/bottom_gd"/>
android:id="@+id/wgbj"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout> </LinearLayout>

View File

@ -4,10 +4,18 @@
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"> android:orientation="vertical">
<androidx.appcompat.widget.Toolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content">
<com.muqingbfq.view.Text
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="26sp"
android:textColor="@color/text"/>
</com.google.android.material.appbar.MaterialToolbar>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/lb" android:id="@+id/lb"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -6,6 +6,7 @@
<CheckBox <CheckBox
android:id="@+id/box" android:id="@+id/box"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="100dp"
android:text="@string/app_name" /> android:text="@string/app_name"
android:textSize="26sp"/>
</LinearLayout> </LinearLayout>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/a"
android:icon="@drawable/zhuye"
android:title="推荐" />
<item
android:id="@+id/b"
android:icon="@drawable/paihangbang"
android:title="排行榜" />
<item
android:id="@+id/c"
android:icon="@drawable/user"
android:title="我的" />
</menu>

View File

@ -2,5 +2,5 @@
<resources> <resources>
<color name="text">@color/white</color> <color name="text">@color/white</color>
<color name="text_tm">#99FFFFFF</color> <color name="text_tm">#99FFFFFF</color>
<color name="bj">#323232</color> <color name="bj">#2A2831</color>
</resources> </resources>

View File

@ -13,7 +13,7 @@
<color name="text">#000000</color> <color name="text">#000000</color>
<color name="text_tm">#80000000</color> <color name="text_tm">#80000000</color>
<color name="tm">#00FFFFFF</color> <color name="tm">#00FFFFFF</color>
<color name="bj">@color/white</color> <color name="bj">#F2ECF6</color>
<color name="button_bj">#B3E5FC</color> <color name="button_bj">#B3E5FC</color>
</resources> </resources>

View File

@ -10,7 +10,7 @@
<style name="Theme.start" parent="Theme.Material3.DayNight"> <style name="Theme.start" parent="Theme.Material3.DayNight">
<item name="windowActionBar">false</item> <item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item> <item name="windowNoTitle">true</item>
<item name="android:statusBarColor">@color/tm</item> <item name="android:statusBarColor">@color/bj</item>
<!-- 控件选中时的颜色,默认使用colorAccent --> <!-- 控件选中时的颜色,默认使用colorAccent -->
<!-- <item name="android:colorControlActivated">#FF7F50</item>--> <!-- <item name="android:colorControlActivated">#FF7F50</item>-->
<!-- 设置文本颜色 --> <!-- 设置文本颜色 -->
@ -19,6 +19,15 @@
<item name="colorPrimaryDark">#8000BCD4</item> <item name="colorPrimaryDark">#8000BCD4</item>
<item name="tabStyle">@style/Widget.App.TabLayout</item> <item name="tabStyle">@style/Widget.App.TabLayout</item>
<item name="toolbarStyle">@style/Widget.App.Toolbar</item>
</style>
<style name="Widget.App.Toolbar" parent="Widget.Material3.Toolbar">
<item name="materialThemeOverlay">@style/ThemeOverlay.App.Toolbar</item>
</style>
<style name="ThemeOverlay.App.Toolbar" parent="">
<item name="android:background">@color/bj</item>
</style> </style>
<style name="Widget.App.TabLayout" parent="Widget.Material3.TabLayout"> <style name="Widget.App.TabLayout" parent="Widget.Material3.TabLayout">
<item name="materialThemeOverlay">@style/ThemeOverlay.App.TabLayout</item> <item name="materialThemeOverlay">@style/ThemeOverlay.App.TabLayout</item>