修复了播放器UI显示异常

实现了搜索歌单的效果
修复了部分BUG
This commit is contained in:
muqing 2023-12-02 13:00:08 +08:00
parent 5645afe283
commit 93ce3bfd29
34 changed files with 441 additions and 276 deletions

View File

@ -8,7 +8,7 @@
<inspection_tool class="ArgumentSelectionDefects" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="ArgumentSelectionDefects" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="ArrayIndexOutOfBounds" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="ArrayIndexOutOfBounds" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AutoCloseableResource" enabled="true" level="WARNING" enabled_by_default="true"> <inspection_tool class="AutoCloseableResource" enabled="true" level="WARNING" enabled_by_default="true">
<option name="METHOD_MATCHER_CONFIG" value="java.util.Formatter,format,java.io.Writer,append,com.google.common.base.Preconditions,checkNotNull,org.hibernate.Session,close,java.io.PrintWriter,printf,java.io.PrintStream,printf,okhttp3.Call,execute,android.app.DownloadManager,query" /> <option name="METHOD_MATCHER_CONFIG" value="java.util.Formatter,format,java.io.Writer,append,com.google.common.base.Preconditions,checkNotNull,org.hibernate.Session,close,java.io.PrintWriter,printf,java.io.PrintStream,printf,okhttp3.Call,execute,android.app.DownloadManager,query,android.content.Context,obtainStyledAttributes" />
</inspection_tool> </inspection_tool>
<inspection_tool class="ClangTidy" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="ClangTidy" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="ClangdErrorsAndWarnings" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="ClangdErrorsAndWarnings" enabled="false" level="WARNING" enabled_by_default="false" />
@ -39,6 +39,7 @@
<inspection_tool class="IncompatibleEnums" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="IncompatibleEnums" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="IncompatibleInitializers" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="IncompatibleInitializers" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="IncompatiblePointers" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="IncompatiblePointers" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="InnerClassMayBeStatic" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="KRUnspecifiedParameters" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="KRUnspecifiedParameters" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="LocalValueEscapesScope" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="LocalValueEscapesScope" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="LoopDoesntUseConditionVariable" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="LoopDoesntUseConditionVariable" enabled="false" level="WARNING" enabled_by_default="false" />

View File

@ -18,7 +18,8 @@ android {
//noinspection OldTargetApi //noinspection OldTargetApi
targetSdk 31 targetSdk 31
versionCode 1 versionCode 1
versionName "1.6.8" versionName "1.7.0"
} }
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
@ -37,6 +38,9 @@ android {
outputFileName = "Cloud_music-${variant.name}-v${variant.versionName}.apk" outputFileName = "Cloud_music-${variant.name}-v${variant.versionName}.apk"
} }
} }
viewBinding {
enabled = true
}
} }
dependencies { dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.appcompat:appcompat:1.6.1'

View File

@ -12,8 +12,8 @@
"filters": [], "filters": [],
"attributes": [], "attributes": [],
"versionCode": 1, "versionCode": 1,
"versionName": "1.6.8", "versionName": "1.7.0",
"outputFile": "Cloud_music-debug-v1.6.8.apk" "outputFile": "Cloud_music-debug-v1.7.0.apk"
} }
], ],
"elementType": "File" "elementType": "File"

View File

@ -52,7 +52,7 @@
<activity android:name=".activity_search" /> <activity android:name=".activity_search" />
<activity <activity
android:name=".bfq" android:name=".bfq"
android:configChanges="screenSize|smallestScreenSize|orientation|screenLayout" android:configChanges="orientation|screenLayout"
android:theme="@style/fragment_dialog" /> android:theme="@style/fragment_dialog" />
<activity android:name=".fragment.mp3" /> <activity android:name=".fragment.mp3" />

View File

@ -18,7 +18,9 @@ import com.bumptech.glide.load.engine.GlideException;
import com.bumptech.glide.request.RequestListener; import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.target.Target; import com.bumptech.glide.request.target.Target;
import com.muqingbfq.fragment.Media; import com.muqingbfq.fragment.Media;
import com.muqingbfq.fragment.bflb_db;
import com.muqingbfq.fragment.bfq_db; import com.muqingbfq.fragment.bfq_db;
import com.muqingbfq.fragment.search;
import com.muqingbfq.mq.gj; import com.muqingbfq.mq.gj;
public class MediaPlayer { public class MediaPlayer {
@ -178,5 +180,12 @@ public class MediaPlayer {
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();
} }
if (search.lbspq != null) {
search.lbspq.notifyDataSetChanged();
}
if (bflb_db.adapter != null) {
bflb_db.adapter.notifyDataSetChanged();
gj.sc(1);
}
} }
} }

View File

@ -25,7 +25,9 @@ import com.google.android.flexbox.FlexDirection;
import com.google.android.flexbox.FlexWrap; import com.google.android.flexbox.FlexWrap;
import com.google.android.flexbox.FlexboxLayoutManager; 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.fragment.search; import com.muqingbfq.fragment.search;
import com.muqingbfq.mq.ActivityToolbar;
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;
@ -37,25 +39,22 @@ 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 AppCompatActivity { public class activity_search extends ActivityToolbar {
private EditText editText; private EditText editText;
private ArrayAdapter<String> adapter; private ArrayAdapter<String> adapter;
private SearchRecordAdapter recordAdapter;
private JSONObject json = new JSONObject(); private JSONObject json = new JSONObject();
private final List<String> json_list = new ArrayList<>(); private final List<String> json_list = new ArrayList<>();
private final List<String> list = new ArrayList<>(); private final List<String> list = new ArrayList<>();
ListView listPopupWindow; ListView listPopupWindow;
public static AppCompatActivity appCompatActivity; ActivitySearchBinding inflate;
@SuppressLint({"RestrictedApi", "NotifyDataSetChanged"}) @SuppressLint({"RestrictedApi", "NotifyDataSetChanged"})
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_search); inflate = ActivitySearchBinding.inflate(getLayoutInflater());
appCompatActivity = this; setContentView(inflate.getRoot());
setSupportActionBar(findViewById(R.id.toolbar));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
RecyclerView recyclerView = findViewById(R.id.list_recycler); RecyclerView recyclerView = findViewById(R.id.list_recycler);
FlexboxLayoutManager manager = new FlexboxLayoutManager(this); FlexboxLayoutManager manager = new FlexboxLayoutManager(this);
//设置主轴排列方式 //设置主轴排列方式
@ -64,7 +63,7 @@ public class activity_search extends AppCompatActivity {
manager.setFlexWrap(FlexWrap.WRAP); manager.setFlexWrap(FlexWrap.WRAP);
manager.setAlignItems(AlignItems.STRETCH); manager.setAlignItems(AlignItems.STRETCH);
recyclerView.setLayoutManager(manager); recyclerView.setLayoutManager(manager);
SearchRecordAdapter recordAdapter = new SearchRecordAdapter(); new SearchRecordAdapter();
recyclerView.setAdapter(recordAdapter); recyclerView.setAdapter(recordAdapter);
editText = findViewById(R.id.editview); editText = findViewById(R.id.editview);
@ -77,7 +76,7 @@ public class activity_search extends AppCompatActivity {
} }
return false; return false;
}); });
findViewById(R.id.deleat).setOnClickListener(v -> new MaterialAlertDialogBuilder(v.getContext()) inflate.deleat.setOnClickListener(v -> new MaterialAlertDialogBuilder(v.getContext())
.setTitle("删除") .setTitle("删除")
.setMessage("清空历史记录?") .setMessage("清空历史记录?")
.setNegativeButton("取消", null) .setNegativeButton("取消", null)
@ -116,7 +115,7 @@ public class activity_search extends AppCompatActivity {
@Override @Override
public void onTextChanged(CharSequence s, int start, int before, int count) { public void onTextChanged(CharSequence s, int start, int before, int count) {
if (TextUtils.isEmpty(s)){ if (TextUtils.isEmpty(s)) {
dismiss(); dismiss();
return; return;
} }
@ -146,6 +145,7 @@ public class activity_search extends AppCompatActivity {
} }
}.start(); }.start();
} }
@Override @Override
public void afterTextChanged(Editable s) { public void afterTextChanged(Editable s) {
} }
@ -221,8 +221,9 @@ public class activity_search extends AppCompatActivity {
} }
} }
if (json_list.isEmpty()) { if (json_list.isEmpty()) {
findViewById(R.id.xxbj1).setVisibility(View.INVISIBLE); inflate.xxbj1.setVisibility(View.INVISIBLE);
} }
recordAdapter = this;
} }
@NonNull @NonNull
@ -270,5 +271,6 @@ public class activity_search extends AppCompatActivity {
} else { } else {
finish(); finish();
} }
com.muqingbfq.fragment.search.lbspq = null;
} }
} }

