refactor(layout): 优化多个布局文件的结构和样式
-调整了多个布局文件中的 View 属性,如可见性、布局权重等 - 优化了部分 UI 组件的使用,例如用 RecyclerView 替换 FragmentContainerView - 统一了搜索相关 UI 的样式和行为 -优化了部分代码逻辑,提高了可维护性
This commit is contained in:
parent
c4311a4711
commit
a487ee4bdd
|
@ -2,36 +2,32 @@ package com.muqingbfq;
|
|||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.text.Editable;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.muqingbfq.Dialog.DialogEditText;
|
||||
import com.muqingbfq.fragment.wode;
|
||||
import com.muqingbfq.login.user_logs;
|
||||
import com.muqingbfq.mq.EditViewDialog;
|
||||
import com.muqingbfq.mq.gj;
|
||||
import com.muqingbfq.mq.wl;
|
||||
import com.muqingbfq.view.Edit;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class HomeSteer {
|
||||
home home;
|
||||
ActivityResultLauncher<Intent> dlintent;
|
||||
|
||||
public HomeSteer(home home) {
|
||||
Runnable runnable;
|
||||
|
||||
public HomeSteer(home home, Runnable runnable) {
|
||||
this.runnable = runnable;
|
||||
this.home = home;
|
||||
dlintent = home.registerForActivityResult(
|
||||
new ActivityResultContracts.StartActivityForResult(),
|
||||
|
@ -41,7 +37,7 @@ public class HomeSteer {
|
|||
Intent data = result.getData();
|
||||
boolean bool = Objects.requireNonNull(data).getBooleanExtra("bool", false);
|
||||
if (bool) {
|
||||
Yes();
|
||||
runnable.run();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -64,11 +60,11 @@ public class HomeSteer {
|
|||
public void run() {
|
||||
super.run();
|
||||
//获取游客Cookie
|
||||
String hq = wl.hq("/register/anonimous");
|
||||
String hq = wl.hq("/register/anonimous", null);
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(hq);
|
||||
wl.setcookie(jsonObject.getString("cookie"));
|
||||
home.runOnUiThread(() -> Yes());
|
||||
home.runOnUiThread(runnable);
|
||||
} catch (Exception e) {
|
||||
home.runOnUiThread(() -> Toast.makeText(home, "游客登陆失败:" + e.getMessage(), Toast.LENGTH_SHORT).show());
|
||||
gj.sc(e);
|
||||
|
@ -80,14 +76,11 @@ public class HomeSteer {
|
|||
}
|
||||
});
|
||||
materialAlertDialogBuilder.show();
|
||||
}else{
|
||||
Yes();
|
||||
} else {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
|
||||
public void Yes() {
|
||||
|
||||
}
|
||||
|
||||
String[] stringIp = new String[]{"https://ncm.nekogan.com", "https://api.csm.sayqz.com"};
|
||||
|
||||
|
@ -100,7 +93,6 @@ public class HomeSteer {
|
|||
if (TextUtils.isEmpty(main.api)) {
|
||||
|
||||
DialogEditText dialogEditText = getDialogEditText(nickname);
|
||||
|
||||
dialogEditText.binding.edittext.addTextChangedListener(new Edit.TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence var1, int var2, int var3, int var4) {
|
||||
|
|
|
@ -32,7 +32,7 @@ import java.util.List;
|
|||
import java.util.Objects;
|
||||
|
||||
public class PlaybackService extends MediaSessionService {
|
||||
public static MediaSession mediaSession = null;
|
||||
public static MediaSession mediaSession;
|
||||
public static List<MP3> list = new ArrayList<>();
|
||||
|
||||
|
||||
|
@ -80,7 +80,8 @@ public class PlaybackService extends MediaSessionService {
|
|||
Gson gson = new GsonBuilder()
|
||||
.registerTypeAdapter(MediaItem.class, new MediaItemAdapter()) // 绑定适配器
|
||||
.create();
|
||||
List<MediaItem> listHistory = gson.fromJson(dqwb, new TypeToken<List<MediaItem>>(){}.getType());
|
||||
List<MediaItem> listHistory = gson.fromJson(dqwb, new TypeToken<List<MediaItem>>() {
|
||||
}.getType());
|
||||
if (listHistory != null) {
|
||||
listHistory.removeIf(mediaItem1 -> mediaItem1.mediaId.equals(mediaItem.mediaId));
|
||||
listHistory.add(0, mediaItem);
|
||||
|
|
|
@ -31,7 +31,6 @@ import androidx.annotation.Nullable;
|
|||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.media3.common.MediaItem;
|
||||
import androidx.media3.common.MediaMetadata;
|
||||
import androidx.media3.common.Player;
|
||||
|
@ -53,7 +52,6 @@ import com.muqingbfq.databinding.ActivityMusicBinding;
|
|||
import com.muqingbfq.fragment.Media;
|
||||
import com.muqingbfq.main;
|
||||
import com.muqingbfq.mq.AppCompatActivity;
|
||||
import com.muqingbfq.mq.MusicViewModel;
|
||||
import com.muqingbfq.mq.gj;
|
||||
|
||||
import java.util.Objects;
|
||||
|
@ -61,7 +59,7 @@ import java.util.Objects;
|
|||
|
||||
public class Music extends AppCompatActivity<ActivityMusicBinding> implements GestureDetector.OnGestureListener {
|
||||
|
||||
private Player player = PlaybackService.mediaSession.getPlayer();
|
||||
private final Player player = PlaybackService.mediaSession.getPlayer();
|
||||
private int TdtHeight = 15;
|
||||
public static Bitmap backgroundbitmap=null;
|
||||
|
||||
|
@ -261,7 +259,6 @@ public class Music extends AppCompatActivity<ActivityMusicBinding> implements Ge
|
|||
String stringBuilder = "标题:" + currentMediaItem.mediaMetadata.title + System.lineSeparator() +
|
||||
"歌手:" + currentMediaItem.mediaMetadata.artist + System.lineSeparator() +
|
||||
"歌曲链接:" + "https://music.163.com/#/song?id=" + currentMediaItem.mediaId;
|
||||
|
||||
Intent intent = new Intent(Intent.ACTION_SEND);
|
||||
intent.setType("text/plain");
|
||||
intent.putExtra(Intent.EXTRA_TEXT, stringBuilder);
|
||||
|
@ -280,7 +277,7 @@ public class Music extends AppCompatActivity<ActivityMusicBinding> implements Ge
|
|||
Runnable runnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (player != null && !isDrag) {
|
||||
if (!isDrag) {
|
||||
// 获取当前进度和持续时间
|
||||
long currentPosition = player.getCurrentPosition();
|
||||
long duration = player.getDuration();
|
||||
|
|
|
@ -42,7 +42,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
public class activity_search extends FragmentActivity<ActivitySearchBinding> {
|
||||
// private List<String> json_list = new ArrayList<>();
|
||||
// private List<String> json_list = new ArrayList<>();
|
||||
private final List<String> list = new ArrayList<>();
|
||||
|
||||
public static void start(Activity context, View view) {
|
||||
|
@ -105,7 +105,11 @@ public class activity_search extends FragmentActivity<ActivitySearchBinding> {
|
|||
synchronized (o) {
|
||||
list.clear();
|
||||
String hq = com.muqingbfq.mq.wl.
|
||||
hq("/search/suggest?keywords=" + s + "&type=mobile");
|
||||
hq("/search/suggest",
|
||||
new String[][]{
|
||||
{"keywords", s.toString()},
|
||||
{"type", "mobile"}
|
||||
});
|
||||
try {
|
||||
JSONArray jsonArray = new JSONObject(hq).getJSONObject("result")
|
||||
.getJSONArray("allMatch");
|
||||
|
@ -205,7 +209,7 @@ public class activity_search extends FragmentActivity<ActivitySearchBinding> {
|
|||
binding.searchview.hide();
|
||||
}
|
||||
|
||||
public static void addSearchRecord(String name,List<String> json_list,SearchRecordAdapter adapter) {
|
||||
public static void addSearchRecord(String name, List<String> json_list, SearchRecordAdapter adapter) {
|
||||
try {
|
||||
int existingIndex = json_list.indexOf(name);
|
||||
if (existingIndex != -1) {
|
||||
|
@ -248,9 +252,9 @@ public class activity_search extends FragmentActivity<ActivitySearchBinding> {
|
|||
public void start(String name) {
|
||||
dismiss();
|
||||
if (!TextUtils.isEmpty(name)) {
|
||||
search sea = (search) getSupportFragmentManager().findFragmentById(R.id.search_fragment);
|
||||
binding.searchFragment.setVisibility(View.VISIBLE);
|
||||
sea.sx(name);
|
||||
// search sea = (search) getSupportFragmentManager().findFragmentById(R.id.search_fragment);
|
||||
// binding.searchFragment.setVisibility(View.VISIBLE);
|
||||
// sea.sx(name);
|
||||
// addSearchRecordd(name);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.DataSource;
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.bumptech.glide.load.engine.GlideException;
|
||||
import com.bumptech.glide.request.RequestListener;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
|
@ -63,6 +64,7 @@ public class AdapterGd extends RecyclerView.Adapter<VH<ListGdBinding>> {
|
|||
Glide.with(holder.itemView.getContext())
|
||||
.asBitmap()
|
||||
.load(xm.picurl)
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
.addListener(new RequestListener<Bitmap>() {
|
||||
@Override
|
||||
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Bitmap> target, boolean isFirstResource) {
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
package com.muqingbfq.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Filter;
|
||||
import android.widget.Filterable;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.media3.common.MediaItem;
|
||||
import androidx.media3.common.Player;
|
||||
|
@ -26,15 +31,58 @@ import com.muqingbfq.mq.gj;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AdapterMp3 extends RecyclerView.Adapter<VH<ListMp3ImageBinding>> {
|
||||
public class AdapterMp3 extends RecyclerView.Adapter<VH<ListMp3ImageBinding>> implements Filterable {
|
||||
public List<MP3> list = new ArrayList<>();
|
||||
private List<MP3> list_ys;
|
||||
private Activity activity;
|
||||
|
||||
public AdapterMp3() {
|
||||
|
||||
}
|
||||
|
||||
public AdapterMp3(Activity activity) {
|
||||
this.activity = activity;
|
||||
}
|
||||
|
||||
public AdapterMp3(List<MP3> list) {
|
||||
this.list = list;
|
||||
list_ys = list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Filter getFilter() {
|
||||
return new Filter() {
|
||||
@Override
|
||||
protected FilterResults performFiltering(CharSequence charSequence) {
|
||||
String charString = charSequence.toString();
|
||||
if (charString.isEmpty()) {
|
||||
//没有过滤的内容,则使用源数据
|
||||
list = list_ys;
|
||||
} else {
|
||||
List<MP3> filteredList = new ArrayList<>();
|
||||
for (int i = 0; i < list_ys.size(); i++) {
|
||||
MP3 mp3 = list_ys.get(i);
|
||||
if (mp3.name.contains(charString)
|
||||
|| mp3.zz.contains(charString)) {
|
||||
filteredList.add(list_ys.get(i));
|
||||
}
|
||||
}
|
||||
list = filteredList;
|
||||
}
|
||||
|
||||
FilterResults filterResults = new FilterResults();
|
||||
filterResults.values = list;
|
||||
return filterResults;
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected void publishResults(CharSequence charSequence, FilterResults filterResults) {
|
||||
list = (List<MP3>) filterResults.values;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
@ -44,6 +92,38 @@ public class AdapterMp3 extends RecyclerView.Adapter<VH<ListMp3ImageBinding>> {
|
|||
LayoutInflater.from(parent.getContext()), parent, false));
|
||||
}
|
||||
|
||||
// 定义全局监听器
|
||||
private final Player.Listener playerListener = new Player.Listener() {
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
@Override
|
||||
public void onMediaItemTransition(@Nullable MediaItem mediaItem, int reason) {
|
||||
if (mediaItem != null) {
|
||||
notifyDataSetChanged();
|
||||
Log.d("RecyclerView", "切换到新音乐: " + mediaItem.mediaId);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public void onAttachedToRecyclerView(@NonNull RecyclerView recyclerView) {
|
||||
super.onAttachedToRecyclerView(recyclerView);
|
||||
if (activity == null && PlaybackService.mediaSession != null) {
|
||||
|
||||
PlaybackService.mediaSession.getPlayer().addListener(playerListener);
|
||||
}
|
||||
Log.d("RecyclerView", "Adapter 绑定到 RecyclerView");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetachedFromRecyclerView(@NonNull RecyclerView recyclerView) {
|
||||
super.onDetachedFromRecyclerView(recyclerView);
|
||||
if (activity == null && PlaybackService.mediaSession != null) {
|
||||
PlaybackService.mediaSession.getPlayer().removeListener(playerListener);
|
||||
}
|
||||
Log.d("RecyclerView", "Adapter 从 RecyclerView 解绑");
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull VH<ListMp3ImageBinding> holder, int position) {
|
||||
|
@ -69,7 +149,7 @@ public class AdapterMp3 extends RecyclerView.Adapter<VH<ListMp3ImageBinding>> {
|
|||
holder.binding.text1.setText(String.valueOf(position + 1));
|
||||
holder.binding.imageView.setVisibility(ViewGroup.GONE);
|
||||
holder.binding.linsum.setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
} else {
|
||||
Glide.with(holder.itemView.getContext()).load(list.get(position).picurl)
|
||||
.apply(new RequestOptions().placeholder(R.drawable.ic_launcher_foreground))
|
||||
.error(R.drawable.ic_launcher_foreground)
|
||||
|
@ -92,7 +172,7 @@ public class AdapterMp3 extends RecyclerView.Adapter<VH<ListMp3ImageBinding>> {
|
|||
MediaItem currentItem = player.getMediaItemAt(i);
|
||||
if (currentItem.mediaId.equals(hq.id)) {
|
||||
gj.sc("存在播放:" + currentItem.mediaId + "==" + hq.id + " i=" + i);
|
||||
player.seekTo(i,0);
|
||||
player.seekTo(i, 0);
|
||||
player.prepare();
|
||||
player.play();
|
||||
notifyDataSetChanged();
|
||||
|
@ -103,8 +183,8 @@ public class AdapterMp3 extends RecyclerView.Adapter<VH<ListMp3ImageBinding>> {
|
|||
PlaybackService.list.add(hq);
|
||||
PlaybackService.ListSave();
|
||||
MediaItem mediaItem = PlaybackService.GetMp3(hq);
|
||||
player.addMediaItem(0,mediaItem);
|
||||
player.seekTo(0,0);
|
||||
player.addMediaItem(0, mediaItem);
|
||||
player.seekTo(0, 0);
|
||||
player.prepare();
|
||||
player.play();
|
||||
notifyDataSetChanged();
|
||||
|
|
|
@ -50,7 +50,7 @@ public class FileDownloader {
|
|||
public void downloadFile(MP3 x) {
|
||||
Request request = new Request.Builder()
|
||||
.url(main.api + url.api + "?id=" + x.id + "&level=" +
|
||||
"standard" + "&cookie=" + wl.Cookie)
|
||||
"standard")
|
||||
.build();
|
||||
client.newCall(request).enqueue(new Callback() {
|
||||
@Override
|
||||
|
|
|
@ -28,15 +28,13 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
public class playlist extends Thread {
|
||||
public static final String api = "/playlist/track/all?id=";
|
||||
public static final String api = "/playlist/track/all";
|
||||
|
||||
public static String gethq(String uid) {
|
||||
if (wj.cz(wj.filesdri + "user.mq")) {
|
||||
return wl.hq(api + uid + "&limit=100" + "&cookie=" + wl.Cookie);
|
||||
// gj.sc(hq);
|
||||
} else {
|
||||
return wl.hq(api + uid + "&limit=100");
|
||||
}
|
||||
return wl.hq(api,new String[][]{
|
||||
{"id", uid},
|
||||
{"limit", "100"}
|
||||
});
|
||||
}
|
||||
|
||||
public static boolean hq(List<MP3> list, String uid) {
|
||||
|
|
|
@ -21,7 +21,7 @@ public class resource {
|
|||
try {
|
||||
list.clear();
|
||||
JSONObject json;
|
||||
String hq = wl.hq("/recommend/resource?cookie=" + wl.Cookie);
|
||||
String hq = wl.hq("/recommend/resource",null);
|
||||
if (hq == null) {
|
||||
hq = wj.dqwb(wj.gd_json);
|
||||
if (hq != null) {
|
||||
|
@ -81,7 +81,7 @@ public class resource {
|
|||
if (wj.cz(wj.gd_phb)) {
|
||||
hq = wj.dqwb(wj.gd_phb);
|
||||
} else {
|
||||
hq = wl.hq("/toplist");
|
||||
hq = wl.hq("/toplist", null);
|
||||
if (hq == null) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -49,8 +49,11 @@ public class url extends Thread {
|
|||
if (wiFiConnected) {
|
||||
level = "exhigh";
|
||||
}
|
||||
String hq = wl.hq(api + "?id=" + mp3.id + "&level=" +
|
||||
level + "&cookie=" + wl.Cookie);
|
||||
String hq = wl.hq(api,
|
||||
new String[][]{
|
||||
{"id", mp3.id},
|
||||
{"level", level}
|
||||
});
|
||||
if (hq == null) {
|
||||
return null;
|
||||
}
|
||||
|
@ -87,22 +90,30 @@ public class url extends Thread {
|
|||
com.muqingbfq.bfqkz.lrc = id3v2Tag.getLyrics();
|
||||
}
|
||||
if (com.muqingbfq.bfqkz.lrc == null) {
|
||||
com.muqingbfq.bfqkz.lrc = wl.hq("/lyric?id=" + id);
|
||||
com.muqingbfq.bfqkz.lrc = wl.hq("/lyric",new String[][]{
|
||||
{"id", id}
|
||||
});
|
||||
}
|
||||
} catch (Exception e) {
|
||||
gj.sc("url getlrc:" + e);
|
||||
}
|
||||
} else {
|
||||
com.muqingbfq.bfqkz.lrc = wl.hq("/lyric?id=" + id);
|
||||
com.muqingbfq.bfqkz.lrc = wl.hq("/lyric",new String[][]{
|
||||
{"id", id}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public static String Lrc(String id) {
|
||||
return wl.hq("/lyric?id=" + id);
|
||||
return wl.hq("/lyric",new String[][]{
|
||||
{"id", id}
|
||||
});
|
||||
}
|
||||
|
||||
public static String picurl(String id) {
|
||||
String hq = wl.hq("/song/detail?ids=" + id);
|
||||
String hq = wl.hq("/song/detail",new String[][]{
|
||||
{"ids", id}
|
||||
});
|
||||
try {
|
||||
return new JSONObject(hq).getJSONArray("songs").getJSONObject(0)
|
||||
.getJSONObject("al").getString("picUrl");
|
||||
|
|
|
@ -91,7 +91,7 @@ public class gd extends FragmentActivity<ActivityGdBinding> {
|
|||
|
||||
binding.fragmentDb.post(() -> {
|
||||
int height = binding.fragmentDb.getHeight();
|
||||
binding.lb.setPadding(0,0,0,height);
|
||||
binding.lb.setPadding(0, 0, 0, height);
|
||||
});
|
||||
new start(id);
|
||||
}
|
||||
|
@ -117,7 +117,14 @@ public class gd extends FragmentActivity<ActivityGdBinding> {
|
|||
if (id.equals("排行榜")) {
|
||||
resource.leaderboard(adapter.list);
|
||||
} else {
|
||||
String hq = wl.hq("/search?keywords=" + id + "&limit=" + (k * 3) + "&type=1000");
|
||||
|
||||
String hq = wl.hq("/search", new String[][]{
|
||||
{"keywords", id},
|
||||
{"limit", String.valueOf((k * 3))},
|
||||
{"type", "1000"}
|
||||
}
|
||||
);
|
||||
// "keywords=" + id + "&limit=" + (k * 3) + "&type=1000"
|
||||
try {
|
||||
JSONArray jsonArray = new JSONObject(hq).getJSONObject("result")
|
||||
.getJSONArray("playlists");
|
||||
|
|
|
@ -35,39 +35,33 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
public class gd_adapter extends Fragment<FragmentGdBinding> {
|
||||
List<XM> list = new ArrayList<>();
|
||||
AdapterMp3 adapterMp3 = new AdapterMp3();
|
||||
|
||||
|
||||
|
||||
AdapterMp3 adapterMp3;
|
||||
@Override
|
||||
protected FragmentGdBinding inflateViewBinding(LayoutInflater inflater, ViewGroup container) {
|
||||
return FragmentGdBinding.inflate(inflater, container, false);
|
||||
}
|
||||
|
||||
AdapterGd adapterGd = new AdapterGd();
|
||||
AdapterGd adapterGd;
|
||||
@Override
|
||||
public void setUI(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext(),LinearLayoutManager.HORIZONTAL,false);
|
||||
binding.recyclerview1.setHasFixedSize(true);
|
||||
binding.recyclerview1.setNestedScrollingEnabled(false);
|
||||
binding.recyclerview1.setLayoutManager(linearLayoutManager);
|
||||
adapterGd.list = list;
|
||||
adapterGd = new AdapterGd();
|
||||
binding.recyclerview1.setAdapter(adapterGd);
|
||||
new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
super.run();
|
||||
resource.recommend(list);
|
||||
resource.recommend(adapterGd.list);
|
||||
main.handler.post(new sx());
|
||||
}
|
||||
}.start();
|
||||
|
||||
mp3list();
|
||||
adapterMp3 = new AdapterMp3();
|
||||
binding.recyclerview2.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
binding.recyclerview2.setNestedScrollingEnabled(false);
|
||||
binding.recyclerview2.setAdapter(adapterMp3);
|
||||
mp3list();
|
||||
// requireActivity().findViewById(R.id.linearLayout4).post(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
|
@ -91,7 +85,7 @@ public class gd_adapter extends Fragment<FragmentGdBinding> {
|
|||
@Override
|
||||
public void run() {
|
||||
super.run();
|
||||
String hq = wl.hq("/recommend/songs" + "?cookie=" + wl.Cookie);
|
||||
String hq = wl.hq("/recommend/songs", null);
|
||||
if (hq == null) {
|
||||
hq = wj.dqwb(wj.filesdri + "songs.json");
|
||||
}
|
||||
|
@ -127,4 +121,10 @@ public class gd_adapter extends Fragment<FragmentGdBinding> {
|
|||
public void Gdlist() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
binding.recyclerview2.setAdapter(null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ import jp.wasabeef.glide.transformations.BlurTransformation;
|
|||
public class mp3 extends FragmentActivity<ActivityMp3Binding> {
|
||||
private final List<MP3> list = new ArrayList<>();
|
||||
private List<MP3> list_ys = new ArrayList<>();
|
||||
public Adapter adapter;
|
||||
public AdapterMp3 adapter;
|
||||
|
||||
public static void start(Activity context, String[] str, View view) {
|
||||
ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(context,
|
||||
|
@ -136,7 +136,7 @@ public class mp3 extends FragmentActivity<ActivityMp3Binding> {
|
|||
Intent intent = getIntent();
|
||||
binding.title.setText(intent.getStringExtra("name"));
|
||||
String id = intent.getStringExtra("id");
|
||||
adapter = new Adapter(list);
|
||||
adapter = new AdapterMp3(list);
|
||||
binding.lb.setLayoutManager(new LinearLayoutManager(this));
|
||||
binding.lb.setAdapter(adapter);
|
||||
new start(id);
|
||||
|
@ -304,58 +304,6 @@ public class mp3 extends FragmentActivity<ActivityMp3Binding> {
|
|||
}
|
||||
}
|
||||
|
||||
public static class Adapter extends AdapterMp3 implements Filterable {
|
||||
|
||||
private final List<MP3> list_ys;
|
||||
|
||||
public Adapter(List<MP3> list) {
|
||||
this.list = list;
|
||||
list_ys = list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull VH<ListMp3ImageBinding> holder, int position) {
|
||||
super.onBindViewHolder(holder, position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Filter getFilter() {
|
||||
return new Filter() {
|
||||
@Override
|
||||
protected FilterResults performFiltering(CharSequence charSequence) {
|
||||
String charString = charSequence.toString();
|
||||
if (charString.isEmpty()) {
|
||||
//没有过滤的内容,则使用源数据
|
||||
list = list_ys;
|
||||
} else {
|
||||
List<MP3> filteredList = new ArrayList<>();
|
||||
for (int i = 0; i < list_ys.size(); i++) {
|
||||
MP3 mp3 = list_ys.get(i);
|
||||
if (mp3.name.contains(charString)
|
||||
|| mp3.zz.contains(charString)) {
|
||||
filteredList.add(list_ys.get(i));
|
||||
}
|
||||
}
|
||||
list = filteredList;
|
||||
}
|
||||
|
||||
FilterResults filterResults = new FilterResults();
|
||||
filterResults.values = list;
|
||||
return filterResults;
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected void publishResults(CharSequence charSequence, FilterResults filterResults) {
|
||||
list = (List<MP3>) filterResults.values;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void startactivity(Context context, String id) {
|
||||
context.startActivity(new Intent(context, mp3.class).putExtra("id", id));
|
||||
}
|
||||
|
@ -363,6 +311,11 @@ public class mp3 extends FragmentActivity<ActivityMp3Binding> {
|
|||
@Override
|
||||
public void finish() {
|
||||
super.finish();
|
||||
adapter = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
binding.lb.setAdapter(null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.muqingbfq.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
@ -9,9 +10,13 @@ import android.view.ViewGroup;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.google.android.material.tabs.TabLayoutMediator;
|
||||
import com.muqingbfq.MP3;
|
||||
import com.muqingbfq.XM;
|
||||
|
@ -30,29 +35,27 @@ import java.text.DecimalFormat;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class search extends Fragment {
|
||||
public FragmentSearchBinding binding;
|
||||
public class search {
|
||||
public String string;
|
||||
List<Fragment> fragments=new ArrayList<>();
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
binding = FragmentSearchBinding.inflate(inflater, container, false);
|
||||
binding.viewPager.setSaveEnabled(false);
|
||||
adapter = new FragmentStateAdapter(this) {
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment createFragment(int position) {
|
||||
return fragments.get(position);
|
||||
}
|
||||
List<Fragment> fragments = new ArrayList<>();
|
||||
TabLayout tablayout;
|
||||
ViewPager2 viewPager2;
|
||||
FragmentActivity activity;
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return fragments.size();
|
||||
public search(FragmentActivity activity, TabLayout tabLayout, ViewPager2 viewPager2) {
|
||||
this.tablayout = tabLayout;
|
||||
this.viewPager2 = viewPager2;
|
||||
this.activity = activity;
|
||||
tabLayoutMediator = new TabLayoutMediator(tablayout, viewPager2, (tab, position) -> {
|
||||
switch (position) {
|
||||
case 0:
|
||||
tab.setText("歌曲");
|
||||
break;
|
||||
case 1:
|
||||
tab.setText("歌单");
|
||||
break;
|
||||
}
|
||||
};
|
||||
return binding.getRoot();
|
||||
});
|
||||
}
|
||||
|
||||
public static class mp3 extends Fragment {
|
||||
|
@ -63,16 +66,19 @@ public class search extends Fragment {
|
|||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
RecyclerVBinding binding;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
List<MP3> list = new ArrayList<>();
|
||||
String string = getArguments().getString("string");
|
||||
RecyclerVBinding binding = RecyclerVBinding.inflate(inflater, container, false);
|
||||
binding = RecyclerVBinding.inflate(inflater, container, false);
|
||||
binding.recycleview.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
binding.recycleview.setAdapter(new AdapterMp3(list));
|
||||
list.clear();
|
||||
AdapterMp3 adapterMp3 = new AdapterMp3();
|
||||
binding.recycleview.setAdapter(adapterMp3);
|
||||
adapterMp3.list.clear();
|
||||
binding.recyclerviewBar.setVisibility(View.VISIBLE);
|
||||
binding.recyclerviewText.setVisibility(View.GONE);
|
||||
new Thread() {
|
||||
|
@ -80,10 +86,10 @@ public class search extends Fragment {
|
|||
@Override
|
||||
public void run() {
|
||||
super.run();
|
||||
mp3(list, string);
|
||||
mp3(adapterMp3.list, string);
|
||||
main.handler.post(() -> {
|
||||
binding.recyclerviewBar.setVisibility(View.GONE);
|
||||
if (list.isEmpty()) {
|
||||
if (adapterMp3.list.isEmpty()) {
|
||||
binding.recyclerviewText.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
binding.recyclerviewText.setVisibility(View.GONE);
|
||||
|
@ -94,7 +100,14 @@ public class search extends Fragment {
|
|||
}.start();
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
binding.recycleview.setAdapter(null);
|
||||
}
|
||||
}
|
||||
|
||||
public static class gd extends Fragment {
|
||||
public static gd newInstance(String string) {
|
||||
gd fragment = new gd();
|
||||
|
@ -103,6 +116,7 @@ public class search extends Fragment {
|
|||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
|
@ -135,19 +149,41 @@ public class search extends Fragment {
|
|||
return binding.getRoot();
|
||||
}
|
||||
}
|
||||
private FragmentStateAdapter adapter;
|
||||
|
||||
TabLayoutMediator tabLayoutMediator;
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
public void sx(String string) {
|
||||
this.string = string;
|
||||
fragments.clear();
|
||||
fragments.add(mp3.newInstance(string));
|
||||
fragments.add(gd.newInstance(string));
|
||||
binding.viewPager.setAdapter(adapter);
|
||||
adapter.notifyDataSetChanged();
|
||||
String[] strtab = new String[]{"歌曲", "歌单"};
|
||||
//将tabbView绑定到tab
|
||||
new TabLayoutMediator(binding.tablayout, binding.viewPager, (tab, position) ->
|
||||
tab.setText(strtab[position])).attach();
|
||||
delete();
|
||||
// viewPager2.setAdapter(null);
|
||||
viewPager2.setAdapter(new FragmentStateAdapter(activity) {
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment createFragment(int position) {
|
||||
switch (position) {
|
||||
case 0:
|
||||
return mp3.newInstance(string);
|
||||
case 1:
|
||||
return gd.newInstance(string);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return 2;
|
||||
}
|
||||
});
|
||||
// 确保只有一个 TabLayoutMediator 被附加
|
||||
if (!tabLayoutMediator.isAttached()) {
|
||||
tabLayoutMediator.attach(); // 仅在没有附加时才附加
|
||||
}
|
||||
}
|
||||
|
||||
public void delete() {
|
||||
tabLayoutMediator.detach();
|
||||
viewPager2.setAdapter(null);
|
||||
}
|
||||
|
||||
private static void mp3(List<MP3> list, String str) {
|
||||
|
@ -158,7 +194,7 @@ public class search extends Fragment {
|
|||
} catch (NumberFormatException e) {
|
||||
gj.sc(e);
|
||||
}
|
||||
String hq = wl.hq("/search?keywords=" + str + "&type=1");
|
||||
String hq = wl.hq("/search", "keywords=" + str + "&type=1", false);
|
||||
try {
|
||||
JSONArray jsonArray = new JSONObject(hq).getJSONObject("result")
|
||||
.getJSONArray("songs");
|
||||
|
@ -189,7 +225,7 @@ public class search extends Fragment {
|
|||
private static void gd(List<XM> list, String str) {
|
||||
try {
|
||||
Long.parseLong(str);
|
||||
String hq = wl.hq("/playlist/detail?id=" + str);
|
||||
String hq = wl.hq("/playlist/detail", "id=" + str, false);
|
||||
JSONObject js = new JSONObject(hq).getJSONObject("playlist");
|
||||
String id = js.getString("id");
|
||||
String name = js.getString("name");
|
||||
|
@ -201,7 +237,7 @@ public class search extends Fragment {
|
|||
gj.sc(e);
|
||||
}
|
||||
try {
|
||||
String hq = wl.hq("/search?keywords=" + str + "&type=1000");
|
||||
String hq = wl.hq("/search", "keywords=" + str + "&type=1000", false);
|
||||
JSONArray jsonArray = new JSONObject(hq).getJSONObject("result")
|
||||
.getJSONArray("playlists");
|
||||
int length = jsonArray.length();
|
||||
|
|
|
@ -26,7 +26,6 @@ import com.muqingbfq.api.playlist;
|
|||
import com.muqingbfq.api.resource;
|
||||
import com.muqingbfq.databinding.FragmentWdBinding;
|
||||
import com.muqingbfq.login.user_logs;
|
||||
import com.muqingbfq.login.visitor;
|
||||
import com.muqingbfq.main;
|
||||
import com.muqingbfq.mq.EditViewDialog;
|
||||
import com.muqingbfq.mq.Fragment;
|
||||
|
@ -94,13 +93,13 @@ public class wode extends Fragment<FragmentWdBinding> {
|
|||
Intent a = new Intent(getContext(), com.muqingbfq.fragment.mp3.class);
|
||||
a.putExtra("id", data);
|
||||
a.putExtra("name", s);
|
||||
getContext().startActivity(a);
|
||||
requireContext().startActivity(a);
|
||||
break;
|
||||
case "排行榜":
|
||||
gd.start(getActivity(), new String[]{data, s});
|
||||
break;
|
||||
case "API":
|
||||
EditViewDialog editViewDialog = new EditViewDialog(getContext(), "更换接口API")
|
||||
EditViewDialog editViewDialog = new EditViewDialog(requireContext(), "更换接口API")
|
||||
.setMessage("当前接口:\n" + main.api);
|
||||
editViewDialog.setPositive(view1 -> {
|
||||
String str = editViewDialog.getEditText();
|
||||
|
@ -116,7 +115,7 @@ public class wode extends Fragment<FragmentWdBinding> {
|
|||
}).show();
|
||||
break;
|
||||
case "gd":
|
||||
EditViewDialog editViewDialog1 = new EditViewDialog(getContext(),
|
||||
EditViewDialog editViewDialog1 = new EditViewDialog(requireContext(),
|
||||
"导入歌单")
|
||||
.setMessage("请用网易云https链接来进行导入或者歌单id");
|
||||
editViewDialog1.setPositive(view1 -> {
|
||||
|
@ -180,12 +179,12 @@ public class wode extends Fragment<FragmentWdBinding> {
|
|||
if (result.getResultCode() == Activity.RESULT_OK) {
|
||||
// 处理返回结果
|
||||
Intent data = result.getData();
|
||||
boolean bool = data.getBooleanExtra("bool", false);
|
||||
if (bool) {
|
||||
// gj.sc("dl");
|
||||
new threadLogin().start();
|
||||
if (data != null) {
|
||||
boolean bool = data.getBooleanExtra("bool", false);
|
||||
if (bool) {
|
||||
new threadLogin().start();
|
||||
}
|
||||
}
|
||||
// ...
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -195,7 +194,7 @@ public class wode extends Fragment<FragmentWdBinding> {
|
|||
File file = new File(wj.filesdri, "user.mq");
|
||||
if (file.exists()) {
|
||||
String[] a = new String[]{"退出登录"};
|
||||
new MaterialAlertDialogBuilder(getContext())
|
||||
new MaterialAlertDialogBuilder(requireContext())
|
||||
.setItems(a, (dialogInterface, i) -> {
|
||||
boolean delete = file.delete();
|
||||
if (delete) {
|
||||
|
@ -203,7 +202,6 @@ public class wode extends Fragment<FragmentWdBinding> {
|
|||
binding.text1.setText(getString(R.string.app_name));
|
||||
binding.text2.setText(getString(R.string.app_name));
|
||||
imageView.setImageResource(R.drawable.ic_launcher_foreground);
|
||||
new visitor();//游客模式
|
||||
wj.sc(wj.filesdri + "user.mq");
|
||||
// new com.muqingbfq.login.user_message();
|
||||
}
|
||||
|
@ -215,7 +213,7 @@ public class wode extends Fragment<FragmentWdBinding> {
|
|||
}
|
||||
|
||||
|
||||
class VH extends RecyclerView.ViewHolder {
|
||||
private static class VH extends RecyclerView.ViewHolder {
|
||||
public ImageView imageView;
|
||||
public TextView textView;
|
||||
|
||||
|
@ -230,7 +228,7 @@ public class wode extends Fragment<FragmentWdBinding> {
|
|||
class threadLogin extends Thread {
|
||||
|
||||
public void run() {
|
||||
String hq = wl.hq("/user/account?cookie=" + wl.Cookie);
|
||||
String hq = wl.hq("/user/account", null);
|
||||
if (hq != null) {
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(hq);
|
||||
|
@ -243,7 +241,7 @@ public class wode extends Fragment<FragmentWdBinding> {
|
|||
requireActivity().runOnUiThread(() -> {
|
||||
binding.text1.setText(nickname);
|
||||
binding.text2.setText(signature);
|
||||
Glide.with(getContext())
|
||||
Glide.with(requireContext())
|
||||
.load(avatarUrl)
|
||||
.error(R.drawable.ic_launcher_foreground)
|
||||
.into(binding.imageView);
|
||||
|
@ -262,7 +260,7 @@ public class wode extends Fragment<FragmentWdBinding> {
|
|||
requireActivity().runOnUiThread(() -> {
|
||||
binding.text1.setText(user.name);
|
||||
binding.text2.setText(user.qianming);
|
||||
Glide.with(getContext())
|
||||
Glide.with(requireContext())
|
||||
.load(user.picUrl)
|
||||
.error(R.drawable.ic_launcher_foreground)
|
||||
.into(binding.imageView);
|
||||
|
|
|
@ -9,7 +9,6 @@ import android.view.LayoutInflater;
|
|||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.activity.OnBackPressedCallback;
|
||||
|
@ -22,7 +21,6 @@ import androidx.fragment.app.Fragment;
|
|||
import androidx.media3.session.MediaController;
|
||||
import androidx.media3.session.SessionToken;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.google.android.flexbox.AlignItems;
|
||||
import com.google.android.flexbox.FlexDirection;
|
||||
|
@ -41,7 +39,6 @@ import com.muqingbfq.fragment.sz;
|
|||
import com.muqingbfq.fragment.wode;
|
||||
import com.muqingbfq.mq.AppCompatActivity;
|
||||
import com.muqingbfq.mq.gj;
|
||||
import com.muqingbfq.mq.wl;
|
||||
import com.muqingbfq.view.Edit;
|
||||
|
||||
import org.json.JSONArray;
|
||||
|
@ -69,14 +66,7 @@ public class home extends AppCompatActivity<ActivityHomeBinding> {
|
|||
controllerFuture.addListener(() -> {
|
||||
|
||||
}, MoreExecutors.directExecutor());
|
||||
if (Strings.isNullOrEmpty(main.api) || Strings.isNullOrEmpty(wl.Cookie)) {
|
||||
new HomeSteer(this) {
|
||||
@Override
|
||||
public void Yes() {
|
||||
UI();
|
||||
}
|
||||
};
|
||||
} else UI();
|
||||
new HomeSteer(this, this::UI);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -97,7 +87,7 @@ public class home extends AppCompatActivity<ActivityHomeBinding> {
|
|||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
// v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
v.setPadding(systemBars.left, 0, systemBars.right, 0);
|
||||
binding.chb.setPadding(0, systemBars.top, 0, 0);
|
||||
binding.chb.setPadding(0, systemBars.top, 0, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
// viewTop=binding.
|
||||
|
@ -184,17 +174,19 @@ public class home extends AppCompatActivity<ActivityHomeBinding> {
|
|||
|
||||
public boolean issearchclicklist = false;//是否点击了列表项目
|
||||
//搜索建议列表
|
||||
private List<String> searchList = new ArrayList<>();
|
||||
private final List<String> searchList = new ArrayList<>();
|
||||
|
||||
private activity_search.SearchRecordAdapter searchRecordAdapter;
|
||||
|
||||
public void SearchUI() {
|
||||
search search = new search(this, binding.searchTablayout, binding.searchViewPager);
|
||||
binding.searchview
|
||||
.getEditText()
|
||||
.setOnEditorActionListener(
|
||||
(v, actionId, event) -> {
|
||||
// binding.searchview.hide();
|
||||
searchStart(binding.toolbar.getText().toString());
|
||||
|
||||
searchStart(search, binding.toolbar.getText().toString());
|
||||
return false;
|
||||
});
|
||||
binding.searchview.setOnMenuItemClickListener(
|
||||
|
@ -216,11 +208,6 @@ public class home extends AppCompatActivity<ActivityHomeBinding> {
|
|||
// Handle search view opened.
|
||||
gj.sc("SHOWING");
|
||||
binding.tablayout.setVisibility(View.GONE);
|
||||
// 添加 Fragment
|
||||
getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(binding.searchFragment.getId(), new search())
|
||||
.commit();
|
||||
searchRecordAdapter = new activity_search.SearchRecordAdapter(binding.searchview);
|
||||
binding.listRecycler.setAdapter(searchRecordAdapter);
|
||||
} else if (newState == SearchView.TransitionState.SHOWN) {
|
||||
|
@ -235,10 +222,7 @@ public class home extends AppCompatActivity<ActivityHomeBinding> {
|
|||
binding.searchRecycler.setVisibility(View.GONE);
|
||||
binding.xxbj1.setVisibility(View.VISIBLE);
|
||||
// 移除当前显示的 Fragment
|
||||
getSupportFragmentManager().beginTransaction()
|
||||
.remove(getSupportFragmentManager()
|
||||
.findFragmentById(binding.searchFragment.getId()))
|
||||
.commit();
|
||||
search.delete();
|
||||
}
|
||||
});
|
||||
final Object o = new Object();
|
||||
|
@ -256,7 +240,7 @@ public class home extends AppCompatActivity<ActivityHomeBinding> {
|
|||
synchronized (o) {
|
||||
searchList.clear();
|
||||
String hq = com.muqingbfq.mq.wl.
|
||||
hq("/search/suggest?keywords=" + var1.toString() + "&type=mobile");
|
||||
hq("/search/suggest", "keywords=" + var1.toString() + "&type=mobile", false);
|
||||
try {
|
||||
JSONArray jsonArray = new JSONObject(hq).getJSONObject("result")
|
||||
.getJSONArray("allMatch");
|
||||
|
@ -274,7 +258,7 @@ public class home extends AppCompatActivity<ActivityHomeBinding> {
|
|||
binding.xxbj1.setVisibility(View.GONE);
|
||||
binding.searchFragment.setVisibility(View.VISIBLE);
|
||||
binding.searchview.setText(string);
|
||||
searchStart(string);
|
||||
searchStart(search,string);
|
||||
// binding.searchRecycler.set
|
||||
})));
|
||||
} catch (Exception e) {
|
||||
|
@ -316,14 +300,13 @@ public class home extends AppCompatActivity<ActivityHomeBinding> {
|
|||
|
||||
}
|
||||
|
||||
public void searchStart(String name) {
|
||||
public void searchStart(search search, String name) {
|
||||
issearchclicklist = true;
|
||||
binding.toolbar.setText(binding.searchview.getText());
|
||||
if (!TextUtils.isEmpty(name)) {
|
||||
search sea = (search) getSupportFragmentManager().findFragmentById(binding.searchFragment.getId());
|
||||
binding.searchFragment.setVisibility(View.VISIBLE);
|
||||
binding.searchRecycler.setVisibility(View.GONE);
|
||||
sea.sx(name);
|
||||
search.sx(name);
|
||||
activity_search.addSearchRecord(name, searchRecordAdapter.json_list, searchRecordAdapter);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,11 +57,11 @@ public class user_logs extends AppCompatActivity<ActivityUserLogsBinding> {
|
|||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
binding.login.setOnClickListener(view1 -> {
|
||||
if (!TextUtils.isEmpty(binding.editUser.getText())) {
|
||||
wl.setcookie(binding.editUser.getText().toString());
|
||||
// wl.setcookie(binding.editUser.getText().toString());
|
||||
}
|
||||
new Thread(() -> {
|
||||
gj.sc(wl.Cookie);
|
||||
String hq = wl.hq("/login/status?cookie=" + wl.Cookie);
|
||||
// gj.sc(wl.Cookie);
|
||||
String hq = wl.hq("/login/status", null);
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(hq);
|
||||
JSONObject data = jsonObject.getJSONObject("data");
|
||||
|
@ -138,7 +138,7 @@ public class user_logs extends AppCompatActivity<ActivityUserLogsBinding> {
|
|||
}
|
||||
user_logs.this.account = binding.editUser.getText().toString();
|
||||
gj.xcts(user_logs.this, "设置成功");
|
||||
wl.setcookie(account);
|
||||
// wl.setcookie(account);
|
||||
finish();
|
||||
// start();
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ public class user_logs extends AppCompatActivity<ActivityUserLogsBinding> {
|
|||
public void run() {
|
||||
super.run();
|
||||
try {
|
||||
String hq = wl.hq("/login/cellphone?phone=" + account + "&password=" + password);
|
||||
String hq = wl.hq("/login/cellphone", "phone=" + account + "&password=" + password, false);
|
||||
if (TextUtils.isEmpty(hq)) {
|
||||
return;
|
||||
}
|
||||
|
@ -189,7 +189,7 @@ public class user_logs extends AppCompatActivity<ActivityUserLogsBinding> {
|
|||
while (code != 0 && !Thread.currentThread().isInterrupted()) {
|
||||
gj.sc(code);
|
||||
try {
|
||||
hq = wl.hq("/login/qr/check?key=" + unikey + Time());
|
||||
hq = wl.hq("/login/qr/check", "key=" + unikey + Time(), false);
|
||||
if (hq != null) {
|
||||
JSONObject json = new JSONObject(hq);
|
||||
code = json.getInt("code");
|
||||
|
@ -207,7 +207,7 @@ public class user_logs extends AppCompatActivity<ActivityUserLogsBinding> {
|
|||
break;
|
||||
case 803:
|
||||
setwb("登录成功");
|
||||
wl.setcookie(json.getString("cookie"));
|
||||
// wl.setcookie(json.getString("cookie"));
|
||||
code = 0;
|
||||
user_logs.this.finish(true);
|
||||
break;
|
||||
|
@ -226,11 +226,11 @@ public class user_logs extends AppCompatActivity<ActivityUserLogsBinding> {
|
|||
}
|
||||
|
||||
private void hqkey() throws Exception {
|
||||
unikey = new JSONObject(Objects.requireNonNull(wl.hq("/login/qr/key"))).
|
||||
unikey = new JSONObject(Objects.requireNonNull(wl.hq("/login/qr/key", null, false))).
|
||||
getJSONObject("data").getString("unikey");
|
||||
JSONObject jsonObject = new JSONObject(Objects.requireNonNull(wl.hq("/login/qr/create?key=" +
|
||||
JSONObject jsonObject = new JSONObject(Objects.requireNonNull(wl.hq("/login/qr/create", "key=" +
|
||||
unikey +
|
||||
"&qrimg=base64")));
|
||||
"&qrimg=base64", false)));
|
||||
qrimg = jsonObject.getJSONObject("data").getString("qrimg");
|
||||
main.handler.post(() -> binding.image.setImageBitmap(user_logs.stringToBitmap(qrimg)));
|
||||
}
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
package com.muqingbfq.login;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.muqingbfq.mq.wj;
|
||||
import com.muqingbfq.mq.wl;
|
||||
import com.muqingbfq.yc;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class visitor extends Thread {
|
||||
public visitor() {
|
||||
start();
|
||||
}
|
||||
@Override
|
||||
public void run() {
|
||||
super.run();
|
||||
String hq = wl.hq("/register/anonimous");
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(hq);
|
||||
wl.setcookie(jsonObject.getString("cookie"));
|
||||
} catch (Exception e) {
|
||||
com.muqingbfq.mq.gj.sc(e);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -62,21 +62,21 @@ public class main extends Application {
|
|||
bj = true;
|
||||
com.muqingbfq.bfqkz.ms = 1;
|
||||
}
|
||||
try {
|
||||
wl.Cookie = sp.getString("Cookie", "");
|
||||
} catch (Exception e) {
|
||||
edit.putString("Cookie", "");
|
||||
wl.Cookie = "";
|
||||
bj = true;
|
||||
}
|
||||
if (bj) {
|
||||
edit.commit();
|
||||
}
|
||||
|
||||
wl.Cookie = main.sp.getString("Cookie", "");
|
||||
if (wl.Cookie.isEmpty()) {
|
||||
new visitor();
|
||||
}
|
||||
// try {
|
||||
// wl.Cookie = sp.getString("Cookie", "");
|
||||
// } catch (Exception e) {
|
||||
// edit.putString("Cookie", "");
|
||||
// wl.Cookie = "";
|
||||
// bj = true;
|
||||
// }
|
||||
// if (bj) {
|
||||
// edit.commit();
|
||||
// }
|
||||
//
|
||||
// wl.Cookie = main.sp.getString("Cookie", "");
|
||||
// if (wl.Cookie.isEmpty()) {
|
||||
// new visitor();
|
||||
// }
|
||||
SharedPreferences theme = getSharedPreferences("theme", MODE_PRIVATE);
|
||||
@SuppressLint("CommitPrefEdits") SharedPreferences.Editor edit = theme.edit();
|
||||
int i = theme.getInt("theme", AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
|
||||
|
|
|
@ -1,23 +1,19 @@
|
|||
package com.muqingbfq.mq;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.OptIn;
|
||||
import androidx.media3.common.MediaItem;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.database.DatabaseProvider;
|
||||
import androidx.media3.database.StandaloneDatabaseProvider;
|
||||
import androidx.media3.datasource.DataSource;
|
||||
import androidx.media3.datasource.cache.Cache;
|
||||
import androidx.media3.datasource.cache.CacheDataSource;
|
||||
import androidx.media3.datasource.cache.LeastRecentlyUsedCacheEvictor;
|
||||
import androidx.media3.datasource.cache.SimpleCache;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.muqingbfq.main;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import okhttp3.Cookie;
|
||||
import okhttp3.CookieJar;
|
||||
import okhttp3.HttpUrl;
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
|
@ -31,16 +27,43 @@ public class wl {
|
|||
main.edit.putString("Cookie", cookie);
|
||||
main.edit.commit();
|
||||
}
|
||||
public static void getCookie(){
|
||||
|
||||
public static void getCookie() {
|
||||
Cookie = main.sp.getString("Cookie", "");
|
||||
}
|
||||
|
||||
public static String hq(String url) {
|
||||
public static final ConcurrentHashMap<String, List<Cookie>> cookieStore = new ConcurrentHashMap<>();
|
||||
|
||||
|
||||
// 自定义 CookieJar 实现
|
||||
private static class CustomCookieJar implements CookieJar {
|
||||
@Override
|
||||
public void saveFromResponse(HttpUrl url, @NonNull List<Cookie> cookies) {
|
||||
cookieStore.put(url.host(), cookies);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public List<Cookie> loadForRequest(HttpUrl url) {
|
||||
return Objects.requireNonNull(cookieStore.getOrDefault(url.host(), new ArrayList<>()));
|
||||
}
|
||||
}
|
||||
|
||||
public final static OkHttpClient client = new OkHttpClient();
|
||||
|
||||
public static String hq(String url, String[][] strings) {
|
||||
try {
|
||||
OkHttpClient client = new OkHttpClient();
|
||||
StringBuilder stringBuffer = new StringBuilder();
|
||||
if (strings != null) {
|
||||
for (String[] b : strings) {
|
||||
stringBuffer.append(b[0]).append("=").append(b[1]).append("&");
|
||||
}
|
||||
}
|
||||
stringBuffer.append("cookie").append("=").append(Cookie);
|
||||
Request request = new Request.Builder()
|
||||
.url(main.api + url)
|
||||
.url(main.api + url + "?" + stringBuffer)
|
||||
.build();
|
||||
|
||||
Response response = client.newCall(request).execute();
|
||||
if (response.body() != null) {
|
||||
return response.body().string();
|
||||
|
@ -51,6 +74,24 @@ public class wl {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static String hq(String url, String strings, boolean bool) {
|
||||
try {
|
||||
Request request = new Request.Builder()
|
||||
.url(main.api + url + "?" + strings)
|
||||
.build();
|
||||
|
||||
Response response = client.newCall(request).execute();
|
||||
if (response.body() != null) {
|
||||
return response.body().string();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
gj.sc("wl hq(Strnig) " + e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static String post(String str, String[][] a) {
|
||||
OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
|
@ -59,7 +100,7 @@ public class wl {
|
|||
for (String[] b : a) {
|
||||
builder.addFormDataPart(b[0], b[1]);
|
||||
}
|
||||
builder.addFormDataPart("cookie", Cookie);
|
||||
// builder.addFormDataPart("cookie", Cookie);
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.url(main.api + str)
|
||||
|
@ -96,26 +137,4 @@ public class wl {
|
|||
return null;
|
||||
}
|
||||
|
||||
|
||||
@OptIn(markerClass = UnstableApi.class)
|
||||
public static DataSource.Factory DownMp3() {
|
||||
Context context = main.application;
|
||||
|
||||
DatabaseProvider databaseProvider = new StandaloneDatabaseProvider(context);
|
||||
// 创建一个 File 对象来指定缓存目录
|
||||
File downloadDirectory = new File(wj.mp3);
|
||||
// 如果缓存目录不存在,则创建它
|
||||
if (!downloadDirectory.exists()) {
|
||||
downloadDirectory.mkdirs();
|
||||
}
|
||||
Cache cache =
|
||||
new SimpleCache(
|
||||
downloadDirectory, new LeastRecentlyUsedCacheEvictor(100 * 1024 * 1024), databaseProvider);
|
||||
|
||||
CacheDataSource.Factory httpDataSourceFactory = new CacheDataSource.Factory();
|
||||
return new CacheDataSource.Factory()
|
||||
.setCache(cache)
|
||||
.setUpstreamDataSourceFactory(httpDataSourceFactory);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -155,7 +155,7 @@
|
|||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_weight="1"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:background="?android:attr/actionBarItemBackground"
|
||||
android:src="@drawable/like"
|
||||
app:tint="#CCCCCC"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
@ -166,7 +166,7 @@
|
|||
android:layout_height="36dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_weight="1"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:background="?android:attr/actionBarItemBackground"
|
||||
android:src="@drawable/syq"
|
||||
app:tint="#CCCCCC"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
@ -176,7 +176,7 @@
|
|||
android:layout_width="46dp"
|
||||
android:layout_height="46dp"
|
||||
android:layout_weight="1"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:background="?android:attr/actionBarItemBackground"
|
||||
android:src="@drawable/zt"
|
||||
app:tint="#CCCCCC"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
@ -187,7 +187,7 @@
|
|||
android:layout_height="36dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_weight="1"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:background="?android:attr/actionBarItemBackground"
|
||||
android:importantForAccessibility="no"
|
||||
android:src="@drawable/xyq"
|
||||
app:tint="#CCCCCC" />
|
||||
|
@ -197,7 +197,7 @@
|
|||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_weight="1"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:background="?android:attr/actionBarItemBackground"
|
||||
android:src="@drawable/gd"
|
||||
app:tint="#CCCCCC"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
@ -216,7 +216,7 @@
|
|||
android:layout_height="36dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_weight="1"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:background="?android:attr/actionBarItemBackground"
|
||||
android:src="@drawable/download"
|
||||
app:tint="#CCCCCC"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
@ -227,7 +227,7 @@
|
|||
android:layout_height="36dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_weight="1"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:background="?android:attr/actionBarItemBackground"
|
||||
android:src="@drawable/mt_sx"
|
||||
app:tint="#CCCCCC"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
|
|
@ -40,21 +40,17 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:hint="@string/search"
|
||||
tools:visibility="visible"
|
||||
app:layout_anchor="@id/toolbar">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:transitionName="edit"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
|
||||
|
||||
android:layout_height="match_parent">
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/search_recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/xxbj1"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -92,12 +88,36 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
<LinearLayout
|
||||
android:id="@+id/search_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone" />
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/search_tablayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#0000FFFF">
|
||||
|
||||
<com.google.android.material.tabs.TabItem
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="歌曲"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<com.google.android.material.tabs.TabItem
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="歌单"
|
||||
tools:ignore="HardcodedText" />
|
||||
</com.google.android.material.tabs.TabLayout>
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/search_viewPager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</com.google.android.material.search.SearchView>
|
||||
|
||||
|
@ -119,12 +139,12 @@
|
|||
|
||||
<com.muqingbfq.view.TabLayout
|
||||
android:id="@+id/tablayout"
|
||||
style="@style/Widget.Material3.CardView.Filled"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Material3.CardView.Filled"
|
||||
android:orientation="horizontal"
|
||||
app:cardCornerRadius="0dp"
|
||||
app:strokeWidth="0dp"
|
||||
android:orientation="horizontal" />
|
||||
app:strokeWidth="0dp" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
|
|
@ -2,12 +2,10 @@
|
|||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="match_parent">
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
|
|
|
@ -108,17 +108,17 @@
|
|||
android:theme="@null"
|
||||
android:thumb="@null"
|
||||
app:layout_constraintBottom_toTopOf="@id/time_a"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/time_a"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:paddingStart="6dp"
|
||||
android:text="@string/_00_00"
|
||||
android:textColor="@color/tint_image"
|
||||
android:paddingStart="6dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/linearLayout3"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:ignore="RtlSymmetry" />
|
||||
|
@ -128,10 +128,10 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:text="@string/_00_00"
|
||||
android:textColor="@color/tint_image"
|
||||
app:layout_constraintBottom_toTopOf="@id/linearLayout3"
|
||||
android:paddingEnd="6dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:ignore="RtlSymmetry" />
|
||||
|
||||
|
@ -151,7 +151,7 @@
|
|||
android:id="@+id/control"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:background="?android:attr/actionBarItemBackground"
|
||||
android:src="@drawable/mt_sx"
|
||||
app:tint="@color/tint_image"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
@ -160,7 +160,7 @@
|
|||
android:id="@+id/syq"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:background="?android:attr/actionBarItemBackground"
|
||||
android:src="@drawable/syq"
|
||||
app:tint="@color/tint_image"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
@ -169,7 +169,7 @@
|
|||
android:id="@+id/kg"
|
||||
android:layout_width="66dp"
|
||||
android:layout_height="66dp"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:background="?android:attr/actionBarItemBackground"
|
||||
android:src="@drawable/zt"
|
||||
app:tint="@color/tint_image"
|
||||
|
||||
|
@ -179,7 +179,7 @@
|
|||
android:id="@+id/xyq"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:background="?android:attr/actionBarItemBackground"
|
||||
android:src="@drawable/xyq"
|
||||
app:tint="@color/tint_image"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
@ -188,7 +188,7 @@
|
|||
android:id="@+id/bfq_list_mp3"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:background="?android:attr/actionBarItemBackground"
|
||||
android:src="@drawable/gd"
|
||||
app:tint="@color/tint_image"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
@ -207,18 +207,18 @@
|
|||
|
||||
<ImageView
|
||||
android:id="@+id/download"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:layout_width="26dp"
|
||||
android:layout_height="26dp"
|
||||
android:background="?android:attr/actionBarItemBackground"
|
||||
android:src="@drawable/download"
|
||||
app:tint="@color/tint_image"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/like"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:layout_width="26dp"
|
||||
android:layout_height="26dp"
|
||||
android:background="?android:attr/actionBarItemBackground"
|
||||
android:src="@drawable/like"
|
||||
app:tint="@color/tint_image"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingBottom="13dp"
|
||||
android:orientation="vertical"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:layout_marginStart="3dp"
|
||||
android:text="@string/name"
|
||||
android:textSize="13sp" />
|
||||
</LinearLayout>
|
||||
|
|
|
@ -29,11 +29,10 @@
|
|||
app:cardElevation="0dp"
|
||||
app:cardUseCompatPadding="true">
|
||||
|
||||
<com.muqingbfq.view.RecyclerViewH
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusableInTouchMode="false"
|
||||
android:nestedScrollingEnabled="false"
|
||||
tools:itemCount="6" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
@ -84,8 +83,8 @@
|
|||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false" />
|
||||
android:layout_height="wrap_content"
|
||||
android:nestedScrollingEnabled="false"/>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
Loading…
Reference in New Issue
Block a user