修复了播放器无播放列表闪退
音乐搜索, 歌词UI显示, 主页报错, 优化了一些体验上面的功能!
This commit is contained in:
parent
a5d00632ca
commit
b35415f172
BIN
app/debug/Cloud_music-debug-v1.6.7.apk
Normal file
BIN
app/debug/Cloud_music-debug-v1.6.7.apk
Normal file
Binary file not shown.
20
app/debug/output-metadata.json
Normal file
20
app/debug/output-metadata.json
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"version": 3,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.muqingbfq",
|
||||
"variantName": "debug",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 1,
|
||||
"versionName": "1.6.7",
|
||||
"outputFile": "Cloud_music-debug-v1.6.7.apk"
|
||||
}
|
||||
],
|
||||
"elementType": "File"
|
||||
}
|
253
app/src/main/java/com/muqingbfq/fragment/Media.java
Normal file
253
app/src/main/java/com/muqingbfq/fragment/Media.java
Normal file
|
@ -0,0 +1,253 @@
|
|||
package com.muqingbfq.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.dirror.lyricviewx.LyricViewX;
|
||||
import com.muqingbfq.R;
|
||||
import com.muqingbfq.api.url;
|
||||
import com.muqingbfq.bfq;
|
||||
import com.muqingbfq.bfq_an;
|
||||
import com.muqingbfq.bfqkz;
|
||||
import com.muqingbfq.main;
|
||||
import com.muqingbfq.xm;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class Media extends Fragment {
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
public static View view;
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private static TextView time_a, time_b;
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private static SeekBar tdt;
|
||||
private static LyricViewX lrcview;
|
||||
|
||||
public static void setTime_a(String str) {
|
||||
if (time_a == null) {
|
||||
return;
|
||||
}
|
||||
time_a.setText(str);
|
||||
}
|
||||
|
||||
public static void setTime_b(String str) {
|
||||
if (time_b == null) {
|
||||
return;
|
||||
}
|
||||
time_b.setText(str);
|
||||
}
|
||||
|
||||
public static void setMax(int max) {
|
||||
tdt.setMax(max);
|
||||
}
|
||||
|
||||
public static void setProgress(int progress) {
|
||||
tdt.setProgress(progress);
|
||||
lrcview.updateTime(progress, true);
|
||||
}
|
||||
|
||||
public static void setbf(boolean bool) {
|
||||
if (bool) {
|
||||
//开始
|
||||
kgsetImageResource(R.drawable.bf);
|
||||
} else {
|
||||
//暂停
|
||||
kgsetImageResource(R.drawable.zt);
|
||||
}
|
||||
bfq_db.setkg(bool);
|
||||
bfqkz.updateNotification();
|
||||
}
|
||||
|
||||
private static void kgsetImageResource(int a) {
|
||||
if (view == null) {
|
||||
return;
|
||||
}
|
||||
ImageView imageView = view.findViewById(R.id.kg);
|
||||
imageView.setImageResource(a);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
if (view != null) {
|
||||
// main.handler.post(() -> setImageBitmap(bfq.bitmap));
|
||||
return view;
|
||||
}
|
||||
view = inflater.inflate(R.layout.fragment_bfq, container, false);
|
||||
bfq_an.kz kz = new bfq_an.kz();
|
||||
ImageView kg = view.findViewById(R.id.kg);
|
||||
kg.setOnClickListener(kz);
|
||||
view.findViewById(R.id.xyq).setOnClickListener(kz);
|
||||
view.findViewById(R.id.syq).setOnClickListener(kz);
|
||||
ImageView tx = view.findViewById(R.id.mttx);
|
||||
tdt = view.findViewById(R.id.tdt);
|
||||
tdt.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||
setTime_b(bfq_an.getTime(progress));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||
// 拖动条移动中
|
||||
main.handler.removeCallbacks(bfqkz.mt.updateSeekBar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||
// 播放音乐到指定位置
|
||||
main.handler.post(bfqkz.mt.updateSeekBar);
|
||||
bfqkz.mt.seekTo(seekBar.getProgress());
|
||||
}
|
||||
});
|
||||
|
||||
time_a = view.findViewById(R.id.time_a);
|
||||
time_b = view.findViewById(R.id.time_b);
|
||||
//初始化歌词组件
|
||||
View kp = view.findViewById(R.id.kp1);
|
||||
lrcview = getlrcView();
|
||||
lrcview.setDraggable(true, (time) -> {
|
||||
com.muqingbfq.bfqkz.mt.build.seekTo(Math.toIntExact(time));
|
||||
return true;
|
||||
});
|
||||
if (!isTablet(bfq.context)) {
|
||||
lrcview.setOnSingerClickListener(() -> {
|
||||
if (kp.getVisibility() == View.VISIBLE) {
|
||||
kp.setVisibility(View.GONE);
|
||||
} else {
|
||||
kp.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
}
|
||||
//初始化播放器列表
|
||||
view.findViewById(R.id.bfq_list_mp3).
|
||||
setOnClickListener(view1 -> com.muqingbfq.fragment.bflb_db.start(bfq.context));
|
||||
|
||||
view.findViewById(R.id.like).setOnClickListener(view1 -> {
|
||||
ImageView like = (ImageView) view1;
|
||||
try {
|
||||
if (bfqkz.like_bool) {
|
||||
like.setImageTintList(ContextCompat.getColorStateList(view.getContext(), R.color.text));
|
||||
com.muqingbfq.fragment.gd.like.remove(String.valueOf(bfqkz.xm.id));
|
||||
} else {
|
||||
like.setImageTintList(ContextCompat.
|
||||
getColorStateList(view.getContext(), android.R.color.holo_red_dark));
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("name", bfqkz.xm.name);
|
||||
json.put("zz", bfqkz.xm.zz);
|
||||
json.put("picUrl", bfqkz.xm.picurl);
|
||||
com.muqingbfq.fragment.gd.like.put(String.valueOf(bfqkz.xm.id), json);
|
||||
}
|
||||
com.muqingbfq.mq.wj.xrwb(com.muqingbfq.mq.wj.mp3_like,
|
||||
com.muqingbfq.fragment.gd.like.toString());
|
||||
bfqkz.like_bool = !bfqkz.like_bool;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
ImageView control = view.findViewById(R.id.control);
|
||||
control.setOnClickListener(new bfq_an.control(control));
|
||||
if (bfqkz.xm != null) {
|
||||
setname(bfqkz.xm.name);
|
||||
setzz(bfqkz.xm.zz);
|
||||
main.handler.removeCallbacks(bfqkz.mt.updateSeekBar); // 在播放开始时启动更新进度
|
||||
long duration = bfqkz.mt.build.getDuration();
|
||||
tdt.setMax((int) bfqkz.mt.build.getDuration());
|
||||
setTime_a(bfq_an.getTime(duration));
|
||||
|
||||
long position = bfqkz.mt.build.getCurrentPosition();
|
||||
setProgress((int) position);
|
||||
|
||||
main.handler.post(bfqkz.mt.updateSeekBar); // 在播放开始时启动更新进度
|
||||
if (bfqkz.mt.build.isPlaying()) {
|
||||
kg.setImageResource(R.drawable.bf);
|
||||
}
|
||||
Glide.with(getContext())
|
||||
.load(bfqkz.xm.picurl)
|
||||
.error(R.drawable.icon)//图片加载失败后,显示的图片
|
||||
.into(tx);
|
||||
bfq_an.islike(bfq.context);
|
||||
new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
super.run();
|
||||
url.gc(bfqkz.xm.id);
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
private boolean isTablet(Context context) {
|
||||
return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK)
|
||||
>= Configuration.SCREENLAYOUT_SIZE_LARGE;
|
||||
}
|
||||
|
||||
public static LyricViewX getlrcView() {
|
||||
if (view == null) {
|
||||
return null;
|
||||
}
|
||||
return view.findViewById(R.id.gc);
|
||||
}
|
||||
|
||||
public static void loadLyric(String a, String b) {
|
||||
lrcview.loadLyric(a, b);
|
||||
}
|
||||
|
||||
public static void setlike(boolean bool) {
|
||||
ImageView imageView = view.findViewById(R.id.like);
|
||||
int color = R.color.text;
|
||||
if (bool) {
|
||||
color = android.R.color.holo_red_dark;
|
||||
}
|
||||
imageView.setImageTintList(ContextCompat.
|
||||
getColorStateList(view.getContext(), color));
|
||||
}
|
||||
|
||||
public static void setImageBitmap(Bitmap bitmap) {
|
||||
if (view == null) {
|
||||
return;
|
||||
}
|
||||
ImageView imageView = view.findViewById(R.id.mttx);
|
||||
if (imageView != null) {
|
||||
imageView.setImageBitmap(bitmap);
|
||||
}
|
||||
}
|
||||
|
||||
public static void setname(String str) {
|
||||
if (view == null) {
|
||||
return;
|
||||
}
|
||||
TextView name = view.findViewById(R.id.name);
|
||||
name.setText(str);
|
||||
}
|
||||
|
||||
public static void setzz(String str) {
|
||||
if (view == null) {
|
||||
return;
|
||||
}
|
||||
TextView zz = view.findViewById(R.id.zz);
|
||||
zz.setText(str);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Context getContext() {
|
||||
return view.getContext();
|
||||
}
|
||||
}
|
159
app/src/main/java/com/muqingbfq/mq/EditViewDialog.java
Normal file
159
app/src/main/java/com/muqingbfq/mq/EditViewDialog.java
Normal file
|
@ -0,0 +1,159 @@
|
|||
package com.muqingbfq.mq;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.text.InputType;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.muqingbfq.R;
|
||||
import com.muqingbfq.main;
|
||||
|
||||
public class EditViewDialog {
|
||||
|
||||
public EditText editText;
|
||||
public Button buttona, buttonb;
|
||||
public MaterialAlertDialogBuilder AlertDialogBuilder;
|
||||
private AlertDialog alertDialog;
|
||||
|
||||
public EditViewDialog(@NonNull Context context, String str) {
|
||||
AlertDialogBuilder = new MaterialAlertDialogBuilder(context);
|
||||
setTitle(str);
|
||||
@SuppressLint("InflateParams") View inflate = LayoutInflater.from(context).inflate(R.layout.view_edit, null);
|
||||
editText = inflate.findViewById(R.id.editview);
|
||||
buttona = inflate.findViewById(R.id.button1);
|
||||
buttonb = inflate.findViewById(R.id.button2);
|
||||
AlertDialogBuilder.setView(inflate);
|
||||
buttona.setOnClickListener(view -> dismiss());
|
||||
buttonb.setOnClickListener(view -> dismiss());
|
||||
}
|
||||
public void setTitle(String str) {
|
||||
AlertDialogBuilder.setTitle(str);
|
||||
}
|
||||
|
||||
public void setMessage(String str) {
|
||||
AlertDialogBuilder.setMessage(str);
|
||||
}
|
||||
|
||||
public AlertDialog show() {
|
||||
alertDialog = AlertDialogBuilder.show();
|
||||
alertDialog.setCancelable(true);
|
||||
alertDialog.setCanceledOnTouchOutside(false);
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
public String getEditText() {
|
||||
return editText.getText().toString();
|
||||
}
|
||||
|
||||
public void setEditinputType(String str) {
|
||||
int inputType;
|
||||
switch (str) {
|
||||
case "textCapCharacters":
|
||||
inputType = InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS;
|
||||
break;
|
||||
case "textCapWords":
|
||||
inputType = InputType.TYPE_TEXT_FLAG_CAP_WORDS;
|
||||
break;
|
||||
case "textCapSentences":
|
||||
inputType = InputType.TYPE_TEXT_FLAG_CAP_SENTENCES;
|
||||
break;
|
||||
case "textAutoCorrect":
|
||||
inputType = InputType.TYPE_TEXT_FLAG_AUTO_CORRECT;
|
||||
break;
|
||||
case "textAutoComplete":
|
||||
inputType = InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE;
|
||||
break;
|
||||
case "textMultiLine":
|
||||
inputType = InputType.TYPE_TEXT_FLAG_MULTI_LINE;
|
||||
break;
|
||||
case "textImeMultiLine":
|
||||
inputType = InputType.TYPE_TEXT_FLAG_IME_MULTI_LINE;
|
||||
break;
|
||||
case "textNoSuggestions":
|
||||
inputType = InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
|
||||
break;
|
||||
case "textUri":
|
||||
inputType = InputType.TYPE_TEXT_VARIATION_URI;
|
||||
break;
|
||||
case "textEmailAddress":
|
||||
inputType = InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS;
|
||||
break;
|
||||
case "textEmailSubject":
|
||||
inputType = InputType.TYPE_TEXT_VARIATION_EMAIL_SUBJECT;
|
||||
break;
|
||||
case "textShortMessage":
|
||||
inputType = InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE;
|
||||
break;
|
||||
case "textLongMessage":
|
||||
inputType = InputType.TYPE_TEXT_VARIATION_LONG_MESSAGE;
|
||||
break;
|
||||
case "textPersonName":
|
||||
inputType = InputType.TYPE_TEXT_VARIATION_PERSON_NAME;
|
||||
break;
|
||||
case "textPostalAddress":
|
||||
inputType = InputType.TYPE_TEXT_VARIATION_POSTAL_ADDRESS;
|
||||
break;
|
||||
case "textPassword":
|
||||
inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD;
|
||||
break;
|
||||
case "textVisiblePassword":
|
||||
inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;
|
||||
break;
|
||||
case "textWebEditText":
|
||||
inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT;
|
||||
break;
|
||||
case "textFilter":
|
||||
inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_FILTER;
|
||||
break;
|
||||
case "textPhonetic":
|
||||
inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PHONETIC;
|
||||
break;
|
||||
case "number":
|
||||
inputType = InputType.TYPE_CLASS_NUMBER;
|
||||
break;
|
||||
case "numberSigned":
|
||||
inputType = InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_SIGNED;
|
||||
break;
|
||||
case "numberDecimal":
|
||||
inputType = InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL;
|
||||
break;
|
||||
case "phone":
|
||||
inputType = InputType.TYPE_CLASS_PHONE;
|
||||
break;
|
||||
case "datetime":
|
||||
inputType = InputType.TYPE_CLASS_DATETIME;
|
||||
break;
|
||||
case "date":
|
||||
inputType = InputType.TYPE_CLASS_DATETIME | InputType.TYPE_DATETIME_VARIATION_DATE;
|
||||
break;
|
||||
case "time":
|
||||
inputType = InputType.TYPE_CLASS_DATETIME | InputType.TYPE_DATETIME_VARIATION_TIME;
|
||||
break;
|
||||
case "none":
|
||||
case "text":
|
||||
default:
|
||||
inputType = InputType.TYPE_CLASS_TEXT;
|
||||
break;
|
||||
}
|
||||
editText.setInputType(inputType);
|
||||
}
|
||||
|
||||
public void dismiss() {
|
||||
main.handler.post(() -> alertDialog.dismiss());
|
||||
}
|
||||
|
||||
public void setNegative(View.OnClickListener a) {
|
||||
buttona.setOnClickListener(a);
|
||||
}
|
||||
|
||||
public void setPositive(View.OnClickListener a) {
|
||||
buttonb.setOnClickListener(a);
|
||||
}
|
||||
|
||||
}
|
165
app/src/main/java/com/muqingbfq/mq/floating.java
Normal file
165
app/src/main/java/com/muqingbfq/mq/floating.java
Normal file
|
@ -0,0 +1,165 @@
|
|||
package com.muqingbfq.mq;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Service;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
import android.provider.Settings;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.muqingbfq.R;
|
||||
import com.muqingbfq.main;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class floating extends Service {
|
||||
private static RecyclerView.Adapter<ViewHolder> lbspq = new RecyclerView.Adapter<ViewHolder>() {
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new ViewHolder(new TextView(parent.getContext()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
String s = list.get(position);
|
||||
holder.textView.setText(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
};
|
||||
|
||||
public static void start(Context context) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M &&
|
||||
Settings.canDrawOverlays(context)) {
|
||||
context.startService(new Intent(context, floating.class));
|
||||
}
|
||||
}
|
||||
|
||||
public static void end(Context context) {
|
||||
Intent serviceIntent = new Intent(context, floating.class);
|
||||
context.stopService(serviceIntent);
|
||||
}
|
||||
|
||||
public static List<String> list = new ArrayList<>();
|
||||
private WindowManager windowManager;
|
||||
private View view;
|
||||
private View image, layout;
|
||||
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
public static void addtext(String str) {
|
||||
if (lbspq == null || list == null) {
|
||||
return;
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); // 创建一个 SimpleDateFormat 对象,指定时间格式
|
||||
String formattedDate = sdf.format(new Date()); // 格式化当前时间
|
||||
list.add(0, formattedDate + ": " + str);
|
||||
main.handler.post(lbspq::notifyDataSetChanged);
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
view = LayoutInflater.from(this).inflate(R.layout.floating_sc, null);
|
||||
layout = view.findViewById(R.id.view1);
|
||||
ViewGroup.LayoutParams layoutParams = layout.getLayoutParams();
|
||||
layoutParams.height = main.g - main.g / 2 / 2;
|
||||
layoutParams.width = main.k - main.k / 2 / 2;
|
||||
layout.setLayoutParams(layoutParams);
|
||||
layout.setVisibility(View.GONE);
|
||||
image = view.findViewById(R.id.image);
|
||||
image.setOnClickListener(vw -> {
|
||||
layout.setVisibility(View.VISIBLE);
|
||||
vw.setVisibility(View.GONE);
|
||||
});
|
||||
view.findViewById(R.id.text4).setOnClickListener(view -> {
|
||||
layout.setVisibility(View.GONE);
|
||||
image.setVisibility(View.VISIBLE);
|
||||
});
|
||||
RecyclerView recyclerView = view.findViewById(R.id.list);
|
||||
recyclerView.setAdapter(lbspq);
|
||||
addtext("Android stdio 2022.3.1版-调试器");
|
||||
|
||||
//清空按钮
|
||||
view.findViewById(R.id.text1).setOnClickListener(view -> {
|
||||
list.clear();
|
||||
lbspq.notifyDataSetChanged();
|
||||
});
|
||||
//复制按钮
|
||||
view.findViewById(R.id.text2).setOnClickListener(view -> {
|
||||
// 获取剪贴板管理器
|
||||
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
clipboard.setPrimaryClip(ClipData.newPlainText("label", list.get(0)));
|
||||
gj.ts(this,"成功复制了第一个数据");
|
||||
});
|
||||
//关闭按钮
|
||||
view.findViewById(R.id.text3).setOnClickListener(view -> stopSelf());
|
||||
int i = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
|
||||
| WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
|
||||
WindowManager.LayoutParams params = new WindowManager.LayoutParams(
|
||||
WindowManager.LayoutParams.WRAP_CONTENT,
|
||||
WindowManager.LayoutParams.WRAP_CONTENT,
|
||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ?
|
||||
WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY :
|
||||
WindowManager.LayoutParams.TYPE_PHONE,
|
||||
i,
|
||||
PixelFormat.TRANSLUCENT
|
||||
);
|
||||
params.x = -main.k;
|
||||
windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
|
||||
windowManager.addView(view, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (view != null && windowManager != null) {
|
||||
lbspq = null;
|
||||
list = null;
|
||||
windowManager.removeView(view);
|
||||
}
|
||||
}
|
||||
|
||||
private static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
public TextView textView;
|
||||
|
||||
public ViewHolder(View itemview) {
|
||||
super(itemview);
|
||||
textView = (TextView) itemview;
|
||||
textView.setTextColor(Color.WHITE);
|
||||
textView.setOnLongClickListener(view -> {
|
||||
// 获取剪贴板管理器
|
||||
ClipboardManager clipboard = (ClipboardManager) view.getContext().
|
||||
getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
clipboard.setPrimaryClip(ClipData.newPlainText("label", list.get(0)));
|
||||
gj.ts(view.getContext(), "复制成功");
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
202
app/src/main/res/layout-land/fragment_bfq.xml
Normal file
202
app/src/main/res/layout-land/fragment_bfq.xml
Normal file
|
@ -0,0 +1,202 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/bfq"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true"
|
||||
android:fitsSystemWindows="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:text="@string/name"
|
||||
android:textColor="@color/text"
|
||||
android:textSize="26sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/zz"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="2"
|
||||
android:text="@string/zz"
|
||||
android:textSize="20sp" />
|
||||
</LinearLayout>
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/kp1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="NestedWeights">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/view1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardUseCompatPadding="true">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mttx"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:importantForAccessibility="no"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</LinearLayout>
|
||||
|
||||
<com.dirror.lyricviewx.LyricViewX
|
||||
android:id="@+id/gc"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
app:lrcCurrentTextColor="@color/text"
|
||||
app:lrcLabel="@string/app_name"
|
||||
app:lrcNormalTextSize="16sp"
|
||||
app:lrcPadding="16dp"
|
||||
app:lrcTextSize="20sp"
|
||||
app:lrcTimelineTextColor="@color/text_tm"
|
||||
tools:ignore="MissingConstraints" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="3dp"
|
||||
android:paddingEnd="3dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/time_a"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/_00_00" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/tdt"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_weight="1"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:padding="6dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/time_b"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/_00_00" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:baselineAligned="false"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/control"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginEnd="26dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:src="@drawable/mt_sx"
|
||||
tools:ignore="ContentDescription" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/syq"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:src="@drawable/syq"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/kg"
|
||||
android:layout_width="46dp"
|
||||
android:layout_height="46dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:src="@drawable/zt"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/xyq"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:importantForAccessibility="no"
|
||||
android:src="@drawable/xyq" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="end">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bfq_list_mp3"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:src="@drawable/cd"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/like"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="26dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:src="@mipmap/like"
|
||||
app:tint="@color/text"
|
||||
tools:ignore="ContentDescription" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
18
app/src/main/res/layout/activity_bfq.xml
Normal file
18
app/src/main/res/layout/activity_bfq.xml
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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:orientation="vertical">
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/fragment_bfq"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:name="com.muqingbfq.fragment.Media"
|
||||
tools:layout="@layout/fragment_bfq" />
|
||||
</LinearLayout>
|
73
app/src/main/res/layout/floating_sc.xml
Normal file
73
app/src/main/res/layout/floating_sc.xml
Normal file
|
@ -0,0 +1,73 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<LinearLayout
|
||||
android:id="@+id/view1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="#80000000">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:gravity="center_horizontal">
|
||||
<TextView
|
||||
android:id="@+id/text1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="清空"
|
||||
android:textColor="#FFFFFF" />
|
||||
<TextView
|
||||
android:id="@+id/text2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="复制"
|
||||
android:textColor="#FFFFFF" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="暂停"
|
||||
android:textColor="#FFFFFF" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="隐藏"
|
||||
android:textColor="#FFFFFF" />
|
||||
</LinearLayout>
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="6dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager">
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
</LinearLayout>
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_centerVertical="true"
|
||||
app:cardBackgroundColor="#00CCFF"
|
||||
app:cardCornerRadius="18dp">
|
||||
<ImageView
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:src="@drawable/icon"/>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</RelativeLayout>
|
42
app/src/main/res/layout/view_edit.xml
Normal file
42
app/src/main/res/layout/view_edit.xml
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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="wrap_content"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:orientation="vertical">
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="请输入内容">
|
||||
<EditText
|
||||
android:id="@+id/editview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColorHint="#546E7A"
|
||||
tools:ignore="TextContrastCheck,TextFields"
|
||||
android:autofillHints="" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:paddingBottom="16dp"
|
||||
android:orientation="horizontal">
|
||||
<Button
|
||||
android:id="@+id/button1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/quxiao"
|
||||
style="?android:attr/buttonBarButtonStyle" />
|
||||
<Button
|
||||
android:id="@+id/button2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="确定"
|
||||
style="?android:attr/buttonBarButtonStyle" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user