View File

@ -20,6 +20,11 @@ public class playlist extends Thread {
public static final String api = "/playlist/track/all?id="; public static final String api = "/playlist/track/all?id=";
@SuppressLint("NotifyDataSetChanged") @SuppressLint("NotifyDataSetChanged")
public static boolean hq(List<xm> list, String uid) { public static boolean hq(List<xm> list, String uid) {
if (uid.equals("mp3_xz.json")) {
return playlist.hq_xz(list);
} else if (uid.equals("mp3_like.json")) {
return playlist.hq_like(list);
}
list.clear(); list.clear();
try { try {
String hq; String hq;
@ -48,7 +53,6 @@ public class playlist extends Thread {
String picUrl = al.getString("picUrl"); String picUrl = al.getString("picUrl");
list.add(new xm(id, name, zz.toString(), picUrl)); list.add(new xm(id, name, zz.toString(), picUrl));
} }
// main.handler.post(new mp3.lbspq_sx());
return true; return true;
} catch (Exception e) { } catch (Exception e) {
gj.sc("失败的错误 " + e); gj.sc("失败的错误 " + e);
@ -56,7 +60,7 @@ public class playlist extends Thread {
return false; return false;
} }
public static void hq_like(List<xm> list) { public static boolean hq_like(List<xm> list) {
list.clear(); list.clear();
try { try {
JSONObject json = gd.like; JSONObject json = gd.like;
@ -69,12 +73,14 @@ public class playlist extends Thread {
list.add(new xm(id, name, zz, picUrl)); list.add(new xm(id, name, zz, picUrl));
} }
main.handler.post(new mp3.lbspq_sx()); main.handler.post(new mp3.lbspq_sx());
return true;
} catch (Exception e) { } catch (Exception e) {
gj.sc("失败的错误 " + e); gj.sc("失败的错误 " + e);
} }
return false;
} }
public static void hq_xz(List<xm> list) { public static boolean hq_xz(List<xm> list) {
list.clear(); list.clear();
try { try {
JSONArray json = new JSONObject(wj.dqwb(wj.mp3_xz)) JSONArray json = new JSONObject(wj.dqwb(wj.mp3_xz))
@ -88,10 +94,11 @@ public class playlist extends Thread {
String picUrl = jsonObject.getString("picUrl"); String picUrl = jsonObject.getString("picUrl");
list.add(new xm(id, name, zz, picUrl)); list.add(new xm(id, name, zz, picUrl));
} }
// main.handler.post(new mp3.lbspq_sx()); return true;
} catch (Exception e) { } catch (Exception e) {
gj.sc("失败的错误 " + e); gj.sc("失败的错误 " + e);
wj.sc(wj.mp3_xz); wj.sc(wj.mp3_xz);
} }
return false;
} }
} }

View File

@ -77,7 +77,6 @@ public class resource {
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));
try { try {
// JSONArray date = jsonObject.getJSONArray("");
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(); ) {
String id = it.next(); String id = it.next();

View File

@ -3,35 +3,38 @@ package com.muqingbfq;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.os.Bundle; import android.os.Bundle;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import com.muqingbfq.databinding.ActivityBfqBinding;
import com.muqingbfq.fragment.Media; import com.muqingbfq.fragment.Media;
import com.muqingbfq.mq.gj;
public class bfq extends AppCompatActivity { public class bfq extends AppCompatActivity {
@SuppressLint("StaticFieldLeak") @SuppressLint("StaticFieldLeak")
public static AppCompatActivity context; public static AppCompatActivity context;
@Override @Override
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
context = this; context = this;
setContentView(R.layout.activity_bfq); ActivityBfqBinding inflate = ActivityBfqBinding.inflate(getLayoutInflater());
Toolbar toolbar = findViewById(R.id.toolbar); setContentView(inflate.getRoot());
toolbar.setNavigationIcon(R.drawable.end); Toolbar toolbar = inflate.toolbar;
toolbar.setNavigationOnClickListener(view1 -> finish()); toolbar.setNavigationOnClickListener(view1 -> finish());
toolbar.inflateMenu(R.menu.bfq);
toolbar.setOnMenuItemClickListener(item -> { toolbar.setOnMenuItemClickListener(item -> {
if (item.getItemId() == R.id.fx) { if (item.getItemId() == R.id.fx && bfqkz.xm != null) {
if (bfqkz.xm != null) { com.muqingbfq.mq.gj.fx(this,
com.muqingbfq.mq.gj.fx(this, "音乐名称:" + bfqkz.xm.name +
"音乐名称:" + bfqkz.xm.name + "\n 作者:" + bfqkz.xm.zz +
"\n 作者:" + bfqkz.xm.zz + "\n 链接https://music.163.com/#/song?id=" + bfqkz.xm.id);
"\n 链接https://music.163.com/#/song?id=" + bfqkz.xm.id);
}
} }
return false; return false;
}); });
@ -39,8 +42,15 @@ public class bfq extends AppCompatActivity {
Media.setname(bfqkz.xm.name); Media.setname(bfqkz.xm.name);
Media.setzz(bfqkz.xm.zz); Media.setzz(bfqkz.xm.zz);
} }
inflate.name.setOnLongClickListener(view -> {
gj.fz(bfq.this, inflate.name.getText().toString());
gj.ts(bfq.this, "复制成功");
return false;
});
} }
public static Bitmap bitmap; public static Bitmap bitmap;
public static void start(Context context) { public static void start(Context context) {
Intent intent = new Intent(); Intent intent = new Intent();
intent.setClass(context, bfq.class); intent.setClass(context, bfq.class);
@ -49,7 +59,8 @@ public class bfq extends AppCompatActivity {
} }
@Override @Override
public void finish() { public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.finish(); super.onConfigurationChanged(newConfig);
Media.view = null;
} }
} }

View File

