修复歌单搜索BUG,修复平板模式播放器显示BUG,修复液已知的歌单操作BUG

添加播放器UI手势,完善播放器控制内部组件
This commit is contained in:
muqing 2023-12-03 13:21:28 +08:00
parent 137a7135e7
commit 157ca8a230
4 changed files with 19 additions and 21 deletions

View File

@ -167,7 +167,7 @@ public class MediaPlayer {
Media.setProgress(0); Media.setProgress(0);
Media.setname(name); Media.setname(name);
Media.setzz(zz); Media.setzz(zz);
bfq_an.islike(Media.view.getContext()); bfq_an.islike();
} }
bfq_db.setname(name); bfq_db.setname(name);
bfq_db.setzz(zz); bfq_db.setzz(zz);

View File

@ -29,7 +29,7 @@ import org.json.JSONObject;
public class bfq extends AppCompatActivity { public class bfq extends AppCompatActivity {
@SuppressLint("StaticFieldLeak") @SuppressLint("StaticFieldLeak")
public static AppCompatActivity context; public static AppCompatActivity context;
ActivityBfqBinding inflate; public ActivityBfqBinding inflate;
@Override @Override
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
@ -56,15 +56,6 @@ public class bfq extends AppCompatActivity {
} }
return false; return false;
}); });
if (bfqkz.xm != null) {
Media.setname(bfqkz.xm.name);
Media.setzz(bfqkz.xm.zz);
}
/* inflate.name.setOnLongClickListener(view -> {
gj.fz(bfq.this, inflate.name.getText().toString());
gj.ts(bfq.this, "复制成功");
return false;
});*/
bfq_an.kz kz = new bfq_an.kz(); bfq_an.kz kz = new bfq_an.kz();
inflate.kg.setOnClickListener(kz); inflate.kg.setOnClickListener(kz);
inflate.xyq.setOnClickListener(kz); inflate.xyq.setOnClickListener(kz);
@ -74,18 +65,17 @@ public class bfq extends AppCompatActivity {
inflate.control.setOnClickListener(new bfq_an.control(inflate.control)); inflate.control.setOnClickListener(new bfq_an.control(inflate.control));
if (bfqkz.mt != null && bfqkz.mt.build.isPlaying()) { if (bfqkz.mt != null && bfqkz.mt.build.isPlaying()) {
inflate.kg.setImageResource(R.drawable.bf); inflate.kg.setImageResource(R.drawable.bf);
bfq_an.islike(this);
} }
text(); text();
inflate.like.setOnClickListener(view1 -> { inflate.like.setOnClickListener(view1 -> {
ImageView like = (ImageView) view1;
try { try {
if (bfqkz.like_bool) { if (bfqkz.like_bool) {
like.setImageTintList(ContextCompat.getColorStateList(bfq.this, R.color.text)); inflate.like
.setImageTintList(ContextCompat.getColorStateList(bfq.this, R.color.text));
com.muqingbfq.fragment.gd.like.remove(String.valueOf(bfqkz.xm.id)); com.muqingbfq.fragment.gd.like.remove(String.valueOf(bfqkz.xm.id));
} else { } else {
like.setImageTintList(ContextCompat. inflate.like.setImageTintList(ContextCompat.
getColorStateList(bfq.this, android.R.color.holo_red_dark)); getColorStateList(bfq.this, android.R.color.holo_red_dark));
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("name", bfqkz.xm.name); json.put("name", bfqkz.xm.name);
@ -100,7 +90,11 @@ public class bfq extends AppCompatActivity {
e.printStackTrace(); e.printStackTrace();
} }
}); });
if (bfqkz.xm != null) {
Media.setname(bfqkz.xm.name);
Media.setzz(bfqkz.xm.zz);
bfq_an.islike();
}
} }
public static Bitmap bitmap; public static Bitmap bitmap;

View File

@ -95,7 +95,7 @@ public class bfq_an {
public static String getTime(long time) { public static String getTime(long time) {
return simpleDateFormat.format(new Date(time)); return simpleDateFormat.format(new Date(time));
} }
public static void islike(Context context) { public static void islike() {
try { try {
gd.like.getJSONObject(String.valueOf(bfqkz.xm.id)); gd.like.getJSONObject(String.valueOf(bfqkz.xm.id));
bfqkz.like_bool = true; bfqkz.like_bool = true;

View File

@ -25,6 +25,7 @@ import com.muqingbfq.bfqkz;
import com.muqingbfq.databinding.FragmentBfqBinding; import com.muqingbfq.databinding.FragmentBfqBinding;
import com.muqingbfq.home; import com.muqingbfq.home;
import com.muqingbfq.main; import com.muqingbfq.main;
import com.muqingbfq.mq.gj;
import org.json.JSONObject; import org.json.JSONObject;
@ -171,13 +172,16 @@ public class Media extends Fragment {
} }
public static void setlike(boolean bool) { public static void setlike(boolean bool) {
ImageView imageView = bfq.findViewById(R.id.like); if (bfq == null || bfq.inflate == null) {
return;
}
int color = R.color.text; int color = R.color.text;
if (bool) { if (bool) {
color = android.R.color.holo_red_dark; color = android.R.color.holo_red_dark;
} }
imageView.setImageTintList(ContextCompat. gj.sc(color);
getColorStateList(view.getContext(), color)); bfq.inflate.like.setImageTintList(ContextCompat.
getColorStateList(com.muqingbfq.bfq.context, color));
} }
public static void setImageBitmap() { public static void setImageBitmap() {