修复歌单搜索BUG,修复平板模式播放器显示BUG,修复液已知的歌单操作BUG
添加播放器UI手势,完善播放器控制内部组件
This commit is contained in:
parent
1196201abe
commit
5e39127b19
|
@ -18,7 +18,7 @@ android {
|
|||
//noinspection OldTargetApi
|
||||
targetSdk 31
|
||||
versionCode 1
|
||||
versionName "1.7.0"
|
||||
versionName "1.7.1"
|
||||
|
||||
}
|
||||
compileOptions {
|
||||
|
|
Binary file not shown.
|
@ -12,8 +12,8 @@
|
|||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 1,
|
||||
"versionName": "1.7.0",
|
||||
"outputFile": "Cloud_music-debug-v1.7.0.apk"
|
||||
"versionName": "1.7.1",
|
||||
"outputFile": "Cloud_music-debug-v1.7.1.apk"
|
||||
}
|
||||
],
|
||||
"elementType": "File"
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<activity android:name=".activity_search" />
|
||||
<activity
|
||||
android:name=".bfq"
|
||||
android:configChanges="orientation|screenLayout"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
android:theme="@style/fragment_dialog" />
|
||||
|
||||
<activity android:name=".fragment.mp3" />
|
||||
|
|
|
@ -171,12 +171,7 @@ public class MediaPlayer {
|
|||
}
|
||||
bfq_db.setname(name);
|
||||
bfq_db.setzz(zz);
|
||||
if (bfqkz.notify.notificationManager != null) {
|
||||
bfqkz.notify.notificationBuilder.setContentTitle(name);
|
||||
bfqkz.notify.notificationBuilder.setContentText(zz);
|
||||
bfqkz.notify.notificationManager_notify();
|
||||
|
||||
}
|
||||
if (com.muqingbfq.fragment.mp3.lbspq != null) {
|
||||
com.muqingbfq.fragment.mp3.lbspq.notifyDataSetChanged();
|
||||
}
|
||||
|
|
|
@ -135,7 +135,6 @@ public class MyButtonClickReceiver extends BroadcastReceiver {
|
|||
if (bfqkz.mt == null) {
|
||||
return;
|
||||
}
|
||||
gj.sc(bfqkz.mt);
|
||||
// gj.sc(isMusicServiceBound);播放/暂停按钮点击事件 if (isMusicServiceBound)
|
||||
if (bfqkz.mt.isPlaying()) {
|
||||
bfqkz.mt.pause();
|
||||
|
|
|
@ -17,7 +17,6 @@ import android.widget.ListView;
|
|||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.flexbox.AlignItems;
|
||||
|
@ -48,8 +47,7 @@ public class activity_search extends ActivityToolbar {
|
|||
private final List<String> list = new ArrayList<>();
|
||||
ListView listPopupWindow;
|
||||
ActivitySearchBinding inflate;
|
||||
|
||||
@SuppressLint({"RestrictedApi", "NotifyDataSetChanged"})
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -197,9 +195,13 @@ public class activity_search extends ActivityToolbar {
|
|||
public void start(String name) {
|
||||
dismiss();
|
||||
if (!TextUtils.isEmpty(name)) {
|
||||
search search = (com.muqingbfq.fragment.search) getSupportFragmentManager().
|
||||
findFragmentById(R.id.search_fragment);
|
||||
search.setStart(name);
|
||||
search sea = (search) getSupportFragmentManager().findFragmentById(R.id.search_fragment);
|
||||
if (!name.equals(sea.name)) {
|
||||
sea.i = 0;
|
||||
sea.inflate.tablayout.getTabAt(0).select();
|
||||
}
|
||||
sea.setVisibility(true);
|
||||
sea.setStart(name);
|
||||
addSearchRecord(name);
|
||||
}
|
||||
}
|
||||
|
@ -266,11 +268,15 @@ public class activity_search extends ActivityToolbar {
|
|||
private void end() {
|
||||
search search = (com.muqingbfq.fragment.search) getSupportFragmentManager().
|
||||
findFragmentById(R.id.search_fragment);
|
||||
if (search.getVisibility()) {
|
||||
if (search.isVisible()) {
|
||||
search.setVisibility(false);
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void finish() {
|
||||
super.finish();
|
||||
com.muqingbfq.fragment.search.lbspq = null;
|
||||
}
|
||||
}
|
|
@ -64,6 +64,9 @@ public class playlist extends Thread {
|
|||
list.clear();
|
||||
try {
|
||||
JSONObject json = gd.like;
|
||||
if (json == null || json.length() < 1) {
|
||||
return false;
|
||||
}
|
||||
for (Iterator<String> it = json.keys(); it.hasNext(); ) {
|
||||
String id = it.next();
|
||||
JSONObject jsonObject = json.getJSONObject(id);
|
||||
|
@ -72,7 +75,7 @@ public class playlist extends Thread {
|
|||
String picUrl = jsonObject.getString("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) {
|
||||
gj.sc("失败的错误 " + e);
|
||||
|
|
|
@ -61,7 +61,11 @@ public class resource {
|
|||
for (int i = 0; i < length; i++) {
|
||||
JSONObject get = list_array.getJSONObject(i);
|
||||
String id = get.getString("id");
|
||||
String name = get.getString("name") + "\n" + get.getString("description");
|
||||
String name = get.getString("name") + "\n";
|
||||
String description = get.getString("description");
|
||||
if (!TextUtils.isEmpty(description) && !description.equals("null")) {
|
||||
name += description;
|
||||
}
|
||||
boolean cz = wj.cz(wj.gd + id);
|
||||
String coverImgUrl = get.getString("coverImgUrl");
|
||||
list.add(new xm(id, name, coverImgUrl, cz));
|
||||
|
|
|
@ -1,12 +1,18 @@
|
|||
package com.muqingbfq;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.util.TypedValue;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
@ -15,18 +21,26 @@ import androidx.appcompat.widget.Toolbar;
|
|||
|
||||
import com.muqingbfq.databinding.ActivityBfqBinding;
|
||||
import com.muqingbfq.fragment.Media;
|
||||
import com.muqingbfq.mq.gj;
|
||||
|
||||
public class bfq extends AppCompatActivity {
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
public static AppCompatActivity context;
|
||||
ActivityBfqBinding inflate;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
|
||||
context = this;
|
||||
ActivityBfqBinding inflate = ActivityBfqBinding.inflate(getLayoutInflater());
|
||||
setContentView(inflate.getRoot());
|
||||
inflate = ActivityBfqBinding.inflate(getLayoutInflater());
|
||||
LinearLayout root = inflate.getRoot();
|
||||
TypedValue typedValue = new TypedValue();
|
||||
home.appCompatActivity.getTheme().resolveAttribute(android.R.attr.windowBackground, typedValue, true);
|
||||
// 设置背景颜色
|
||||
root.setBackgroundColor(typedValue.data);
|
||||
setContentView(root);
|
||||
Media media = (Media) getSupportFragmentManager().findFragmentById(R.id.fragment_bfq);
|
||||
media.setBfq(this);
|
||||
Toolbar toolbar = inflate.toolbar;
|
||||
toolbar.setNavigationOnClickListener(view1 -> finish());
|
||||
toolbar.setOnMenuItemClickListener(item -> {
|
||||
|
@ -42,11 +56,22 @@ public class bfq extends AppCompatActivity {
|
|||
Media.setname(bfqkz.xm.name);
|
||||
Media.setzz(bfqkz.xm.zz);
|
||||
}
|
||||
inflate.name.setOnLongClickListener(view -> {
|
||||
/* 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();
|
||||
inflate.kg.setOnClickListener(kz);
|
||||
inflate.xyq.setOnClickListener(kz);
|
||||
inflate.xyq.setOnClickListener(kz);
|
||||
inflate.bfqListMp3.
|
||||
setOnClickListener(view1 -> com.muqingbfq.fragment.bflb_db.start(this));
|
||||
inflate.control.setOnClickListener(new bfq_an.control(inflate.control));
|
||||
if (bfqkz.mt != null && bfqkz.mt.build.isPlaying()) {
|
||||
inflate.kg.setImageResource(R.drawable.bf);
|
||||
}
|
||||
text();
|
||||
}
|
||||
|
||||
public static Bitmap bitmap;
|
||||
|
@ -58,9 +83,59 @@ public class bfq extends AppCompatActivity {
|
|||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
public void kgsetImageResource(int a) {
|
||||
if (inflate == null) {
|
||||
return;
|
||||
}
|
||||
inflate.kg.setImageResource(a);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
Media.view = null;
|
||||
}
|
||||
|
||||
float downY, moveY;
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
public void text() {
|
||||
inflate.toolbar.setOnTouchListener((view, motionEvent) -> {
|
||||
LinearLayout root = inflate.getRoot();
|
||||
switch (motionEvent.getAction()) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
downY = motionEvent.getRawY();
|
||||
break;
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
//长按事件,可以移动
|
||||
moveY = motionEvent.getRawY();
|
||||
//移动的距离
|
||||
float dy = moveY - downY;
|
||||
//重新设置控件的位置。移动
|
||||
if (dy <= 0) {
|
||||
return true;
|
||||
} else if (dy > main.g - main.g / 5.0) {
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
root.setTranslationY(dy);
|
||||
break;
|
||||
case MotionEvent.ACTION_UP:
|
||||
if (inflate.getRoot().getY() > main.g - main.g / 1.5) {
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
ObjectAnimator animator = ObjectAnimator.ofFloat(root, "y", root.getY(), 0);
|
||||
animator.setDuration(300);
|
||||
animator.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
root.setY(0);
|
||||
}
|
||||
});
|
||||
animator.start();
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
|
@ -3,14 +3,20 @@ package com.muqingbfq;
|
|||
import android.annotation.SuppressLint;
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.net.Uri;
|
||||
import android.os.Binder;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.support.v4.media.MediaMetadataCompat;
|
||||
import android.support.v4.media.session.MediaSessionCompat;
|
||||
import android.support.v4.media.session.PlaybackStateCompat;
|
||||
import android.text.TextUtils;
|
||||
import android.view.KeyEvent;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.MediaItem;
|
||||
|
||||
import com.muqingbfq.api.url;
|
||||
import com.muqingbfq.mq.BluetoothMusicController;
|
||||
|
@ -58,6 +64,27 @@ public class bfqkz extends Service {
|
|||
yc.start(home.appCompatActivity, "bfqkz mp3(" + id + ") :" + e);
|
||||
}
|
||||
}
|
||||
public static void mp3(Uri id) {
|
||||
try {
|
||||
if (TextUtils.isEmpty(id.toString())) {
|
||||
return;
|
||||
}
|
||||
gj.sc(xm.picurl);
|
||||
if (TextUtils.isEmpty(xm.picurl.toString())) {
|
||||
xm.picurl = url.picurl(xm.id);
|
||||
}
|
||||
MediaItem mediaItem = MediaItem.fromUri(id);
|
||||
main.handler.post(() -> {
|
||||
mt.build.setMediaItem(mediaItem);
|
||||
mt.build.prepare();
|
||||
mt.build.setPlayWhenReady(true);
|
||||
mt.start();
|
||||
});
|
||||
} catch (Exception e) {
|
||||
yc.start(home.appCompatActivity, "bfqkz mp3(" + id + ") :" + e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static MediaSessionCompat mSession;
|
||||
public static MediaMetadataCompat build;
|
||||
|
@ -73,36 +100,76 @@ public class bfqkz extends Service {
|
|||
playback=new PlaybackStateCompat.Builder()
|
||||
.setState(PlaybackStateCompat.STATE_NONE,0,1.0f)
|
||||
.build();
|
||||
/* mSession.setCallback(new MediaSessionCompat.Callback() {
|
||||
@Override
|
||||
public void onPlay() {
|
||||
mt.start();
|
||||
}
|
||||
@Override
|
||||
public void onPause() {
|
||||
// 处理暂停音乐逻辑
|
||||
mt.pause();
|
||||
}
|
||||
@Override
|
||||
public void onSkipToNext() {
|
||||
// 处理切换到下一首音乐逻辑
|
||||
}
|
||||
mSession.setCallback(new callback());
|
||||
mSession.setFlags(MediaSessionCompat.FLAG_HANDLES_TRANSPORT_CONTROLS);
|
||||
mSession.setPlaybackState(playback);
|
||||
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.icon);
|
||||
|
||||
@Override
|
||||
public void onSkipToPrevious() {
|
||||
// 处理切换到上一首音乐逻辑
|
||||
}
|
||||
});*/
|
||||
build = new MediaMetadataCompat.Builder()
|
||||
.putString(MediaMetadataCompat.METADATA_KEY_TITLE, "Song Title")
|
||||
.putString(MediaMetadataCompat.METADATA_KEY_ARTIST, "Artist Name")
|
||||
.putBitmap(MediaMetadataCompat.METADATA_KEY_ALBUM_ART, bitmap)
|
||||
.putLong(MediaMetadataCompat.METADATA_KEY_DURATION, 1000) // 单位为毫秒
|
||||
.build();
|
||||
mSession.setMetadata(build);
|
||||
mSession.setPlaybackState(playback);
|
||||
mSession.setActive(true);
|
||||
// setSessionToken(mSession.getSessionToken());
|
||||
notify = new com.muqingbfq.mq.NotificationManagerCompat(this);
|
||||
|
||||
}
|
||||
|
||||
class callback extends MediaSessionCompat.Callback {
|
||||
@Override
|
||||
public boolean onMediaButtonEvent(Intent mediaButtonEvent) {
|
||||
KeyEvent event = (KeyEvent) mediaButtonEvent.getParcelableExtra(Intent.EXTRA_KEY_EVENT);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlay() {
|
||||
super.onPlay();
|
||||
if(playback.getState() == PlaybackStateCompat.STATE_PAUSED){
|
||||
mt.start();
|
||||
playback = new PlaybackStateCompat.Builder()
|
||||
.setState(PlaybackStateCompat.STATE_PLAYING,0,1.0f)
|
||||
.build();
|
||||
mSession.setPlaybackState(playback);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
if(playback.getState() == PlaybackStateCompat.STATE_PLAYING){
|
||||
mt.pause();
|
||||
playback = new PlaybackStateCompat.Builder()
|
||||
.setState(PlaybackStateCompat.STATE_PAUSED,0,1.0f)
|
||||
.build();
|
||||
mSession.setPlaybackState(playback);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onPlayFromUri(Uri uri, Bundle extras) {
|
||||
try {
|
||||
switch (playback.getState()){
|
||||
case PlaybackStateCompat.STATE_PLAYING:
|
||||
case PlaybackStateCompat.STATE_PAUSED:
|
||||
case PlaybackStateCompat.STATE_NONE:
|
||||
mp3(uri);
|
||||
playback = new PlaybackStateCompat.Builder()
|
||||
.setState(PlaybackStateCompat.STATE_CONNECTING,0,1.0f)
|
||||
.build();
|
||||
mSession.setPlaybackState(playback);
|
||||
//我们可以保存当前播放音乐的信息,以便客户端刷新UI
|
||||
mSession.setMetadata(new MediaMetadataCompat.Builder()
|
||||
.putString(MediaMetadataCompat.METADATA_KEY_TITLE,extras.getString("title"))
|
||||
.build()
|
||||
);
|
||||
break;
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@Nullable
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
|
@ -118,7 +185,7 @@ public class bfqkz extends Service {
|
|||
try {
|
||||
// 更新通知栏的播放状态
|
||||
if (notify.notificationBuilder != null) {
|
||||
notify.tzl_an();
|
||||
notify.tzl();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
gj.sc("bfqkz updateNotification:" + e);
|
||||
|
|
|
@ -33,6 +33,12 @@ import me.wcy.lrcview.LrcView;
|
|||
public class Media extends Fragment {
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
public static LinearLayout view;
|
||||
private static bfq bfq;
|
||||
|
||||
public void setBfq(bfq bfq) {
|
||||
Media.bfq = bfq;
|
||||
}
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private static TextView time_a, time_b;
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
|
@ -63,24 +69,19 @@ public class Media extends Fragment {
|
|||
}
|
||||
|
||||
public static void setbf(boolean bool) {
|
||||
if (bool) {
|
||||
//开始
|
||||
kgsetImageResource(R.drawable.bf);
|
||||
} else {
|
||||
//暂停
|
||||
kgsetImageResource(R.drawable.zt);
|
||||
if (bfq != null) {
|
||||
if (bool) {
|
||||
//开始
|
||||
bfq.kgsetImageResource(R.drawable.bf);
|
||||
} else {
|
||||
//暂停
|
||||
bfq.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,
|
||||
|
@ -90,17 +91,8 @@ public class Media extends Fragment {
|
|||
}
|
||||
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();
|
||||
ImageView kg = view.findViewById(R.id.kg);
|
||||
kg.setOnClickListener(kz);
|
||||
view.findViewById(R.id.xyq).setOnClickListener(kz);
|
||||
view.findViewById(R.id.syq).setOnClickListener(kz);
|
||||
|
||||
tdt = inflate.tdt;
|
||||
tdt.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@Override
|
||||
|
@ -130,7 +122,7 @@ public class Media extends Fragment {
|
|||
bfqkz.mt.build.seekTo(Math.toIntExact(time));
|
||||
return false;
|
||||
});
|
||||
if (!isTablet(bfq.context)) {
|
||||
if (!isTablet(com.muqingbfq.bfq.context)) {
|
||||
lrcview.setOnTapListener((view, x, y) -> {
|
||||
View kp = inflate.kp1;
|
||||
if (kp.getVisibility() == View.VISIBLE) {
|
||||
|
@ -141,10 +133,7 @@ public class Media extends Fragment {
|
|||
});
|
||||
}
|
||||
//初始化播放器列表
|
||||
inflate.bfqListMp3.
|
||||
setOnClickListener(view1 -> com.muqingbfq.fragment.bflb_db.start(bfq.context));
|
||||
|
||||
inflate.like.setOnClickListener(view1 -> {
|
||||
bfq.findViewById(R.id.like).setOnClickListener(view1 -> {
|
||||
ImageView like = (ImageView) view1;
|
||||
try {
|
||||
if (bfqkz.like_bool) {
|
||||
|
@ -166,22 +155,15 @@ public class Media extends Fragment {
|
|||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
|
||||
inflate.control.setOnClickListener(new bfq_an.control(inflate.control));
|
||||
if (bfqkz.xm != null) {
|
||||
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);
|
||||
}
|
||||
bfq_an.islike(bfq.context);
|
||||
bfq_an.islike(com.muqingbfq.bfq.context);
|
||||
new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
@ -209,7 +191,7 @@ public class Media extends Fragment {
|
|||
}
|
||||
|
||||
public static void setlike(boolean bool) {
|
||||
ImageView imageView = view.findViewById(R.id.like);
|
||||
ImageView imageView = bfq.findViewById(R.id.like);
|
||||
int color = R.color.text;
|
||||
if (bool) {
|
||||
color = android.R.color.holo_red_dark;
|
||||
|
@ -222,22 +204,22 @@ public class Media extends Fragment {
|
|||
if (home.imageView == null) {
|
||||
return;
|
||||
}
|
||||
main.handler.post(() -> home.imageView.setImageBitmap(bfq.bitmap));
|
||||
main.handler.post(() -> home.imageView.setImageBitmap(com.muqingbfq.bfq.bitmap));
|
||||
}
|
||||
|
||||
public static void setname(String str) {
|
||||
if (bfq.context == null) {
|
||||
if (com.muqingbfq.bfq.context == null) {
|
||||
return;
|
||||
}
|
||||
TextView name = bfq.context.findViewById(R.id.name);
|
||||
TextView name = com.muqingbfq.bfq.context.findViewById(R.id.name);
|
||||
name.setText(str);
|
||||
}
|
||||
|
||||
public static void setzz(String str) {
|
||||
if (bfq.context == null) {
|
||||
if (com.muqingbfq.bfq.context == null) {
|
||||
return;
|
||||
}
|
||||
TextView zz = bfq.context.findViewById(R.id.zz);
|
||||
TextView zz = com.muqingbfq.bfq.context.findViewById(R.id.zz);
|
||||
zz.setText(str);
|
||||
}
|
||||
|
||||
|
|
|
@ -102,6 +102,10 @@ public class gd extends Fragment {
|
|||
return new VH(view);
|
||||
}
|
||||
|
||||
public void setList(List<xm> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull VH holder, int position) {
|
||||
xm xm = list.get(position);
|
||||
|
|
|
@ -30,7 +30,7 @@ import com.muqingbfq.xm;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class mp3 extends AppCompatActivity {
|
||||
public class mp3 extends com.muqingbfq.mq.ActivityToolbar {
|
||||
private final List<xm> list = new ArrayList<>();
|
||||
public static RecyclerView.Adapter<MyViewHoder> lbspq;
|
||||
|
||||
|
@ -41,8 +41,6 @@ public class mp3 extends AppCompatActivity {
|
|||
Intent intent = getIntent();
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
toolbar.setTitle(intent.getStringExtra("name"));
|
||||
setSupportActionBar(toolbar);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
lbspq = new spq();
|
||||
RecyclerView lb = findViewById(R.id.lb);
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
|
||||
|
@ -50,8 +48,6 @@ public class mp3 extends AppCompatActivity {
|
|||
lb.setAdapter(lbspq);
|
||||
String id = intent.getStringExtra("id");
|
||||
new start(id);
|
||||
/* getSupportFragmentManager().beginTransaction()
|
||||
.add(R.id.bfq_db,home.bfq_db).commit();*/
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
|
|
|
@ -37,22 +37,22 @@ import java.util.List;
|
|||
public class search extends Fragment {
|
||||
public static RecyclerView.Adapter<MyViewHoder> lbspq;
|
||||
List<xm> list = new ArrayList<>();
|
||||
gd.baseadapter adapter_gd;
|
||||
public String name;
|
||||
|
||||
private String name;
|
||||
|
||||
FragmentSearchBinding inflate;
|
||||
private int i = 0;
|
||||
|
||||
public FragmentSearchBinding inflate;
|
||||
public int i = 0;
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
inflate = FragmentSearchBinding.inflate(inflater, container, false);
|
||||
lbspq = new spq();
|
||||
View view = inflate.getRoot();
|
||||
TypedValue typedValue = new TypedValue();
|
||||
requireContext().getTheme().resolveAttribute(android.R.attr.windowBackground, typedValue, true);
|
||||
// 设置背景颜色
|
||||
lbspq = new spq();
|
||||
adapter_gd = new gd.baseadapter(getContext(), list);
|
||||
view.setBackgroundColor(typedValue.data);
|
||||
inflate.tablayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||
@Override
|
||||
|
@ -86,13 +86,19 @@ public class search extends Fragment {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean getVisibility() {
|
||||
return inflate.getRoot().isShown();
|
||||
}
|
||||
|
||||
public int k;
|
||||
public void setStart(String name) {
|
||||
setVisibility(true);
|
||||
gj.sc(i);
|
||||
if (i == 0) {
|
||||
new spq();
|
||||
inflate.recyclerview.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
inflate.recyclerview.setAdapter(lbspq);
|
||||
} else if (i == 1) {
|
||||
k = (int) (main.k / getResources().getDisplayMetrics().density + 0.5f) / 120;
|
||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(),
|
||||
k);
|
||||
inflate.recyclerview.setLayoutManager(gridLayoutManager);
|
||||
inflate.recyclerview.setAdapter(adapter_gd);
|
||||
}
|
||||
new start(name);
|
||||
}
|
||||
|
||||
|
@ -100,7 +106,6 @@ public class search extends Fragment {
|
|||
public start(String name) {
|
||||
list.clear();
|
||||
search.this.name = name;
|
||||
|
||||
start();
|
||||
}
|
||||
|
||||
|
@ -115,13 +120,9 @@ public class search extends Fragment {
|
|||
}
|
||||
main.handler.post(() -> {
|
||||
if (i == 0) {
|
||||
inflate.recyclerview.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
inflate.recyclerview.setAdapter(new spq());
|
||||
lbspq.notifyDataSetChanged();
|
||||
} 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));
|
||||
adapter_gd.notifyDataSetChanged();
|
||||
}
|
||||
// lbspq.notifyDataSetChanged();
|
||||
});
|
||||
|
@ -158,7 +159,7 @@ public class search extends Fragment {
|
|||
}
|
||||
|
||||
private void gd() {
|
||||
String hq = wl.hq("/search?keywords=" + name + "&type=1000");
|
||||
String hq = wl.hq("/search?keywords=" + name + "&limit=" + (k * k) + "&type=1000");
|
||||
try {
|
||||
JSONArray jsonArray = new JSONObject(hq).getJSONObject("result")
|
||||
.getJSONArray("playlists");
|
||||
|
|
|
@ -14,6 +14,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.drawerlayout.widget.DrawerLayout;
|
||||
|
||||
import com.google.android.material.card.MaterialCardView;
|
||||
import com.google.android.material.navigation.NavigationView;
|
||||
import com.muqingbfq.fragment.Media;
|
||||
import com.muqingbfq.fragment.bfq_db;
|
||||
|
@ -22,9 +23,9 @@ import com.muqingbfq.mq.gj;
|
|||
public class home extends AppCompatActivity {
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
public static AppCompatActivity appCompatActivity;
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
public static ImageView imageView;
|
||||
|
||||
@SuppressLint({"CommitTransaction", "ObsoleteSdkInt"})
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
setTheme(R.style.Theme_muqing);
|
||||
|
@ -35,10 +36,11 @@ public class home extends AppCompatActivity {
|
|||
if (imageView == null) {
|
||||
imageView = new ImageView(this);
|
||||
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
imageView.setImageResource(R.drawable.icon);
|
||||
}
|
||||
if (bfq.bitmap != null) {
|
||||
Media.setImageBitmap();
|
||||
if (bfq.bitmap == null) {
|
||||
imageView.setImageResource(R.drawable.icon);
|
||||
} else {
|
||||
Media.setImageBitmap();
|
||||
}
|
||||
}
|
||||
try {
|
||||
//初始化工具栏
|
||||
|
|
|
@ -12,11 +12,10 @@ import android.content.Intent;
|
|||
import android.content.pm.PackageManager;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.os.Build;
|
||||
import android.support.v4.media.session.PlaybackStateCompat;
|
||||
import android.support.v4.media.MediaMetadataCompat;
|
||||
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.media.session.MediaButtonReceiver;
|
||||
|
||||
import com.muqingbfq.MyButtonClickReceiver;
|
||||
import com.muqingbfq.R;
|
||||
|
@ -30,11 +29,12 @@ public class NotificationManagerCompat {
|
|||
Service context;
|
||||
public NotificationCompat.Builder notificationBuilder;
|
||||
public androidx.core.app.NotificationManagerCompat notificationManager;
|
||||
private String name, zz;
|
||||
|
||||
public NotificationManagerCompat(Service context) {
|
||||
this.context = context;
|
||||
CharSequence name = context.getString(R.string.app_name);
|
||||
String zz = context.getString(R.string.zz);
|
||||
name = context.getString(R.string.app_name);
|
||||
zz = context.getString(R.string.zz);
|
||||
try {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name,
|
||||
|
@ -54,7 +54,7 @@ public class NotificationManagerCompat {
|
|||
intent.setComponent(new ComponentName(context, home.class));//用ComponentName得到class对象
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);// 关键的一步,设置启动模式,两种情况
|
||||
PendingIntent pendingIntent = getActivity(context, intent);
|
||||
pendingIntent = getActivity(context, intent);
|
||||
Intent my = new Intent(context, MyButtonClickReceiver.class);
|
||||
pendingIntent_kg = getBroadcast(context, my.
|
||||
setAction("kg"));
|
||||
|
@ -64,15 +64,14 @@ public class NotificationManagerCompat {
|
|||
setAction("xyq"));
|
||||
// 取消操作的PendingIntent
|
||||
// 取消操作的PendingIntent
|
||||
PendingIntent cancelIntent = MediaButtonReceiver.buildMediaButtonPendingIntent(context,
|
||||
PlaybackStateCompat.ACTION_STOP);
|
||||
androidx.media.app.NotificationCompat.MediaStyle style =
|
||||
new androidx.media.app.NotificationCompat.MediaStyle()
|
||||
.setShowActionsInCompactView(0, 1, 2)
|
||||
.setMediaSession(bfqkz.mSession.getSessionToken())
|
||||
.setShowCancelButton(true)
|
||||
.setCancelButtonIntent(cancelIntent);
|
||||
|
||||
/* PendingIntent cancelIntent = MediaButtonReceiver.buildMediaButtonPendingIntent(context,
|
||||
PlaybackStateCompat.ACTION_STOP);*/
|
||||
style = new androidx.media.app.NotificationCompat.MediaStyle()
|
||||
.setShowActionsInCompactView(0, 1, 2)
|
||||
.setMediaSession(bfqkz.mSession.getSessionToken());
|
||||
// .setShowCancelButton(true)
|
||||
// .setCancelButtonIntent(cancelIntent);
|
||||
notificationManager = androidx.core.app.NotificationManagerCompat.from(context);
|
||||
notificationBuilder = getNotificationBuilder(context)
|
||||
.setSmallIcon(R.drawable.icon)
|
||||
.setContentTitle(name).setContentText(zz)
|
||||
|
@ -81,35 +80,43 @@ public class NotificationManagerCompat {
|
|||
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
|
||||
.setContentIntent(pendingIntent)
|
||||
.setStyle(style);
|
||||
notificationManager = androidx.core.app.NotificationManagerCompat.from(context);
|
||||
tzl_an();
|
||||
tzl();
|
||||
// context.startForeground(1, notificationBuilder.build());
|
||||
} catch (Exception e) {
|
||||
yc.start(context, e);
|
||||
}
|
||||
}
|
||||
|
||||
PendingIntent pendingIntent;
|
||||
androidx.media.app.NotificationCompat.MediaStyle style;
|
||||
|
||||
@SuppressLint("RestrictedApi")
|
||||
public void tzl() {
|
||||
if (bfqkz.xm != null) {
|
||||
name = bfqkz.xm.name;
|
||||
zz = bfqkz.xm.zz;
|
||||
}
|
||||
bfqkz.build = new MediaMetadataCompat.Builder()
|
||||
.putString(MediaMetadataCompat.METADATA_KEY_TITLE, name)
|
||||
.putString(MediaMetadataCompat.METADATA_KEY_ARTIST, zz)
|
||||
.build();
|
||||
bfqkz.mSession.setMetadata(bfqkz.build);
|
||||
notificationBuilder.mActions.clear();
|
||||
notificationBuilder.addAction(android.R.drawable.ic_media_previous, "syq", pendingIntent_syq) // #0
|
||||
.addAction(bfqkz.mt.isPlaying() ? android.R.drawable.ic_media_pause : android.R.drawable.ic_media_play
|
||||
, "kg", pendingIntent_kg) // #1
|
||||
.addAction(android.R.drawable.ic_media_next, "xyq", pendingIntent_xyq)
|
||||
.setContentTitle(name)
|
||||
.setContentText(zz)
|
||||
.setOngoing(bfqkz.mt.isPlaying());
|
||||
notificationManager_notify();
|
||||
}
|
||||
|
||||
private PendingIntent pendingIntent_kg,
|
||||
pendingIntent_syq,
|
||||
pendingIntent_xyq;
|
||||
private final String CHANNEL_ID = "muqing_yy_id";
|
||||
|
||||
@SuppressLint("RestrictedApi")
|
||||
public void tzl_an() {
|
||||
notificationBuilder.mActions.clear();
|
||||
notificationBuilder
|
||||
/* .addAction(R.drawable.syq, "syq", pendingIntent_syq) // #0
|
||||
.addAction(bfqkz.mt.isPlaying() ? R.drawable.bf : R.drawable.zt
|
||||
, "kg", pendingIntent_kg) // #1
|
||||
.addAction(R.drawable.xyq, "xyq", pendingIntent_xyq);*/
|
||||
.addAction(android.R.drawable.ic_media_previous, "syq", pendingIntent_syq) // #0
|
||||
.addAction(bfqkz.mt.isPlaying() ? android.R.drawable.ic_media_pause : android.R.drawable.ic_media_play
|
||||
, "kg", pendingIntent_kg) // #1
|
||||
.addAction(android.R.drawable.ic_media_next, "xyq", pendingIntent_xyq);
|
||||
notificationBuilder.setOngoing(bfqkz.mt.isPlaying());
|
||||
notificationManager_notify();
|
||||
}
|
||||
|
||||
public void notificationManager_notify() {
|
||||
if (ActivityCompat.checkSelfPermission(context, Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED) {
|
||||
return;
|
||||
|
@ -133,7 +140,7 @@ public class NotificationManagerCompat {
|
|||
private NotificationCompat.Builder getNotificationBuilder(Context context) {
|
||||
// 适用于Android 8.0及以上版本
|
||||
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
||||
return new NotificationCompat.Builder(context, CHANNEL_ID);
|
||||
return new NotificationCompat.Builder(context, CHANNEL_ID);
|
||||
}
|
||||
|
||||
private PendingIntent getBroadcast(Context context, Intent intent) {
|
||||
|
|
|
@ -27,9 +27,12 @@ import java.text.SimpleDateFormat;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class floating extends Service {
|
||||
private static RecyclerView.Adapter<ViewHolder> lbspq = new RecyclerView.Adapter<ViewHolder>() {
|
||||
private static RecyclerView.Adapter<ViewHolder> lbspq;
|
||||
|
||||
class spq extends RecyclerView.Adapter<ViewHolder> {
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
|
@ -46,11 +49,10 @@ public class floating extends Service {
|
|||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static void start(Context context) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M &&
|
||||
Settings.canDrawOverlays(context)) {
|
||||
if (Settings.canDrawOverlays(context)) {
|
||||
context.startService(new Intent(context, floating.class));
|
||||
}
|
||||
}
|
||||
|
@ -60,7 +62,7 @@ public class floating extends Service {
|
|||
context.stopService(serviceIntent);
|
||||
}
|
||||
|
||||
public static List<String> list = new ArrayList<>();
|
||||
public static List<String> list;
|
||||
private WindowManager windowManager;
|
||||
private View view;
|
||||
private View image, layout;
|
||||
|
@ -75,7 +77,7 @@ public class floating extends Service {
|
|||
if (lbspq == null || list == null) {
|
||||
return;
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); // 创建一个 SimpleDateFormat 对象,指定时间格式
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss", Locale.CHINA); // 创建一个 SimpleDateFormat 对象,指定时间格式
|
||||
String formattedDate = sdf.format(new Date()); // 格式化当前时间
|
||||
list.add(0, formattedDate + ": " + str);
|
||||
main.handler.post(lbspq::notifyDataSetChanged);
|
||||
|
@ -85,6 +87,8 @@ public class floating extends Service {
|
|||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
list = new ArrayList<>();
|
||||
lbspq = new spq();
|
||||
view = LayoutInflater.from(this).inflate(R.layout.floating_sc, null);
|
||||
layout = view.findViewById(R.id.view1);
|
||||
ViewGroup.LayoutParams layoutParams = layout.getLayoutParams();
|
||||
|
|
|
@ -19,7 +19,7 @@ public class wj {
|
|||
public static String gd = "gd/";
|
||||
public static String tx = "image/";
|
||||
public static String gd_json = "gd.json", mp3_xz = "mp3_xz.json", gd_xz = "gd_xz.json",
|
||||
gd_phb = "gd_phb.json", mp3_like = "like.json";
|
||||
gd_phb = "gd_phb.json", mp3_like = "mp3_like.json";
|
||||
|
||||
public wj(Context context) {
|
||||
try {
|
||||
|
|
|
@ -4,11 +4,12 @@ import android.annotation.SuppressLint;
|
|||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
|
@ -68,6 +69,8 @@ public class sz extends AppCompatActivity {
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||
if (item.getItemId() == android.R.id.home) {
|
||||
|
@ -76,15 +79,20 @@ public class sz extends AppCompatActivity {
|
|||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
ActivityResultLauncher<Intent> intent = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(),
|
||||
result -> {
|
||||
if (Settings.canDrawOverlays(this)) {
|
||||
com.muqingbfq.mq.floating.start(sz.this);
|
||||
}
|
||||
});
|
||||
public void kaifazhe() {
|
||||
MaterialSwitch materialSwitch = findViewById(R.id.switch_kfz);
|
||||
materialSwitch.setOnCheckedChangeListener((compoundButton, b) -> {
|
||||
if (b) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M &&
|
||||
!Settings.canDrawOverlays(this)) {
|
||||
if (!Settings.canDrawOverlays(this)) {
|
||||
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
|
||||
Uri.parse("package:" + getPackageName()));
|
||||
startActivityForResult(intent, 114511);
|
||||
this.intent.launch(intent);
|
||||
} else {
|
||||
com.muqingbfq.mq.floating.start(sz.this);
|
||||
}
|
||||
|
@ -93,15 +101,4 @@ public class sz extends AppCompatActivity {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == 114511) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && Settings.canDrawOverlays(this)) {
|
||||
com.muqingbfq.mq.floating.start(sz.this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -6,19 +6,19 @@ import android.util.AttributeSet;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
public class TextView extends androidx.appcompat.widget.AppCompatTextView {
|
||||
public TextView(@NonNull Context context) {
|
||||
public class Text extends androidx.appcompat.widget.AppCompatTextView {
|
||||
public Text(@NonNull Context context) {
|
||||
super(context);
|
||||
initView();
|
||||
}
|
||||
|
||||
|
||||
public TextView(Context context, AttributeSet attrs) {
|
||||
public Text(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
initView();
|
||||
}
|
||||
|
||||
public TextView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
public Text(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
initView();
|
||||
}
|
|
@ -5,8 +5,8 @@
|
|||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:pathData="M995,538.7c-13.8,-8.9 -30.3,-12 -46.4,-8.5l-182.9,39.3c-28.2,6.1 -48.6,31.4 -48.6,60.2v224.6c0,21.8 -17.7,39.5 -39.6,39.5 -21.8,0 -39.5,-17.7 -39.5,-39.5s17.7,-39.6 39.5,-39.6c15.4,0 27.8,-12.4 27.8,-27.8s-12.4,-27.8 -27.8,-27.8c-52.4,0 -95.1,42.7 -95.1,95.2 0,52.4 42.7,95.1 95.1,95.1 52.5,0 95.1,-42.7 95.1,-95.1V629.8c0,-2.9 2,-5.3 4.8,-5.9l182.9,-39.3c1.9,-0.5 3.6,0.2 4.5,0.8 1,0.6 2.2,1.8 2.7,5V814c0,21.8 -17.7,39.6 -39.6,39.6 -10.5,0 -20.5,-4.1 -27.9,-11.6 -7.5,-7.5 -11.6,-17.4 -11.6,-28 0,-21.8 17.7,-39.6 39.6,-39.6 15.4,0 27.8,-12.4 27.8,-27.8s-12.4,-27.8 -27.8,-27.8c-52.5,0 -95.1,42.7 -95.1,95.1 0,25.4 9.9,49.3 27.9,67.3s41.8,27.9 67.2,27.9c52.5,0 95.1,-42.7 95.1,-95.1V590.5c0,-4.4 -0.5,-8.7 -1.4,-12.9 -3.4,-16.1 -12.9,-29.9 -26.7,-38.9z"
|
||||
android:fillColor="@color/text"/>
|
||||
android:fillColor="#000000"/>
|
||||
<path
|
||||
android:pathData="M338.3,315.1c35.3,-63.9 90.4,-114.1 158.6,-143.6 81.4,-35.2 171.7,-36.6 254.1,-3.9 106.7,42.3 183,134.9 204.1,247.8 3.1,16.7 17.7,28.4 34.1,28.4 2.1,0 4.3,-0.2 6.4,-0.6 18.9,-3.5 31.3,-21.7 27.8,-40.5C997.9,266.2 905.7,154.1 776.6,103c-99.7,-39.5 -208.8,-37.8 -307.3,4.7 -92.5,40 -165.1,111.6 -206.4,202.8 -48.9,3.6 -96.2,19.8 -137.8,48C62.2,400.9 19.7,465.3 5.3,539.7c-14.4,74.4 1,150 43.5,212.9 52.9,78.3 140.8,125 235.2,125h153.3c19.2,0 34.7,-15.6 34.7,-34.7s-15.6,-34.7 -34.7,-34.7H284c-71.3,0 -137.7,-35.3 -177.7,-94.4C74.2,666.3 62.6,609.3 73.5,553c10.9,-56.2 43,-104.8 90.5,-136.9 47.5,-32.1 104.5,-43.7 160.8,-32.8 56.2,10.9 104.8,43 136.9,90.5 10.7,15.9 32.3,20.1 48.2,9.3 15.9,-10.7 20.1,-32.3 9.3,-48.2 -42.4,-62.8 -106.6,-105.3 -180.9,-119.8z"
|
||||
android:fillColor="@color/text"/>
|
||||
android:fillColor="#000000"/>
|
||||
</vector>
|
||||
|
|
134
app/src/main/res/layout-land/activity_bfq.xml
Normal file
134
app/src/main/res/layout-land/activity_bfq.xml
Normal file
|
@ -0,0 +1,134 @@
|
|||
<?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: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"
|
||||
app:menu="@menu/bfq"
|
||||
app:navigationIcon="@drawable/end">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.muqingbfq.view.Text
|
||||
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>
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/fragment_bfq"
|
||||
android:name="com.muqingbfq.fragment.Media"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
tools:layout="@layout/fragment_bfq" />
|
||||
|
||||
<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>
|
|
@ -67,89 +67,4 @@
|
|||
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>
|
|
@ -1,22 +1,25 @@
|
|||
<?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:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:navigationIcon="@drawable/end"
|
||||
app:menu="@menu/bfq">
|
||||
app:menu="@menu/bfq"
|
||||
app:navigationIcon="@drawable/end">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
<com.muqingbfq.view.TextView
|
||||
|
||||
<com.muqingbfq.view.Text
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -34,10 +37,64 @@
|
|||
android:textSize="20sp" />
|
||||
</LinearLayout>
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
<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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
tools:layout="@layout/fragment_bfq" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:paddingBottom="26dp">
|
||||
|
||||
<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"/>
|
||||
<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" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bfq_list_mp3"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginStart="26dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:src="@drawable/cd"
|
||||
tools:ignore="ContentDescription" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
|
@ -17,7 +17,8 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center">
|
||||
android:gravity="center"
|
||||
tools:ignore="NestedWeights">
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cardview"
|
||||
android:layout_width="260dp"
|
||||
|
@ -86,57 +87,4 @@
|
|||
android:text="@string/_00_00" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:paddingBottom="26dp">
|
||||
|
||||
<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" />
|
||||
|
||||
<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" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bfq_list_mp3"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginStart="26dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:src="@drawable/cd"
|
||||
tools:ignore="ContentDescription" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
|
@ -18,6 +18,13 @@
|
|||
|
||||
<style name="fragment_dialog" parent="Theme.muqing">
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<!--设置无标题-->
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<!--设置窗口内容不覆盖-->
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.main" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
|
|
Loading…
Reference in New Issue
Block a user