diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
index b494900..6553ed7 100644
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -10,6 +10,10 @@
+
+
+
+
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 5861474..f6cd62a 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,4 +1,3 @@
-
diff --git a/app/src/main/java/com/muqingbfq/MP3.java b/app/src/main/java/com/muqingbfq/MP3.java
index 70bd8fe..00e9651 100644
--- a/app/src/main/java/com/muqingbfq/MP3.java
+++ b/app/src/main/java/com/muqingbfq/MP3.java
@@ -8,10 +8,10 @@ import java.util.Objects;
public class MP3 implements Serializable {
public String id, name, zz, url;
// 音乐的贴图
- public Object picurl;
+ public String picurl;
- public MP3(String id, String name, String zz, Object picurl) {
+ public MP3(String id, String name, String zz, String picurl) {
this.id = id;
this.name = name;
this.zz = zz;
diff --git a/app/src/main/java/com/muqingbfq/MediaPlayer.java b/app/src/main/java/com/muqingbfq/MediaPlayer.java
index fd9298e..7a6202a 100644
--- a/app/src/main/java/com/muqingbfq/MediaPlayer.java
+++ b/app/src/main/java/com/muqingbfq/MediaPlayer.java
@@ -1,11 +1,13 @@
package com.muqingbfq;
-import static com.muqingbfq.bfqkz.xm;
+
import android.annotation.SuppressLint;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.media.AudioAttributes;
+
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.DataSource;
import com.bumptech.glide.load.engine.GlideException;
@@ -14,11 +16,11 @@ import com.bumptech.glide.request.target.Target;
import com.mpatric.mp3agic.ID3v2;
import com.mpatric.mp3agic.Mp3File;
import com.muqingbfq.fragment.bflb_db;
-import com.muqingbfq.fragment.bfq_db;
import com.muqingbfq.fragment.mp3;
import com.muqingbfq.fragment.search;
import com.muqingbfq.mq.gj;
import com.muqingbfq.mq.wj;
+
import java.io.IOException;
public class MediaPlayer extends android.media.MediaPlayer {
@@ -116,7 +118,7 @@ public class MediaPlayer extends android.media.MediaPlayer {
boolean isFirstResource) {
Bitmap bitmap = null;
try {
- Mp3File mp3file = new Mp3File(wj.mp3 + bfqkz.xm.id);
+ Mp3File mp3file = new Mp3File(bfqkz.xm.picurl);
if (mp3file.hasId3v2Tag()) {
ID3v2 id3v2Tag = mp3file.getId3v2Tag();
byte[] albumImage = id3v2Tag.getAlbumImage();
@@ -148,9 +150,7 @@ public class MediaPlayer extends android.media.MediaPlayer {
@SuppressLint("NotifyDataSetChanged")
public void bfui() {
- String name = xm.name, zz = bfqkz.xm.zz;
setTX();
- bfq_db.setname(name + "/" + zz);
if (bflb_db.adapter != null) {
bflb_db.adapter.notifyDataSetChanged();
}
diff --git a/app/src/main/java/com/muqingbfq/MyButtonClickReceiver.java b/app/src/main/java/com/muqingbfq/MyButtonClickReceiver.java
index ead7746..27628ec 100644
--- a/app/src/main/java/com/muqingbfq/MyButtonClickReceiver.java
+++ b/app/src/main/java/com/muqingbfq/MyButtonClickReceiver.java
@@ -194,6 +194,7 @@ public class MyButtonClickReceiver extends BroadcastReceiver {
} else {
bfqkz.mt.start();
}
+ bfqkz.notify.tzl();
}
/**
diff --git a/app/src/main/java/com/muqingbfq/activity_search.java b/app/src/main/java/com/muqingbfq/activity_search.java
index 3894d56..902de3f 100644
--- a/app/src/main/java/com/muqingbfq/activity_search.java
+++ b/app/src/main/java/com/muqingbfq/activity_search.java
@@ -7,6 +7,7 @@ import android.annotation.SuppressLint;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
+import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
@@ -42,19 +43,17 @@ import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
-public class activity_search extends FragmentActivity {
+public class activity_search extends FragmentActivity {
private ArrayAdapter adapter;
private List json_list = new ArrayList<>();
private final List list = new ArrayList<>();
ListView listPopupWindow;
- ActivitySearchBinding binding;
@SuppressLint("NotifyDataSetChanged")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- binding = ActivitySearchBinding.inflate(getLayoutInflater());
- setContentView(binding.getRoot());
+ setContentView(getViewBinding().getRoot());
FlexboxLayoutManager manager = new FlexboxLayoutManager(this);
//设置主轴排列方式
manager.setFlexDirection(FlexDirection.ROW);
@@ -182,6 +181,11 @@ public class activity_search extends FragmentActivity {
return super.onCreateOptionsMenu(menu);
}
+ @Override
+ protected ActivitySearchBinding getViewBindingObject(LayoutInflater layoutInflater) {
+ return ActivitySearchBinding.inflate(layoutInflater);
+ }
+
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
int itemId = item.getItemId();
diff --git a/app/src/main/java/com/muqingbfq/api/FileDownloader.java b/app/src/main/java/com/muqingbfq/api/FileDownloader.java
index 7181e60..425c2ac 100644
--- a/app/src/main/java/com/muqingbfq/api/FileDownloader.java
+++ b/app/src/main/java/com/muqingbfq/api/FileDownloader.java
@@ -3,7 +3,6 @@ package com.muqingbfq.api;
import android.annotation.SuppressLint;
import android.content.Context;
-import android.graphics.Bitmap;
import android.widget.TextView;
import androidx.annotation.NonNull;
@@ -145,16 +144,13 @@ public class FileDownloader {
id3v2Tag.setLyrics(com.muqingbfq.api.url.Lrc(x.id));
ByteArrayOutputStream o = new ByteArrayOutputStream();
if (x.picurl instanceof String) {
- Request build = new Request.Builder().url(x.picurl.toString())
+ Request build = new Request.Builder().url(x.picurl)
.build();
Response execute = client.newCall(build).execute();
if (execute.isSuccessful()) {
id3v2Tag.setAlbumImage(execute.body().bytes()
, "image/jpeg");
}
- } else if (x.picurl instanceof Bitmap) {
- id3v2Tag.setAlbumImage(((Bitmap) x.picurl).getNinePatchChunk()
- , "image/jpeg");
}
o.close();
mp3file.save(file_url + x.id);
diff --git a/app/src/main/java/com/muqingbfq/api/playlist.java b/app/src/main/java/com/muqingbfq/api/playlist.java
index 055e5ae..6147ada 100644
--- a/app/src/main/java/com/muqingbfq/api/playlist.java
+++ b/app/src/main/java/com/muqingbfq/api/playlist.java
@@ -166,12 +166,9 @@ public class playlist extends Thread {
if (mp3file.hasId3v2Tag()) {
// 获取 ID3v2 标签实例
ID3v2 id3v2tag = mp3file.getId3v2Tag();
- byte[] albumImage = id3v2tag.getAlbumImage();
- Bitmap bitmap = BitmapFactory.decodeByteArray(albumImage,
- 0, albumImage.length);
MP3 mp3 = new MP3(a.toString(), id3v2tag.getTitle(),
id3v2tag.getArtist()
- , bitmap);
+ , a.toString());
list.add(mp3);
}
} catch (Exception e) {
diff --git a/app/src/main/java/com/muqingbfq/api/url.java b/app/src/main/java/com/muqingbfq/api/url.java
index 147074e..f9f3a50 100644
--- a/app/src/main/java/com/muqingbfq/api/url.java
+++ b/app/src/main/java/com/muqingbfq/api/url.java
@@ -33,6 +33,7 @@ public class url extends Thread {
getLrc(x.id);
try {
if (wj.cz(x.id)) {
+ x.url = x.id;
return x;
} else if (wj.cz(wj.mp3 + x.id)) {
x.url = wj.mp3 + x.id;
diff --git a/app/src/main/java/com/muqingbfq/bfq.java b/app/src/main/java/com/muqingbfq/bfq.java
index c1cc22b..d12c465 100644
--- a/app/src/main/java/com/muqingbfq/bfq.java
+++ b/app/src/main/java/com/muqingbfq/bfq.java
@@ -7,25 +7,27 @@ import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
+import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.util.DisplayMetrics;
+import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.LinearLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import com.google.android.material.slider.Slider;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
+import com.mpatric.mp3agic.ID3v2;
+import com.mpatric.mp3agic.Mp3File;
import com.muqingbfq.api.FileDownloader;
import com.muqingbfq.databinding.ActivityBfqBinding;
import com.muqingbfq.fragment.Media;
-import com.muqingbfq.fragment.bfq_db;
+import com.muqingbfq.mq.AppCompatActivity;
import com.muqingbfq.mq.gj;
import com.muqingbfq.mq.wj;
@@ -34,57 +36,47 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
-import me.wcy.lrcview.LrcView;
+public class bfq extends AppCompatActivity {
-public class bfq extends AppCompatActivity {
- public ActivityBfqBinding binding;
public String lrc;
public MP3 mp3;
public boolean isplay = true;
private void setLrc() {
- ViewGroup.LayoutParams layoutParams = binding.cardview.getLayoutParams();
- DisplayMetrics dm = getResources().getDisplayMetrics();
- main.k = dm.widthPixels;
- main.g = dm.heightPixels;
- layoutParams.height = main.k - 100;
- layoutParams.width = main.k - 100;
- binding.cardview.setLayoutParams(layoutParams);
-// bfqkz.mt.seekTo(Math.toIntExact(time));
if (!gj.isTablet(this)) {
- binding.lrcView.setOnClickListener((view) -> {
- View kp = binding.kp1;
- if (kp.getVisibility() == View.VISIBLE) {
- kp.setVisibility(View.GONE);
+ ViewGroup.LayoutParams layoutParams = binding.cardview.getLayoutParams();
+ DisplayMetrics dm = getResources().getDisplayMetrics();
+ main.k = dm.widthPixels;
+ main.g = dm.heightPixels;
+ layoutParams.height = main.k - 100;
+ layoutParams.width = main.k - 100;
+ binding.cardview.setLayoutParams(layoutParams);
+
+ binding.cardview.setOnClickListener((view) -> {
+ if (binding.cardview.getVisibility() == View.VISIBLE) {
+ binding.cardview.setVisibility(View.GONE);
+ binding.lrcView.setVisibility(View.VISIBLE);
} else {
- kp.setVisibility(View.VISIBLE);
+ binding.cardview.setVisibility(View.VISIBLE);
+ binding.lrcView.setVisibility(View.GONE);
}
-// binding.lrcView.setLrcline(kp.getVisibility() == View.VISIBLE);
});
+
binding.lrcView.setOnTapListener((view, x, y) -> {
- View kp = binding.kp1;
- if (kp.getVisibility() == View.VISIBLE) {
- kp.setVisibility(View.GONE);
- binding.lrcView.
- setDraggable(true, (a, time) -> {
- bfqkz.mt.seekTo((int) time);
- return false;
- });
+ if (binding.cardview.getVisibility() == View.VISIBLE) {
+ binding.cardview.setVisibility(View.GONE);
+ binding.lrcView.setVisibility(View.VISIBLE);
} else {
- kp.setVisibility(View.VISIBLE);
- binding.lrcView.
- setDraggable(false,null);
+ binding.cardview.setVisibility(View.VISIBLE);
+ binding.lrcView.setVisibility(View.GONE);
}
});
- binding.lrcView.
- setDraggable(false, null);
- } else {
- binding.lrcView.setOnClickListener(null);
- binding.lrcView.
- setDraggable(false, null);
}
-
-
+ binding.lrcView.
+ setDraggable(true, (a, time) -> {
+ bfqkz.mt.seekTo((int) time);
+ return false;
+ });
binding.tdt.addOnChangeListener((slider, value, fromUser) ->
setTime_b(bfq_an.getTime((long) value)));
binding.tdt.addOnSliderTouchListener(new Slider.OnSliderTouchListener() {
@@ -113,12 +105,9 @@ public class bfq extends AppCompatActivity {
@SuppressLint("ClickableViewAccessibility")
@Override
- protected void onCreate(@Nullable Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);/*getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);*/
- binding = ActivityBfqBinding.inflate(getLayoutInflater());
- Intent intent = getIntent();
+ protected void UI(@Nullable Bundle savedInstanceState) {
+// getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
setLrc();
- setContentView(binding.getRoot());
binding.toolbar.setNavigationOnClickListener(view1 -> finish());
binding.toolbar.setOnMenuItemClickListener(item -> {
if (item.getItemId() == R.id.fx && bfqkz.xm != null) {
@@ -142,6 +131,7 @@ public class bfq extends AppCompatActivity {
setOnClickListener(view1 -> com.muqingbfq.fragment.bflb_db.start(this));
binding.control.setOnClickListener(new bfq_an.control(binding.control));
+// binding.fragmentBfq.setOnTouchListener(new Touch());
binding.toolbar.setOnTouchListener(new Touch());
binding.getRoot().setOnTouchListener(new Touch());
@@ -178,33 +168,34 @@ public class bfq extends AppCompatActivity {
new FileDownloader(bfq.this).downloadFile(bfqkz.xm);
}
});
+ Intent intent = getIntent();
mp3 = (MP3) intent.getSerializableExtra("MP3");
- new Thread() {
- @Override
- public void run() {
- super.run();
- if (mp3 != null) {
- if (bfqkz.xm == null || !bfqkz.xm.equals(mp3)) {
- bfqkz.xm = mp3;
- bfqkz.mp3(com.muqingbfq.api.url.hq(mp3));
- }
- }
- main.handler.post(() -> {
- if (mp3 != null) {
- UI();
- }
- if (bfqkz.mt != null && bfqkz.mt.isPlaying()) {
- binding.kg.setImageResource(R.drawable.bf);
- }
- });
- main.handler.post(runnable);
- }
- }.start();
-// UI();
+ new thread().start();
}
+ class thread extends Thread {
+ @Override
+ public void run() {
+ super.run();
+ if (mp3 != null) {
+ if (bfqkz.xm == null || !bfqkz.xm.equals(mp3)) {
+ bfqkz.xm = mp3;
+ bfqkz.mp3(com.muqingbfq.api.url.hq(mp3));
+ }
+ }
+ main.handler.post(() -> {
+ if (mp3 != null) {
+ sx();
+ }
+ if (bfqkz.mt != null && bfqkz.mt.isPlaying()) {
+ binding.kg.setImageResource(R.drawable.bf);
+ }
+ });
+ main.handler.post(runnable);
+ }
+ }
- public void UI() {
+ public void sx() {
setname(mp3.name);
setzz(mp3.zz);
bfq_an.islike();
@@ -240,6 +231,11 @@ public class bfq extends AppCompatActivity {
super.onConfigurationChanged(newConfig);
}
+ @Override
+ protected ActivityBfqBinding getViewBindingObject(LayoutInflater layoutInflater) {
+ return ActivityBfqBinding.inflate(layoutInflater);
+ }
+
public class Touch implements View.OnTouchListener {
private float downY;
@@ -247,7 +243,7 @@ public class bfq extends AppCompatActivity {
@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
- LinearLayout root = binding.getRoot();
+
switch (motionEvent.getAction()) {
case MotionEvent.ACTION_DOWN:
downY = motionEvent.getRawY();
@@ -257,32 +253,34 @@ public class bfq extends AppCompatActivity {
float moveY = motionEvent.getRawY();
//移动的距离
float dy = moveY - downY;
- //重新设置控件的位置。移动
- if (dy < 0) {
- return true;
- } else if (dy > main.g - main.g / 5.0) {
+ if (dy > main.g - main.g / 5.0) { // touchSlop是系统最小识别滑动距离,可以避免抖动
+ // 在这里根据deltaY更新视图位置
finish();
return true;
+ } else if (dy < 0) {
+ return true;
}
- root.setTranslationY(dy);
- break;
+ binding.getRoot().setTranslationY(dy);
+
+ return true;
case MotionEvent.ACTION_UP:
if (binding.getRoot().getY() > main.g - main.g / 1.5) {
finish();
return true;
}
- ObjectAnimator animator = ObjectAnimator.ofFloat(root, "y", root.getY(), 0);
+ ObjectAnimator animator = ObjectAnimator.ofFloat(binding.getRoot()
+ , "y", binding.getRoot().getY(), 0);
animator.setDuration(300);
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
- root.setY(0);
+ binding.getRoot().setY(0);
}
});
animator.start();
break;
}
- return true;
+ return false;
}
}
@@ -303,7 +301,7 @@ public class bfq extends AppCompatActivity {
int position = bfqkz.mt.getCurrentPosition();
Progress(position);
}
- if (!mp3.equals(bfqkz.xm)) {
+ if (mp3 != null && !mp3.equals(bfqkz.xm)) {
mp3 = bfqkz.xm;
setname(mp3.name);
setzz(mp3.zz);
@@ -342,7 +340,6 @@ public class bfq extends AppCompatActivity {
//暂停
kgsetImageResource(R.drawable.zt);
}
- bfq_db.setkg(bool);
if (bfqkz.notify != null) {
bfqkz.notify.tzl_button();
}
@@ -350,17 +347,29 @@ public class bfq extends AppCompatActivity {
}
public void setImageBitmap() {
+ if (wj.cz(bfqkz.xm.picurl)) {
+ try {
+ Mp3File mp3file = new Mp3File(bfqkz.xm.picurl);
+ if (mp3file.hasId3v2Tag()) {
+ ID3v2 id3v2Tag = mp3file.getId3v2Tag();
+ byte[] albumImage = id3v2Tag.getAlbumImage();
+ binding.cardview.setImage(BitmapFactory.
+ decodeByteArray(albumImage, 0, albumImage.length));
+ }
+ return;
+ } catch (Exception a) {
+ gj.sc(getClass() + " yc:" + a);
+ }
+ }
binding.cardview.setImage(bfqkz.xm.picurl);
}
@Override
public void finish() {
super.finish();
- binding = null;
main.handler.removeCallbacks(runnable); // 在播放开始时启动更新进度
}
-
public void setTime_a(String str) {
binding.timeA.setText(str);
}
@@ -384,5 +393,4 @@ public class bfq extends AppCompatActivity {
binding.tdt.setValue(progress);
binding.lrcView.updateTime(progress);
}
-
}
\ No newline at end of file
diff --git a/app/src/main/java/com/muqingbfq/bfqkz.java b/app/src/main/java/com/muqingbfq/bfqkz.java
index e1a2d53..63f880d 100644
--- a/app/src/main/java/com/muqingbfq/bfqkz.java
+++ b/app/src/main/java/com/muqingbfq/bfqkz.java
@@ -21,6 +21,7 @@ import androidx.media.MediaBrowserServiceCompat;
import com.muqingbfq.api.url;
import com.muqingbfq.mq.BluetoothMusicController;
import com.muqingbfq.mq.gj;
+import com.muqingbfq.mq.wj;
import java.util.ArrayList;
import java.util.List;
diff --git a/app/src/main/java/com/muqingbfq/clean/fragment_clean.java b/app/src/main/java/com/muqingbfq/clean/fragment_clean.java
index 3ca532c..b5c9c03 100644
--- a/app/src/main/java/com/muqingbfq/clean/fragment_clean.java
+++ b/app/src/main/java/com/muqingbfq/clean/fragment_clean.java
@@ -25,7 +25,7 @@ import java.io.File;
import java.util.ArrayList;
import java.util.List;
-public class fragment_clean extends FragmentActivity {
+public class fragment_clean extends FragmentActivity {
List list = new ArrayList<>();
List list_box = new ArrayList<>();
ActivityCleanBinding binding;
@@ -58,7 +58,7 @@ public class fragment_clean extends FragmentActivity {
return new VH(inflate);
}
- @SuppressLint("ClickableViewAccessibility")
+ @SuppressLint({"ClickableViewAccessibility", "SetTextI18n"})
@Override
public void onBindViewHolder(@NonNull VH holder, int position) {
String[] s = list.get(position);
@@ -111,6 +111,11 @@ public class fragment_clean extends FragmentActivity {
return super.onCreateOptionsMenu(menu);
}
+ @Override
+ protected ActivityCleanBinding getViewBindingObject(LayoutInflater layoutInflater) {
+ return ActivityCleanBinding.inflate(layoutInflater);
+ }
+
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
diff --git a/app/src/main/java/com/muqingbfq/fragment/bfq_db.java b/app/src/main/java/com/muqingbfq/fragment/bfq_db.java
index 0bb68f4..6f621cb 100644
--- a/app/src/main/java/com/muqingbfq/fragment/bfq_db.java
+++ b/app/src/main/java/com/muqingbfq/fragment/bfq_db.java
@@ -1,7 +1,6 @@
package com.muqingbfq.fragment;
import android.annotation.SuppressLint;
-import android.content.Context;
import android.graphics.Color;
import android.os.Bundle;
import android.view.GestureDetector;
@@ -9,15 +8,12 @@ import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.ImageView;
-import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
-import com.google.gson.reflect.TypeToken;
import com.muqingbfq.MP3;
import com.muqingbfq.R;
import com.muqingbfq.bfq;
@@ -25,53 +21,20 @@ import com.muqingbfq.bfq_an;
import com.muqingbfq.bfqkz;
import com.muqingbfq.databinding.FragmentBfqDbBinding;
import com.muqingbfq.main;
-import com.muqingbfq.mq.wj;
+import com.muqingbfq.mq.gj;
-import java.lang.reflect.Type;
-import java.util.List;
+import java.util.Objects;
public class bfq_db extends Fragment implements GestureDetector.OnGestureListener {
- @SuppressLint("StaticFieldLeak")
- public static View view;
+ FragmentBfqDbBinding binding;
private GestureDetector gestureDetector;
@SuppressLint({"ClickableViewAccessibility", "SetTextI18n"})
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
- if (view == null) {
- String jsonList = this.getContext().getSharedPreferences("list", Context.MODE_PRIVATE)
- .getString("listData", null); // 获取保存的 JSON 字符串
- if (jsonList != null) {
- Type type = new TypeToken>() {
- }.getType();
- bfqkz.list = new com.google.gson.Gson().fromJson(jsonList, type);
- // 将 JSON 字符串转换回列表数据
- }
-
- bfqkz.xm = wj.getMP3FromFile();
- if (bfqkz.xm != null) {
- new Thread() {
- @Override
- public void run() {
- super.run();
- MP3 hq = com.muqingbfq.api.url.hq(bfqkz.xm);
- if (hq == null) {
- return;
- }
- try {
- bfqkz.mt.DataSource(hq);
- } catch (Exception e) {
- com.muqingbfq.mq.gj.sc(e);
- }
- }
- }.start();
- }
- }
-
- FragmentBfqDbBinding binding = FragmentBfqDbBinding.inflate(getLayoutInflater(),
+ binding = FragmentBfqDbBinding.inflate(getLayoutInflater(),
container, false);
- view = binding.getRoot();
binding.kg.setOnClickListener(v -> {
if (bfqkz.mt == null) {
return;
@@ -82,17 +45,15 @@ public class bfq_db extends Fragment implements GestureDetector.OnGestureListene
} else {
bfqkz.mt.start();
}
- setkg(bfqkz.mt.isPlaying());
+// setkg(bfqkz.mt.isPlaying());
});
binding.txb.setOnClickListener(view -> bflb_db.start(getContext()));
-// view.setOnClickListener(vw -> bfq.start(getContext()));
gestureDetector = new GestureDetector(getContext(), this);
- view.setOnTouchListener((view, motionEvent) -> {
-/* if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
- view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.bj));
- return true;
- }*/
+ binding.getRoot().setOnTouchListener((view, motionEvent) -> {
+ if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
+ binding.name.setTranslationX(0);
+ }
return gestureDetector.onTouchEvent(motionEvent);
});
// 恢复列表数据
@@ -102,41 +63,53 @@ public class bfq_db extends Fragment implements GestureDetector.OnGestureListene
if (bfqkz.mt != null) {
setkg(bfqkz.mt.isPlaying());
}
- return view;
- }
-
- private static T findViewById(int id) {
- return view.findViewById(id);
- }
-
- public static void setkg(boolean bool) {
- if (view != null) {
- ImageView imageView = findViewById(R.id.kg);
- if (bool) {
- imageView.setImageResource(R.drawable.bf);
- } else {
- imageView.setImageResource(R.drawable.zt);
- }
- }
- }
-
- public static void setname(String str) {
- if (view != null) {
- TextView textView = findViewById(R.id.name);
- textView.setText(str);
- }
- }
-
- public static TextView getname() {
- if (view != null) {
- return findViewById(R.id.name);
- }
- return null;
+ return binding.getRoot();
}
@Override
- public boolean onDown(@NonNull MotionEvent motionEvent) {
- view.setBackgroundColor(Color.parseColor("#80F2ECF6"));
+ public void onResume() {
+ super.onResume();
+ main.handler.post(runnable);
+ }
+
+ @Override
+ public void onPause() {
+ super.onPause();
+ main.handler.removeCallbacks(runnable);
+ }
+
+ MP3 mp3;
+ boolean isPlaying = false;
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ if (!Objects.equals(mp3, bfqkz.xm)) {
+ mp3 = bfqkz.xm;
+ setname(mp3.name + "/" + mp3.zz);
+ }
+ if (bfqkz.mt != null && bfqkz.mt.isPlaying() != isPlaying) {
+ setkg(bfqkz.mt.isPlaying());
+ }
+ main.handler.postDelayed(this, 1000);
+ }
+ };
+
+ public void setkg(boolean bool) {
+ if (bool) {
+ binding.kg.setImageResource(R.drawable.bf);
+ } else {
+ binding.kg.setImageResource(R.drawable.zt);
+ }
+ isPlaying = bool;
+ }
+
+ public void setname(String str) {
+ binding.name.setText(str);
+ }
+
+ @Override
+ public boolean onDown(@NonNull MotionEvent motionEvent) {
+ binding.getRoot().setBackgroundColor(Color.parseColor("#80F2ECF6"));
return true;
}
@@ -147,28 +120,27 @@ public class bfq_db extends Fragment implements GestureDetector.OnGestureListene
@Override
public boolean onSingleTapUp(@NonNull MotionEvent motionEvent) {
bfq.startactivity(getContext(), bfqkz.xm);
-// view.setBackgroundColor(ContextCompat.getColor(getContext(),R.color.bj));
-// view.setBackgroundColor(ContextCompat.getColor(getContext(),R.color.bj));
+ binding.getRoot().setBackgroundColor(ContextCompat.getColor(getContext(), R.color.bj));
return true;
}
@Override
public boolean onScroll(@Nullable MotionEvent motionEvent, @NonNull MotionEvent motionEvent1,
float v, float v1) {
- getname().setTranslationX(view.getTranslationX() - v);
- view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.bj));
+ binding.name.setTranslationX(binding.name.getTranslationX() - v);
+ binding.getRoot().setBackgroundColor(ContextCompat.getColor(getContext(), R.color.bj));
return false;
}
@Override
public void onLongPress(@NonNull MotionEvent motionEvent) {
-
+ binding.getRoot().setBackgroundColor(ContextCompat.getColor(getContext(), R.color.bj));
}
@Override
public boolean onFling(@Nullable MotionEvent e1,
@NonNull MotionEvent e2, float v, float v1) {
- view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.bj));
+ binding.getRoot().setBackgroundColor(ContextCompat.getColor(getContext(), R.color.bj));
float distance = e1.getX() - e2.getX();
float threshold = main.k / 2.0f;
// 判断手势方向并限制滑动距离
@@ -181,7 +153,6 @@ public class bfq_db extends Fragment implements GestureDetector.OnGestureListene
// 在这里添加你的逻辑代码
bfq_an.syq();
}
- getname().setTranslationX(0);
return true;
}
}
\ No newline at end of file
diff --git a/app/src/main/java/com/muqingbfq/fragment/gd.java b/app/src/main/java/com/muqingbfq/fragment/gd.java
index 114017e..e54da0a 100644
--- a/app/src/main/java/com/muqingbfq/fragment/gd.java
+++ b/app/src/main/java/com/muqingbfq/fragment/gd.java
@@ -1,6 +1,7 @@
package com.muqingbfq.fragment;
import android.annotation.SuppressLint;
+import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
@@ -24,7 +25,8 @@ import com.muqingbfq.api.playlist;
import com.muqingbfq.api.resource;
import com.muqingbfq.bfq_an;
import com.muqingbfq.bfqkz;
-import com.muqingbfq.databinding.FragmentMp3Binding;
+import com.muqingbfq.databinding.ActivityGdBinding;
+import com.muqingbfq.databinding.ActivityMp3Binding;
import com.muqingbfq.databinding.ListGdBBinding;
import com.muqingbfq.databinding.ListGdBinding;
import com.muqingbfq.main;
@@ -41,19 +43,16 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-public class gd extends com.muqingbfq.mq.FragmentActivity {
+public class gd extends com.muqingbfq.mq.FragmentActivity {
public static String gdid;
private final List list = new ArrayList<>();
public static RecyclerView.Adapter adapter;
int k;
- FragmentMp3Binding binding;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- binding = FragmentMp3Binding.inflate(getLayoutInflater());
- setContentView(binding.getRoot());
-
+ setContentView(getViewBinding().getRoot());
Intent intent = getIntent();
binding.title.setText(intent.getStringExtra("name"));
adapter = new baseadapter(this, list);
@@ -65,6 +64,11 @@ public class gd extends com.muqingbfq.mq.FragmentActivity {
new start(id);
}
+ @Override
+ protected ActivityGdBinding getViewBindingObject(LayoutInflater layoutInflater) {
+ return ActivityGdBinding.inflate(layoutInflater);
+ }
+
@SuppressLint("NotifyDataSetChanged")
class start extends Thread {
String id;
diff --git a/app/src/main/java/com/muqingbfq/fragment/mp3.java b/app/src/main/java/com/muqingbfq/fragment/mp3.java
index 05b28ee..05a2d40 100644
--- a/app/src/main/java/com/muqingbfq/fragment/mp3.java
+++ b/app/src/main/java/com/muqingbfq/fragment/mp3.java
@@ -31,7 +31,7 @@ import com.muqingbfq.api.playlist;
import com.muqingbfq.bfq;
import com.muqingbfq.bfq_an;
import com.muqingbfq.bfqkz;
-import com.muqingbfq.databinding.FragmentMp3Binding;
+import com.muqingbfq.databinding.ActivityMp3Binding;
import com.muqingbfq.databinding.ListMp3Binding;
import com.muqingbfq.list.MyViewHoder;
import com.muqingbfq.main;
@@ -43,21 +43,19 @@ import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
-public class mp3 extends FragmentActivity {
+public class mp3 extends FragmentActivity {
private List list = new ArrayList<>();
private List list_ys = new ArrayList<>();
public static Adapter adapter;
- FragmentMp3Binding binding;
// private static String id;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- binding = FragmentMp3Binding.inflate(getLayoutInflater());
+ setContentView(getViewBinding().getRoot());
Intent intent = getIntent();
binding.title.setText(intent.getStringExtra("name"));
String id = intent.getStringExtra("id");
- setContentView(binding.getRoot());
adapter = new Adapter(list);
binding.lb.setLayoutManager(new LinearLayoutManager(this));
binding.lb.setAdapter(adapter);
@@ -94,6 +92,11 @@ public class mp3 extends FragmentActivity {
return super.onCreateOptionsMenu(menu);
}
+ @Override
+ protected ActivityMp3Binding getViewBindingObject(LayoutInflater layoutInflater) {
+ return ActivityMp3Binding.inflate(layoutInflater);
+ }
+
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
int itemId = item.getItemId();
diff --git a/app/src/main/java/com/muqingbfq/home.java b/app/src/main/java/com/muqingbfq/home.java
index 2c981cc..154aaf2 100644
--- a/app/src/main/java/com/muqingbfq/home.java
+++ b/app/src/main/java/com/muqingbfq/home.java
@@ -8,10 +8,12 @@ import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v4.media.MediaBrowserCompat;
import android.util.DisplayMetrics;
+import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
@@ -27,20 +29,24 @@ import com.muqingbfq.mq.gj;
import java.util.ArrayList;
import java.util.List;
-public class home extends AppCompatActivity {
+public class home extends com.muqingbfq.mq.AppCompatActivity {
@SuppressLint("StaticFieldLeak")
public static AppCompatActivity appCompatActivity;
- ActivityHomeBinding binding;
+// ActivityHomeBinding binding;
public MediaBrowserCompat mBrowser;
+ @Override
+ protected ActivityHomeBinding getViewBindingObject(LayoutInflater layoutInflater) {
+ return ActivityHomeBinding.inflate(layoutInflater);
+ }
+
@Override
protected void onCreate(Bundle savedInstanceState) {
appCompatActivity = this;
setTheme(R.style.Theme_muqing);
super.onCreate(savedInstanceState);
- binding = ActivityHomeBinding.inflate(getLayoutInflater());
- setContentView(binding.getRoot());
+ setContentView(getViewBinding().getRoot());
// binding.toolbar.setPadding(0, gj.getztl(this), 0, 0);
DisplayMetrics dm = getResources().getDisplayMetrics();
main.k = dm.widthPixels;
@@ -67,12 +73,18 @@ public class home extends AppCompatActivity {
//检测更新
new gj.jianchagengxin(this);
UI();
+
// startService(new Intent(this, FloatingLyricsService.class));
} catch (Exception e) {
yc.tc(this, e);
}
}
+ @Override
+ protected void UI(@Nullable Bundle savedInstanceState) {
+
+ }
+
public static ComponentName componentName;
private class Adaper extends FragmentStateAdapter {
diff --git a/app/src/main/java/com/muqingbfq/login/enroll.java b/app/src/main/java/com/muqingbfq/login/enroll.java
deleted file mode 100644
index c845b00..0000000
--- a/app/src/main/java/com/muqingbfq/login/enroll.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package com.muqingbfq.login;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.os.Bundle;
-import android.text.TextUtils;
-import android.view.View;
-import android.view.inputmethod.InputMethodManager;
-import android.widget.EditText;
-
-import com.muqingbfq.R;
-import com.muqingbfq.mq.FragmentActivity;
-import com.muqingbfq.mq.gj;
-import com.muqingbfq.mq.wl;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-public class enroll extends FragmentActivity {
- EditText edit_account, edit_username,
- edit_password, edit_email;
-
- public String account, username, password, email, appID;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_enroll);
- Intent intent = getIntent();
- //获取UID编辑框
- edit_account = findViewById(R.id.edit_user);
- edit_username = findViewById(R.id.edit_name);
- //设置密码编辑框
- edit_password = findViewById(R.id.edit_password);
- edit_email = findViewById(R.id.edit_email);
- edit_username.setText(
- intent.getStringExtra("user"));
- appID = intent.getStringExtra("appID");
- findViewById(R.id.enroll).setOnClickListener(view -> a());
- }
-
- public void a() {
- InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
- View v = getWindow().peekDecorView();
- if (null != v) {
- imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
- }
- }
-
- private void end() {
- Intent intent = new Intent(); // 创建一个新意图
- Bundle bundle = new Bundle(); // 创建一个新包裹
- // 往包裹存入名叫response_time的字符串
- bundle.putString("user", account);
- // 往包裹存入名叫response_content的字符串
- bundle.putString("password", password);
- intent.putExtras(bundle); // 把快递包裹塞给意图
- // 携带意图返回上一个页面。RESULT_OK表示处理成功
- setResult(Activity.RESULT_OK, intent);
- finish(); // 结束当前的活动页面
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/muqingbfq/login/user_editing.java b/app/src/main/java/com/muqingbfq/login/user_editing.java
deleted file mode 100644
index e37efb9..0000000
--- a/app/src/main/java/com/muqingbfq/login/user_editing.java
+++ /dev/null
@@ -1,170 +0,0 @@
-package com.muqingbfq.login;
-
-import android.Manifest;
-import android.annotation.SuppressLint;
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.database.Cursor;
-import android.net.Uri;
-import android.os.Bundle;
-import android.provider.MediaStore;
-import android.text.TextUtils;
-import android.view.View;
-import android.widget.EditText;
-import android.widget.ImageView;
-
-import androidx.activity.result.ActivityResultLauncher;
-import androidx.activity.result.contract.ActivityResultContracts;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.core.app.ActivityCompat;
-import androidx.core.content.ContextCompat;
-
-import com.bumptech.glide.Glide;
-import com.muqingbfq.R;
-import com.muqingbfq.databinding.ActivityUserEditingBinding;
-import com.muqingbfq.fragment.sz;
-import com.muqingbfq.main;
-import com.muqingbfq.mq.FragmentActivity;
-import com.muqingbfq.mq.gj;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import java.io.File;
-import java.io.IOException;
-
-import okhttp3.Call;
-import okhttp3.Callback;
-import okhttp3.MediaType;
-import okhttp3.MultipartBody;
-import okhttp3.OkHttpClient;
-import okhttp3.Request;
-import okhttp3.RequestBody;
-import okhttp3.Response;
-
-public class user_editing extends FragmentActivity {
- //头像,用户名,签名,性别,背景
- ImageView imageViewa;
- EditText edit_name, edit_qianming;
- ImageView imageViewb;
- String file_a, file_b;
- ActivityUserEditingBinding binding;
- @SuppressLint("CheckResult")
- ActivityResultLauncher setimagea =
- registerForActivityResult(new ActivityResultContracts.StartActivityForResult(),
- result -> {
- if (result.getResultCode() == RESULT_OK) {
- Intent data = result.getData();
- if (data != null) {
- Uri uri = data.getData();
- file_a = getImagePath(uri);
- Glide.with(user_editing.this)
- .load(file_a)
- .error(R.drawable.icon)
- .into(imageViewa);
- // 处理选择的图片
- }
-
- }
- }), setimageb =
- registerForActivityResult(new ActivityResultContracts.StartActivityForResult(),
- result -> {
- if (result.getResultCode() == RESULT_OK) {
- Intent data = result.getData();
- if (data != null) {
- Uri imageUri = data.getData();
- file_b = getImagePath(imageUri);
- Glide.with(user_editing.this)
- .load(file_b)
- .error(R.drawable.icon)
- .into(imageViewb);
- // 处理选择的图片
- }
- }
- });
-
- @Override
- protected void onCreate(@Nullable Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- binding = ActivityUserEditingBinding.inflate(getLayoutInflater());
- setContentView(binding.getRoot());
- imageViewa = findViewById(R.id.image1);
- edit_name = findViewById(R.id.edit_name);
- edit_qianming = findViewById(R.id.edit_qianming);
- imageViewb = findViewById(R.id.image2);
- new Thread() {
- @Override
- public void run() {
- super.run();
- try {
-// user_message.string string = user_message.get();
-/*
- main.handler.post(() -> {
- Glide.with(user_editing.this)
- .load(string.headIcon())
- .into(imageViewa);
- edit_name.setText(string.userName());
- edit_qianming.setText(string.introduce());
- Glide.with(user_editing.this)
- .load(string.cover())
- .into(imageViewb);
- String gender = string.gender();
- if (gender.equals("1")) {
- gender = "男";
- } else {
- gender = "女";
- }
- binding.autoComplete.setText(gender);
- });*/
- } catch (Exception e) {
- gj.sc(e);
- }
- }
- }.start();
-
- View.OnClickListener onClickListener = view -> {
- Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
- intent.setType("image/*");
- intent.putExtra(Intent.EXTRA_MIME_TYPES, new String[]{"image/jpeg", "image/png", "image/jpg", "image/gif"}); // 指定可选的文件类型
- intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true); // 仅显示本地存储的文件
- // 检查权限
- if (ContextCompat.checkSelfPermission(user_editing.this,
- Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
- // 如果没有写入存储的权限,则请求权限
- ActivityCompat.requestPermissions(user_editing.this,
- new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
- 1);
- } else {
- if (view.getId() == R.id.image1) {
- setimagea.launch(new Intent(Intent.ACTION_PICK,
- MediaStore.Images.Media.EXTERNAL_CONTENT_URI));
- } else if (view.getId() == R.id.image2) {
- setimageb.launch(new Intent(Intent.ACTION_PICK,
- MediaStore.Images.Media.EXTERNAL_CONTENT_URI));
- }
- }
- };
- imageViewa.setOnClickListener(onClickListener);
- imageViewb.setOnClickListener(onClickListener);
- binding.userEnd.setOnClickListener(view ->{
- finish();
-// main.settoken(null, null);
- });
- }
-
- // 获取图片的实际路径
- private String getImagePath(Uri uri) {
- String path = null;
- String[] projection = {MediaStore.Images.Media.DATA};
- Cursor cursor = getContentResolver().query(uri, projection, null, null, null);
- if (cursor != null) {
- int columnIndex = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
- if (cursor.moveToFirst()) {
- path = cursor.getString(columnIndex);
- }
- cursor.close();
- }
- return path;
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/muqingbfq/main.java b/app/src/main/java/com/muqingbfq/main.java
index 002b378..b8b07bb 100644
--- a/app/src/main/java/com/muqingbfq/main.java
+++ b/app/src/main/java/com/muqingbfq/main.java
@@ -3,6 +3,7 @@ package com.muqingbfq;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Application;
+import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
@@ -14,12 +15,15 @@ import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatDelegate;
+import com.google.gson.reflect.TypeToken;
import com.muqingbfq.login.visitor;
import com.muqingbfq.mq.FloatingLyricsService;
import com.muqingbfq.mq.wj;
import com.muqingbfq.mq.wl;
import java.io.File;
+import java.lang.reflect.Type;
+import java.util.List;
public class main extends Application {
public static Application application;
@@ -86,6 +90,32 @@ public class main extends Application {
}
AppCompatDelegate.setDefaultNightMode(i);
+ String jsonList = this.getSharedPreferences("list", Context.MODE_PRIVATE)
+ .getString("listData", null); // 获取保存的 JSON 字符串
+ if (jsonList != null) {
+ Type type = new TypeToken>() {
+ }.getType();
+ bfqkz.list = new com.google.gson.Gson().fromJson(jsonList, type);
+ // 将 JSON 字符串转换回列表数据
+ }
+ bfqkz.xm = wj.getMP3FromFile();
+ if (bfqkz.xm != null) {
+ new Thread() {
+ @Override
+ public void run() {
+ super.run();
+ MP3 hq = com.muqingbfq.api.url.hq(bfqkz.xm);
+ if (hq == null) {
+ return;
+ }
+ try {
+ bfqkz.mt.DataSource(hq);
+ } catch (Exception e) {
+ com.muqingbfq.mq.gj.sc(e);
+ }
+ }
+ }.start();
+ }
registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() {
@Override
@@ -122,7 +152,7 @@ public class main extends Application {
try {
sleep(1000);
} catch (InterruptedException e) {
- e.toString();
+ e.printStackTrace();
}
// gj.sc(count);
if (count != 0) {
diff --git a/app/src/main/java/com/muqingbfq/mq/AppCompatActivity.java b/app/src/main/java/com/muqingbfq/mq/AppCompatActivity.java
new file mode 100644
index 0000000..ed97630
--- /dev/null
+++ b/app/src/main/java/com/muqingbfq/mq/AppCompatActivity.java
@@ -0,0 +1,30 @@
+package com.muqingbfq.mq;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+
+import androidx.annotation.Nullable;
+import androidx.viewbinding.ViewBinding;
+
+import com.jaeger.library.StatusBarUtil;
+
+public abstract class AppCompatActivity extends androidx.appcompat.app.AppCompatActivity {
+
+ protected abstract ViewBindingType getViewBindingObject(LayoutInflater layoutInflater);
+
+ protected ViewBindingType getViewBinding() {
+ binding = getViewBindingObject(getLayoutInflater());
+ return binding;
+ }
+
+ public ViewBindingType binding;
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ StatusBarUtil.setTransparent(this);
+ setContentView(getViewBinding().getRoot());
+ UI(savedInstanceState);
+ }
+
+ protected abstract void UI(@Nullable Bundle savedInstanceState);
+}
diff --git a/app/src/main/java/com/muqingbfq/mq/FragmentActivity.java b/app/src/main/java/com/muqingbfq/mq/FragmentActivity.java
index 2a073e1..feaaf8e 100644
--- a/app/src/main/java/com/muqingbfq/mq/FragmentActivity.java
+++ b/app/src/main/java/com/muqingbfq/mq/FragmentActivity.java
@@ -1,14 +1,26 @@
package com.muqingbfq.mq;
+import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import androidx.annotation.NonNull;
-import androidx.appcompat.app.AppCompatActivity;
+import androidx.viewbinding.ViewBinding;
+import com.jaeger.library.StatusBarUtil;
import com.muqingbfq.R;
-public class FragmentActivity extends AppCompatActivity {
+public abstract class FragmentActivity
+ extends androidx.appcompat.app.AppCompatActivity {
+
+ protected abstract ViewBindingType getViewBindingObject(LayoutInflater layoutInflater);
+
+ protected ViewBindingType getViewBinding() {
+ binding = getViewBindingObject(getLayoutInflater());
+ return binding;
+ }
+
+ public ViewBindingType binding;
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
if (item.getItemId() == android.R.id.home) {
@@ -29,6 +41,7 @@ public class FragmentActivity extends AppCompatActivity {
@Override
public void setContentView(View view) {
+ StatusBarUtil.setTransparent(this);
super.setContentView(view);
setToolbar();
}
diff --git a/app/src/main/java/com/muqingbfq/mq/NotificationManagerCompat.java b/app/src/main/java/com/muqingbfq/mq/NotificationManagerCompat.java
index 417be08..a6cc10b 100644
--- a/app/src/main/java/com/muqingbfq/mq/NotificationManagerCompat.java
+++ b/app/src/main/java/com/muqingbfq/mq/NotificationManagerCompat.java
@@ -17,7 +17,6 @@ import androidx.core.app.NotificationCompat;
import com.muqingbfq.MyButtonClickReceiver;
import com.muqingbfq.R;
-import com.muqingbfq.bfq;
import com.muqingbfq.bfqkz;
import com.muqingbfq.yc;
diff --git a/app/src/main/java/com/muqingbfq/view/CardImage.java b/app/src/main/java/com/muqingbfq/view/CardImage.java
index 5b7fb1d..c4df59c 100644
--- a/app/src/main/java/com/muqingbfq/view/CardImage.java
+++ b/app/src/main/java/com/muqingbfq/view/CardImage.java
@@ -14,7 +14,7 @@ import com.muqingbfq.main;
import com.muqingbfq.mq.gj;
public class CardImage extends MaterialCardView {
- private ImageView imageView;
+ public ImageView imageView;
public CardImage(Context context) {
super(context);
diff --git a/app/src/main/res/layout-land/activity_bfq.xml b/app/src/main/res/layout-land/activity_bfq.xml
index 51eacc8..914e799 100644
--- a/app/src/main/res/layout-land/activity_bfq.xml
+++ b/app/src/main/res/layout-land/activity_bfq.xml
@@ -5,6 +5,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
+ android:background="?android:colorBackground"
android:orientation="vertical">
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+ app:layout_constraintBottom_toTopOf="@+id/kg"
+ tools:layout_editor_absoluteX="20dp">
+ android:text="@string/_00_00"
+ android:textSize="20sp" />
+ app:trackColorActive="@color/thumbColor"
+ tools:ignore="SpeakableTextPresentCheck" />
-
-
-
-
-
-
-
-
-
+ android:text="@string/_00_00"
+ android:textSize="20sp" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_bfq.xml b/app/src/main/res/layout/activity_bfq.xml
index 6316367..f448630 100644
--- a/app/src/main/res/layout/activity_bfq.xml
+++ b/app/src/main/res/layout/activity_bfq.xml
@@ -4,9 +4,10 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:fitsSystemWindows="true"
android:background="?android:colorBackground"
+ android:fitsSystemWindows="true"
android:orientation="vertical">
+
-
-
+
-
-
-
-
-
-
-
+ android:layout_height="match_parent"
+ android:visibility="gone"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent"/>
+
+ app:layout_constraintStart_toStartOf="parent"
+ tools:ignore="ContentDescription" />
+ android:text="@string/_00_00"
+ android:textSize="20sp" />
+ app:trackColorActive="@color/thumbColor"
+ tools:ignore="SpeakableTextPresentCheck" />
+ android:text="@string/_00_00"
+ android:textSize="20sp" />
diff --git a/app/src/main/res/layout/activity_gd.xml b/app/src/main/res/layout/activity_gd.xml
index 9b57c88..eadad64 100644
--- a/app/src/main/res/layout/activity_gd.xml
+++ b/app/src/main/res/layout/activity_gd.xml
@@ -16,11 +16,34 @@
android:textSize="26sp"
android:textColor="@color/text"/>
-
+ android:layout_weight="1">
+
+
+
+
+
+
+
+
1000
- 16sp
+ 20sp
+ 16sp
12sp
16dp
1dp