@ -8,6 +8,7 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.SeekBar; import android.widget.SeekBar;
import android.widget.TextView; import android.widget.TextView;
@ -16,12 +17,13 @@ import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import com.bumptech.glide.Glide;
import com.muqingbfq.R; import com.muqingbfq.R;
import com.muqingbfq.api.url; import com.muqingbfq.api.url;
import com.muqingbfq.bfq; 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.databinding.FragmentBfqBinding;
import com.muqingbfq.home;
import com.muqingbfq.main; import com.muqingbfq.main;
import org.json.JSONObject; import org.json.JSONObject;
@ -30,7 +32,7 @@ import me.wcy.lrcview.LrcView;
public class Media extends Fragment { public class Media extends Fragment {
@SuppressLint("StaticFieldLeak") @SuppressLint("StaticFieldLeak")
public static View view; public static LinearLayout view;
@SuppressLint("StaticFieldLeak") @SuppressLint("StaticFieldLeak")
private static TextView time_a, time_b; private static TextView time_a, time_b;
@SuppressLint("StaticFieldLeak") @SuppressLint("StaticFieldLeak")
@ -84,18 +86,22 @@ public class Media extends Fragment {
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) { @Nullable Bundle savedInstanceState) {
if (view != null) { if (view != null) {
main.handler.post(Media::setImageBitmap);
return view; return view;
} }
view = inflater.inflate(R.layout.fragment_bfq, container, false); FragmentBfqBinding inflate = FragmentBfqBinding.inflate(inflater, container, false);
view = inflate.getRoot();
/* if (home.imageView == null) {
home.imageView = new ImageView(home.appCompatActivity);
home.imageView.setScaleType(ImageView.ScaleType.FIT_XY);
home.imageView.setImageResource(R.drawable.icon);
}*/
inflate.cardview.addView(home.imageView);
bfq_an.kz kz = new bfq_an.kz(); bfq_an.kz kz = new bfq_an.kz();
ImageView kg = view.findViewById(R.id.kg); ImageView kg = view.findViewById(R.id.kg);
kg.setOnClickListener(kz); kg.setOnClickListener(kz);
view.findViewById(R.id.xyq).setOnClickListener(kz); view.findViewById(R.id.xyq).setOnClickListener(kz);
view.findViewById(R.id.syq).setOnClickListener(kz); view.findViewById(R.id.syq).setOnClickListener(kz);
ImageView tx = view.findViewById(R.id.mttx); tdt = inflate.tdt;
tdt = view.findViewById(R.id.tdt);
tdt.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { tdt.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override @Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
@ -116,10 +122,9 @@ public class Media extends Fragment {
} }
}); });
time_a = view.findViewById(R.id.time_a); time_a = inflate.timeA;
time_b = view.findViewById(R.id.time_b); time_b = inflate.timeB;
//初始化歌词组件 //初始化歌词组件
View kp = view.findViewById(R.id.kp1);
lrcview = getlrcView(); 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));
@ -127,6 +132,7 @@ public class Media extends Fragment {
}); });
if (!isTablet(bfq.context)) { if (!isTablet(bfq.context)) {
lrcview.setOnTapListener((view, x, y) -> { lrcview.setOnTapListener((view, x, y) -> {
View kp = inflate.kp1;
if (kp.getVisibility() == View.VISIBLE) { if (kp.getVisibility() == View.VISIBLE) {
kp.setVisibility(View.GONE); kp.setVisibility(View.GONE);
} else { } else {
@ -135,10 +141,10 @@ public class Media extends Fragment {
}); });
} }
//初始化播放器列表 //初始化播放器列表
view.findViewById(R.id.bfq_list_mp3). inflate.bfqListMp3.
setOnClickListener(view1 -> com.muqingbfq.fragment.bflb_db.start(bfq.context)); setOnClickListener(view1 -> com.muqingbfq.fragment.bflb_db.start(bfq.context));
view.findViewById(R.id.like).setOnClickListener(view1 -> { inflate.like.setOnClickListener(view1 -> {
ImageView like = (ImageView) view1; ImageView like = (ImageView) view1;
try { try {
if (bfqkz.like_bool) { if (bfqkz.like_bool) {
@ -160,8 +166,8 @@ public class Media extends Fragment {
e.printStackTrace(); e.printStackTrace();
} }
}); });
ImageView control = view.findViewById(R.id.control);
control.setOnClickListener(new bfq_an.control(control)); inflate.control.setOnClickListener(new bfq_an.control(inflate.control));
if (bfqkz.xm != null) { if (bfqkz.xm != null) {
main.handler.removeCallbacks(bfqkz.mt.updateSeekBar); // 在播放开始时启动更新进度 main.handler.removeCallbacks(bfqkz.mt.updateSeekBar); // 在播放开始时启动更新进度
long duration = bfqkz.mt.build.getDuration(); long duration = bfqkz.mt.build.getDuration();
@ -175,10 +181,6 @@ public class Media extends Fragment {
if (bfqkz.mt.build.isPlaying()) { if (bfqkz.mt.build.isPlaying()) {
kg.setImageResource(R.drawable.bf); kg.setImageResource(R.drawable.bf);
} }
Glide.with(getContext())
.load(bfqkz.xm.picurl)
.error(R.drawable.icon)//图片加载失败后显示的图片
.into(tx);
bfq_an.islike(bfq.context); bfq_an.islike(bfq.context);
new Thread() { new Thread() {
@Override @Override
@ -192,8 +194,7 @@ public class Media extends Fragment {
} }
private boolean isTablet(Context context) { private boolean isTablet(Context context) {
return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
>= Configuration.SCREENLAYOUT_SIZE_LARGE;
} }
public static LrcView getlrcView() { public static LrcView getlrcView() {
@ -202,9 +203,11 @@ public class Media extends Fragment {
} }
return view.findViewById(R.id.gc); return view.findViewById(R.id.gc);
} }
public static void loadLyric(String a, String b) { public static void loadLyric(String a, String b) {
lrcview.loadLrc(a, b); lrcview.loadLrc(a, b);
} }
public static void setlike(boolean bool) { public static void setlike(boolean bool) {
ImageView imageView = view.findViewById(R.id.like); ImageView imageView = view.findViewById(R.id.like);
int color = R.color.text; int color = R.color.text;
@ -216,13 +219,10 @@ public class Media extends Fragment {
} }
public static void setImageBitmap() { public static void setImageBitmap() {
if (view == null) { if (home.imageView == null) {
return; return;
} }
ImageView imageView = view.findViewById(R.id.mttx); main.handler.post(() -> home.imageView.setImageBitmap(bfq.bitmap));
if (imageView != null) {
main.handler.post(() -> imageView.setImageBitmap(bfq.bitmap));
}
} }
public static void setname(String str) { public static void setname(String str) {

View File

@ -21,7 +21,7 @@ import com.muqingbfq.yc;
public class bflb_db extends BottomSheetDialog { public class bflb_db extends BottomSheetDialog {
public static String gdid; public static String gdid;
public static RecyclerView.Adapter<MyViewHoder> adapter;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -55,6 +55,9 @@ public class bflb_db extends BottomSheetDialog {
} }
class spq extends RecyclerView.Adapter<MyViewHoder> { class spq extends RecyclerView.Adapter<MyViewHoder> {
public spq() {
adapter = this;
}
@NonNull @NonNull
@Override @Override
public MyViewHoder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { public MyViewHoder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
@ -73,7 +76,7 @@ public class bflb_db extends BottomSheetDialog {
} }
holder.name.setTextColor(color); holder.name.setTextColor(color);
holder.zz.setTextColor(color); holder.zz.setTextColor(color);
holder.view.setOnClickListener(view -> { holder.itemView.setOnClickListener(view -> {
if (bfqkz.xm != x) { if (bfqkz.xm != x) {
bfqkz.xm = x; bfqkz.xm = x;
new url(x); new url(x);
@ -87,4 +90,9 @@ public class bflb_db extends BottomSheetDialog {
} }
} }
@Override
public void dismiss() {
super.dismiss();
adapter = null;
}
} }

View File

@ -7,13 +7,14 @@ import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
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 com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.request.RequestOptions;
@ -27,6 +28,7 @@ import com.muqingbfq.bfqkz;
import com.muqingbfq.list.list_gd; import com.muqingbfq.list.list_gd;
import com.muqingbfq.main; import com.muqingbfq.main;
import com.muqingbfq.mq.wj; import com.muqingbfq.mq.wj;
import com.muqingbfq.xm;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
@ -34,22 +36,22 @@ import org.json.JSONObject;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.muqingbfq.xm;
public class gd extends Fragment { public class gd extends Fragment {
public static String gdid; public static String gdid;
public static BaseAdapter lbspq; public static RecyclerView.Adapter<VH> lbspq;
public static List<xm> list; public List<xm> list = new ArrayList<>();
public static JSONObject like = new JSONObject(); public static JSONObject like = new JSONObject();
GridView gridView; RecyclerView gridView;
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_gd, container, false); View view = inflater.inflate(R.layout.fragment_gd, container, false);
list = new ArrayList<>(); lbspq = new baseadapter(view.getContext(),list);
lbspq = new baseadapter(view.getContext());
gridView = view.findViewById(R.id.wgbj); gridView = view.findViewById(R.id.wgbj);
int k = (int) (main.k / getResources().getDisplayMetrics().density + 0.5f);
GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(), k / 120);
gridView.setLayoutManager(gridLayoutManager);
gridView.setAdapter(lbspq); gridView.setAdapter(lbspq);
if (gdid == null) { if (gdid == null) {
gdid = main.mp3_csh; gdid = main.mp3_csh;
@ -64,13 +66,13 @@ public class gd extends Fragment {
tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override @Override
public void onTabSelected(TabLayout.Tab tab) { public void onTabSelected(TabLayout.Tab tab) {
list.clear();
lbspq.notifyDataSetChanged();
new thread(tab.getText().toString()); new thread(tab.getText().toString());
} }
@Override @Override
public void onTabUnselected(TabLayout.Tab tab) { public void onTabUnselected(TabLayout.Tab tab) {
} }
@Override @Override
public void onTabReselected(TabLayout.Tab tab) { public void onTabReselected(TabLayout.Tab tab) {
} }
@ -85,68 +87,47 @@ public class gd extends Fragment {
return view; return view;
} }
class baseadapter extends BaseAdapter { public static class baseadapter extends RecyclerView.Adapter<VH> {
Context context; Context context;
LayoutInflater layoutInflater; List<xm> list;
public baseadapter(Context context, List<xm> list) {
public baseadapter(Context context) {
this.context = context; this.context = context;
layoutInflater = LayoutInflater.from(context); this.list = list;
}
@NonNull
@Override
public VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context)
.inflate(R.layout.list_gd, parent, false);
return new VH(view);
} }
@Override @Override
public int getCount() { public void onBindViewHolder(@NonNull VH holder, int position) {
return list.size(); xm xm = list.get(position);
}
@Override
public Object getItem(int i) {
return list.get(i);
}
@Override
public long getItemId(int i) {
return i;
}
@SuppressLint({"ResourceAsColor", "InflateParams", "ClickableViewAccessibility"})
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
ViewHoder viewHoder;
xm xm = list.get(i);
if (view == null) {
viewHoder = new ViewHoder();
view = layoutInflater.inflate(R.layout.list_gd, null, false);
viewHoder.textView = view.findViewById(R.id.wb1);
viewHoder.imageView = view.findViewById(R.id.fh);
viewHoder.cardView = view.findViewById(R.id.cardview);
viewHoder.kg = view.findViewById(R.id.kg);
view.setTag(viewHoder);
} else {
viewHoder = (ViewHoder) view.getTag();
}
list_gd gd = new list_gd(xm); list_gd gd = new list_gd(xm);
viewHoder.cardView.setOnClickListener(gd); holder.cardView.setOnClickListener(gd);
viewHoder.cardView.setOnLongClickListener(gd); holder.cardView.setOnLongClickListener(gd);
viewHoder.textView.setText(xm.name); holder.textView.setText(xm.name);
viewHoder.kg.setOnClickListener(view1 -> { holder.kg.setOnClickListener(view1 -> {
ImageView tx = (ImageView) view1; ImageView tx = (ImageView) view1;
new Thread() { new Thread() {
@SuppressLint("NotifyDataSetChanged")
@Override @Override
public void run() { public void run() {
super.run(); super.run();
boolean an=playlist.hq(bfqkz.list, xm.id); boolean an = playlist.hq(bfqkz.list, xm.id);
main.handler.post(() -> { main.handler.post(() -> {
if (an) { if (an) {
bfq_an.xyq(); bfq_an.xyq();
tx.setImageResource(R.drawable.bf); tx.setImageResource(R.drawable.bf);
main.edit.putString(main.mp3, xm.id); main.edit.putString(main.mp3, xm.id);
main.edit.commit(); main.edit.commit();
main.mp3_csh = gdid = xm.id; main.mp3_csh = gdid = xm.id;
} }
com.muqingbfq.fragment.gd.lbspq.notifyDataSetChanged(); com.muqingbfq.fragment.gd.lbspq.notifyDataSetChanged();
}); });
} }
}.start(); }.start();
}); });
int color = ContextCompat.getColor(context, R.color.text); int color = ContextCompat.getColor(context, R.color.text);
@ -157,19 +138,31 @@ public class gd extends Fragment {
} else if (xm.cz) { } else if (xm.cz) {
color = ContextCompat.getColor(context, R.color.text_cz_tm); color = ContextCompat.getColor(context, R.color.text_cz_tm);
} }
viewHoder.kg.setImageDrawable(color_kg); holder.kg.setImageDrawable(color_kg);
viewHoder.textView.setTextColor(color); holder.textView.setTextColor(color);
Glide.with(context).load(xm.picurl).apply(new RequestOptions().placeholder(R.drawable.icon)) Glide.with(context).load(xm.picurl).apply(new RequestOptions().placeholder(R.drawable.icon))
.into(viewHoder.imageView); .into(holder.imageView);
// new wl(xm.picurl, Glide.with(context)).loadImage(bitmap -> viewHoder.imageView.setImageBitmap(bitmap));
return view;
} }
@Override
public int getItemCount() {
return list.size();
}
} }
class ViewHoder { static class VH extends RecyclerView.ViewHolder {
TextView textView; TextView textView;
ImageView imageView, kg; ImageView imageView, kg;
MaterialCardView cardView; MaterialCardView cardView;
public VH(@NonNull View itemView) {
super(itemView);
textView = itemView.findViewById(R.id.wb1);
imageView = itemView.findViewById(R.id.fh);
cardView = itemView.findViewById(R.id.cardview);
kg = itemView.findViewById(R.id.kg);
}
} }
class thread extends Thread { class thread extends Thread {
@ -177,9 +170,11 @@ public class gd extends Fragment {
public thread(String name) { public thread(String name) {
this.name = name; this.name = name;
list.clear();
start(); start();
} }
@SuppressLint("NotifyDataSetChanged")
@Override @Override
public void run() { public void run() {
super.run(); super.run();

View File

@ -107,16 +107,13 @@ public class mp3 extends AppCompatActivity {
} }
holder.name.setTextColor(color); holder.name.setTextColor(color);
holder.zz.setTextColor(color); holder.zz.setTextColor(color);
holder.view.setOnClickListener(view -> { holder.itemView.setOnClickListener(view -> {
if (bfqkz.xm == null || !bfqkz.xm.id.equals(x.id)) { if (bfqkz.xm == null || !bfqkz.xm.id.equals(x.id)) {
bfqkz.xm = x; bfqkz.xm = x;
new url(x); new url(x);
} }
bfqkz.list.clear(); bfqkz.list.clear();
int size = list.size(); bfqkz.list.addAll(list);
for (int i = 0; i < size; i++) {
bfqkz.list.add(list.get(i));
}
bfq.start(mp3.this); bfq.start(mp3.this);
}); });
} }

View File

@ -11,17 +11,20 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
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.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.tabs.TabLayout;
import com.muqingbfq.R; import com.muqingbfq.R;
import com.muqingbfq.activity_search;
import com.muqingbfq.api.url; 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.FragmentSearchBinding;
import com.muqingbfq.list.MyViewHoder; import com.muqingbfq.list.MyViewHoder;
import com.muqingbfq.main; import com.muqingbfq.main;
import com.muqingbfq.mq.gj; import com.muqingbfq.mq.gj;
import com.muqingbfq.mq.wj;
import com.muqingbfq.mq.wl; import com.muqingbfq.mq.wl;
import com.muqingbfq.xm; import com.muqingbfq.xm;
@ -32,50 +35,72 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
public class search extends Fragment { public class search extends Fragment {
View view; public static RecyclerView.Adapter<MyViewHoder> lbspq;
RecyclerView.Adapter<MyViewHoder> lbspq;
List<xm> list = new ArrayList<>(); List<xm> list = new ArrayList<>();
private String name;
FragmentSearchBinding inflate;
private int i = 0;
@Nullable @Nullable
@Override @Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
view = inflater.inflate(R.layout.fragment_search, container, false); @Nullable Bundle savedInstanceState) {
inflate = FragmentSearchBinding.inflate(inflater, container, false);
View view = inflate.getRoot();
TypedValue typedValue = new TypedValue(); TypedValue typedValue = new TypedValue();
requireContext().getTheme().resolveAttribute(android.R.attr.windowBackground, typedValue, true); requireContext().getTheme().resolveAttribute(android.R.attr.windowBackground, typedValue, true);
// 设置背景颜色 // 设置背景颜色
view.setBackgroundColor(typedValue.data);
RecyclerView lb = view.findViewById(R.id.recyclerview);
LinearLayoutManager manager = new LinearLayoutManager(getContext());
lb.setLayoutManager(manager);
lbspq = new spq(); lbspq = new spq();
lb.setAdapter(lbspq); view.setBackgroundColor(typedValue.data);
inflate.tablayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
// 当用户再次选择已选择的选项卡时调用
search.this.i = tab.getPosition();
setStart(name);
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
// 当选项卡退出选定状态时调用
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
// 当选项卡进入选定状态时调用
}
});
setVisibility(false); setVisibility(false);
return view; return view;
} }
public void setVisibility(boolean bool) { public void setVisibility(boolean bool) {
if (bool) { if (bool) {
view.setVisibility(View.VISIBLE); inflate.getRoot().setVisibility(View.VISIBLE);
} else { } else {
view.setVisibility(View.GONE); inflate.getRoot().setVisibility(View.GONE);
} }
} }
public boolean getVisibility() { public boolean getVisibility() {
return view.isShown(); return inflate.getRoot().isShown();
} }
public void setStart(String name) { public void setStart(String name) {
setVisibility(true); setVisibility(true);
list.clear(); gj.sc(i);
new start(name); new start(name);
} }
public class start extends Thread { public class start extends Thread {
String name;
public start(String name) { public start(String name) {
this.name = name; list.clear();
search.this.name = name;
start(); start();
} }
@ -83,41 +108,85 @@ public class search extends Fragment {
@Override @Override
public void run() { public void run() {
super.run(); super.run();
String hq = wl.hq("/search?keywords=" + name); if (i == 0) {
try { mp3();
JSONArray jsonArray = new JSONObject(hq).getJSONObject("result") } else if (i == 1) {
.getJSONArray("songs"); gd();
int length = jsonArray.length();
for (int i = 0; i < length; i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
String id = jsonObject.getString("id");
String name = jsonObject.getString("name");
JSONArray artists = jsonObject.getJSONArray("artists");
int length1 = artists.length();
StringBuilder zz = null;
for (int j = 0; j < length1; j++) {
JSONObject josn = artists.getJSONObject(j);
String name_zz = josn.getString("name");
if (zz == null) {
zz = new StringBuilder(name_zz);
} else {
zz.append("/").append(name_zz);
}
}
list.add(new xm(id, name, zz.toString(), ""));
}
main.handler.post(() -> lbspq.notifyDataSetChanged());
} catch (Exception e) {
gj.sc(e);
} }
main.handler.post(() -> {
if (i == 0) {
inflate.recyclerview.setLayoutManager(new LinearLayoutManager(getContext()));
inflate.recyclerview.setAdapter(new spq());
} else if (i == 1) {
int k = (int) (main.k / getResources().getDisplayMetrics().density + 0.5f);
GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(), 3);
inflate.recyclerview.setLayoutManager(gridLayoutManager);
inflate.recyclerview.setAdapter(new gd.baseadapter(getContext(), list));
}
// lbspq.notifyDataSetChanged();
});
}
}
private void mp3() {
String hq = wl.hq("/search?keywords=" + name + "&type=1");
try {
JSONArray jsonArray = new JSONObject(hq).getJSONObject("result")
.getJSONArray("songs");
int length = jsonArray.length();
for (int i = 0; i < length; i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
String id = jsonObject.getString("id");
String name = jsonObject.getString("name");
JSONArray artists = jsonObject.getJSONArray("artists");
int length1 = artists.length();
StringBuilder zz = null;
for (int j = 0; j < length1; j++) {
JSONObject josn = artists.getJSONObject(j);
String name_zz = josn.getString("name");
if (zz == null) {
zz = new StringBuilder(name_zz);
} else {
zz.append("/").append(name_zz);
}
}
list.add(new xm(id, name, zz.toString(), ""));
}
} catch (Exception e) {
gj.sc(e);
}
}
private void gd() {
String hq = wl.hq("/search?keywords=" + name + "&type=1000");
try {
JSONArray jsonArray = new JSONObject(hq).getJSONObject("result")
.getJSONArray("playlists");
int length = jsonArray.length();
for (int i = 0; i < length; i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
String id = jsonObject.getString("id");
String name = jsonObject.getString("name");
String coverImgUrl = jsonObject.getString("coverImgUrl");
// gj.sc(name);
list.add(new xm(id, name, coverImgUrl, wj.cz(wj.gd + id)));
}
} catch (Exception e) {
gj.sc(e);
} }
} }
class spq extends RecyclerView.Adapter<MyViewHoder> { class spq extends RecyclerView.Adapter<MyViewHoder> {
public spq() {
lbspq = this;
}
@NonNull @NonNull
@Override @Override
public MyViewHoder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { public MyViewHoder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_mp3, parent, false); View view = LayoutInflater.
from(parent.getContext()).inflate(R.layout.list_mp3, parent, false);
return new MyViewHoder(view); return new MyViewHoder(view);
} }
@ -132,7 +201,7 @@ public class search extends Fragment {
} }
holder.name.setTextColor(color); holder.name.setTextColor(color);
holder.zz.setTextColor(color); holder.zz.setTextColor(color);
holder.view.setOnClickListener(view1 -> { holder.itemView.setOnClickListener(view1 -> {
if (bfqkz.xm == null || !bfqkz.xm.id.equals(x.id)) { if (bfqkz.xm == null || !bfqkz.xm.id.equals(x.id)) {
bfqkz.xm = x; bfqkz.xm = x;
new url(x); new url(x);
@ -145,7 +214,7 @@ public class search extends Fragment {
} }
} }
bfqkz.mt.start(); bfqkz.mt.start();
bfq.start(activity_search.appCompatActivity); bfq.start(getContext());
}); });
} }

View File

@ -7,6 +7,7 @@ import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.widget.ImageView;
import androidx.appcompat.app.ActionBarDrawerToggle; import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
@ -21,6 +22,7 @@ import com.muqingbfq.mq.gj;
public class home extends AppCompatActivity { public class home extends AppCompatActivity {
@SuppressLint("StaticFieldLeak") @SuppressLint("StaticFieldLeak")
public static AppCompatActivity appCompatActivity; public static AppCompatActivity appCompatActivity;
public static ImageView imageView;
@SuppressLint({"CommitTransaction", "ObsoleteSdkInt"}) @SuppressLint({"CommitTransaction", "ObsoleteSdkInt"})
@Override @Override
@ -30,7 +32,14 @@ public class home extends AppCompatActivity {
setContentView(R.layout.activity_home); setContentView(R.layout.activity_home);
appCompatActivity = this; appCompatActivity = this;
new start(); new start();
Media.view = null; if (imageView == null) {
imageView = new ImageView(this);
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
imageView.setImageResource(R.drawable.icon);
}
if (bfq.bitmap != null) {
Media.setImageBitmap();
}
try { try {
//初始化工具栏 //初始化工具栏
Toolbar toolbar = findViewById(R.id.toolbar); Toolbar toolbar = findViewById(R.id.toolbar);
@ -61,6 +70,7 @@ public class home extends AppCompatActivity {
} }
private static Intent serviceIntent; private static Intent serviceIntent;
@Override @Override
protected void onPause() { protected void onPause() {
super.onPause(); super.onPause();
@ -81,6 +91,7 @@ public class home extends AppCompatActivity {
} }
private long time; private long time;
@Override @Override
public void onBackPressed() { public void onBackPressed() {
if (bfqkz.mt.isPlaying()) { if (bfqkz.mt.isPlaying()) {

View File

@ -11,16 +11,13 @@ import com.muqingbfq.R;
public class MyViewHoder extends RecyclerView.ViewHolder { public class MyViewHoder extends RecyclerView.ViewHolder {
public TextView name, zz; public TextView name, zz;
public View view;
public MyViewHoder(@NonNull View itemView) { public MyViewHoder(@NonNull View itemView) {
super(itemView); super(itemView);
view = itemView;
name = itemView.findViewById(R.id.wb1); name = itemView.findViewById(R.id.wb1);
zz = itemView.findViewById(R.id.zz); zz = itemView.findViewById(R.id.zz);
} }
public Context getContext() { public Context getContext() {
return view.getContext(); return itemView.getContext();
} }
} }

View File

@ -23,6 +23,7 @@ import androidx.core.content.ContextCompat;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.muqingbfq.R; import com.muqingbfq.R;
import com.muqingbfq.databinding.ActivityUserEditingBinding;
import com.muqingbfq.main; import com.muqingbfq.main;
import com.muqingbfq.mq.ActivityToolbar; import com.muqingbfq.mq.ActivityToolbar;
import com.muqingbfq.mq.gj; import com.muqingbfq.mq.gj;
@ -46,9 +47,9 @@ public class user_editing extends ActivityToolbar {
//头像用户名签名性别背景 //头像用户名签名性别背景
ImageView imageViewa; ImageView imageViewa;
EditText edit_name, edit_qianming; EditText edit_name, edit_qianming;
AutoCompleteTextView autoCompleteTextView;
ImageView imageViewb; ImageView imageViewb;
String file_a, file_b; String file_a, file_b;
ActivityUserEditingBinding binding;
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
ActivityResultLauncher<Intent> setimagea = ActivityResultLauncher<Intent> setimagea =
registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), registerForActivityResult(new ActivityResultContracts.StartActivityForResult(),
@ -86,11 +87,11 @@ public class user_editing extends ActivityToolbar {
@Override @Override
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_user_editing); binding = ActivityUserEditingBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
imageViewa = findViewById(R.id.image1); imageViewa = findViewById(R.id.image1);
edit_name = findViewById(R.id.edit_name); edit_name = findViewById(R.id.edit_name);
edit_qianming = findViewById(R.id.edit_qianming); edit_qianming = findViewById(R.id.edit_qianming);
autoCompleteTextView = findViewById(R.id.autoComplete);
imageViewb = findViewById(R.id.image2); imageViewb = findViewById(R.id.image2);
new Thread() { new Thread() {
@Override @Override
@ -110,6 +111,13 @@ public class user_editing extends ActivityToolbar {
Glide.with(user_editing.this) Glide.with(user_editing.this)
.load(string.cover()) .load(string.cover())
.into(imageViewb); .into(imageViewb);
String gender = string.gender();
if (gender.equals("1")) {
gender = "";
} else {
gender = "";
}
binding.autoComplete.setText(gender);
}); });
} catch (Exception e) { } catch (Exception e) {
gj.sc(e); gj.sc(e);

View File

@ -28,6 +28,8 @@ import com.muqingbfq.mq.wl;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import java.util.regex.Pattern;
public class user_logs extends AppCompatActivity { public class user_logs extends AppCompatActivity {
EditText edituser, editpassword; EditText edituser, editpassword;
@ -98,7 +100,7 @@ public class user_logs extends AppCompatActivity {
return bitmap; return bitmap;
} }
String isEmail="false";
public String account, password; public String account, password;
class CloudUser extends Thread { class CloudUser extends Thread {
@ -110,6 +112,10 @@ public class user_logs extends AppCompatActivity {
} }
user_logs.this.account = account; user_logs.this.account = account;
user_logs.this.password = password; user_logs.this.password = password;
Pattern pattern = Pattern.compile("^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$");
if (pattern.matcher(account).matches()) {
isEmail = "true";
}
start(); start();
} }
@ -122,7 +128,7 @@ public class user_logs extends AppCompatActivity {
"account", "passWord", "appID", "isEmail" "account", "passWord", "appID", "isEmail"
}, },
new String[]{ new String[]{
account, password, UUID, "" account, password, UUID, isEmail
}); });
gj.sc(post); gj.sc(post);
if (TextUtils.isEmpty(post)) { if (TextUtils.isEmpty(post)) {
@ -148,7 +154,7 @@ public class user_logs extends AppCompatActivity {
"account", "passWord", "appID", "isEmail" "account", "passWord", "appID", "isEmail"
}, },
new String[]{ new String[]{
account, password, UUID, "" account, password, UUID, isEmail
}); });
gj.sc(jsonpost); gj.sc(jsonpost);
if (!TextUtils.isEmpty(jsonpost.toString()) && if (!TextUtils.isEmpty(jsonpost.toString()) &&
@ -170,8 +176,9 @@ public class user_logs extends AppCompatActivity {
"account", "key", "appID", "isEmail" "account", "key", "appID", "isEmail"
}, },
new String[]{ new String[]{
account, editViewDialog.getEditText(), UUID, "false" account, editViewDialog.getEditText(), UUID, isEmail
}); });
gj.sc(jsonpost.toString()); gj.sc(jsonpost.toString());
if (!TextUtils.isEmpty(jsonpost.toString())) { if (!TextUtils.isEmpty(jsonpost.toString())) {
try { try {

View File

@ -69,8 +69,9 @@ public class user_message extends Thread {
if (cover.startsWith("..")) { if (cover.startsWith("..")) {
cover = "https://rust.coldmint.top" + cover.substring(2); cover = "https://rust.coldmint.top" + cover.substring(2);
} }
String gender = data.getString("gender");
return new string(new String[]{ return new string(new String[]{
headIcon, account, userName, introduce, cover headIcon, account, userName, introduce, cover, gender
}); });
} }
return null; return null;
@ -101,6 +102,8 @@ public class user_message extends Thread {
public String cover() { public String cover() {
return strings[4]; return strings[4];
} }
public String gender() {
return strings[5];
}
} }
} }

View File

@ -28,4 +28,10 @@ public class ActivityToolbar extends AppCompatActivity {
super.setContentView(view); super.setContentView(view);
setToolbar(); setToolbar();
} }
@Override
public void setContentView(View view) {
super.setContentView(view);
setToolbar();
}
} }

View File

@ -10,7 +10,6 @@ import android.content.ComponentName;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.os.Build; import android.os.Build;
import android.support.v4.media.session.PlaybackStateCompat; import android.support.v4.media.session.PlaybackStateCompat;
@ -24,7 +23,7 @@ import com.muqingbfq.R;
import com.muqingbfq.bfq; import com.muqingbfq.bfq;
import com.muqingbfq.bfqkz; import com.muqingbfq.bfqkz;
import com.muqingbfq.fragment.Media; import com.muqingbfq.fragment.Media;
import com.muqingbfq.start; import com.muqingbfq.home;
import com.muqingbfq.yc; import com.muqingbfq.yc;
public class NotificationManagerCompat { public class NotificationManagerCompat {
@ -52,7 +51,7 @@ public class NotificationManagerCompat {
// 设置启动的程序如果存在则找出否则新的启动 // 设置启动的程序如果存在则找出否则新的启动
Intent intent = new Intent(Intent.ACTION_MAIN); Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER); intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setComponent(new ComponentName(context, start.class));//用ComponentName得到class对象 intent.setComponent(new ComponentName(context, home.class));//用ComponentName得到class对象
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);// 关键的一步设置启动模式两种情况 | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);// 关键的一步设置启动模式两种情况
PendingIntent pendingIntent = getActivity(context, intent); PendingIntent pendingIntent = getActivity(context, intent);
@ -133,15 +132,10 @@ public class NotificationManagerCompat {
private NotificationCompat.Builder getNotificationBuilder(Context context) { private NotificationCompat.Builder getNotificationBuilder(Context context) {
// 适用于Android 8.0及以上版本 // 适用于Android 8.0及以上版本
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { // if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
return new NotificationCompat.Builder(context, CHANNEL_ID); return new NotificationCompat.Builder(context, CHANNEL_ID);
} else {
// Android 7.1及以下版本
return new NotificationCompat.Builder(context);
}
} }
@SuppressLint("UnspecifiedImmutableFlag")
private PendingIntent getBroadcast(Context context, Intent intent) { private PendingIntent getBroadcast(Context context, Intent intent) {
int flag; int flag;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
@ -150,13 +144,8 @@ public class NotificationManagerCompat {
flag = PendingIntent.FLAG_UPDATE_CURRENT; flag = PendingIntent.FLAG_UPDATE_CURRENT;
} }
return PendingIntent.getBroadcast(context, 0, intent, flag); return PendingIntent.getBroadcast(context, 0, intent, flag);
/* if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) {
return PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
} else {
return PendingIntent.getBroadcast(context, 0, intent, 0);
}*/
} }
@SuppressLint("UnspecifiedImmutableFlag")
private PendingIntent getActivity(Context context, Intent intent) { private PendingIntent getActivity(Context context, Intent intent) {
int flag; int flag;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {

View File

@ -1,5 +1,7 @@
package com.muqingbfq.mq; package com.muqingbfq.mq;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.res.Configuration; import android.content.res.Configuration;
@ -45,6 +47,19 @@ public class gj {
shareIntent.putExtra(Intent.EXTRA_TEXT, str); shareIntent.putExtra(Intent.EXTRA_TEXT, str);
context.startActivity(shareIntent); context.startActivity(shareIntent);
} }
/**
* 复制文字到剪切板
* @param text
*/
public static void fz(Context context,String text){
ClipboardManager systemService =
(ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
// 创建能够存入剪贴板的ClipData对象
//Label这是任意文字标签
ClipData mClipData = ClipData.newPlainText("Label", text);
//将ClipData数据复制到剪贴板
systemService.setPrimaryClip(mClipData);
}
public static boolean isWiFiConnected() { public static boolean isWiFiConnected() {
try { try {

View File

@ -1,16 +1,8 @@
package com.muqingbfq; package com.muqingbfq;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import com.muqingbfq.login.visitor;
import com.muqingbfq.mq.wj; import com.muqingbfq.mq.wj;
import com.muqingbfq.mq.wl;
public class start { public class start {
public start() { public start() {

View File

@ -0,0 +1,36 @@
package com.muqingbfq.view;
import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import androidx.annotation.NonNull;
public class TextView extends androidx.appcompat.widget.AppCompatTextView {
public TextView(@NonNull Context context) {
super(context);
initView();
}
public TextView(Context context, AttributeSet attrs) {
super(context, attrs);
initView();
}
public TextView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initView();
}
private void initView() {
this.setEllipsize(TextUtils.TruncateAt.MARQUEE);
this.setSingleLine(true);
this.setMarqueeRepeatLimit(-1);
}
@Override
public boolean isFocused() {
return true;
}
}

View File

@ -2,11 +2,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/bfq"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fillViewport="true"
android:fitsSystemWindows="true"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -14,6 +11,7 @@
android:layout_weight="1" android:layout_weight="1"
android:orientation="horizontal"> android:orientation="horizontal">
<LinearLayout <LinearLayout
android:id="@+id/kp1"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
@ -21,19 +19,11 @@
android:orientation="vertical" android:orientation="vertical"
tools:ignore="NestedWeights"> tools:ignore="NestedWeights">
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:id="@+id/kp1" android:id="@+id/cardview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:cardCornerRadius="16dp" app:cardCornerRadius="16dp"
app:cardUseCompatPadding="true"> app:cardUseCompatPadding="true" />
<ImageView
android:id="@+id/mttx"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:importantForAccessibility="no"
android:scaleType="fitXY"
android:src="@drawable/icon" />
</com.google.android.material.card.MaterialCardView>
</LinearLayout> </LinearLayout>
<me.wcy.lrcview.LrcView <me.wcy.lrcview.LrcView
android:id="@+id/gc" android:id="@+id/gc"

View File

@ -1,20 +1,22 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"> android:orientation="vertical">
<androidx.appcompat.widget.Toolbar <androidx.appcompat.widget.Toolbar
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"
app:navigationIcon="@drawable/end"
app:menu="@menu/bfq">
<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_horizontal" android:gravity="center_horizontal"
android:orientation="vertical"> android:orientation="vertical">
<TextView <com.muqingbfq.view.TextView
android:id="@+id/name" android:id="@+id/name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@ -1,40 +1,48 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/home" android:id="@+id/home"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
android:orientation="vertical"
tools:context=".home"> tools:context=".home">
<androidx.drawerlayout.widget.DrawerLayout <androidx.drawerlayout.widget.DrawerLayout
android:id="@+id/chct" android:id="@+id/chct"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<androidx.appcompat.widget.LinearLayoutCompat
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
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"
</androidx.appcompat.widget.Toolbar> android:minHeight="?attr/actionBarSize"
app:layout_constraintTop_toTopOf="parent" />
<androidx.fragment.app.FragmentContainerView <androidx.fragment.app.FragmentContainerView
android:id="@+id/gd" android:id="@+id/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"
android:layout_weight="1" app:layout_constraintBottom_toTopOf="@+id/bfq_db"
android:name="com.muqingbfq.fragment.gd" app:layout_constraintTop_toBottomOf="@+id/toolbar"
tools:layout="@layout/fragment_gd" /> tools:layout="@layout/fragment_gd" />
<androidx.fragment.app.FragmentContainerView <androidx.fragment.app.FragmentContainerView
android:id="@+id/bfq_db" android:id="@+id/bfq_db"
android:name="com.muqingbfq.fragment.bfq_db"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:name="com.muqingbfq.fragment.bfq_db" app:layout_constraintBottom_toBottomOf="parent"
tools:layout="@layout/fragment_bfq_db" /> tools:layout="@layout/fragment_bfq_db" />
</androidx.appcompat.widget.LinearLayoutCompat> </androidx.constraintlayout.widget.ConstraintLayout>
<com.google.android.material.navigation.NavigationView <com.google.android.material.navigation.NavigationView
android:id="@+id/chb" android:id="@+id/chb"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -42,7 +50,6 @@
android:layout_gravity="start" android:layout_gravity="start"
app:headerLayout="@layout/fragment_sz" app:headerLayout="@layout/fragment_sz"
app:itemTextColor="@color/text" app:itemTextColor="@color/text"
app:menu="@menu/sz" app:menu="@menu/sz" />
tools:ignore="VisualLintBounds" />
</androidx.drawerlayout.widget.DrawerLayout> </androidx.drawerlayout.widget.DrawerLayout>
</RelativeLayout> </FrameLayout>

View File

@ -89,16 +89,19 @@
android:id="@+id/menu" android:id="@+id/menu"
style="@style/Widget.Material3.TextInputLayout.FilledBox.ExposedDropdownMenu" style="@style/Widget.Material3.TextInputLayout.FilledBox.ExposedDropdownMenu"
android:layout_width="match_parent" android:layout_width="match_parent"
android:hint="性别"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<AutoCompleteTextView <AutoCompleteTextView
android:id="@+id/autoComplete" android:id="@+id/autoComplete"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="性别" android:completionThreshold="1"
android:inputType="none" android:imeOptions="actionSearch"
android:maxLength="1"
android:singleLine="true"
app:simpleItems="@array/xingbie" app:simpleItems="@array/xingbie"
tools:ignore="SpeakableTextPresentCheck,VisualLintTextFieldSize" /> tools:ignore="VisualLintTextFieldSize,SpeakableTextPresentCheck" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<LinearLayout <LinearLayout

View File

@ -19,17 +19,10 @@
android:layout_weight="1" android:layout_weight="1"
android:gravity="center"> android:gravity="center">
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:id="@+id/cardview"
android:layout_width="260dp" android:layout_width="260dp"
android:layout_height="260dp" android:layout_height="260dp"
app:cardCornerRadius="16dp"> app:cardCornerRadius="16dp" />
<ImageView
android:id="@+id/mttx"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:importantForAccessibility="no"
android:scaleType="fitXY"
android:src="@drawable/icon" />
</com.google.android.material.card.MaterialCardView>
</RelativeLayout> </RelativeLayout>
<me.wcy.lrcview.LrcView <me.wcy.lrcview.LrcView

View File

@ -2,17 +2,15 @@
<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:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"> android:orientation="vertical">
<com.google.android.material.tabs.TabLayout <com.google.android.material.tabs.TabLayout
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" />
<GridView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/wgbj" android:id="@+id/wgbj"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"/>
android:columnWidth="120dp"
android:numColumns="auto_fit"
android:stretchMode="columnWidth" />
</LinearLayout> </LinearLayout>

View File

@ -2,6 +2,7 @@
<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:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"> android:orientation="vertical">
<com.google.android.material.tabs.TabLayout <com.google.android.material.tabs.TabLayout
android:id="@+id/tablayout" android:id="@+id/tablayout"
@ -19,5 +20,6 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerview" android:id="@+id/recyclerview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>
</LinearLayout> </LinearLayout>

View File

@ -2,14 +2,16 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content" android:layout_width="120dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:orientation="vertical" android:orientation="vertical"
android:background="@null"> android:background="@null">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:id="@+id/relativeLayout"
android:layout_height="match_parent"> android:layout_width="120dp"
android:layout_height="120dp">
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:id="@+id/cardview" android:id="@+id/cardview"
@ -23,6 +25,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:scaleType="fitXY" /> android:scaleType="fitXY" />
</com.google.android.material.card.MaterialCardView> </com.google.android.material.card.MaterialCardView>
<ImageView <ImageView
android:id="@+id/kg" android:id="@+id/kg"
android:layout_width="36dp" android:layout_width="36dp"
@ -34,6 +37,7 @@
android:src="@drawable/zt" android:src="@drawable/zt"
tools:ignore="RtlSymmetry" /> tools:ignore="RtlSymmetry" />
</RelativeLayout> </RelativeLayout>
<TextView <TextView
android:id="@+id/wb1" android:id="@+id/wb1"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -1,8 +1,8 @@
<resources> <resources>
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="Theme.muqing" parent="Theme.start"> <style name="Theme.muqing" parent="Theme.start">
<!-- <item name="colorOnPrimary">@color/text</item>--> <!-- <item name="colorOnPrimary">@color/text</item>-->
<!-- <item name="colorOnSecondary">@color/text</item>--> <!-- <item name="colorOnSecondary">@color/text</item>-->
<item name="android:windowLightStatusBar">true</item> <item name="android:windowLightStatusBar">true</item>
</style> </style>
@ -10,8 +10,8 @@
<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:textColorTertiary">@color/text</item>--> <!-- <item name="android:textColorTertiary">@color/text</item>-->
<!-- <item name="android:textColorPrimary">@color/text</item>--> <!-- <item name="android:textColorPrimary">@color/text</item>-->
<item name="android:statusBarColor">@color/tm</item> <item name="android:statusBarColor">@color/tm</item>
</style> </style>