更新了UI

This commit is contained in:
muqing 2024-07-19 08:03:23 +08:00
parent 90795a4b18
commit de76eefd7d
34 changed files with 616 additions and 603 deletions

View File

@ -1,14 +1,12 @@
云音乐是什么?
## 云音乐是什么?
一个对接网易云的音乐播放器
* 内置集成作者自己写的歌词Lrc组件支持单行歌词和多行歌词支持悬浮窗歌词。
* 内置适配Android13的通知栏 (不完善请大佬请教)
* 对接了网易云的歌单,歌曲,搜索,二维码登录等其余功能。
* main.java-内api变量是网易云SDK后台服务器地址可变更
* http 是我服务器php接口的地址用于软件更新用或者其他功能个根据需要做出必须的更改或者删除
进度:
## 进度
* UI
* 歌单
* 音乐播放选择列表
@ -25,53 +23,22 @@
* 基本播放器功能(控制暂停 上下曲 播放歌单操作)
## 截图
<img alt="Screenshot_20240224_154259_com.muqingbfq.jpg" height="700" src="image%2FScreenshot_20240224_154259_com.muqingbfq.jpg" width="300"/>
<img alt="Screenshot_20240224_154302_com.muqingbfq.jpg" height="700" src="image%2FScreenshot_20240224_154302_com.muqingbfq.jpg" width="300"/>
<img alt="Screenshot_20240224_154306_com.muqingbfq.jpg" height="700" src="image%2FScreenshot_20240224_154306_com.muqingbfq.jpg" width="300"/>
* 在使用中有任何问题,欢迎反馈给我,可以用以下联系方式跟我交流
* [邮件](<a target="_blank"
%2href="http://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&email=MAEJBgYJBAQDAABwQUEeU19d"
style="text-decoration:
none;"><img src="http://rescdn.qqmail.com/zh_CN/htmledition/images/function/qm_open/ico_mailme_12.png"/></a>)
## 在使用中有任何问题,欢迎反馈给我,可以用以下联系方式跟我交流
* QQ:1966944300
* 后台源码-Github: [网易云音乐 API](https://github.com/Binaryify/NeteaseCloudMusicApi)
开发者说 :
## 后台
* Github: [网易云音乐 API](https://github.com/Binaryify/NeteaseCloudMusicApi)
## 关于
在兴趣的驱动下,写一个`免费`的东西,有欣喜,也还有汗水,希望你喜欢我的作品,同时也能支持一下。
导入的包
```javascript
dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.code.gson:gson:2.9.1'
implementation 'com.squareup.okhttp3:okhttp:4.11.0'
//图片处理
implementation 'com.github.bumptech.glide:glide:4.16.0'
implementation "androidx.palette:palette:1.0.0"
// 废弃的歌词组件
// implementation 'com.github.wangchenyan:lrcview:2.2.1'
implementation 'com.google.android.flexbox:flexbox:3.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
//修改音乐标签库
implementation 'com.mpatric:mp3agic:0.9.1'
// 沉浸式状态栏
api project(path: ':StatusBarUtil')
api project(path: ':lrcview')
}
```
修改JAR的包
## 修改JAR的包
```javascript
[//]: # (主要修改内容MD3化)
com.github.QuadFlask:colorpicker:0.0.15

View File

@ -6,6 +6,7 @@ import android.content.res.AssetManager;
import android.os.Build;
import android.os.Bundle;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
@ -14,14 +15,15 @@ import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.google.android.material.bottomsheet.BottomSheetDialog;
import com.muqingbfq.databinding.ActivityAboutSoftwareBinding;
import com.muqingbfq.databinding.ListKaifazheBinding;
import com.muqingbfq.mq.AppCompatActivity;
import com.muqingbfq.mq.gj;
import com.muqingbfq.mq.wj;
@ -32,21 +34,20 @@ import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class activity_about_software extends AppCompatActivity {
public class activity_about_software extends AppCompatActivity<ActivityAboutSoftwareBinding> {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about_software);
setContentView();
try {
String versionName = getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
((TextView) findViewById(R.id.text2)).setText(String.format("%s Bate", versionName));
binding.text2.setText(String.format("%s Bate", versionName));
} catch (PackageManager.NameNotFoundException e) {
yc.start(this, e);
}
setSupportActionBar(findViewById(R.id.toolbar));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
findViewById(R.id.button1).setOnClickListener(view -> {
wj.sc(wj.filesdri + "gx.mq");
new Thread() {
@Override
public void run() {
@ -103,6 +104,11 @@ public class activity_about_software extends AppCompatActivity {
return super.onOptionsItemSelected(item);
}
@Override
protected ActivityAboutSoftwareBinding getViewBindingObject(LayoutInflater layoutInflater) {
return ActivityAboutSoftwareBinding.inflate(layoutInflater);
}
class botton extends BottomSheetDialog {
List<Object[]> list = new ArrayList<>();

View File

@ -0,0 +1,75 @@
package com.muqingbfq.adapter;
import android.content.Context;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.muqingbfq.MP3;
import com.muqingbfq.R;
import com.muqingbfq.api.url;
import com.muqingbfq.bfqkz;
import com.muqingbfq.databinding.ListMp3ImageBinding;
import com.muqingbfq.mq.VH;
import java.util.ArrayList;
import java.util.List;
public class AdapterMp3 extends RecyclerView.Adapter<VH<ListMp3ImageBinding>> {
public List<MP3> list = new ArrayList<>();
@NonNull
@Override
public VH<ListMp3ImageBinding> onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new VH<>(ListMp3ImageBinding.inflate(
LayoutInflater.from(parent.getContext()), parent, false));
}
@Override
public void onBindViewHolder(@NonNull VH<ListMp3ImageBinding> holder, int position) {
MP3 x = list.get(position);
holder.binding.wb1.setText(x.name);
holder.binding.zz.setText(x.zz);
if (bfqkz.xm != null && x.id.equals(bfqkz.xm.id)) {
TypedValue typedValue = new TypedValue();
holder.itemView.getContext().getTheme().resolveAttribute(
com.google.android.material.R.attr.colorPrimaryDark, typedValue, true);
int colorSurface = typedValue.data;
// 这里 colorSurface 就是你要找的颜色值
holder.binding.getRoot().setCardBackgroundColor(colorSurface);
} else {
holder.binding.getRoot().setCardBackgroundColor(ContextCompat
.getColor(holder.itemView.getContext(), android.R.color.transparent));
}
holder.itemView.setOnClickListener(view -> {
if (bfqkz.xm == null || !bfqkz.xm.id.equals(x.id)) {
bfqkz.xm = x;
new url(x);
notifyDataSetChanged();
} else if (!bfqkz.mt.isPlaying()) {
bfqkz.mt.start();
}
if (!bfqkz.list.contains(x)) {
bfqkz.list.add(0, x);
}
// bfqkz.list.addAll(list);
// bfq.start(getContext());
});
Glide.with(holder.itemView.getContext()).load(x.picurl)
.apply(new RequestOptions().placeholder(R.drawable.ic_launcher_foreground))
.error(R.drawable.ic_launcher_foreground)
.into(holder.binding.imageView);
}
@Override
public int getItemCount() {
return list.size();
}
}

View File

@ -52,11 +52,7 @@ public class url extends Thread {
// gj.sc(json);
if (json.getInt("code") == -460) {
String message = json.getString("message");
main.handler.post(() -> {
gj.ts(home.activity, message);
home.activity.startActivity(new android.content.Intent(home.activity
, com.muqingbfq.login.user_logs.class));
});
gj.sc(message);
return null;
}
JSONArray data = json.getJSONArray("data");

View File

@ -171,9 +171,9 @@ public class bfq extends AppCompatActivity<ActivityBfqBinding>
}
}
@SuppressLint("ClickableViewAccessibility")
@Override
protected void UI(@Nullable Bundle savedInstanceState) {
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView();
gestureDetector = new GestureDetector(this, this);
setLrc();
rotateAnimation = ObjectAnimator.ofFloat(binding.cardview
@ -223,7 +223,7 @@ public class bfq extends AppCompatActivity<ActivityBfqBinding>
bfqkz.like_bool = !bfqkz.like_bool;
wj.xrwb(wj.gd + "mp3_like.json", gson.toJson(list));
} catch (Exception e) {
e.printStackTrace();
gj.sc(e);
}
});
binding.download.setOnClickListener(view -> {

View File

@ -10,23 +10,19 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.muqingbfq.MP3;
import com.muqingbfq.R;
import com.muqingbfq.XM;
import com.muqingbfq.activity_search;
import com.muqingbfq.adapter.AdapterMp3;
import com.muqingbfq.api.resource;
import com.muqingbfq.api.url;
import com.muqingbfq.bfqkz;
import com.muqingbfq.databinding.FragmentGdBinding;
import com.muqingbfq.databinding.ListMp3ImageBinding;
import com.muqingbfq.main;
import com.muqingbfq.mq.Fragment;
import com.muqingbfq.mq.gj;
import com.muqingbfq.mq.wj;
import com.muqingbfq.mq.wl;
@ -37,10 +33,9 @@ import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
public class gd_adapter extends Fragment {
public class gd_adapter extends Fragment<FragmentGdBinding> {
List<XM> list = new ArrayList<>();
List<MP3> listmp3 = new ArrayList<>();
FragmentGdBinding binding;
AdapterMp3 adapterMp3 = new AdapterMp3();
public void toolbar() {
// binding.bar.setupWithDrawer
@ -52,15 +47,18 @@ public class gd_adapter extends Fragment {
toggle.syncState();
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
protected FragmentGdBinding inflateViewBinding(LayoutInflater inflater, ViewGroup container) {
return FragmentGdBinding.inflate(inflater, container, false);
}
@Override
public void setUI(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
binding = FragmentGdBinding.inflate(getLayoutInflater(), container, false);
//初始化工具栏
toolbar();
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext(),LinearLayoutManager.HORIZONTAL,false);
binding.recyclerview1.setHasFixedSize(true);
binding.recyclerview1.setNestedScrollingEnabled(false);
binding.recyclerview1.setLayoutManager(linearLayoutManager);
@ -74,81 +72,12 @@ public class gd_adapter extends Fragment {
}
}.start();
binding.recyclerview2.setLayoutManager(new LinearLayoutManager(getContext()) {
@Override
public boolean canScrollVertically() {
return false;
}
});
binding.recyclerview2.setAdapter(new RecyclerView.Adapter<VH_MP3>() {
@NonNull
@Override
public VH_MP3 onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new VH_MP3(ListMp3ImageBinding.inflate(getLayoutInflater(), parent, false));
}
@SuppressLint("NotifyDataSetChanged")
@Override
public void onBindViewHolder(@NonNull VH_MP3 holder, int position) {
MP3 x = listmp3.get(position);
holder.binding.wb1.setText(x.name);
holder.binding.zz.setText(x.zz);
if (bfqkz.xm != null && x.id.equals(bfqkz.xm.id)) {
int musicListBackgroundColor = ContextCompat.getColor(holder.itemView.getContext(), R.color.bj);
holder.binding.getRoot().setBackgroundColor(musicListBackgroundColor);
}else{
holder.binding.getRoot().setBackground(ContextCompat
.getDrawable(holder.itemView.getContext(),R.drawable.background));
}
holder.itemView.setOnClickListener(view -> {
if (bfqkz.xm == null || !bfqkz.xm.id.equals(x.id)) {
bfqkz.xm = x;
new url(x);
notifyDataSetChanged();
} else if (!bfqkz.mt.isPlaying()) {
bfqkz.mt.start();
}
if (!bfqkz.list.contains(x)) {
bfqkz.list.add(0, x);
}
// bfqkz.list.addAll(list);
// bfq.start(getContext());
});
Glide.with(getContext()).load(x.picurl)
.apply(new RequestOptions().placeholder(R.drawable.ic_launcher_foreground))
.error(R.drawable.ic_launcher_foreground)
.into(holder.binding.imageView);
}
@Override
public int getItemCount() {
return listmp3.size();
}
});
mp3list();
binding.recyclerview2.setLayoutManager(new LinearLayoutManager(getContext()));
binding.recyclerview2.setNestedScrollingEnabled(false);
binding.recyclerview2.setAdapter(adapterMp3);
binding.toolbar.setOnClickListener(v -> activity_search.start(getActivity(), v));
return binding.getRoot();
}
class VH_MP3 extends RecyclerView.ViewHolder {
ListMp3ImageBinding binding;
public VH_MP3(@NonNull ListMp3ImageBinding itemView) {
super(itemView.getRoot());
this.binding = itemView;
}
}
@SuppressLint("NotifyDataSetChanged")
@Override
public void onResume() {
super.onResume();
if (binding.recyclerview1.getAdapter() != null) {
binding.recyclerview1.getAdapter().notifyDataSetChanged();
}
}
private class sx implements Runnable {
@SuppressLint("NotifyDataSetChanged")
@Override
@ -166,7 +95,7 @@ public class gd_adapter extends Fragment {
super.run();
String hq = wl.hq("/recommend/songs" + "?cookie=" + wl.Cookie);
if (hq == null) {
hq = wj.dqwb(wj.filesdri + "songs.josn");
hq = wj.dqwb(wj.filesdri + "songs.json");
}
try {
JSONObject jsonObject = new JSONObject(hq);
@ -183,11 +112,11 @@ public class gd_adapter extends Fragment {
}
JSONObject al = jsonObject1.getJSONObject("al");
String picUrl = al.getString("picUrl");
listmp3.add(new MP3(id, name, zz.toString(), picUrl));
adapterMp3.list.add(new MP3(id, name, zz.toString(), picUrl));
}
wj.xrwb(wj.filesdri + "songs.josn", hq);
main.handler.post(() -> {
binding.recyclerview2.getAdapter().notifyDataSetChanged();
wj.xrwb(wj.filesdri + "songs.json", hq);
requireActivity().runOnUiThread(() -> {
adapterMp3.notifyDataSetChanged();
binding.recyclerview2Bar.setVisibility(View.GONE);
});
} catch (Exception e) {

View File

@ -8,6 +8,7 @@ import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
@ -89,9 +90,6 @@ public class mp3 extends FragmentActivity<ActivityMp3Binding> {
}
});
//添加Android自带的分割线
binding.lb.addItemDecoration(
new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
}
@Override
@ -208,11 +206,15 @@ public class mp3 extends FragmentActivity<ActivityMp3Binding> {
holder.binding.name.setText(x.name);
holder.binding.zz.setText(x.zz);
if (bfqkz.xm != null && x.id.equals(bfqkz.xm.id)) {
int musicListBackgroundColor = ContextCompat.getColor(holder.getContext(), R.color.bj);
holder.binding.getRoot().setBackgroundColor(musicListBackgroundColor);
TypedValue typedValue = new TypedValue();
holder.itemView.getContext().getTheme().resolveAttribute(
com.google.android.material.R.attr.colorPrimaryDark, typedValue, true);
int colorSurface = typedValue.data;
// 这里 colorSurface 就是你要找的颜色值
holder.binding.getRoot().setCardBackgroundColor(colorSurface);
}else{
holder.binding.getRoot().setBackground(ContextCompat
.getDrawable(holder.getContext(),R.drawable.background));
holder.binding.getRoot().setCardBackgroundColor(ContextCompat
.getColor(holder.itemView.getContext(), android.R.color.transparent));
}
// holder.binding.zz.setTextColor(color);
holder.itemView.setOnClickListener(view -> {

View File

@ -3,7 +3,6 @@ package com.muqingbfq.fragment;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.LayoutInflater;
@ -16,18 +15,13 @@ import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.gson.Gson;
import com.muqingbfq.R;
@ -41,6 +35,7 @@ import com.muqingbfq.login.user_logs;
import com.muqingbfq.login.visitor;
import com.muqingbfq.main;
import com.muqingbfq.mq.EditViewDialog;
import com.muqingbfq.mq.Fragment;
import com.muqingbfq.mq.gj;
import com.muqingbfq.mq.wj;
@ -54,10 +49,9 @@ import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class wode extends Fragment {
public class wode extends Fragment<FragmentWdBinding> {
public TextView name, jieshao;
public ImageView imageView;
FragmentWdBinding binding;
private final Object[][] lista = {
{R.drawable.mdimusicbox, "最近播放", "mp3_hc.json"},
{R.drawable.download, "下载音乐", "mp3_xz.json"},
@ -72,22 +66,14 @@ public class wode extends Fragment {
@SuppressLint("StaticFieldLeak")
public static baseadapter adaper;
public void toolbar() {
((AppCompatActivity) requireActivity()).setSupportActionBar(binding.toolbar);
DrawerLayout drawerLayout = requireActivity().findViewById(R.id.chct);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
requireActivity(), drawerLayout, binding.toolbar, R.string.app_name, R.string.app_name);
drawerLayout.addDrawerListener(toggle);
toggle.syncState();
@Override
protected FragmentWdBinding inflateViewBinding(LayoutInflater inflater, ViewGroup container) {
return FragmentWdBinding.inflate(inflater, container, false);
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
public void setUI(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
binding = FragmentWdBinding.inflate(inflater, container, false);
//初始化工具栏
toolbar();
name = binding.text1;
binding.appbar.addOnOffsetChangedListener((appBarLayout, verticalOffset) -> {
gj.sc(binding.text1.isShown());
@ -217,7 +203,6 @@ public class wode extends Fragment {
binding.recyclerview2.setAdapter(adaper);
sx();
denglu();
return binding.getRoot();
}
ActivityResultLauncher<Intent> dlintent = registerForActivityResult(

View File

@ -1,7 +1,6 @@
package com.muqingbfq;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@ -14,10 +13,7 @@ import android.view.Menu;
import android.view.MenuItem;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager2.adapter.FragmentStateAdapter;
import androidx.viewpager2.widget.ViewPager2;
@ -25,7 +21,7 @@ import com.jaeger.library.StatusBarUtil;
import com.muqingbfq.databinding.ActivityHomeBinding;
import com.muqingbfq.fragment.gd_adapter;
import com.muqingbfq.fragment.wode;
import com.muqingbfq.login.visitor;
import com.muqingbfq.mq.AppCompatActivity;
import com.muqingbfq.mq.gj;
import com.muqingbfq.mq.wl;
@ -34,20 +30,18 @@ import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
public class home extends AppCompatActivity {
public class home extends AppCompatActivity<ActivityHomeBinding> {
public MediaBrowserCompat mBrowser;
@SuppressLint("StaticFieldLeak")
public static Context activity;
ActivityHomeBinding binding;
@Override
protected ActivityHomeBinding getViewBindingObject(LayoutInflater layoutInflater) {
return ActivityHomeBinding.inflate(layoutInflater);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
setTheme(R.style.Theme_muqing);
activity = this;
super.onCreate(savedInstanceState);
wl.Cookie = main.sp.getString("Cookie", "");
if (wl.Cookie.equals("")) {
if (wl.Cookie.isEmpty()) {
new Thread() {
@Override
public void run() {
@ -56,9 +50,7 @@ public class home extends AppCompatActivity {
try {
JSONObject jsonObject = new JSONObject(hq);
wl.setcookie(jsonObject.getString("cookie"));
home.this.runOnUiThread(() -> {
UI();
});
home.this.runOnUiThread(() -> UI());
} catch (Exception e) {
com.muqingbfq.mq.gj.sc(e);
}
@ -68,14 +60,15 @@ public class home extends AppCompatActivity {
UI();
}
}
@Override
protected void onResume() {
super.onResume();
}
public static ComponentName componentName;
List<Fragment> list = new ArrayList<>();
public void UI() {
binding = ActivityHomeBinding.inflate(getLayoutInflater());
StatusBarUtil.setTransparent(home.this);
setContentView(binding.getRoot());
setContentView();
DisplayMetrics dm = getResources().getDisplayMetrics();
main.k = dm.widthPixels;
main.g = dm.heightPixels;

View File

@ -6,15 +6,16 @@ import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Base64;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import com.muqingbfq.databinding.ActivityUserLogsBinding;
import com.muqingbfq.main;
import com.muqingbfq.mq.AppCompatActivity;
import com.muqingbfq.mq.gj;
import com.muqingbfq.mq.wl;
@ -23,7 +24,12 @@ import org.json.JSONObject;
import java.util.Objects;
public class user_logs extends AppCompatActivity {
public class user_logs extends AppCompatActivity<ActivityUserLogsBinding> {
@Override
protected ActivityUserLogsBinding getViewBindingObject(LayoutInflater layoutInflater) {
return ActivityUserLogsBinding.inflate(layoutInflater);
}
public static class USER {
public String name, qianming;
public Object picUrl;
@ -35,13 +41,11 @@ public class user_logs extends AppCompatActivity {
}
}
ActivityUserLogsBinding binding;
erweima thread;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityUserLogsBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
setContentView();
setSupportActionBar(binding.toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
binding.login.setOnClickListener(view -> new CloudUser());
@ -103,8 +107,9 @@ public class user_logs extends AppCompatActivity {
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
}
user_logs.this.account = binding.editUser.getText().toString();
user_logs.this.password = binding.editPassword.getText().toString();
start();
gj.xcts(user_logs.this, "设置成功");
wl.setcookie(account);
// start();
}
@Override
@ -123,8 +128,6 @@ public class user_logs extends AppCompatActivity {
String avatarUrl = data.getString("avatarUrl");//用户头像
String signature = data.getString("signature");//用户签名
String cookie = jsonObject.getString("cookie");
gj.xcts(user_logs.this, "登录成功");
wl.setcookie(cookie);
new user_message(nickname, signature, avatarUrl);
user_logs.this.finish(true);
} else if (code == 502) {

View File

@ -29,7 +29,7 @@ import java.util.List;
public class main extends Application {
public static Application application;
public static Handler handler = new Handler(Looper.getMainLooper());
public static String api = "https://service-8xjb06vc-1319932248.gz.tencentapigw.com.cn/release";
public static String api = "https://api.csm.sayqz.com";
public static String http = "https://www.muqingkaifazhe.top/muqingbfq.php";
public static int k, g;
public static SharedPreferences sp;

View File

@ -2,6 +2,7 @@ package com.muqingbfq.mq;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import androidx.annotation.Nullable;
import androidx.viewbinding.ViewBinding;
@ -18,15 +19,7 @@ public abstract class AppCompatActivity<ViewBindingType extends ViewBinding> ext
}
public ViewBindingType binding;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
StatusBarUtil.setTransparent(this);
setContentView(getViewBinding().getRoot());
UI(savedInstanceState);
}
protected void UI(@Nullable Bundle savedInstanceState) {
public void setContentView() {
super.setContentView(getViewBinding().getRoot());
}
}

View File

@ -19,6 +19,7 @@ import androidx.annotation.Nullable;
import com.dirror.lyricviewx.LyricEntry;
import com.dirror.lyricviewx.LyricViewX;
import com.google.android.material.card.MaterialCardView;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.muqingbfq.R;
@ -28,9 +29,10 @@ import com.muqingbfq.main;
import java.io.File;
import java.lang.reflect.Type;
public class FloatingLyricsService extends Service implements View.OnClickListener, View.OnTouchListener {
private WindowManager windowManager;
private View layout;
FloatLrcviewBinding binding;
public Runnable updateSeekBar = new Runnable() {
@Override
@ -45,19 +47,20 @@ public class FloatingLyricsService extends Service implements View.OnClickListen
}
}
if (index < LyricViewX.lyricEntryList.size()) {
String text;
LyricEntry currentLrc = LyricViewX.lyricEntryList.get(index);
text = currentLrc.text;
binding.lrcView.setText(currentLrc.text);
if (currentLrc.secondText != null) {
text += "\n" + currentLrc.secondText;
binding.lrcViewMessage.setText(currentLrc.secondText);
}else{
binding.lrcViewMessage.setText("");
}
binding.lrcView.setText(text);
}
handler.postDelayed(this, 1000); // 每秒更新一次进度
}
};
@SuppressLint("StaticFieldLeak")
public static FloatingLyricsService lei;
public static boolean get() {
File file = new File(wj.filesdri + "FloatingLyricsService.json");
if (file.exists() && file.isFile()) {
@ -71,9 +74,10 @@ public class FloatingLyricsService extends Service implements View.OnClickListen
return false;
}
}
Handler handler = new Handler();
FloatLrcviewBinding binding;
WindowManager.LayoutParams params;
public static class SETUP {
//0是关闭 1是打开 2是锁定
public int i = 1, size = 20;
@ -83,6 +87,7 @@ public class FloatingLyricsService extends Service implements View.OnClickListen
}
public SETUP setup = new SETUP();
public int lock() {
if (setup != null && setup.i == 2) {
return WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
@ -91,6 +96,7 @@ public class FloatingLyricsService extends Service implements View.OnClickListen
return WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
| WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
}
@Override
public void onCreate() {
super.onCreate();
@ -107,8 +113,7 @@ public class FloatingLyricsService extends Service implements View.OnClickListen
// 创建悬浮窗歌词的 View
// FloatLrcviewBinding
binding = FloatLrcviewBinding.inflate(LayoutInflater.from(this));
layout = binding.getRoot();
layout.setOnTouchListener(this);
// binding.getRoot().setOnTouchListener(this);
// int i = WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE;FLAG_NOT_TOUCH_MODAL
params = new WindowManager.LayoutParams(
WindowManager.LayoutParams.MATCH_PARENT,
@ -122,24 +127,24 @@ public class FloatingLyricsService extends Service implements View.OnClickListen
params.y = setup.Y;
binding.lrcView.setAlpha(setup.Alpha);
binding.lrcView.setTextSize(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PX,
binding.getRoot().setAlpha(setup.Alpha);
float v = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PX,
setup.size,
getResources().getDisplayMetrics()));
getResources().getDisplayMetrics());
binding.lrcView.setTextSize(v);
binding.lrcView.setTextColor(Color.parseColor(setup.Color));
binding.lrcViewMessage.setTextSize(v-1.0f);
binding.lrcViewMessage.setTextColor(Color.parseColor(setup.Color));
binding.lock.setOnClickListener(this);
// params.gravity = Gravity.CENTER;
// 获取 WindowManager 并将悬浮窗歌词添加到窗口中
windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
windowManager.addView(layout, params);
windowManager.addView(binding.getRoot(), params);
if (setup.i == 2) {
setyc();
/* params.flags = lock();
layout.setBackground(null);
binding.lrcView.setAlpha(setup.Alpha);
layout.findViewById(R.id.lock).setVisibility(View.GONE);*/
} else {
show();
}
@ -158,8 +163,8 @@ public class FloatingLyricsService extends Service implements View.OnClickListen
public void onDestroy() {
super.onDestroy();
// Service 销毁时移除悬浮窗歌词
if (windowManager != null && layout != null) {
windowManager.removeView(layout);
if (windowManager != null && binding != null) {
windowManager.removeView(binding.getRoot());
handler.removeCallbacks(updateSeekBar); // 在播放开始时启动更新进度
}
lei = null;
@ -176,6 +181,7 @@ public class FloatingLyricsService extends Service implements View.OnClickListen
wj.xrwb(new File(wj.filesdri + "FloatingLyricsService.json").toString(),
new Gson().toJson(setup));
}
public static void baocun(SETUP setup) {
if (setup == null) {
return;
@ -202,7 +208,7 @@ public class FloatingLyricsService extends Service implements View.OnClickListen
int offsetY = (int) (motionEvent.getRawY() - initialTouchY);
setup.Y = initialY + offsetY;
params.y = setup.Y;
windowManager.updateViewLayout(layout, params);
windowManager.updateViewLayout(binding.getRoot(), params);
return true;
case MotionEvent.ACTION_UP:
baocun();
@ -235,10 +241,8 @@ public class FloatingLyricsService extends Service implements View.OnClickListen
public void setyc() {
setup.i = 2;
params.flags = lock();
layout.setBackground(null);
binding.lrcView.setAlpha(setup.Alpha);
layout.findViewById(R.id.lock).setVisibility(View.GONE);
windowManager.updateViewLayout(layout, params);
binding.lock.setVisibility(View.GONE);
windowManager.updateViewLayout(binding.getRoot(), params);
baocun();
}
@ -246,9 +250,8 @@ public class FloatingLyricsService extends Service implements View.OnClickListen
public void show() {
setup.i = 1;
params.flags = lock();
binding.lrcView.setAlpha(1.0f);
layout.findViewById(R.id.lock).setVisibility(View.VISIBLE);
windowManager.updateViewLayout(layout, params);
binding.lock.setVisibility(View.VISIBLE);
windowManager.updateViewLayout(binding.getRoot(), params);
baocun();
}
}

View File

@ -0,0 +1,27 @@
package com.muqingbfq.mq;
import android.graphics.Rect;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.viewbinding.ViewBinding;
public abstract class Fragment<Binding extends ViewBinding> extends androidx.fragment.app.Fragment {
protected abstract Binding inflateViewBinding(LayoutInflater inflater,ViewGroup container);
public Binding binding;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
binding=inflateViewBinding(inflater,container);
setUI(inflater, container, savedInstanceState);
return binding.getRoot();
}
public abstract void setUI(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState);
}

View File

@ -0,0 +1,13 @@
package com.muqingbfq.mq;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewbinding.ViewBinding;
public class RecyclerAdapter {
}

View File

@ -0,0 +1,16 @@
package com.muqingbfq.mq;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewbinding.ViewBinding;
public class VH<bind extends ViewBinding> extends RecyclerView.ViewHolder {
public bind binding;
public VH(bind itemView) {
super(itemView.getRoot());
binding = itemView;
}
}

View File

@ -144,11 +144,10 @@ public class gj {
String bb = jsonObject.getString("bb");
main.handler.post(() -> new MaterialAlertDialogBuilder(context)
.setTitle("更新" + bb)
.setMessage(msg + "\n" + "取消后不再提示更新你需要到关于软件手动检测")
.setNegativeButton("取消", (dialogInterface, i) -> wj.xrwb(wj.filesdri + "gx.mq", null))
.setMessage(msg)
.setNegativeButton("取消", null)
.setPositiveButton("更新", (dialogInterface, i) -> context.startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse(url))))
// new ApkDownloader(context).downloadAndInstall(url, wj.filesdri))
.show());
}
//1表示需要更新
@ -158,7 +157,6 @@ public class gj {
}
return 400;
}
public static void tcjp(EditText editText) {
editText.requestFocus();//获取焦点
InputMethodManager imm = (InputMethodManager)

View File

@ -42,13 +42,17 @@ import okhttp3.Response;
public class llq extends AppCompatActivity<ActivityLlqBinding> {
WebView web;
@Override
protected ActivityLlqBinding getViewBindingObject(LayoutInflater layoutInflater) {
return ActivityLlqBinding.inflate(layoutInflater);
}
@SuppressLint("SetJavaScriptEnabled")
@Override
protected void UI(@Nullable Bundle savedInstanceState) {
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView();
Intent intent = getIntent();
setSupportActionBar(binding.toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
@ -108,6 +112,7 @@ public class llq extends AppCompatActivity<ActivityLlqBinding> {
public void onFailure(@NonNull Call call, @NonNull IOException e) {
}
@Override
public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException {
InputStream inputStream = response.body().byteStream();
@ -131,13 +136,13 @@ public class llq extends AppCompatActivity<ActivityLlqBinding> {
}
fileOutputStream.close();
} catch (Exception e) {
e.printStackTrace();
}finally {
gj.sc(e);
} finally {
if (fileOutputStream != null) {
fileOutputStream.close();
}
}
main.handler.post(()->{
main.handler.post(() -> {
gj.ts(llq.this, "下载完成");
show.dismiss();
});
@ -162,9 +167,11 @@ public class llq extends AppCompatActivity<ActivityLlqBinding> {
});
loadUrl(intent.getStringExtra("url"));
}
private void loadUrl(String url) {
web.loadUrl(url);
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
@ -174,11 +181,13 @@ public class llq extends AppCompatActivity<ActivityLlqBinding> {
gj.ts(this, "权限已授予,请重新执行文件下载操作");
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.llq, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public void onBackPressed() {
if (web.canGoBack()) {
@ -187,6 +196,7 @@ public class llq extends AppCompatActivity<ActivityLlqBinding> {
finish();
}
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
int itemId = item.getItemId();

View File

@ -31,19 +31,22 @@ import com.muqingbfq.databinding.ActivitySzBinding;
import com.muqingbfq.databinding.ActivitySzSetlrcBinding;
import com.muqingbfq.mq.AppCompatActivity;
import com.muqingbfq.mq.FloatingLyricsService;
import com.muqingbfq.mq.gj;
import com.muqingbfq.mq.wj;
import java.io.File;
import java.lang.reflect.Type;
import java.util.Locale;
public class sz extends AppCompatActivity<ActivitySzBinding> {
@Override
protected ActivitySzBinding getViewBindingObject(LayoutInflater layoutInflater) {
return ActivitySzBinding.inflate(layoutInflater);
}
@Override
protected void UI(Bundle bundle) {
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView();
setSupportActionBar(binding.toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setTitle(getString(R.string.sz));
@ -82,6 +85,7 @@ public class sz extends AppCompatActivity<ActivitySzBinding> {
}
});
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
if (item.getItemId() == android.R.id.home) {
@ -89,9 +93,11 @@ public class sz extends AppCompatActivity<ActivitySzBinding> {
}
return super.onOptionsItemSelected(item);
}
public static class setlrc extends Fragment implements Slider.OnSliderTouchListener,
Slider.OnChangeListener {
ActivitySzSetlrcBinding binding;
boolean is = true;
ActivityResultLauncher<Intent> LyricsService =
registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> {
if (Settings.canDrawOverlays(getContext())) {
@ -99,15 +105,16 @@ public class sz extends AppCompatActivity<ActivitySzBinding> {
} else {
binding.switchA3.setChecked(false);
binding.slide1.setEnabled(true);
binding.slide2.setEnabled(true);
}
});
FloatingLyricsService.SETUP setup;
public Runnable updateSeekBar = new Runnable() {
class ThreadLrc extends Thread {
@Override
public void run() {
if (bfqkz.mt.isPlaying()) {
super.run();
while (is) {
int index = 0;
for (int i = 0; i < LyricViewX.lyricEntryList.size(); i++) {
LyricEntry lineLrc = LyricViewX.lyricEntryList.get(i);
@ -118,20 +125,25 @@ public class sz extends AppCompatActivity<ActivitySzBinding> {
}
}
if (index < LyricViewX.lyricEntryList.size()) {
String text;
LyricEntry currentLrc = LyricViewX.lyricEntryList.get(index);
text = currentLrc.text;
requireActivity().runOnUiThread(() -> {
if (currentLrc.secondText != null) {
text += "\n" + currentLrc.secondText;
binding.lrcViewMessage.setText(currentLrc.secondText);
} else {
binding.lrcViewMessage.setText("");
}
binding.lrcView.setText(currentLrc.text);
});
}
gj.sc("ThreadLrc");
try {
sleep(1000);
} catch (InterruptedException e) {
break;
}
binding.lrctext.setText(text);
}
}
// gj.sc(getClass()+"执行");
main.handler.postDelayed(this, 1000); // 每秒更新一次进度
}
};
@Nullable
@Override
@ -145,18 +157,19 @@ public class sz extends AppCompatActivity<ActivitySzBinding> {
}.getType();
binding.slide1.setEnabled(true);
binding.slide2.setEnabled(true);
setup = gson.fromJson(dqwb, type);
binding.slide1.setValue(setup.size);
binding.slide2.setValue(setup.Alpha);
binding.lrctext.setAlpha(setup.Alpha);
binding.lrctext.setTextSize(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PX,
binding.lrcView.setTextSize(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PX,
setup.size,
getResources().getDisplayMetrics()));
binding.lrctext.setTextColor(Color.parseColor(setup.Color));
binding.lrctext.setOnClickListener(view -> ColorPickerDialogBuilder
binding.lrcView.setTextColor(Color.parseColor(setup.Color));
binding.lrcViewMessage.setTextSize(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PX,
setup.size,
getResources().getDisplayMetrics()) - 1.0f);
binding.lrcViewMessage.setTextColor(Color.parseColor(setup.Color));
binding.lrclin.setOnClickListener(view -> ColorPickerDialogBuilder
.with(view.getContext())
.setTitle("调色盘")
.initialColor(Color.parseColor(setup.Color))
@ -166,18 +179,18 @@ public class sz extends AppCompatActivity<ActivitySzBinding> {
})
.setPositiveButton("确定", (dialog, selectedColor, allColors) -> {
setup.Color = String.format("#%08X", selectedColor);
binding.lrctext.setTextColor(selectedColor);
binding.lrcView.setTextColor(selectedColor);
binding.lrcViewMessage.setTextColor(selectedColor);
FloatingLyricsService.baocun(setup);
})
.setNegativeButton("取消", null)
.build()
.show());
binding.textSlide1.setText(String.valueOf(setup.size));
binding.textSlide2.setText(String.format(Locale.US, "%.2f", setup.Alpha));
if (setup.i != 0) {
binding.switchA3.setChecked(true);
}
main.handler.post(updateSeekBar);
new ThreadLrc().start();
}
binding.switchA3.setOnCheckedChangeListener((compoundButton, b) -> {
if (b) {
@ -206,16 +219,13 @@ public class sz extends AppCompatActivity<ActivitySzBinding> {
binding.slide1.addOnChangeListener(this);
binding.slide1.addOnSliderTouchListener(this);
binding.slide2.addOnChangeListener(this);
binding.slide2.addOnSliderTouchListener(this);
return binding.getRoot();
}
@Override
public void onDestroy() {
super.onDestroy();
main.handler.removeCallbacks(updateSeekBar);
is = false;
}
@Override
@ -236,17 +246,14 @@ public class sz extends AppCompatActivity<ActivitySzBinding> {
if (setup == null) {
return;
}
if (slider == binding.slide1) {
setup.size = (int) value;
binding.lrctext.setTextSize(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PX,
float v = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PX,
setup.size,
getResources().getDisplayMetrics()));
getResources().getDisplayMetrics());
binding.lrcView.setTextSize(v);
binding.lrcViewMessage.setTextSize(v - 1.0f);
binding.textSlide1.setText(String.valueOf(setup.size));
} else if (slider == binding.slide2) {
setup.Alpha = value;
binding.lrctext.setAlpha(value);
binding.textSlide2.setText(String.format(Locale.US, "%.2f", value));
}
}
}

View File

@ -1,7 +1,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="60"
android:endColor="#252525"
android:startColor="#474242"
android:endColor="?attr/colorPrimary"
android:startColor="?attr/colorPrimaryContainer"
android:type="linear" />
</shape>

View File

@ -1,78 +1,104 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:fitsSystemWindows="true"
android:orientation="vertical"
tools:context=".activity_about_software">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.CollapsingToolbarLayout
style="?attr/collapsingToolbarLayoutLargeStyle"
android:layout_width="match_parent"
android:layout_height="?attr/collapsingToolbarLayoutLargeSize"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:title="@string/about" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="10dp"
android:layout_marginTop="6dp"
app:cardBackgroundColor="?attr/colorSurface"
app:cardElevation="1dp"
app:cardForegroundColor="@android:color/transparent"
app:strokeColor="?attr/colorOutline"
app:strokeWidth="0dp"
app:shapeAppearance="?attr/shapeAppearanceMediumComponent"
app:cardElevation="1dp">
app:strokeColor="?attr/colorOutline"
app:strokeWidth="0dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<androidx.constraintlayout.utils.widget.ImageFilterView
android:layout_width="50dp"
android:layout_height="50dp"
app:round="16dp"
app:srcCompat="@drawable/ic_launcher_foreground"
android:layout_marginTop="5dp"
android:background="@color/bj"
android:layout_marginTop="5dp"/>
app:round="16dp"
app:srcCompat="@drawable/ic_launcher_foreground" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:textStyle="bold"
android:layout_marginTop="6dp"
android:textSize="16sp"/>
android:text="@string/app_name"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:textStyle="bold"
android:layout_marginTop="6dp"
android:layout_marginBottom="5dp"/>
android:layout_marginBottom="5dp"
android:text="@string/app_name"
android:textStyle="bold" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<androidx.core.widget.NestedScrollView
<TextView
android:id="@+id/text1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginHorizontal="10dp"
android:layout_marginVertical="10dp"
android:requiresFadingEdge="vertical"
android:layout_weight="1"
android:fadingEdgeLength="50dp"
android:layout_weight="1">
<TextView
android:id="@+id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="bold" />
</androidx.core.widget.NestedScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginHorizontal="10dp"
android:layout_marginBottom="10dp">
android:layout_marginBottom="10dp"
android:orientation="vertical">
<Button
android:id="@+id/button1"
@ -88,4 +114,7 @@
android:layout_height="wrap_content"
android:text="@string/juanzeng" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -46,11 +46,13 @@
<com.muqingbfq.view.CardImage
style="@style/Widget.Material3.CardView.Elevated"
android:id="@+id/cardview"
android:layout_width="256dp"
android:layout_height="256dp"
app:cardBackgroundColor="@color/tm"
app:cardCornerRadius="180dp"
app:cardElevation="0dp"
app:layout_constraintBottom_toBottomOf="@id/fragment_bfq"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@ -21,7 +21,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/text"
android:transitionName="text"
android:transitionName="texst"
android:textSize="26sp" />
<EditText

View File

@ -16,14 +16,36 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/lrctext"
<LinearLayout
android:id="@+id/lrclin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:gravity="center"
android:text="@string/app_name"
app:layout_constraintTop_toTopOf="parent" />
android:gravity="center_horizontal"
android:orientation="vertical"
android:layout_margin="6dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/lrcView"
style="@style/TextAppearance.Material3.BodyMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="6dp"
android:layout_marginTop="3dp"
android:text="@string/app_name" />
<TextView
android:id="@+id/lrcViewMessage"
style="@style/TextAppearance.Material3.BodySmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="6dp"
android:layout_marginTop="3dp"
android:text="@string/app_name" />
</LinearLayout>
<LinearLayout
android:id="@+id/layout1"
@ -31,7 +53,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:gravity="center_vertical"
app:layout_constraintTop_toBottomOf="@+id/lrctext">
app:layout_constraintTop_toBottomOf="@+id/lrclin">
<TextView
android:layout_width="wrap_content"
@ -44,7 +66,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:valueFrom="0"
android:valueFrom="3"
android:valueTo="36"
android:enabled="false"
tools:ignore="SpeakableTextPresentCheck" />
@ -57,37 +79,6 @@
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/layout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
app:layout_constraintTop_toBottomOf="@+id/layout1">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="透明度:"
android:textSize="20sp" />
<com.google.android.material.slider.Slider
android:id="@+id/slide2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:valueFrom="0"
android:valueTo="1"
android:enabled="false"
tools:ignore="SpeakableTextPresentCheck" />
<TextView
android:id="@+id/text_slide2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="20sp" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>

View File

@ -1,23 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:fitsSystemWindows="true"
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:title="@string/login" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:fitsSystemWindows="true"
android:layout_height="match_parent"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"
android:fillViewport="true">
<RelativeLayout
@ -44,66 +48,24 @@
android:layout_marginStart="16dp"
android:layout_marginTop="50dp"
android:layout_marginEnd="16dp">
<EditText
android:id="@+id/edit_user"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autofillHints=""
android:hint="网易云音乐账号/手机号"
android:inputType="textEmailAddress"
tools:ignore="LabelFor,VisualLintTextFieldSize,TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="16dp"
app:passwordToggleEnabled="true">
<EditText
android:id="@+id/edit_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autofillHints=""
android:hint="密码"
android:inputType="textPassword"
android:textColorHint="#546E7A"
tools:ignore="LabelFor,TextContrastCheck,VisualLintTextFieldSize" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="16dp"
android:hint="验证码"
android:visibility="gone">
<EditText
android:id="@+id/edit_key"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autofillHints=""
android:inputType="number"
tools:ignore="TextContrastCheck,VisualLintTextFieldSize" />
android:hint="网易云音乐Cookie"/>
</com.google.android.material.textfield.TextInputLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:gravity="end">
<Button
android:id="@+id/login"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="30dp"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:layout_margin="16dp"
style="@style/Widget.Material3.Button.ElevatedButton"
android:text="@string/login"
tools:ignore="ButtonStyle,DuplicateSpeakableTextCheck,VisualLintButtonSize" />
</LinearLayout>
@ -143,5 +105,5 @@
android:layout_margin="16dp"
android:contentDescription="登录模式切换"
android:text="二维码"
app:icon="@drawable/ic_launcher_foreground" />
</LinearLayout>
app:icon="@drawable/user" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,27 +1,31 @@
<androidx.constraintlayout.widget.ConstraintLayout 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"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/lrcView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:text="@string/app_name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:layout_marginHorizontal="6dp"
android:layout_marginTop="20dp"
style="@style/TextAppearance.Material3.BodyMedium"
android:text="@string/app_name" />
<TextView
android:id="@+id/lrcViewMessage"
style="@style/TextAppearance.Material3.BodySmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:layout_marginHorizontal="6dp"
android:text="@string/app_name" />
<ImageView
android:id="@+id/lock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/lock"
android:layout_marginTop="16dp"
app:layout_constraintTop_toBottomOf="@id/lrcView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
android:src="@drawable/lock" />
</LinearLayout>

View File

@ -5,28 +5,24 @@
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
android:id="@+id/bottomSheetDragHandleView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal">
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
android:id="@+id/bottomSheetDragHandleView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/bflb"
android:textColor="@color/text"
android:textSize="20sp"
style="@style/TextAppearance.Material3.TitleLarge"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

View File

@ -18,8 +18,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_marginVertical="6dp"
android:layout_marginHorizontal="3dp"
android:layout_margin="9dp"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/linearLayout"

View File

@ -31,17 +31,31 @@
android:orientation="vertical">
<TextView
style="@style/TextAppearance.Material3.TitleMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="每日趣荐"
android:textSize="16sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
android:text="每日趣荐" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardUseCompatPadding="true"
android:layout_marginHorizontal="3dp"
style="@style/Widget.Material3.CardView.Elevated"
app:cardElevation="0dp">
<com.muqingbfq.view.RecyclerViewH
android:id="@+id/recyclerview1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusableInTouchMode="false"
android:nestedScrollingEnabled="false"
tools:itemCount="6" />
</com.google.android.material.card.MaterialCardView>
<ProgressBar
android:id="@+id/recyclerview1_bar"
android:layout_width="wrap_content"
@ -55,24 +69,15 @@
android:padding="6dp"
android:visibility="gone"
android:layout_centerHorizontal="true"/>
<com.muqingbfq.view.RecyclerViewH
android:id="@+id/recyclerview1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusableInTouchMode="false"
android:nestedScrollingEnabled="false"
android:layout_marginVertical="3dp"
tools:itemCount="6" />
</RelativeLayout>
<TextView
style="@style/TextAppearance.Material3.TitleMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="每日一首"
android:layout_marginTop="6dp"
android:textSize="16sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
android:textSize="16sp"/>
<RelativeLayout
android:layout_width="match_parent"
@ -94,9 +99,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerview2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusableInTouchMode="false"
android:nestedScrollingEnabled="false" />
android:layout_height="wrap_content"/>
</RelativeLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View File

@ -2,16 +2,10 @@
<com.google.android.material.card.MaterialCardView 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"
style="Widget.Material3.CardView.Outlined"
android:layout_width="120dp"
style="@style/Widget.Material3.CardView.Elevated"
android:layout_width="130dp"
android:layout_height="160dp"
android:layout_marginEnd="6dp"
app:cardBackgroundColor="?attr/colorSurface"
app:cardForegroundColor="@android:color/transparent"
app:strokeColor="?attr/colorOutline"
app:strokeWidth="0dp"
app:shapeAppearance="?attr/shapeAppearanceMediumComponent"
app:cardElevation="1dp">
app:cardUseCompatPadding="true">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"

View File

@ -3,13 +3,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="?attr/colorSurface"
app:cardElevation="1dp"
app:cardForegroundColor="@android:color/transparent"
app:cardUseCompatPadding="true"
app:shapeAppearance="?attr/shapeAppearanceMediumComponent"
app:strokeColor="?attr/colorOutline"
app:strokeWidth="0dp">
style="@style/Widget.Material3.CardView.Elevated">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -25,6 +20,7 @@
android:layout_margin="6dp"
app:altSrc="@drawable/ic_launcher_foreground"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:round="16dp" />
@ -49,15 +45,15 @@
<TextView
android:id="@+id/text1"
style="@style/TextAppearance.Material3.TitleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:text="@string/name"
android:textColor="@color/text"
android:textSize="20sp" />
android:text="@string/name"/>
<TextView
android:id="@+id/text2"
style="@style/TextAppearance.Material3.BodySmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"

View File

@ -1,14 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
style="@style/Widget.Material3.CardView.Elevated"
app:cardElevation="0dp"
app:cardBackgroundColor="?attr/colorPrimaryDark"
app:cardUseCompatPadding="true"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:foreground="?selectableItemBackground"
android:padding="10dp">
android:layout_margin="6dp">
<TextView
android:id="@+id/text1"
android:layout_width="36dp"
@ -54,4 +59,6 @@
android:singleLine="true"
android:text="@string/zz" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>

View File

@ -1,24 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingVertical="10dp"
android:background="?android:attr/selectableItemBackground">
style="@style/Widget.Material3.CardView.Elevated"
app:cardElevation="0dp"
app:cardBackgroundColor="?attr/colorPrimaryDark"
app:cardUseCompatPadding="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_margin="9dp"
android:orientation="horizontal">
<androidx.constraintlayout.utils.widget.ImageFilterView
android:id="@+id/imageView"
android:layout_width="56dp"
android:layout_height="56dp"
app:srcCompat="@drawable/ic_launcher_foreground"
app:round="6dp" />
app:round="9dp"
app:srcCompat="@drawable/ic_launcher_foreground" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginStart="6dp">
android:layout_marginStart="6dp"
android:orientation="vertical">
<TextView
android:id="@+id/wb1"
@ -33,7 +40,9 @@
android:id="@+id/zz"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/text"
android:text="@string/zz" />
android:text="@string/zz"
android:textColor="@color/text" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>

View File

@ -15,6 +15,4 @@ dependencyResolutionManagement {
}
rootProject.name = "Cloud_music"
include ':app'
include(':StatusBarUtil')
//include(":lrcview")
include ':app', ':StatusBarUtil'