添加导入歌单操作优化歌曲显示UI
This commit is contained in:
parent
f00b765c91
commit
70a2a4e8b1
|
@ -18,7 +18,7 @@ android {
|
||||||
//noinspection OldTargetApi
|
//noinspection OldTargetApi
|
||||||
targetSdk 31
|
targetSdk 31
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.9.3"
|
versionName "1.9.5"
|
||||||
|
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
package com.muqingbfq;
|
package com.muqingbfq;
|
||||||
import static android.support.v4.media.session.MediaSessionCompat.*;
|
|
||||||
|
|
||||||
import android.support.v4.media.session.MediaSessionCompat;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Queue;
|
|
||||||
|
|
||||||
public class MP3 {
|
public class MP3 {
|
||||||
public String id, name, zz;
|
public String id, name, zz;
|
||||||
|
|
|
@ -21,6 +21,7 @@ import com.mpatric.mp3agic.Mp3File;
|
||||||
import com.muqingbfq.fragment.Media;
|
import com.muqingbfq.fragment.Media;
|
||||||
import com.muqingbfq.fragment.bflb_db;
|
import com.muqingbfq.fragment.bflb_db;
|
||||||
import com.muqingbfq.fragment.bfq_db;
|
import com.muqingbfq.fragment.bfq_db;
|
||||||
|
import com.muqingbfq.fragment.mp3;
|
||||||
import com.muqingbfq.fragment.search;
|
import com.muqingbfq.fragment.search;
|
||||||
import com.muqingbfq.mq.gj;
|
import com.muqingbfq.mq.gj;
|
||||||
import com.muqingbfq.mq.wj;
|
import com.muqingbfq.mq.wj;
|
||||||
|
@ -60,7 +61,6 @@ public class MediaPlayer extends android.media.MediaPlayer {
|
||||||
}
|
}
|
||||||
bfq_an.xyq();
|
bfq_an.xyq();
|
||||||
});
|
});
|
||||||
// setAudioStreamType(AudioManager.STREAM_MUSIC);
|
|
||||||
setAudioAttributes(new AudioAttributes
|
setAudioAttributes(new AudioAttributes
|
||||||
.Builder()
|
.Builder()
|
||||||
.setContentType(AudioAttributes.CONTENT_TYPE_MUSIC)
|
.setContentType(AudioAttributes.CONTENT_TYPE_MUSIC)
|
||||||
|
@ -87,9 +87,6 @@ public class MediaPlayer extends android.media.MediaPlayer {
|
||||||
super.start();
|
super.start();
|
||||||
Media.setbf(true);
|
Media.setbf(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建 MediaItem 列表
|
|
||||||
// public static List<MediaItem> list = new ArrayList<>();
|
|
||||||
@Override
|
@Override
|
||||||
public void setDataSource(String path) throws IOException {
|
public void setDataSource(String path) throws IOException {
|
||||||
reset();
|
reset();
|
||||||
|
@ -132,7 +129,6 @@ public class MediaPlayer extends android.media.MediaPlayer {
|
||||||
prepare();
|
prepare();
|
||||||
setTX();
|
setTX();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTX() {
|
public void setTX() {
|
||||||
Glide.with(main.application)
|
Glide.with(main.application)
|
||||||
.asBitmap()
|
.asBitmap()
|
||||||
|
@ -171,30 +167,30 @@ public class MediaPlayer extends android.media.MediaPlayer {
|
||||||
bfqkz.notify.tzl();
|
bfqkz.notify.tzl();
|
||||||
}
|
}
|
||||||
Media.setImageBitmap();
|
Media.setImageBitmap();
|
||||||
return false;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.submit();
|
|
||||||
}
|
|
||||||
@SuppressLint("NotifyDataSetChanged")
|
|
||||||
public void bfui() {
|
|
||||||
String name = xm.name, zz = bfqkz.xm.zz;
|
|
||||||
setTX();
|
|
||||||
if (bfq.view != null) {
|
|
||||||
Media.setProgress(0);
|
|
||||||
bfq.setname(name);
|
|
||||||
bfq.setzz(zz);
|
|
||||||
bfq_an.islike();
|
|
||||||
}
|
|
||||||
bfq_db.setname(name + "/" + zz);
|
|
||||||
if (com.muqingbfq.fragment.mp3.lbspq != null) {
|
|
||||||
com.muqingbfq.fragment.mp3.lbspq.notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
if (search.lbspq != null) {
|
|
||||||
search.lbspq.notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
if (bflb_db.adapter != null) {
|
if (bflb_db.adapter != null) {
|
||||||
bflb_db.adapter.notifyDataSetChanged();
|
bflb_db.adapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.submit();
|
||||||
|
}
|
||||||
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
|
public void bfui() {
|
||||||
|
String name = xm.name, zz = bfqkz.xm.zz;
|
||||||
|
setTX();
|
||||||
|
if (bfq.view != null) {
|
||||||
|
Media.setProgress(0);
|
||||||
|
bfq.setname(name);
|
||||||
|
bfq.setzz(zz);
|
||||||
|
bfq_an.islike();
|
||||||
|
}
|
||||||
|
bfq_db.setname(name + "/" + zz);
|
||||||
|
if (com.muqingbfq.fragment.mp3.lbspq != null) {
|
||||||
|
new mp3.lbspq_sx();
|
||||||
|
}
|
||||||
|
if (search.lbspq != null) {
|
||||||
|
search.lbspq.notifyDataSetChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,13 +1,19 @@
|
||||||
package com.muqingbfq;
|
package com.muqingbfq;
|
||||||
|
|
||||||
public class XM {
|
public class XM {
|
||||||
public String id, name;
|
public String id, name, message;
|
||||||
public Object picurl;
|
public Object picurl;
|
||||||
public XM(String id, String name, String picurl) {
|
public XM(String id, String name, String picurl) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.picurl = picurl;
|
this.picurl = picurl;
|
||||||
}
|
}
|
||||||
|
public XM(String id, String name,String message, String picurl) {
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
this.picurl = picurl;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
public XM(String id, String name, int picurl) {
|
public XM(String id, String name, int picurl) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.muqingbfq;
|
package com.muqingbfq;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
@ -13,7 +12,6 @@ import android.view.ViewGroup;
|
||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.EditText;
|
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
@ -41,7 +39,6 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class activity_search extends FragmentActivity {
|
public class activity_search extends FragmentActivity {
|
||||||
private EditText editText;
|
|
||||||
private ArrayAdapter<String> adapter;
|
private ArrayAdapter<String> adapter;
|
||||||
private List<String> json_list = new ArrayList<>();
|
private List<String> json_list = new ArrayList<>();
|
||||||
private final List<String> list = new ArrayList<>();
|
private final List<String> list = new ArrayList<>();
|
||||||
|
@ -63,8 +60,7 @@ public class activity_search extends FragmentActivity {
|
||||||
binding.listRecycler.setLayoutManager(manager);
|
binding.listRecycler.setLayoutManager(manager);
|
||||||
binding.listRecycler.setAdapter(new SearchRecordAdapter());
|
binding.listRecycler.setAdapter(new SearchRecordAdapter());
|
||||||
|
|
||||||
editText = findViewById(R.id.editview);
|
binding.editview.setOnEditorActionListener((v, actionId, event) -> {
|
||||||
editText.setOnEditorActionListener((v, actionId, event) -> {
|
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
|
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
|
||||||
String str = v.getText().toString();
|
String str = v.getText().toString();
|
||||||
if (!str.equals("")) {
|
if (!str.equals("")) {
|
||||||
|
@ -93,19 +89,19 @@ public class activity_search extends FragmentActivity {
|
||||||
|
|
||||||
//设置项点击监听
|
//设置项点击监听
|
||||||
listPopupWindow.setOnItemClickListener((adapterView, view, i, l) -> {
|
listPopupWindow.setOnItemClickListener((adapterView, view, i, l) -> {
|
||||||
editText.clearFocus();
|
view.clearFocus();
|
||||||
InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
|
InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
|
||||||
View v = getWindow().peekDecorView();
|
View v = getWindow().peekDecorView();
|
||||||
if (null != v) {
|
if (null != v) {
|
||||||
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
|
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
|
||||||
}
|
}
|
||||||
editText.setText(list.get(i));//把选择的选项内容展示在EditText上
|
binding.editview.setText(list.get(i));//把选择的选项内容展示在EditText上
|
||||||
dismiss();//如果已经选择了,隐藏起来
|
dismiss();//如果已经选择了,隐藏起来
|
||||||
start(editText.getText().toString());
|
start(binding.editview.getText().toString());
|
||||||
|
|
||||||
});
|
});
|
||||||
Object o = new Object();
|
Object o = new Object();
|
||||||
editText.addTextChangedListener(new TextWatcher() {
|
binding.editview.addTextChangedListener(new TextWatcher() {
|
||||||
@Override
|
@Override
|
||||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
}
|
}
|
||||||
|
@ -147,20 +143,13 @@ public class activity_search extends FragmentActivity {
|
||||||
public void afterTextChanged(Editable s) {
|
public void afterTextChanged(Editable s) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
gj.tcjp(binding.editview);
|
||||||
binding.editview.requestFocus();//获取焦点
|
|
||||||
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
|
||||||
//if (!imm.isActive()) //没有显示键盘,弹出
|
|
||||||
imm.showSoftInput(binding.editview, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dismiss() {
|
public void dismiss() {
|
||||||
binding.editview.clearFocus();
|
binding.editview.clearFocus();
|
||||||
listPopupWindow.setVisibility(View.GONE);
|
listPopupWindow.setVisibility(View.GONE);
|
||||||
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
gj.ycjp(binding.editview);
|
||||||
if (imm.isActive()) //有显示键盘,隐藏
|
|
||||||
imm.hideSoftInputFromWindow(binding.editview.getWindowToken(),
|
|
||||||
InputMethodManager.HIDE_NOT_ALWAYS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("NotifyDataSetChanged")
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
|
@ -190,7 +179,7 @@ public class activity_search extends FragmentActivity {
|
||||||
if (itemId == android.R.id.home) {
|
if (itemId == android.R.id.home) {
|
||||||
finish();
|
finish();
|
||||||
} else if (itemId == R.id.menu_search) {
|
} else if (itemId == R.id.menu_search) {
|
||||||
start(editText.getText().toString());
|
start(binding.editview.getText().toString());
|
||||||
}
|
}
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
@ -238,7 +227,7 @@ public class activity_search extends FragmentActivity {
|
||||||
String keyword = json_list.get(position);
|
String keyword = json_list.get(position);
|
||||||
holder.recordTextView.setText(keyword);
|
holder.recordTextView.setText(keyword);
|
||||||
holder.recordTextView.setOnClickListener(v -> {
|
holder.recordTextView.setOnClickListener(v -> {
|
||||||
editText.setText(keyword);
|
binding.editview.setText(keyword);
|
||||||
start(keyword);
|
start(keyword);
|
||||||
});
|
});
|
||||||
holder.recordTextView.setOnLongClickListener(view -> {
|
holder.recordTextView.setOnLongClickListener(view -> {
|
||||||
|
|
|
@ -122,6 +122,7 @@ public class FileDownloader {
|
||||||
outputStream = new FileOutputStream(outputFile);
|
outputStream = new FileOutputStream(outputFile);
|
||||||
|
|
||||||
int read;
|
int read;
|
||||||
|
fileSizeDownloaded = 0;
|
||||||
while ((read = inputStream.read(buffer)) != -1) {
|
while ((read = inputStream.read(buffer)) != -1) {
|
||||||
outputStream.write(buffer, 0, read);
|
outputStream.write(buffer, 0, read);
|
||||||
fileSizeDownloaded += read;
|
fileSizeDownloaded += read;
|
||||||
|
|
|
@ -23,6 +23,14 @@ import java.util.List;
|
||||||
public class playlist extends Thread {
|
public class playlist extends Thread {
|
||||||
public static final String api = "/playlist/track/all?id=";
|
public static final String api = "/playlist/track/all?id=";
|
||||||
|
|
||||||
|
public static String gethq(String uid) {
|
||||||
|
if (wj.cz(wj.filesdri + "user.mq")) {
|
||||||
|
return wl.hq(api + uid + "&limit=100" + "&cookie=" + wl.Cookie);
|
||||||
|
// gj.sc(hq);
|
||||||
|
} else {
|
||||||
|
return wl.hq(api + uid + "&limit=100");
|
||||||
|
}
|
||||||
|
}
|
||||||
@SuppressLint("NotifyDataSetChanged")
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
public static boolean hq(List<MP3> list, String uid) {
|
public static boolean hq(List<MP3> list, String uid) {
|
||||||
switch (uid) {
|
switch (uid) {
|
||||||
|
@ -39,11 +47,7 @@ public class playlist extends Thread {
|
||||||
if (wj.cz(wj.gd + uid)) {
|
if (wj.cz(wj.gd + uid)) {
|
||||||
hq = wj.dqwb(wj.gd + uid);
|
hq = wj.dqwb(wj.gd + uid);
|
||||||
} else {
|
} else {
|
||||||
if (wj.cz(wj.filesdri + "user.mq")) {
|
hq = gethq(uid);
|
||||||
hq = wl.hq(api + uid + "&limit=100" + "&cookie=" + wl.Cookie);
|
|
||||||
} else {
|
|
||||||
hq = wl.hq(api + uid + "&limit=100");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
JSONObject json = new JSONObject(hq);
|
JSONObject json = new JSONObject(hq);
|
||||||
JSONArray songs = json.getJSONArray("songs");
|
JSONArray songs = json.getJSONArray("songs");
|
||||||
|
@ -52,7 +56,14 @@ public class playlist extends Thread {
|
||||||
JSONObject jsonObject = songs.getJSONObject(i);
|
JSONObject jsonObject = songs.getJSONObject(i);
|
||||||
String id = jsonObject.getString("id");
|
String id = jsonObject.getString("id");
|
||||||
String name = jsonObject.getString("name");
|
String name = jsonObject.getString("name");
|
||||||
|
try {
|
||||||
|
String tns = jsonObject.getString("tns");
|
||||||
|
tns = tns.replace("[\"", "(");
|
||||||
|
tns = tns.replace("\"]", ")");
|
||||||
|
name += tns;
|
||||||
|
} catch (Exception e) {
|
||||||
|
gj.sc(e);
|
||||||
|
}
|
||||||
JSONObject al = jsonObject.getJSONObject("al");
|
JSONObject al = jsonObject.getJSONObject("al");
|
||||||
JSONArray ar = jsonObject.getJSONArray("ar");
|
JSONArray ar = jsonObject.getJSONArray("ar");
|
||||||
StringBuilder zz = new StringBuilder();
|
StringBuilder zz = new StringBuilder();
|
||||||
|
@ -95,13 +106,15 @@ public class playlist extends Thread {
|
||||||
try {
|
try {
|
||||||
File file = new File(wj.filesdri + "mp3");
|
File file = new File(wj.filesdri + "mp3");
|
||||||
File[] files = file.listFiles();
|
File[] files = file.listFiles();
|
||||||
|
int i = 0;
|
||||||
for (File value : files) {
|
for (File value : files) {
|
||||||
ID3v2 mp3File = new Mp3File(value).getId3v2Tag();
|
ID3v2 mp3File = new Mp3File(value).getId3v2Tag();
|
||||||
String id = value.getName();
|
String id = value.getName();
|
||||||
String name = mp3File.getTitle();
|
String name = mp3File.getTitle();
|
||||||
String zz = mp3File.getArtist();
|
String zz = mp3File.getArtist();
|
||||||
String picUrl = mp3File.getUrl();
|
String picUrl = mp3File.getUrl();
|
||||||
list.add(new MP3(id, name, zz, picUrl));
|
list.add(new MP3(id, name, zz.toString(), picUrl));
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -29,6 +29,8 @@ public class url extends Thread {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String hq(MP3 x) {
|
public static String hq(MP3 x) {
|
||||||
|
getLrc(x.id);
|
||||||
|
Media.loadLyric();
|
||||||
try {
|
try {
|
||||||
if (wj.cz(wj.mp3 + x.id)) {
|
if (wj.cz(wj.mp3 + x.id)) {
|
||||||
return wj.mp3 + x.id;
|
return wj.mp3 + x.id;
|
||||||
|
@ -47,7 +49,7 @@ public class url extends Thread {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
JSONObject json = new JSONObject(hq);
|
JSONObject json = new JSONObject(hq);
|
||||||
gj.sc(json);
|
// gj.sc(json);
|
||||||
if (json.getInt("code") == -460) {
|
if (json.getInt("code") == -460) {
|
||||||
String message = json.getString("message");
|
String message = json.getString("message");
|
||||||
main.handler.post(() -> {
|
main.handler.post(() -> {
|
||||||
|
@ -57,15 +59,10 @@ public class url extends Thread {
|
||||||
});
|
});
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
getLrc(x.id);
|
|
||||||
Media.loadLyric();
|
|
||||||
JSONArray data = json.getJSONArray("data");
|
JSONArray data = json.getJSONArray("data");
|
||||||
JSONObject jsonObject = data.getJSONObject(0);
|
JSONObject jsonObject = data.getJSONObject(0);
|
||||||
String url = jsonObject.getString("url");
|
gj.sc(jsonObject.getString("url"));
|
||||||
if (wiFiConnected) {
|
return jsonObject.getString("url");
|
||||||
new FileDownloader(url, x,true);
|
|
||||||
}
|
|
||||||
return url;
|
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
yc.start("url hq :" + e);
|
yc.start("url hq :" + e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,6 @@ import java.util.List;
|
||||||
public class bfqkz extends MediaBrowserServiceCompat {
|
public class bfqkz extends MediaBrowserServiceCompat {
|
||||||
public static MediaPlayer mt = new MediaPlayer();
|
public static MediaPlayer mt = new MediaPlayer();
|
||||||
public static List<MP3> list = new ArrayList<>();
|
public static List<MP3> list = new ArrayList<>();
|
||||||
|
|
||||||
//保存原始list顺序
|
//保存原始list顺序
|
||||||
public static List<MP3> list_baocun = new ArrayList<>();
|
public static List<MP3> list_baocun = new ArrayList<>();
|
||||||
public static List<MP3> lishi_list = new ArrayList<>();
|
public static List<MP3> lishi_list = new ArrayList<>();
|
||||||
|
@ -52,7 +51,6 @@ public class bfqkz extends MediaBrowserServiceCompat {
|
||||||
if (id == null) {
|
if (id == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TextUtils.isEmpty(id)) {
|
if (TextUtils.isEmpty(id)) {
|
||||||
//针对错误进行相应的处理
|
//针对错误进行相应的处理
|
||||||
bfqkz.list.remove(bfqkz.xm);
|
bfqkz.list.remove(bfqkz.xm);
|
||||||
|
|
|
@ -136,9 +136,6 @@ public class Media {
|
||||||
if (bfq.view == null) {
|
if (bfq.view == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (bfq.bitmap == null) {
|
|
||||||
bfq.bitmap= BitmapFactory.decodeResource(bfq.view.getResources(), R.drawable.icon);
|
|
||||||
}
|
|
||||||
main.handler.post(() -> bfq.binding.cardview.setImage(com.muqingbfq.bfq.bitmap));
|
main.handler.post(() -> bfq.binding.cardview.setImage(com.muqingbfq.bfq.bitmap));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ import com.muqingbfq.R;
|
||||||
import com.muqingbfq.api.url;
|
import com.muqingbfq.api.url;
|
||||||
import com.muqingbfq.bfqkz;
|
import com.muqingbfq.bfqkz;
|
||||||
import com.muqingbfq.databinding.FragmentBflbDbBinding;
|
import com.muqingbfq.databinding.FragmentBflbDbBinding;
|
||||||
|
import com.muqingbfq.databinding.ListMp3Binding;
|
||||||
import com.muqingbfq.list.MyViewHoder;
|
import com.muqingbfq.list.MyViewHoder;
|
||||||
import com.muqingbfq.main;
|
import com.muqingbfq.main;
|
||||||
import com.muqingbfq.yc;
|
import com.muqingbfq.yc;
|
||||||
|
@ -82,21 +83,22 @@ public class bflb_db extends BottomSheetDialog {
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public MyViewHoder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public MyViewHoder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_mp3, parent, false);
|
// View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_mp3, parent, false);
|
||||||
return new MyViewHoder(view);
|
return new MyViewHoder(ListMp3Binding.
|
||||||
|
inflate(getLayoutInflater(),parent,false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull MyViewHoder holder, int position) {
|
public void onBindViewHolder(@NonNull MyViewHoder holder, int position) {
|
||||||
MP3 x = bfqkz.list.get(position);
|
MP3 x = bfqkz.list.get(position);
|
||||||
holder.name.setText(x.name);
|
holder.binding.name.setText(x.name);
|
||||||
holder.zz.setText(x.zz);
|
holder.binding.zz.setText(x.zz);
|
||||||
int color = ContextCompat.getColor(holder.getContext(), R.color.text);
|
int color = ContextCompat.getColor(holder.getContext(), R.color.text);
|
||||||
if (bfqkz.xm != null && x.id.equals(bfqkz.xm.id)) {
|
if (bfqkz.xm != null && x.id.equals(bfqkz.xm.id)) {
|
||||||
color = ContextCompat.getColor(holder.getContext(), R.color.text_cz);
|
color = ContextCompat.getColor(holder.getContext(), R.color.text_cz);
|
||||||
}
|
}
|
||||||
holder.name.setTextColor(color);
|
holder.binding.name.setTextColor(color);
|
||||||
holder.zz.setTextColor(color);
|
holder.binding.zz.setTextColor(color);
|
||||||
holder.itemView.setOnClickListener(view -> {
|
holder.itemView.setOnClickListener(view -> {
|
||||||
if (bfqkz.xm != x) {
|
if (bfqkz.xm != x) {
|
||||||
bfqkz.xm = x;
|
bfqkz.xm = x;
|
||||||
|
|
|
@ -25,6 +25,8 @@ import com.muqingbfq.api.resource;
|
||||||
import com.muqingbfq.bfq_an;
|
import com.muqingbfq.bfq_an;
|
||||||
import com.muqingbfq.bfqkz;
|
import com.muqingbfq.bfqkz;
|
||||||
import com.muqingbfq.databinding.FragmentMp3Binding;
|
import com.muqingbfq.databinding.FragmentMp3Binding;
|
||||||
|
import com.muqingbfq.databinding.ListGdBBinding;
|
||||||
|
import com.muqingbfq.databinding.ListGdBinding;
|
||||||
import com.muqingbfq.main;
|
import com.muqingbfq.main;
|
||||||
import com.muqingbfq.mq.gj;
|
import com.muqingbfq.mq.gj;
|
||||||
import com.muqingbfq.mq.wj;
|
import com.muqingbfq.mq.wj;
|
||||||
|
@ -45,6 +47,7 @@ public class gd extends com.muqingbfq.mq.FragmentActivity {
|
||||||
private final List<XM> list = new ArrayList<>();
|
private final List<XM> list = new ArrayList<>();
|
||||||
public static RecyclerView.Adapter<VH> adapter;
|
public static RecyclerView.Adapter<VH> adapter;
|
||||||
int k;
|
int k;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
@ -52,7 +55,7 @@ public class gd extends com.muqingbfq.mq.FragmentActivity {
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
binding.title.setText(intent.getStringExtra("name"));
|
binding.title.setText(intent.getStringExtra("name"));
|
||||||
adapter = new baseadapter(this,list);
|
adapter = new baseadapter(this, list);
|
||||||
k = (int) (main.k / getResources().getDisplayMetrics().density + 0.5f);
|
k = (int) (main.k / getResources().getDisplayMetrics().density + 0.5f);
|
||||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(this, k / 120);
|
GridLayoutManager gridLayoutManager = new GridLayoutManager(this, k / 120);
|
||||||
binding.lb.setLayoutManager(gridLayoutManager);
|
binding.lb.setLayoutManager(gridLayoutManager);
|
||||||
|
@ -64,6 +67,7 @@ public class gd extends com.muqingbfq.mq.FragmentActivity {
|
||||||
@SuppressLint("NotifyDataSetChanged")
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
class start extends Thread {
|
class start extends Thread {
|
||||||
String id;
|
String id;
|
||||||
|
|
||||||
public start(String id) {
|
public start(String id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
list.clear();
|
list.clear();
|
||||||
|
@ -97,7 +101,7 @@ public class gd extends com.muqingbfq.mq.FragmentActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class baseadapter extends RecyclerView.Adapter<VH>{
|
public static class baseadapter extends RecyclerView.Adapter<VH> {
|
||||||
Context context;
|
Context context;
|
||||||
List<XM> list;
|
List<XM> list;
|
||||||
|
|
||||||
|
@ -107,6 +111,7 @@ public class gd extends com.muqingbfq.mq.FragmentActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean bool = false;
|
boolean bool = false;
|
||||||
|
|
||||||
public baseadapter(Context context, List<XM> list, boolean bool) {
|
public baseadapter(Context context, List<XM> list, boolean bool) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.list = list;
|
this.list = list;
|
||||||
|
@ -117,11 +122,11 @@ public class gd extends com.muqingbfq.mq.FragmentActivity {
|
||||||
@Override
|
@Override
|
||||||
public VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
if (bool) {
|
if (bool) {
|
||||||
return new VH(LayoutInflater.from(context)
|
return new VH(ListGdBBinding.bind(LayoutInflater.from(context)
|
||||||
.inflate(R.layout.list_gd_b, parent, false));
|
.inflate(R.layout.list_gd_b, parent, false)));
|
||||||
}
|
}
|
||||||
return new VH(LayoutInflater.from(context)
|
return new VH(ListGdBinding.bind(LayoutInflater.from(context)
|
||||||
.inflate(R.layout.list_gd, parent, false));
|
.inflate(R.layout.list_gd, parent, false)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setList(List<XM> list) {
|
public void setList(List<XM> list) {
|
||||||
|
@ -134,12 +139,13 @@ public class gd extends com.muqingbfq.mq.FragmentActivity {
|
||||||
CARD card = new CARD(position);
|
CARD card = new CARD(position);
|
||||||
if (bool) {
|
if (bool) {
|
||||||
holder.itemView.setOnClickListener(card);
|
holder.itemView.setOnClickListener(card);
|
||||||
|
holder.bindingB.text2.setText(xm.message);
|
||||||
holder.itemView.setOnLongClickListener(card);
|
holder.itemView.setOnLongClickListener(card);
|
||||||
} else {
|
} else {
|
||||||
holder.image.setOnClickListener(card);
|
holder.binding.image.setOnClickListener(card);
|
||||||
holder.image.setOnLongClickListener(card);
|
holder.binding.image.setOnLongClickListener(card);
|
||||||
}
|
}
|
||||||
holder.textView.setText(xm.name);
|
holder.title.setText(xm.name);
|
||||||
holder.kg.setOnClickListener(view1 -> {
|
holder.kg.setOnClickListener(view1 -> {
|
||||||
ImageView tx = (ImageView) view1;
|
ImageView tx = (ImageView) view1;
|
||||||
new Thread() {
|
new Thread() {
|
||||||
|
@ -208,7 +214,7 @@ public class gd extends com.muqingbfq.mq.FragmentActivity {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (id == 0) {
|
if (id == 0) {
|
||||||
String hq = wl.hq(playlist.api + xm.id + "&limit=100");
|
String hq = playlist.gethq(xm.id);
|
||||||
if (hq != null) {
|
if (hq != null) {
|
||||||
wj.xrwb(wj.gd + xm.id, hq);
|
wj.xrwb(wj.gd + xm.id, hq);
|
||||||
try {
|
try {
|
||||||
|
@ -235,15 +241,14 @@ public class gd extends com.muqingbfq.mq.FragmentActivity {
|
||||||
jsonObject.remove(xm.id);
|
jsonObject.remove(xm.id);
|
||||||
list.remove(xm);
|
list.remove(xm);
|
||||||
wj.xrwb(wj.gd_xz, jsonObject.toString());
|
wj.xrwb(wj.gd_xz, jsonObject.toString());
|
||||||
|
main.handler.post(() -> notifyItemChanged(position));
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
gj.sc(e);
|
gj.sc(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
main.handler.post(() -> notifyItemChanged(position));
|
|
||||||
}
|
}
|
||||||
}.start();
|
}.start();
|
||||||
// 在这里处理菜单项的点击事件
|
// 在这里处理菜单项的点击事件
|
||||||
dialog.dismiss();
|
|
||||||
}).show();
|
}).show();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -253,17 +258,29 @@ public class gd extends com.muqingbfq.mq.FragmentActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
static class VH extends RecyclerView.ViewHolder {
|
static class VH extends RecyclerView.ViewHolder {
|
||||||
TextView textView;
|
public ListGdBinding binding;
|
||||||
ImageView kg;
|
public ImageView kg;
|
||||||
CardImage image;
|
public CardImage image;
|
||||||
|
public TextView title;
|
||||||
|
public VH(@NonNull ListGdBinding itemView) {
|
||||||
|
super(itemView.getRoot());
|
||||||
|
binding = itemView;
|
||||||
|
title = binding.wb1;
|
||||||
|
kg = binding.kg;
|
||||||
|
image = binding.image;
|
||||||
|
}
|
||||||
|
|
||||||
public VH(@NonNull View itemView) {
|
ListGdBBinding bindingB;
|
||||||
super(itemView);
|
|
||||||
textView = itemView.findViewById(R.id.wb1);
|
public VH(@NonNull ListGdBBinding itemView) {
|
||||||
image = itemView.findViewById(R.id.image);
|
super(itemView.getRoot());
|
||||||
kg = itemView.findViewById(R.id.kg);
|
bindingB = itemView;
|
||||||
|
title = bindingB.text1;
|
||||||
|
kg = bindingB.kg;
|
||||||
|
image = bindingB.image;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class lbspq_sx implements Runnable {
|
private class lbspq_sx implements Runnable {
|
||||||
@SuppressLint("NotifyDataSetChanged")
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -19,12 +19,12 @@ import com.muqingbfq.R;
|
||||||
import com.muqingbfq.XM;
|
import com.muqingbfq.XM;
|
||||||
import com.muqingbfq.api.resource;
|
import com.muqingbfq.api.resource;
|
||||||
import com.muqingbfq.api.url;
|
import com.muqingbfq.api.url;
|
||||||
import com.muqingbfq.bfq;
|
|
||||||
import com.muqingbfq.bfqkz;
|
import com.muqingbfq.bfqkz;
|
||||||
import com.muqingbfq.databinding.FragmentGdBinding;
|
import com.muqingbfq.databinding.FragmentGdBinding;
|
||||||
import com.muqingbfq.databinding.ListMp3ImageBinding;
|
import com.muqingbfq.databinding.ListMp3ImageBinding;
|
||||||
import com.muqingbfq.main;
|
import com.muqingbfq.main;
|
||||||
import com.muqingbfq.mq.gj;
|
import com.muqingbfq.mq.gj;
|
||||||
|
import com.muqingbfq.mq.wj;
|
||||||
import com.muqingbfq.mq.wl;
|
import com.muqingbfq.mq.wl;
|
||||||
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
|
@ -91,8 +91,12 @@ public class gd_adapter extends Fragment {
|
||||||
bfqkz.xm = x;
|
bfqkz.xm = x;
|
||||||
new url(x);
|
new url(x);
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
|
} else if (!bfqkz.mt.isPlaying()) {
|
||||||
|
bfqkz.mt.start();
|
||||||
|
}
|
||||||
|
if (!bfqkz.list.contains(x)) {
|
||||||
|
bfqkz.list.add(0, x);
|
||||||
}
|
}
|
||||||
bfqkz.list.add(0, x);
|
|
||||||
// bfqkz.list.addAll(list);
|
// bfqkz.list.addAll(list);
|
||||||
// bfq.start(getContext());
|
// bfq.start(getContext());
|
||||||
});
|
});
|
||||||
|
@ -134,6 +138,9 @@ public class gd_adapter extends Fragment {
|
||||||
public void run() {
|
public void run() {
|
||||||
super.run();
|
super.run();
|
||||||
String hq = wl.hq("/recommend/songs" + "?cookie=" + wl.Cookie);
|
String hq = wl.hq("/recommend/songs" + "?cookie=" + wl.Cookie);
|
||||||
|
if (hq == null) {
|
||||||
|
hq = wj.dqwb(wj.filesdri + "songs.josn");
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
JSONObject jsonObject = new JSONObject(hq);
|
JSONObject jsonObject = new JSONObject(hq);
|
||||||
JSONObject data = jsonObject.getJSONObject("data");
|
JSONObject data = jsonObject.getJSONObject("data");
|
||||||
|
@ -151,6 +158,7 @@ public class gd_adapter extends Fragment {
|
||||||
String picUrl = al.getString("picUrl");
|
String picUrl = al.getString("picUrl");
|
||||||
listmp3.add(new MP3(id, name, zz.toString(), picUrl));
|
listmp3.add(new MP3(id, name, zz.toString(), picUrl));
|
||||||
}
|
}
|
||||||
|
wj.xrwb(wj.filesdri + "songs.josn", hq);
|
||||||
main.handler.post(() -> binding.recyclerview2.getAdapter().notifyDataSetChanged());
|
main.handler.post(() -> binding.recyclerview2.getAdapter().notifyDataSetChanged());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gj.sc(e);
|
gj.sc(e);
|
||||||
|
|
|
@ -4,84 +4,132 @@ import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.text.Editable;
|
||||||
|
import android.text.TextWatcher;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.Filter;
|
||||||
|
import android.widget.Filterable;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
|
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||||
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
import com.muqingbfq.MP3;
|
import com.muqingbfq.MP3;
|
||||||
import com.muqingbfq.R;
|
import com.muqingbfq.R;
|
||||||
|
import com.muqingbfq.XM;
|
||||||
import com.muqingbfq.api.FileDownloader;
|
import com.muqingbfq.api.FileDownloader;
|
||||||
import com.muqingbfq.api.playlist;
|
import com.muqingbfq.api.playlist;
|
||||||
|
import com.muqingbfq.api.resource;
|
||||||
import com.muqingbfq.api.url;
|
import com.muqingbfq.api.url;
|
||||||
import com.muqingbfq.bfq;
|
import com.muqingbfq.bfq;
|
||||||
import com.muqingbfq.bfqkz;
|
import com.muqingbfq.bfqkz;
|
||||||
import com.muqingbfq.databinding.FragmentMp3Binding;
|
import com.muqingbfq.databinding.FragmentMp3Binding;
|
||||||
|
import com.muqingbfq.databinding.ListMp3Binding;
|
||||||
import com.muqingbfq.list.MyViewHoder;
|
import com.muqingbfq.list.MyViewHoder;
|
||||||
import com.muqingbfq.main;
|
import com.muqingbfq.main;
|
||||||
import com.muqingbfq.mq.FragmentActivity;
|
import com.muqingbfq.mq.FragmentActivity;
|
||||||
import com.muqingbfq.mq.gj;
|
import com.muqingbfq.mq.gj;
|
||||||
|
import com.muqingbfq.mq.wj;
|
||||||
|
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
public class mp3 extends FragmentActivity {
|
public class mp3 extends FragmentActivity {
|
||||||
private final List<MP3> list = new ArrayList<>();
|
private List<MP3> list = new ArrayList<>();
|
||||||
public static RecyclerView.Adapter<MyViewHoder> lbspq;
|
private List<MP3> list_ys = new ArrayList<>();
|
||||||
|
public static adaper lbspq;
|
||||||
|
FragmentMp3Binding binding;
|
||||||
|
// private static String id;
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
FragmentMp3Binding inflate = FragmentMp3Binding.inflate(getLayoutInflater());
|
binding = FragmentMp3Binding.inflate(getLayoutInflater());
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
inflate.title.setText(intent.getStringExtra("name"));
|
binding.title.setText(intent.getStringExtra("name"));
|
||||||
// inflate.toolbar.setTitle(intent.getStringExtra("name"));
|
|
||||||
setContentView(inflate.getRoot());
|
|
||||||
lbspq = new spq();
|
|
||||||
RecyclerView lb = findViewById(R.id.lb);
|
|
||||||
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
|
|
||||||
lb.setLayoutManager(layoutManager);
|
|
||||||
lb.setAdapter(lbspq);
|
|
||||||
String id = intent.getStringExtra("id");
|
String id = intent.getStringExtra("id");
|
||||||
|
setContentView(binding.getRoot());
|
||||||
// inflate.bfqDb.setBackground(gd.color);
|
lbspq = new adaper(list);
|
||||||
|
binding.lb.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
binding.lb.setAdapter(lbspq);
|
||||||
new start(id);
|
new start(id);
|
||||||
|
binding.edittext.addTextChangedListener(new TextWatcher() {
|
||||||
|
@Override
|
||||||
|
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||||
|
if (binding.edittext.getVisibility() == View.VISIBLE) {
|
||||||
|
lbspq.getFilter().filter(charSequence);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterTextChanged(Editable editable) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//添加Android自带的分割线
|
||||||
|
binding.lb.addItemDecoration(
|
||||||
|
new DividerItemDecoration(this,DividerItemDecoration.VERTICAL));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
MenuItem itemA = menu.add("下载所有歌曲");
|
MenuItem itemA = menu.add("搜索");
|
||||||
itemA.setTitle("下载所有歌曲");
|
itemA.setTitle("搜索");
|
||||||
itemA.setIcon(R.drawable.download);
|
itemA.setIcon(R.drawable.sousuo);
|
||||||
itemA.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
itemA.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
||||||
gj.sc(itemA.getItemId());
|
|
||||||
return super.onCreateOptionsMenu(menu);
|
return super.onCreateOptionsMenu(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||||
if (item.getItemId() == 0) {
|
int itemId = item.getItemId();
|
||||||
FileDownloader fileDownloader = new FileDownloader(
|
if (itemId == android.R.id.home) {
|
||||||
mp3.
|
if (binding.edittext.getVisibility() == View.VISIBLE) {
|
||||||
this);
|
binding.title.setVisibility(View.VISIBLE);
|
||||||
for (MP3 mp3 : list) {
|
binding.edittext.setVisibility(View.GONE);
|
||||||
new Thread(){
|
} else {
|
||||||
@Override
|
finish();
|
||||||
public void run() {
|
|
||||||
super.run();
|
|
||||||
fileDownloader.downloadFile(mp3);
|
|
||||||
}
|
|
||||||
}.start();
|
|
||||||
}
|
}
|
||||||
|
gj.ycjp(binding.edittext);
|
||||||
|
lbspq.getFilter().filter("");
|
||||||
|
} else if (itemId == 0) {
|
||||||
|
binding.title.setVisibility(View.GONE);
|
||||||
|
binding.edittext.setVisibility(View.VISIBLE);
|
||||||
|
gj.tcjp(binding.edittext);
|
||||||
}
|
}
|
||||||
return super.onOptionsItemSelected(item);
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
if (binding.edittext.getVisibility() == View.VISIBLE) {
|
||||||
|
binding.title.setVisibility(View.VISIBLE);
|
||||||
|
binding.edittext.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
gj.ycjp(binding.edittext);
|
||||||
|
lbspq.getFilter().filter("");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("NotifyDataSetChanged")
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
|
@ -91,7 +139,7 @@ public class mp3 extends FragmentActivity {
|
||||||
public start(String id) {
|
public start(String id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
list.clear();
|
list.clear();
|
||||||
mp3.lbspq.notifyDataSetChanged();
|
list_ys.clear();
|
||||||
start();
|
start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,6 +153,7 @@ public class mp3 extends FragmentActivity {
|
||||||
} else {
|
} else {
|
||||||
playlist.hq(list, id);
|
playlist.hq(list, id);
|
||||||
}
|
}
|
||||||
|
list_ys = list;
|
||||||
main.handler.post(new lbspq_sx());
|
main.handler.post(new lbspq_sx());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,25 +166,34 @@ public class mp3 extends FragmentActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class spq extends RecyclerView.Adapter<MyViewHoder> {
|
public static class adaper extends RecyclerView.Adapter<MyViewHoder> implements Filterable {
|
||||||
|
|
||||||
|
private List<MP3> list;
|
||||||
|
private List<MP3> list_ys;
|
||||||
|
public adaper(List list) {
|
||||||
|
this.list = list;
|
||||||
|
list_ys = list;
|
||||||
|
}
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public MyViewHoder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public MyViewHoder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_mp3, parent, false);
|
return new MyViewHoder(ListMp3Binding.bind(LayoutInflater.from(parent.getContext()).
|
||||||
return new MyViewHoder(view);
|
inflate(R.layout.list_mp3,
|
||||||
|
parent, false)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull MyViewHoder holder, int position) {
|
public void onBindViewHolder(@NonNull MyViewHoder holder, int position) {
|
||||||
MP3 x = list.get(position);
|
MP3 x = list.get(position);
|
||||||
holder.name.setText(x.name);
|
holder.binding.text1.setText(String.valueOf(position + 1));
|
||||||
holder.zz.setText(x.zz);
|
holder.binding.name.setText(x.name);
|
||||||
|
holder.binding.zz.setText(x.zz);
|
||||||
int color = ContextCompat.getColor(holder.getContext(), R.color.text);
|
int color = ContextCompat.getColor(holder.getContext(), R.color.text);
|
||||||
if (bfqkz.xm != null && x.id.equals(bfqkz.xm.id)) {
|
if (bfqkz.xm != null && x.id.equals(bfqkz.xm.id)) {
|
||||||
color = ContextCompat.getColor(holder.getContext(), R.color.text_cz);
|
color = ContextCompat.getColor(holder.getContext(), R.color.text_cz);
|
||||||
}
|
}
|
||||||
holder.name.setTextColor(color);
|
holder.binding.name.setTextColor(color);
|
||||||
holder.zz.setTextColor(color);
|
holder.binding.zz.setTextColor(color);
|
||||||
holder.itemView.setOnClickListener(view -> {
|
holder.itemView.setOnClickListener(view -> {
|
||||||
if (bfqkz.xm == null || !bfqkz.xm.id.equals(x.id)) {
|
if (bfqkz.xm == null || !bfqkz.xm.id.equals(x.id)) {
|
||||||
bfqkz.xm = x;
|
bfqkz.xm = x;
|
||||||
|
@ -143,7 +201,48 @@ public class mp3 extends FragmentActivity {
|
||||||
}
|
}
|
||||||
bfqkz.list.clear();
|
bfqkz.list.clear();
|
||||||
bfqkz.list.addAll(list);
|
bfqkz.list.addAll(list);
|
||||||
bfq.start(mp3.this);
|
bfq.start(holder.getContext());
|
||||||
|
});
|
||||||
|
holder.itemView.setOnLongClickListener(view -> {
|
||||||
|
String a[] = new String[]{"喜欢歌曲", "下载歌曲", "复制名字"};
|
||||||
|
new MaterialAlertDialogBuilder(view.getContext()).
|
||||||
|
setItems(a, (dialog, id) -> {
|
||||||
|
String title = a[id];
|
||||||
|
switch (title) {
|
||||||
|
case "下载歌曲":
|
||||||
|
new FileDownloader(view.getContext()).downloadFile(x);
|
||||||
|
break;
|
||||||
|
case "喜欢歌曲":
|
||||||
|
try {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
Type type = new TypeToken<List<MP3>>() {
|
||||||
|
}.getType();
|
||||||
|
List<MP3> list = gson.fromJson(wj.dqwb(wj.gd + "mp3_like.json"), type);
|
||||||
|
if (list == null) {
|
||||||
|
list = new ArrayList<>();
|
||||||
|
}
|
||||||
|
if (bfqkz.like_bool) {
|
||||||
|
list.remove(bfqkz.xm);
|
||||||
|
bfq.setlike(false);
|
||||||
|
} else {
|
||||||
|
if (!list.contains(bfqkz.xm)) {
|
||||||
|
list.add(bfqkz.xm);
|
||||||
|
bfq.setlike(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bfqkz.like_bool = !bfqkz.like_bool;
|
||||||
|
wj.xrwb(wj.gd + "mp3_like.json", gson.toJson(list));
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "复制名字":
|
||||||
|
gj.fz(view.getContext(), x.name);
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
}).show();
|
||||||
|
return false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,6 +250,42 @@ public class mp3 extends FragmentActivity {
|
||||||
public int getItemCount() {
|
public int getItemCount() {
|
||||||
return list.size();
|
return list.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Filter getFilter() {
|
||||||
|
return new Filter() {
|
||||||
|
@Override
|
||||||
|
protected FilterResults performFiltering(CharSequence charSequence) {
|
||||||
|
String charString = charSequence.toString();
|
||||||
|
if (charString.isEmpty()) {
|
||||||
|
//没有过滤的内容,则使用源数据
|
||||||
|
list = list_ys;
|
||||||
|
} else {
|
||||||
|
List<MP3> filteredList = new ArrayList<>();
|
||||||
|
for (int i = 0; i < list_ys.size(); i++) {
|
||||||
|
MP3 mp3 = list_ys.get(i);
|
||||||
|
if (mp3.name.contains(charString)
|
||||||
|
|| mp3.zz.contains(charString)) {
|
||||||
|
filteredList.add(list_ys.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
list = filteredList;
|
||||||
|
}
|
||||||
|
|
||||||
|
FilterResults filterResults = new FilterResults();
|
||||||
|
filterResults.values = list;
|
||||||
|
return filterResults;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@Override
|
||||||
|
protected void publishResults(CharSequence charSequence, FilterResults filterResults) {
|
||||||
|
list = (List<MP3>) filterResults.values;
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ import android.view.ViewGroup;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
@ -17,20 +16,17 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.google.android.material.tabs.TabLayout;
|
import com.google.android.material.tabs.TabLayout;
|
||||||
import com.muqingbfq.MP3;
|
import com.muqingbfq.MP3;
|
||||||
import com.muqingbfq.R;
|
import com.muqingbfq.XM;
|
||||||
import com.muqingbfq.api.url;
|
|
||||||
import com.muqingbfq.bfq;
|
|
||||||
import com.muqingbfq.bfqkz;
|
|
||||||
import com.muqingbfq.databinding.FragmentSearchBinding;
|
import com.muqingbfq.databinding.FragmentSearchBinding;
|
||||||
import com.muqingbfq.list.MyViewHoder;
|
import com.muqingbfq.list.MyViewHoder;
|
||||||
import com.muqingbfq.main;
|
import com.muqingbfq.main;
|
||||||
import com.muqingbfq.mq.gj;
|
import com.muqingbfq.mq.gj;
|
||||||
import com.muqingbfq.mq.wl;
|
import com.muqingbfq.mq.wl;
|
||||||
import com.muqingbfq.XM;
|
|
||||||
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.text.DecimalFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -48,7 +44,7 @@ public class search extends Fragment {
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||||
@Nullable Bundle savedInstanceState) {
|
@Nullable Bundle savedInstanceState) {
|
||||||
inflate = FragmentSearchBinding.inflate(inflater, container, false);
|
inflate = FragmentSearchBinding.inflate(inflater, container, false);
|
||||||
lbspq = new spq();
|
lbspq = new mp3.adaper(list);
|
||||||
View view = inflate.getRoot();
|
View view = inflate.getRoot();
|
||||||
TypedValue typedValue = new TypedValue();
|
TypedValue typedValue = new TypedValue();
|
||||||
requireContext().getTheme().resolveAttribute(android.R.attr.windowBackground, typedValue, true);
|
requireContext().getTheme().resolveAttribute(android.R.attr.windowBackground, typedValue, true);
|
||||||
|
@ -90,15 +86,13 @@ public class search extends Fragment {
|
||||||
|
|
||||||
public void setStart(String name) {
|
public void setStart(String name) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
new spq();
|
new mp3.adaper(list);
|
||||||
inflate.recyclerview.setLayoutManager(new LinearLayoutManager(getContext()));
|
inflate.recyclerview.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
inflate.recyclerview.setAdapter(lbspq);
|
inflate.recyclerview.setAdapter(lbspq);
|
||||||
} else if (i == 1) {
|
} else if (i == 1) {
|
||||||
k = (int) (main.k / getResources().getDisplayMetrics().density + 0.5f) / 120;
|
k = (int) (main.k / getResources().getDisplayMetrics().density + 0.5f) / 120;
|
||||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(),
|
inflate.recyclerview.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
k);
|
inflate.recyclerview.setAdapter(new gd.baseadapter(getContext(), xmList, true));
|
||||||
inflate.recyclerview.setLayoutManager(gridLayoutManager);
|
|
||||||
inflate.recyclerview.setAdapter(new gd.baseadapter(getContext(), xmList));
|
|
||||||
}
|
}
|
||||||
new start(name);
|
new start(name);
|
||||||
}
|
}
|
||||||
|
@ -175,23 +169,34 @@ public class search extends Fragment {
|
||||||
gj.sc(e);
|
gj.sc(e);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
String hq = wl.hq("/search?keywords=" + name + "&limit=" + (k * 3) + "&type=1000");
|
String hq = wl.hq("/search?keywords=" + name +"&type=1000");
|
||||||
JSONArray jsonArray = new JSONObject(hq).getJSONObject("result")
|
JSONArray jsonArray = new JSONObject(hq).getJSONObject("result")
|
||||||
.getJSONArray("playlists");
|
.getJSONArray("playlists");
|
||||||
int length = jsonArray.length();
|
int length = jsonArray.length();
|
||||||
for (int i = 0; i < length; i++) {
|
for (int i = 0; i < length; i++) {
|
||||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||||
String id = jsonObject.getString("id");
|
String id = jsonObject.getString("id");
|
||||||
|
int trackCount = jsonObject.getInt("trackCount");
|
||||||
|
|
||||||
|
String nickname = "by " + jsonObject.getJSONObject("creator")
|
||||||
|
.getString("nickname");
|
||||||
|
long playCount = jsonObject.getLong("playCount");
|
||||||
String name = jsonObject.getString("name");
|
String name = jsonObject.getString("name");
|
||||||
String coverImgUrl = jsonObject.getString("coverImgUrl");
|
String coverImgUrl = jsonObject.getString("coverImgUrl");
|
||||||
// gj.sc(name);
|
// gj.sc(name);
|
||||||
xmList.add(new XM(id, name, coverImgUrl));
|
String formattedNumber = String.valueOf(playCount);
|
||||||
|
if (playCount > 9999) {
|
||||||
|
DecimalFormat df = new DecimalFormat("#,###.0万");
|
||||||
|
formattedNumber = df.format(playCount / 10000);
|
||||||
|
}
|
||||||
|
xmList.add(new XM(id, name, trackCount + "首," + nickname + ",播放"
|
||||||
|
+ formattedNumber + "次", coverImgUrl));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
gj.sc(e);
|
gj.sc(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
class spq extends RecyclerView.Adapter<MyViewHoder> {
|
class spq extends RecyclerView.Adapter<MyViewHoder> {
|
||||||
public spq() {
|
public spq() {
|
||||||
lbspq = this;
|
lbspq = this;
|
||||||
|
@ -200,22 +205,21 @@ public class search extends Fragment {
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public MyViewHoder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public MyViewHoder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
View view = LayoutInflater.
|
return new MyViewHoder(ListMp3Binding.
|
||||||
from(parent.getContext()).inflate(R.layout.list_mp3, parent, false);
|
inflate(getLayoutInflater(),parent,false));
|
||||||
return new MyViewHoder(view);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull MyViewHoder holder, int position) {
|
public void onBindViewHolder(@NonNull MyViewHoder holder, int position) {
|
||||||
MP3 x = list.get(position);
|
MP3 x = list.get(position);
|
||||||
holder.name.setText(x.name);
|
holder.binding.name.setText(x.name);
|
||||||
holder.zz.setText(x.zz);
|
holder.binding.zz.setText(x.zz);
|
||||||
int color = ContextCompat.getColor(holder.getContext(), R.color.text);
|
int color = ContextCompat.getColor(holder.getContext(), R.color.text);
|
||||||
if (bfqkz.xm != null && x.id.equals(bfqkz.xm.id)) {
|
if (bfqkz.xm != null && x.id.equals(bfqkz.xm.id)) {
|
||||||
color = ContextCompat.getColor(holder.getContext(), R.color.text_cz);
|
color = ContextCompat.getColor(holder.getContext(), R.color.text_cz);
|
||||||
}
|
}
|
||||||
holder.name.setTextColor(color);
|
holder.binding.name.setTextColor(color);
|
||||||
holder.zz.setTextColor(color);
|
holder.binding.zz.setTextColor(color);
|
||||||
holder.itemView.setOnClickListener(view1 -> {
|
holder.itemView.setOnClickListener(view1 -> {
|
||||||
if (bfqkz.xm == null || !bfqkz.xm.id.equals(x.id)) {
|
if (bfqkz.xm == null || !bfqkz.xm.id.equals(x.id)) {
|
||||||
bfqkz.xm = x;
|
bfqkz.xm = x;
|
||||||
|
@ -233,5 +237,5 @@ public class search extends Fragment {
|
||||||
public int getItemCount() {
|
public int getItemCount() {
|
||||||
return list.size();
|
return list.size();
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,9 +47,6 @@ public class sz {
|
||||||
} else if (id == R.id.f) {
|
} else if (id == R.id.f) {
|
||||||
context.startActivity(new Intent(context, activity_about_software.class));
|
context.startActivity(new Intent(context, activity_about_software.class));
|
||||||
// 关于软件
|
// 关于软件
|
||||||
} else if (id == R.id.g) {
|
|
||||||
context.startActivity(new Intent(context, cookie.class));
|
|
||||||
//绑定网易云
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2,7 +2,6 @@ package com.muqingbfq.fragment;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.ColorStateList;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -12,7 +11,6 @@ import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
@ -23,6 +21,8 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.muqingbfq.R;
|
import com.muqingbfq.R;
|
||||||
import com.muqingbfq.XM;
|
import com.muqingbfq.XM;
|
||||||
|
import com.muqingbfq.api.playlist;
|
||||||
|
import com.muqingbfq.api.resource;
|
||||||
import com.muqingbfq.databinding.FragmentWdBinding;
|
import com.muqingbfq.databinding.FragmentWdBinding;
|
||||||
import com.muqingbfq.login.user_logs;
|
import com.muqingbfq.login.user_logs;
|
||||||
import com.muqingbfq.login.visitor;
|
import com.muqingbfq.login.visitor;
|
||||||
|
@ -31,13 +31,16 @@ import com.muqingbfq.mq.EditViewDialog;
|
||||||
import com.muqingbfq.mq.gj;
|
import com.muqingbfq.mq.gj;
|
||||||
import com.muqingbfq.mq.wj;
|
import com.muqingbfq.mq.wj;
|
||||||
|
|
||||||
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.lang.reflect.Type;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
public class wode extends Fragment {
|
public class wode extends Fragment {
|
||||||
|
|
||||||
|
@ -52,7 +55,7 @@ public class wode extends Fragment {
|
||||||
{R.drawable.like, "喜欢音乐", "mp3_like.json"},
|
{R.drawable.like, "喜欢音乐", "mp3_like.json"},
|
||||||
{R.drawable.icon, "本地搜索", ""},
|
{R.drawable.icon, "本地搜索", ""},
|
||||||
{R.drawable.fuwuzhongxing, "更换接口", "API"},
|
{R.drawable.fuwuzhongxing, "更换接口", "API"},
|
||||||
{R.drawable.icon, "导入歌单", ""},
|
{R.drawable.gd, "导入歌单", "gd"},
|
||||||
{R.drawable.paihangbang, "排行榜", "排行榜"},
|
{R.drawable.paihangbang, "排行榜", "排行榜"},
|
||||||
{R.drawable.icon, "开发中", ""}
|
{R.drawable.icon, "开发中", ""}
|
||||||
};
|
};
|
||||||
|
@ -83,8 +86,6 @@ public class wode extends Fragment {
|
||||||
startActivity(new Intent(getContext(), user_logs.class));
|
startActivity(new Intent(getContext(), user_logs.class));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// new user_message();
|
|
||||||
// int k = (int) (main.k / getResources().getDisplayMetrics().density + 0.5f);
|
|
||||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(), 4) {
|
GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(), 4) {
|
||||||
@Override
|
@Override
|
||||||
public boolean canScrollVertically() {
|
public boolean canScrollVertically() {
|
||||||
|
@ -105,10 +106,7 @@ public class wode extends Fragment {
|
||||||
public void onBindViewHolder(@NonNull VH holder, int position) {
|
public void onBindViewHolder(@NonNull VH holder, int position) {
|
||||||
String s = lista[position][1].toString();
|
String s = lista[position][1].toString();
|
||||||
holder.textView.setText(s);
|
holder.textView.setText(s);
|
||||||
holder.imageView.setImageTintList(ColorStateList.valueOf(ContextCompat.getColor(getContext(), R.color.text)));
|
holder.imageView.setImageResource((Integer) lista[position][0]);
|
||||||
Glide.with(getContext())
|
|
||||||
.load(lista[position][0])
|
|
||||||
.into(holder.imageView);
|
|
||||||
String data = lista[position][2].toString();
|
String data = lista[position][2].toString();
|
||||||
holder.itemView.setOnClickListener(view -> {
|
holder.itemView.setOnClickListener(view -> {
|
||||||
switch (data) {
|
switch (data) {
|
||||||
|
@ -142,6 +140,53 @@ public class wode extends Fragment {
|
||||||
}
|
}
|
||||||
}).show();
|
}).show();
|
||||||
break;
|
break;
|
||||||
|
case "gd":
|
||||||
|
EditViewDialog editViewDialog1 = new EditViewDialog(getContext(),
|
||||||
|
"导入歌单")
|
||||||
|
.setMessage("请用网易云https链接来进行导入或者歌单id");
|
||||||
|
editViewDialog1.setPositive(view1 -> {
|
||||||
|
String str = editViewDialog1.getEditText();
|
||||||
|
// 使用正则表达式提取链接
|
||||||
|
Pattern pattern = Pattern.compile("https?://[\\w./?=&]+");
|
||||||
|
Matcher matcher = pattern.matcher(str);
|
||||||
|
if (matcher.find())
|
||||||
|
str = matcher.group();
|
||||||
|
if (!str.isEmpty()) {
|
||||||
|
// 使用截取方法获取歌单 ID
|
||||||
|
str = str.substring(str.indexOf("id=") + 3, str.indexOf("&"));
|
||||||
|
}
|
||||||
|
String finalStr = str;
|
||||||
|
gj.ts(getContext(), "导入中");
|
||||||
|
new Thread(){
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
super.run();
|
||||||
|
String hq = playlist.gethq(finalStr);
|
||||||
|
if (hq != null) {
|
||||||
|
wj.xrwb(wj.gd + finalStr, hq);
|
||||||
|
try {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
if (wj.cz(wj.gd_xz)) {
|
||||||
|
jsonObject = new JSONObject(Objects.requireNonNull(wj.dqwb(wj.gd_xz)));
|
||||||
|
}
|
||||||
|
XM fh = resource.Playlist_content(finalStr);
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
json.put("name", fh.name);
|
||||||
|
json.put("picUrl", fh.picurl);
|
||||||
|
jsonObject.put(fh.id, json);
|
||||||
|
wj.xrwb(wj.gd_xz, jsonObject.toString());
|
||||||
|
sx();
|
||||||
|
gj.xcts(getContext(), "成功");
|
||||||
|
} catch (JSONException e) {
|
||||||
|
gj.sc("list gd onclick thear " + e);
|
||||||
|
gj.xcts(getContext(), "失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.start();
|
||||||
|
editViewDialog1.dismiss();
|
||||||
|
}).show();
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -218,6 +263,7 @@ public class wode extends Fragment {
|
||||||
setqianming(user.qianming);
|
setqianming(user.qianming);
|
||||||
Glide.with(getContext())
|
Glide.with(getContext())
|
||||||
.load(user.picUrl)
|
.load(user.picUrl)
|
||||||
|
.error(R.drawable.ic_launcher_foreground)
|
||||||
.into(binding.imageView);
|
.into(binding.imageView);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -250,7 +250,6 @@ public class home extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onChildrenLoaded(@NonNull String parentId,
|
public void onChildrenLoaded(@NonNull String parentId,
|
||||||
@NonNull List<MediaBrowserCompat.MediaItem> children) {
|
@NonNull List<MediaBrowserCompat.MediaItem> children) {
|
||||||
|
|
||||||
gj.sc("onChildrenLoaded------");
|
gj.sc("onChildrenLoaded------");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -262,7 +261,7 @@ public class home extends AppCompatActivity {
|
||||||
if (mBrowser != null && mBrowser.isConnected()) {
|
if (mBrowser != null && mBrowser.isConnected()) {
|
||||||
mBrowser.disconnect();
|
mBrowser.disconnect();
|
||||||
}
|
}
|
||||||
int i = Process.myPid();
|
// int i = Process.myPid();
|
||||||
android.os.Process.killProcess(i);
|
// android.os.Process.killProcess(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -8,13 +8,13 @@ import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.muqingbfq.R;
|
import com.muqingbfq.R;
|
||||||
|
import com.muqingbfq.databinding.ListMp3Binding;
|
||||||
|
|
||||||
public class MyViewHoder extends RecyclerView.ViewHolder {
|
public class MyViewHoder extends RecyclerView.ViewHolder {
|
||||||
public TextView name, zz;
|
public ListMp3Binding binding;
|
||||||
public MyViewHoder(@NonNull View itemView) {
|
public MyViewHoder(@NonNull ListMp3Binding itemView) {
|
||||||
super(itemView);
|
super(itemView.getRoot());
|
||||||
name = itemView.findViewById(R.id.wb1);
|
binding = itemView;
|
||||||
zz = itemView.findViewById(R.id.zz);
|
|
||||||
}
|
}
|
||||||
public Context getContext() {
|
public Context getContext() {
|
||||||
return itemView.getContext();
|
return itemView.getContext();
|
||||||
|
|
|
@ -33,76 +33,7 @@ public class cookie extends FragmentActivity {
|
||||||
//view2 里面的控件
|
//view2 里面的控件
|
||||||
textView = findViewById(R.id.textView);
|
textView = findViewById(R.id.textView);
|
||||||
imageView = findViewById(R.id.imageView);
|
imageView = findViewById(R.id.imageView);
|
||||||
new erweima();
|
// new erweima();
|
||||||
}
|
|
||||||
|
|
||||||
class erweima extends Thread {
|
|
||||||
int code = 800;
|
|
||||||
String unikey, qrimg, hq;
|
|
||||||
private long time = 0;
|
|
||||||
public erweima() {
|
|
||||||
textView.setText("请使用网易云音乐扫码");
|
|
||||||
start();
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
super.run();
|
|
||||||
while (code != 0) {
|
|
||||||
try {
|
|
||||||
hq = wl.hq("/login/qr/check?key=" + unikey + Time());
|
|
||||||
if (hq != null) {
|
|
||||||
JSONObject json = new JSONObject(hq);
|
|
||||||
code = json.getInt("code");
|
|
||||||
switch (code) {
|
|
||||||
case 800:
|
|
||||||
case 400:
|
|
||||||
setwb("二维码过期");
|
|
||||||
hqkey();
|
|
||||||
break;
|
|
||||||
case 801:
|
|
||||||
setwb("等待扫码");
|
|
||||||
break;
|
|
||||||
case 802:
|
|
||||||
setwb("等待确认");
|
|
||||||
break;
|
|
||||||
case 803:
|
|
||||||
setwb("登录成功");
|
|
||||||
wl.setcookie(json.getString("cookie"));
|
|
||||||
code = 0;
|
|
||||||
cookie.this.finish();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
code = 0;
|
|
||||||
// 默认情况下的操作
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sleep(1000);
|
|
||||||
} catch (Exception e) {
|
|
||||||
gj.sc(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void hqkey() throws Exception {
|
|
||||||
unikey = new JSONObject(Objects.requireNonNull(wl.hq("/login/qr/key"))).
|
|
||||||
getJSONObject("data").getString("unikey");
|
|
||||||
JSONObject jsonObject = new JSONObject(Objects.requireNonNull(wl.hq("/login/qr/create?key=" +
|
|
||||||
unikey +
|
|
||||||
"&qrimg=base64")));
|
|
||||||
qrimg = jsonObject.getJSONObject("data").getString("qrimg");
|
|
||||||
main.handler.post(() -> imageView.setImageBitmap(user_logs.stringToBitmap(qrimg)));
|
|
||||||
}
|
|
||||||
|
|
||||||
private String Time() {
|
|
||||||
if (time < System.currentTimeMillis() - 1000) {
|
|
||||||
time = System.currentTimeMillis();
|
|
||||||
}
|
|
||||||
return "×tamp" + time;
|
|
||||||
}
|
|
||||||
private void setwb(String wb) {
|
|
||||||
main.handler.post(() -> textView.setText(wb));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -154,72 +154,6 @@ public class user_editing extends FragmentActivity {
|
||||||
com.muqingbfq.fragment.wode.setqianming(null);
|
com.muqingbfq.fragment.wode.setqianming(null);
|
||||||
com.muqingbfq.fragment.wode.imageView.setImageResource(R.drawable.icon);
|
com.muqingbfq.fragment.wode.imageView.setImageResource(R.drawable.icon);
|
||||||
});
|
});
|
||||||
findViewById(R.id.button1).setOnClickListener(view -> {
|
|
||||||
// 创建OkHttpClient实例
|
|
||||||
OkHttpClient client = new OkHttpClient();
|
|
||||||
|
|
||||||
// 创建MultipartBody.Builder来构建请求体
|
|
||||||
MultipartBody.Builder builder = new MultipartBody.Builder()
|
|
||||||
.setType(MultipartBody.FORM);
|
|
||||||
if (file_a != null) {
|
|
||||||
File file = new File(file_a);
|
|
||||||
RequestBody requestBody = RequestBody.create(file, MediaType.parse("image/*"));
|
|
||||||
builder.addFormDataPart("icon", file.getName(), requestBody);
|
|
||||||
}
|
|
||||||
if (file_b != null) {
|
|
||||||
File file = new File(file_b);
|
|
||||||
RequestBody requestBody = RequestBody.create(file, MediaType.parse("image/*"));
|
|
||||||
builder.addFormDataPart("cover", file.getName(), requestBody);
|
|
||||||
}
|
|
||||||
builder.addFormDataPart("token", main.token)
|
|
||||||
.addFormDataPart("userName", edit_name.getText().toString())
|
|
||||||
.addFormDataPart("introduce", edit_qianming.getText().toString())
|
|
||||||
.addFormDataPart("gender", "1")
|
|
||||||
.addFormDataPart("dynamicColor", "");
|
|
||||||
// 构建请求体
|
|
||||||
Request request = new Request.Builder()
|
|
||||||
.url("https://rust.coldmint.top/php/user.php?action=updateSpaceInfo")
|
|
||||||
.post(builder.build())
|
|
||||||
.build();
|
|
||||||
// 发起请求
|
|
||||||
client.newCall(request).enqueue(new Callback() {
|
|
||||||
@Override
|
|
||||||
public void onFailure(@NonNull Call call, @NonNull IOException e) {
|
|
||||||
gj.sc(e);
|
|
||||||
// 请求失败处理
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException {
|
|
||||||
// 请求成功处理
|
|
||||||
String responseData = response.body().string();
|
|
||||||
gj.sc(responseData);
|
|
||||||
if (TextUtils.isEmpty(responseData)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
JSONObject jsonObject = new JSONObject(responseData);
|
|
||||||
int code = jsonObject.getInt("code");
|
|
||||||
if (code == 1) {
|
|
||||||
String data = jsonObject.getString("data");
|
|
||||||
switch (data) {
|
|
||||||
case "@event:用户名占用":
|
|
||||||
break;
|
|
||||||
case "introduce":
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else if (code == 0) {
|
|
||||||
// new user_message();
|
|
||||||
}
|
|
||||||
gj.xcts(user_editing.this, jsonObject.getString("message"));
|
|
||||||
} catch (JSONException e) {
|
|
||||||
gj.sc(e);
|
|
||||||
}
|
|
||||||
// 处理响应数据
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取图片的实际路径
|
// 获取图片的实际路径
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package com.muqingbfq.login;
|
package com.muqingbfq.login;
|
||||||
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
@ -9,22 +8,18 @@ import android.util.Base64;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.EditText;
|
|
||||||
|
|
||||||
import androidx.activity.result.ActivityResultLauncher;
|
|
||||||
import androidx.activity.result.contract.ActivityResultContracts;
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.muqingbfq.databinding.ActivityUserLogsBinding;
|
import com.muqingbfq.databinding.ActivityUserLogsBinding;
|
||||||
import com.muqingbfq.main;
|
import com.muqingbfq.main;
|
||||||
import com.muqingbfq.mq.EditViewDialog;
|
|
||||||
import com.muqingbfq.mq.gj;
|
import com.muqingbfq.mq.gj;
|
||||||
import com.muqingbfq.mq.wl;
|
import com.muqingbfq.mq.wl;
|
||||||
|
|
||||||
import org.json.JSONException;
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
||||||
public class user_logs extends AppCompatActivity {
|
public class user_logs extends AppCompatActivity {
|
||||||
|
@ -38,24 +33,9 @@ public class user_logs extends AppCompatActivity {
|
||||||
this.picUrl = picUrl;
|
this.picUrl = picUrl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EditText edituser, editpassword;
|
|
||||||
public static String UUID;
|
|
||||||
|
|
||||||
ActivityResultLauncher<Intent> enroll =
|
|
||||||
registerForActivityResult(new ActivityResultContracts.StartActivityForResult(),
|
|
||||||
result -> {
|
|
||||||
if (result.getResultCode() == RESULT_OK) {
|
|
||||||
Intent data = result.getData();
|
|
||||||
if (data != null) {
|
|
||||||
Bundle bundle = data.getExtras();
|
|
||||||
String user = bundle.getString("user");
|
|
||||||
String password = bundle.getString("password");
|
|
||||||
edituser.setText(user);
|
|
||||||
editpassword.setText(password);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
ActivityUserLogsBinding binding;
|
ActivityUserLogsBinding binding;
|
||||||
|
erweima thread;
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
@ -63,17 +43,21 @@ public class user_logs extends AppCompatActivity {
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
setSupportActionBar(binding.toolbar);
|
setSupportActionBar(binding.toolbar);
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
|
|
||||||
// UUID = Settings.Secure.getString(getContentResolver(),
|
|
||||||
// Settings.Secure.ANDROID_ID);
|
|
||||||
binding.login.setOnClickListener(view -> new CloudUser());
|
binding.login.setOnClickListener(view -> new CloudUser());
|
||||||
/* findViewById(R.id.enroll).setOnClickListener(view -> {
|
binding.button1.setOnClickListener(view -> {
|
||||||
Intent intent = new Intent(user_logs.this, enroll.class);
|
if (binding.layout1.getVisibility() == View.VISIBLE) {
|
||||||
intent.putExtra("user", edituser.getText().toString());
|
binding.layout1.setVisibility(View.GONE);
|
||||||
intent.putExtra("appID", UUID);
|
binding.layout2.setVisibility(View.VISIBLE);
|
||||||
enroll.launch(intent);
|
binding.button1.setText("账号");
|
||||||
});*/
|
thread = new erweima();
|
||||||
|
thread.start();
|
||||||
|
} else {
|
||||||
|
thread.interrupt();
|
||||||
|
binding.button1.setText("二维码");
|
||||||
|
binding.layout1.setVisibility(View.VISIBLE);
|
||||||
|
binding.layout2.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
//some statement
|
//some statement
|
||||||
|
|
||||||
|
@ -102,6 +86,7 @@ public class user_logs extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String account, password;
|
public String account, password;
|
||||||
|
|
||||||
class CloudUser extends Thread {
|
class CloudUser extends Thread {
|
||||||
public CloudUser() {
|
public CloudUser() {
|
||||||
InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
|
InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
|
||||||
|
@ -132,7 +117,7 @@ public class user_logs extends AppCompatActivity {
|
||||||
String cookie = jsonObject.getString("cookie");
|
String cookie = jsonObject.getString("cookie");
|
||||||
gj.xcts(user_logs.this, "登录成功");
|
gj.xcts(user_logs.this, "登录成功");
|
||||||
wl.setcookie(cookie);
|
wl.setcookie(cookie);
|
||||||
new user_message(nickname,signature,avatarUrl);
|
new user_message(nickname, signature, avatarUrl);
|
||||||
user_logs.this.finish();
|
user_logs.this.finish();
|
||||||
} else if (code == 502) {
|
} else if (code == 502) {
|
||||||
gj.xcts(user_logs.this, jsonObject.getString("message"));
|
gj.xcts(user_logs.this, jsonObject.getString("message"));
|
||||||
|
@ -144,4 +129,79 @@ public class user_logs extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class erweima extends Thread {
|
||||||
|
int code = 800;
|
||||||
|
String unikey, qrimg, hq;
|
||||||
|
private long time = 0;
|
||||||
|
|
||||||
|
public erweima() {
|
||||||
|
binding.text1.setText("请使用网易云音乐扫码");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
super.run();
|
||||||
|
while (code != 0 && !Thread.currentThread().isInterrupted()) {
|
||||||
|
gj.sc(code);
|
||||||
|
try {
|
||||||
|
hq = wl.hq("/login/qr/check?key=" + unikey + Time());
|
||||||
|
if (hq != null) {
|
||||||
|
JSONObject json = new JSONObject(hq);
|
||||||
|
code = json.getInt("code");
|
||||||
|
switch (code) {
|
||||||
|
case 800:
|
||||||
|
case 400:
|
||||||
|
setwb("二维码过期");
|
||||||
|
hqkey();
|
||||||
|
break;
|
||||||
|
case 801:
|
||||||
|
setwb("等待扫码");
|
||||||
|
break;
|
||||||
|
case 802:
|
||||||
|
setwb("等待确认");
|
||||||
|
break;
|
||||||
|
case 803:
|
||||||
|
setwb("登录成功");
|
||||||
|
wl.setcookie(json.getString("cookie"));
|
||||||
|
code = 0;
|
||||||
|
user_logs.this.finish();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
code = 0;
|
||||||
|
// 默认情况下的操作
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sleep(1000);
|
||||||
|
} catch (Exception e) {
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
|
gj.sc(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void hqkey() throws Exception {
|
||||||
|
unikey = new JSONObject(Objects.requireNonNull(wl.hq("/login/qr/key"))).
|
||||||
|
getJSONObject("data").getString("unikey");
|
||||||
|
JSONObject jsonObject = new JSONObject(Objects.requireNonNull(wl.hq("/login/qr/create?key=" +
|
||||||
|
unikey +
|
||||||
|
"&qrimg=base64")));
|
||||||
|
qrimg = jsonObject.getJSONObject("data").getString("qrimg");
|
||||||
|
main.handler.post(() -> binding.image.setImageBitmap(user_logs.stringToBitmap(qrimg)));
|
||||||
|
}
|
||||||
|
|
||||||
|
private String Time() {
|
||||||
|
if (time < System.currentTimeMillis() - 1000) {
|
||||||
|
time = System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
return "×tamp" + time;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setwb(String wb) {
|
||||||
|
main.handler.post(() -> binding.text1.setText(wb));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -5,20 +5,17 @@ import android.app.Activity;
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import androidx.activity.result.ActivityResultLauncher;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.activity.result.contract.ActivityResultContracts;
|
|
||||||
import androidx.appcompat.app.AppCompatDelegate;
|
import androidx.appcompat.app.AppCompatDelegate;
|
||||||
|
|
||||||
import com.muqingbfq.login.visitor;
|
import com.muqingbfq.login.visitor;
|
||||||
import com.muqingbfq.mq.FloatingLyricsService;
|
import com.muqingbfq.mq.FloatingLyricsService;
|
||||||
import com.muqingbfq.mq.gj;
|
|
||||||
import com.muqingbfq.mq.wj;
|
import com.muqingbfq.mq.wj;
|
||||||
import com.muqingbfq.mq.wl;
|
import com.muqingbfq.mq.wl;
|
||||||
|
|
||||||
|
@ -33,10 +30,8 @@ public class main extends Application {
|
||||||
public static int k, g;
|
public static int k, g;
|
||||||
public static SharedPreferences sp;
|
public static SharedPreferences sp;
|
||||||
public static SharedPreferences.Editor edit;
|
public static SharedPreferences.Editor edit;
|
||||||
|
|
||||||
public static String account,token;
|
|
||||||
|
|
||||||
public int count = 0;
|
public int count = 0;
|
||||||
|
public static long item = System.currentTimeMillis();
|
||||||
@SuppressLint("HardwareIds")
|
@SuppressLint("HardwareIds")
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
|
@ -56,7 +51,6 @@ public class main extends Application {
|
||||||
wj.xrwb(file.toString(), main.api);
|
wj.xrwb(file.toString(), main.api);
|
||||||
}
|
}
|
||||||
application = this;
|
application = this;
|
||||||
// UUID.randomUUID().toString();
|
|
||||||
sp = getSharedPreferences("Set_up", MODE_PRIVATE);
|
sp = getSharedPreferences("Set_up", MODE_PRIVATE);
|
||||||
edit = sp.edit();
|
edit = sp.edit();
|
||||||
boolean bj = false;
|
boolean bj = false;
|
||||||
|
@ -95,13 +89,12 @@ public class main extends Application {
|
||||||
|
|
||||||
registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() {
|
registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() {
|
||||||
@Override
|
@Override
|
||||||
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
|
public void onActivityCreated(@NonNull Activity activity, Bundle savedInstanceState) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityStarted(Activity activity) {
|
public void onActivityStarted(@NonNull Activity activity) {
|
||||||
if (count == 0) { //后台切换到前台
|
if (count == 0) { //后台切换到前台
|
||||||
gj.sc(">>>>>>>>>>>>>>>>>>>App切到前台");
|
|
||||||
if (FloatingLyricsService.lei != null) {
|
if (FloatingLyricsService.lei != null) {
|
||||||
stopService(new Intent(main.this, FloatingLyricsService.class));
|
stopService(new Intent(main.this, FloatingLyricsService.class));
|
||||||
}
|
}
|
||||||
|
@ -110,19 +103,19 @@ public class main extends Application {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityResumed(Activity activity) {
|
public void onActivityResumed(@NonNull Activity activity) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityPaused(Activity activity) {
|
public void onActivityPaused(@NonNull Activity activity) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityStopped(Activity activity) {
|
public void onActivityStopped(@NonNull Activity activity) {
|
||||||
count--;
|
count--;
|
||||||
if (count == 0) { //后台切换到前台
|
if (count == 0) { //后台切换到前台
|
||||||
gj.sc(">>>>>>>>>>>>>>>>>>>App切到后台");
|
// gj.sc(">>>>>>>>>>>>>>>>>>>App切到后台");
|
||||||
new Thread(){
|
new Thread(){
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -148,11 +141,11 @@ public class main extends Application {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
|
public void onActivitySaveInstanceState(@NonNull Activity activity, @NonNull Bundle outState) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityDestroyed(Activity activity) {
|
public void onActivityDestroyed(@NonNull Activity activity) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,8 @@ import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
import android.widget.EditText;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||||
|
@ -33,6 +35,7 @@ public class gj {
|
||||||
main.handler.post(() -> Toast.makeText(context, b.toString(), Toast.LENGTH_SHORT).show());
|
main.handler.post(() -> Toast.makeText(context, b.toString(), Toast.LENGTH_SHORT).show());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isAppInForeground(Context context) {
|
public static boolean isAppInForeground(Context context) {
|
||||||
ActivityManager activityManager = (ActivityManager) context.getSystemService(Service.ACTIVITY_SERVICE);
|
ActivityManager activityManager = (ActivityManager) context.getSystemService(Service.ACTIVITY_SERVICE);
|
||||||
List<ActivityManager.RunningAppProcessInfo> runningAppProcessInfoList = activityManager.getRunningAppProcesses();
|
List<ActivityManager.RunningAppProcessInfo> runningAppProcessInfoList = activityManager.getRunningAppProcesses();
|
||||||
|
@ -48,6 +51,7 @@ public class gj {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isTablet(Context context) {
|
public static boolean isTablet(Context context) {
|
||||||
boolean b;
|
boolean b;
|
||||||
DisplayMetrics dm = context.getResources().getDisplayMetrics();
|
DisplayMetrics dm = context.getResources().getDisplayMetrics();
|
||||||
|
@ -56,6 +60,7 @@ public class gj {
|
||||||
b = main.k > main.g;
|
b = main.k > main.g;
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void sc(Object a) {
|
public static void sc(Object a) {
|
||||||
if (a == null) {
|
if (a == null) {
|
||||||
a = "null";
|
a = "null";
|
||||||
|
@ -74,11 +79,13 @@ public class gj {
|
||||||
shareIntent.putExtra(Intent.EXTRA_TEXT, str);
|
shareIntent.putExtra(Intent.EXTRA_TEXT, str);
|
||||||
context.startActivity(shareIntent);
|
context.startActivity(shareIntent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 复制文字到剪切板
|
* 复制文字到剪切板
|
||||||
|
*
|
||||||
* @param text
|
* @param text
|
||||||
*/
|
*/
|
||||||
public static void fz(Context context,String text){
|
public static void fz(Context context, String text) {
|
||||||
ClipboardManager systemService =
|
ClipboardManager systemService =
|
||||||
(ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
(ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
// 创建能够存入剪贴板的ClipData对象
|
// 创建能够存入剪贴板的ClipData对象
|
||||||
|
@ -86,6 +93,7 @@ public class gj {
|
||||||
ClipData mClipData = ClipData.newPlainText("Label", text);
|
ClipData mClipData = ClipData.newPlainText("Label", text);
|
||||||
//将ClipData数据复制到剪贴板:
|
//将ClipData数据复制到剪贴板:
|
||||||
systemService.setPrimaryClip(mClipData);
|
systemService.setPrimaryClip(mClipData);
|
||||||
|
gj.ts(context, "复制成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isWiFiConnected() {
|
public static boolean isWiFiConnected() {
|
||||||
|
@ -135,7 +143,7 @@ public class gj {
|
||||||
String bb = jsonObject.getString("bb");
|
String bb = jsonObject.getString("bb");
|
||||||
main.handler.post(() -> new MaterialAlertDialogBuilder(context)
|
main.handler.post(() -> new MaterialAlertDialogBuilder(context)
|
||||||
.setTitle("更新" + bb)
|
.setTitle("更新" + bb)
|
||||||
.setMessage(msg+"\n"+"取消后不再提示更新你需要到关于软件手动检测")
|
.setMessage(msg + "\n" + "取消后不再提示更新你需要到关于软件手动检测")
|
||||||
.setNegativeButton("取消", (dialogInterface, i) -> wj.xrwb(wj.filesdri + "gx.mq", null))
|
.setNegativeButton("取消", (dialogInterface, i) -> wj.xrwb(wj.filesdri + "gx.mq", null))
|
||||||
.setPositiveButton("更新", (dialogInterface, i) -> context.startActivity(new Intent(Intent.ACTION_VIEW,
|
.setPositiveButton("更新", (dialogInterface, i) -> context.startActivity(new Intent(Intent.ACTION_VIEW,
|
||||||
Uri.parse(url))))
|
Uri.parse(url))))
|
||||||
|
@ -149,4 +157,20 @@ public class gj {
|
||||||
}
|
}
|
||||||
return 400;
|
return 400;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void tcjp(EditText editText) {
|
||||||
|
editText.requestFocus();//获取焦点
|
||||||
|
InputMethodManager imm = (InputMethodManager)
|
||||||
|
editText.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
// gj.sc(imm.isActive());
|
||||||
|
//没有显示键盘,弹出
|
||||||
|
imm.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT);
|
||||||
|
}
|
||||||
|
public static void ycjp(EditText editText) {
|
||||||
|
InputMethodManager imm = (InputMethodManager)
|
||||||
|
editText.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
if (imm.isActive()) //有显示键盘,隐藏
|
||||||
|
imm.hideSoftInputFromWindow(editText.getWindowToken(),
|
||||||
|
InputMethodManager.HIDE_NOT_ALWAYS);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1,15 +1,15 @@
|
||||||
package com.muqingbfq.mq;
|
package com.muqingbfq.mq;
|
||||||
|
|
||||||
|
|
||||||
import com.muqingbfq.main;
|
|
||||||
import com.muqingbfq.XM;
|
import com.muqingbfq.XM;
|
||||||
|
import com.muqingbfq.main;
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import okhttp3.FormBody;
|
import okhttp3.MultipartBody;
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
import okhttp3.Response;
|
import okhttp3.Response;
|
||||||
|
@ -40,22 +40,29 @@ public class wl {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String post(String str, String[][] a) {
|
public static String post(String str, String[][] a) {
|
||||||
|
|
||||||
OkHttpClient client = new OkHttpClient().newBuilder()
|
OkHttpClient client = new OkHttpClient().newBuilder()
|
||||||
.build();
|
.build();
|
||||||
FormBody.Builder builder = new FormBody.Builder();
|
// MediaType mediaType = MediaType.parse("text/plain");
|
||||||
for (String[] strings : a) {
|
MultipartBody.Builder builder = new MultipartBody.Builder().setType(MultipartBody.FORM);
|
||||||
// gj.sc(strings[0] + ":" + strings[1]);
|
for (String[] b : a) {
|
||||||
builder.add(strings[0], strings[1]);
|
builder.addFormDataPart(b[0], b[1]);
|
||||||
}
|
}
|
||||||
|
builder.addFormDataPart("cookie", Cookie);
|
||||||
|
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url(main.api + str)
|
.url(main.api + str)
|
||||||
.post(builder.build())
|
.method("POST", builder.build())
|
||||||
|
.addHeader("User-Agent", "Apifox/1.0.0 (https://apifox.com)")
|
||||||
|
.addHeader("Accept", "*/*")
|
||||||
|
.addHeader("Host", "139.196.224.229:3000")
|
||||||
|
.addHeader("Connection", "keep-alive")
|
||||||
.build();
|
.build();
|
||||||
try {
|
try {
|
||||||
Response response = client.newCall(request).execute();
|
Response response = client.newCall(request).execute();
|
||||||
return response.body().string();
|
if (response.body() != null) {
|
||||||
} catch (IOException e) {
|
return response.body().string();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
gj.sc(e);
|
gj.sc(e);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -42,6 +42,7 @@ public class CardImage extends MaterialCardView {
|
||||||
Glide.with(this)
|
Glide.with(this)
|
||||||
.load(bitmap)
|
.load(bitmap)
|
||||||
// .apply(new RequestOptions().placeholder(R.drawable.icon))
|
// .apply(new RequestOptions().placeholder(R.drawable.icon))
|
||||||
|
.error(R.drawable.ic_launcher_foreground)
|
||||||
.into(imageView);
|
.into(imageView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ package com.muqingbfq.view;
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.graphics.Canvas;
|
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
@ -112,33 +111,35 @@ public class LrcView extends RecyclerView {
|
||||||
public void setLrcline(boolean lrcline) {
|
public void setLrcline(boolean lrcline) {
|
||||||
Lrcline = lrcline;
|
Lrcline = lrcline;
|
||||||
if (lrcline) {
|
if (lrcline) {
|
||||||
addItemDecoration(new ItemDecoration() {
|
removeItemDecoration(ItemDecoration);
|
||||||
|
/* addItemDecoration(new ItemDecoration() {
|
||||||
@Override
|
@Override
|
||||||
public void onDraw(@NonNull Canvas c, @NonNull RecyclerView parent, @NonNull State state) {
|
public void onDraw(@NonNull Canvas c, @NonNull RecyclerView parent, @NonNull State state) {
|
||||||
super.onDraw(c, parent, state);
|
super.onDraw(c, parent, state);
|
||||||
}
|
}
|
||||||
});
|
});*/
|
||||||
} else {
|
} else {
|
||||||
addItemDecoration(new RecyclerView.ItemDecoration() {
|
addItemDecoration(ItemDecoration);
|
||||||
@Override
|
|
||||||
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
|
|
||||||
super.getItemOffsets(outRect, view, parent, state);
|
|
||||||
view.setOnClickListener(onClickListener);
|
|
||||||
|
|
||||||
int parentHeight = parent.getHeight();
|
|
||||||
int childHeight = view.getHeight();
|
|
||||||
|
|
||||||
int topMargin = (parentHeight - childHeight) / 2;
|
|
||||||
|
|
||||||
// 设置第一项的顶部间距
|
|
||||||
if (parent.getChildAdapterPosition(view) == 0) {
|
|
||||||
outRect.top = topMargin;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private final RecyclerView.ItemDecoration ItemDecoration = new ItemDecoration() {
|
||||||
|
@Override
|
||||||
|
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
|
||||||
|
super.getItemOffsets(outRect, view, parent, state);
|
||||||
|
view.setOnClickListener(onClickListener);
|
||||||
|
|
||||||
|
int parentHeight = parent.getHeight();
|
||||||
|
int childHeight = view.getHeight();
|
||||||
|
|
||||||
|
int topMargin = (parentHeight - childHeight) / 2;
|
||||||
|
|
||||||
|
// 设置第一项的顶部间距
|
||||||
|
if (parent.getChildAdapterPosition(view) == 0) {
|
||||||
|
outRect.top = topMargin;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
public android.os.Handler handler = new Handler(Looper.getMainLooper());
|
public android.os.Handler handler = new Handler(Looper.getMainLooper());
|
||||||
|
|
||||||
@SuppressLint("ClickableViewAccessibility")
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
|
|
9
app/src/main/res/drawable/gd.xml
Normal file
9
app/src/main/res/drawable/gd.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="200dp"
|
||||||
|
android:height="200dp"
|
||||||
|
android:viewportWidth="1024"
|
||||||
|
android:viewportHeight="1024">
|
||||||
|
<path
|
||||||
|
android:pathData="M964.6,234.5c-46.1,-52.6 -104.8,-93.7 -169.6,-118.8a34,34 0,0 0,-46.4 31.7v420.4a178,178 0,0 0,-110.9 -38.7c-98.8,0 -179.2,80.4 -179.2,179.2S538.8,887.5 637.6,887.5s179.2,-80.4 179.2,-179.2c0,-1.9 -0.2,-3.8 -0.3,-5.6 0,-1 0.3,-1.9 0.3,-2.9V201.2c36.2,20.3 69.1,46.9 96.6,78.2 12.5,14.2 34.1,15.5 48.1,3.1 14.2,-12.3 15.5,-33.8 3.1,-48zM637.6,819.2c-61.1,0 -110.9,-49.8 -110.9,-110.9s49.8,-110.9 110.9,-110.9 110.9,49.8 110.9,110.9 -49.8,110.9 -110.9,110.9zM185.3,307.2h392.5c18.8,0 34.1,-15.4 34.1,-34.1s-15.4,-34.1 -34.1,-34.1h-392.5a34.1,34.1 0,1 0,0 68.3zM424.3,460.8h-238.9c-18.8,0 -34.1,15.4 -34.1,34.1s15.4,34.1 34.1,34.1h238.9c18.8,0 34.1,-15.4 34.1,-34.1s-15.4,-34.1 -34.1,-34.1zM321.9,682.7h-136.5c-18.8,0 -34.1,15.4 -34.1,34.1s15.4,34.1 34.1,34.1h136.5c18.8,0 34.1,-15.4 34.1,-34.1s-15.4,-34.1 -34.1,-34.1z"
|
||||||
|
android:fillColor="@color/text"/>
|
||||||
|
</vector>
|
|
@ -5,8 +5,8 @@
|
||||||
android:viewportHeight="1024">
|
android:viewportHeight="1024">
|
||||||
<path
|
<path
|
||||||
android:pathData="M995,538.7c-13.8,-8.9 -30.3,-12 -46.4,-8.5l-182.9,39.3c-28.2,6.1 -48.6,31.4 -48.6,60.2v224.6c0,21.8 -17.7,39.5 -39.6,39.5 -21.8,0 -39.5,-17.7 -39.5,-39.5s17.7,-39.6 39.5,-39.6c15.4,0 27.8,-12.4 27.8,-27.8s-12.4,-27.8 -27.8,-27.8c-52.4,0 -95.1,42.7 -95.1,95.2 0,52.4 42.7,95.1 95.1,95.1 52.5,0 95.1,-42.7 95.1,-95.1V629.8c0,-2.9 2,-5.3 4.8,-5.9l182.9,-39.3c1.9,-0.5 3.6,0.2 4.5,0.8 1,0.6 2.2,1.8 2.7,5V814c0,21.8 -17.7,39.6 -39.6,39.6 -10.5,0 -20.5,-4.1 -27.9,-11.6 -7.5,-7.5 -11.6,-17.4 -11.6,-28 0,-21.8 17.7,-39.6 39.6,-39.6 15.4,0 27.8,-12.4 27.8,-27.8s-12.4,-27.8 -27.8,-27.8c-52.5,0 -95.1,42.7 -95.1,95.1 0,25.4 9.9,49.3 27.9,67.3s41.8,27.9 67.2,27.9c52.5,0 95.1,-42.7 95.1,-95.1V590.5c0,-4.4 -0.5,-8.7 -1.4,-12.9 -3.4,-16.1 -12.9,-29.9 -26.7,-38.9z"
|
android:pathData="M995,538.7c-13.8,-8.9 -30.3,-12 -46.4,-8.5l-182.9,39.3c-28.2,6.1 -48.6,31.4 -48.6,60.2v224.6c0,21.8 -17.7,39.5 -39.6,39.5 -21.8,0 -39.5,-17.7 -39.5,-39.5s17.7,-39.6 39.5,-39.6c15.4,0 27.8,-12.4 27.8,-27.8s-12.4,-27.8 -27.8,-27.8c-52.4,0 -95.1,42.7 -95.1,95.2 0,52.4 42.7,95.1 95.1,95.1 52.5,0 95.1,-42.7 95.1,-95.1V629.8c0,-2.9 2,-5.3 4.8,-5.9l182.9,-39.3c1.9,-0.5 3.6,0.2 4.5,0.8 1,0.6 2.2,1.8 2.7,5V814c0,21.8 -17.7,39.6 -39.6,39.6 -10.5,0 -20.5,-4.1 -27.9,-11.6 -7.5,-7.5 -11.6,-17.4 -11.6,-28 0,-21.8 17.7,-39.6 39.6,-39.6 15.4,0 27.8,-12.4 27.8,-27.8s-12.4,-27.8 -27.8,-27.8c-52.5,0 -95.1,42.7 -95.1,95.1 0,25.4 9.9,49.3 27.9,67.3s41.8,27.9 67.2,27.9c52.5,0 95.1,-42.7 95.1,-95.1V590.5c0,-4.4 -0.5,-8.7 -1.4,-12.9 -3.4,-16.1 -12.9,-29.9 -26.7,-38.9z"
|
||||||
android:fillColor="#000000"/>
|
android:fillColor="@color/text"/>
|
||||||
<path
|
<path
|
||||||
android:pathData="M338.3,315.1c35.3,-63.9 90.4,-114.1 158.6,-143.6 81.4,-35.2 171.7,-36.6 254.1,-3.9 106.7,42.3 183,134.9 204.1,247.8 3.1,16.7 17.7,28.4 34.1,28.4 2.1,0 4.3,-0.2 6.4,-0.6 18.9,-3.5 31.3,-21.7 27.8,-40.5C997.9,266.2 905.7,154.1 776.6,103c-99.7,-39.5 -208.8,-37.8 -307.3,4.7 -92.5,40 -165.1,111.6 -206.4,202.8 -48.9,3.6 -96.2,19.8 -137.8,48C62.2,400.9 19.7,465.3 5.3,539.7c-14.4,74.4 1,150 43.5,212.9 52.9,78.3 140.8,125 235.2,125h153.3c19.2,0 34.7,-15.6 34.7,-34.7s-15.6,-34.7 -34.7,-34.7H284c-71.3,0 -137.7,-35.3 -177.7,-94.4C74.2,666.3 62.6,609.3 73.5,553c10.9,-56.2 43,-104.8 90.5,-136.9 47.5,-32.1 104.5,-43.7 160.8,-32.8 56.2,10.9 104.8,43 136.9,90.5 10.7,15.9 32.3,20.1 48.2,9.3 15.9,-10.7 20.1,-32.3 9.3,-48.2 -42.4,-62.8 -106.6,-105.3 -180.9,-119.8z"
|
android:pathData="M338.3,315.1c35.3,-63.9 90.4,-114.1 158.6,-143.6 81.4,-35.2 171.7,-36.6 254.1,-3.9 106.7,42.3 183,134.9 204.1,247.8 3.1,16.7 17.7,28.4 34.1,28.4 2.1,0 4.3,-0.2 6.4,-0.6 18.9,-3.5 31.3,-21.7 27.8,-40.5C997.9,266.2 905.7,154.1 776.6,103c-99.7,-39.5 -208.8,-37.8 -307.3,4.7 -92.5,40 -165.1,111.6 -206.4,202.8 -48.9,3.6 -96.2,19.8 -137.8,48C62.2,400.9 19.7,465.3 5.3,539.7c-14.4,74.4 1,150 43.5,212.9 52.9,78.3 140.8,125 235.2,125h153.3c19.2,0 34.7,-15.6 34.7,-34.7s-15.6,-34.7 -34.7,-34.7H284c-71.3,0 -137.7,-35.3 -177.7,-94.4C74.2,666.3 62.6,609.3 73.5,553c10.9,-56.2 43,-104.8 90.5,-136.9 47.5,-32.1 104.5,-43.7 160.8,-32.8 56.2,10.9 104.8,43 136.9,90.5 10.7,15.9 32.3,20.1 48.2,9.3 15.9,-10.7 20.1,-32.3 9.3,-48.2 -42.4,-62.8 -106.6,-105.3 -180.9,-119.8z"
|
||||||
android:fillColor="#000000"/>
|
android:fillColor="@color/text"/>
|
||||||
</vector>
|
</vector>
|
||||||
|
|
|
@ -5,5 +5,5 @@
|
||||||
android:viewportHeight="1024">
|
android:viewportHeight="1024">
|
||||||
<path
|
<path
|
||||||
android:pathData="M544,661.3a32,32 0,0 1,-64 0L480,362.7a32,32 0,0 1,64 0v298.7zM704,661.3a32,32 0,0 1,-64 0L640,490.7a32,32 0,0 1,64 0v170.7zM384,661.3a32,32 0,0 1,-64 0L320,448a32,32 0,0 1,64 0v213.3zM202.7,138.7h618.7c64.8,0 117.3,52.5 117.3,117.3v512c0,64.8 -52.5,117.3 -117.3,117.3L202.7,885.3c-64.8,0 -117.3,-52.5 -117.3,-117.3L85.3,256c0,-64.8 52.5,-117.3 117.3,-117.3zM202.7,202.7a53.3,53.3 0,0 0,-53.3 53.3v512a53.3,53.3 0,0 0,53.3 53.3h618.7a53.3,53.3 0,0 0,53.3 -53.3L874.7,256a53.3,53.3 0,0 0,-53.3 -53.3L202.7,202.7z"
|
android:pathData="M544,661.3a32,32 0,0 1,-64 0L480,362.7a32,32 0,0 1,64 0v298.7zM704,661.3a32,32 0,0 1,-64 0L640,490.7a32,32 0,0 1,64 0v170.7zM384,661.3a32,32 0,0 1,-64 0L320,448a32,32 0,0 1,64 0v213.3zM202.7,138.7h618.7c64.8,0 117.3,52.5 117.3,117.3v512c0,64.8 -52.5,117.3 -117.3,117.3L202.7,885.3c-64.8,0 -117.3,-52.5 -117.3,-117.3L85.3,256c0,-64.8 52.5,-117.3 117.3,-117.3zM202.7,202.7a53.3,53.3 0,0 0,-53.3 53.3v512a53.3,53.3 0,0 0,53.3 53.3h618.7a53.3,53.3 0,0 0,53.3 -53.3L874.7,256a53.3,53.3 0,0 0,-53.3 -53.3L202.7,202.7z"
|
||||||
android:fillColor="#000000"/>
|
android:fillColor="@color/text"/>
|
||||||
</vector>
|
</vector>
|
||||||
|
|
|
@ -85,13 +85,4 @@
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
|
||||||
android:id="@+id/button1"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="bottom|end"
|
|
||||||
android:layout_margin="16dp"
|
|
||||||
android:contentDescription="登录模式切换"
|
|
||||||
android:text="二维码"
|
|
||||||
app:icon="@drawable/icon"/>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -11,85 +11,136 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:title="@string/login" />
|
app:title="@string/login" />
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/user1"
|
<androidx.core.widget.NestedScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
android:fillViewport="true">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/layout1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/img_logo"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="150dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:src="@drawable/icon" />
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
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" />
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/login"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/login"
|
||||||
|
tools:ignore="ButtonStyle,DuplicateSpeakableTextCheck,VisualLintButtonSize" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/layout2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:ignore="UseCompoundDrawables">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="6dp"
|
||||||
|
android:text="@string/app_name"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/image"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="fitCenter"
|
||||||
|
android:src="@drawable/ic_launcher_foreground"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
|
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||||
|
android:id="@+id/button1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_horizontal"
|
android:layout_gravity="bottom|end"
|
||||||
android:orientation="vertical">
|
android:layout_margin="16dp"
|
||||||
|
android:contentDescription="登录模式切换"
|
||||||
<ImageView
|
android:text="二维码"
|
||||||
android:id="@+id/img_logo"
|
app:icon="@drawable/icon" />
|
||||||
android:layout_width="150dp"
|
|
||||||
android:layout_height="150dp"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:src="@drawable/icon" />
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:layout_marginTop="50dp"
|
|
||||||
android:layout_marginEnd="16dp">
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/edit_user"
|
|
||||||
android:hint="网易云音乐账号/手机号"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:inputType="textEmailAddress"
|
|
||||||
tools:ignore="LabelFor,VisualLintTextFieldSize,TextContrastCheck"
|
|
||||||
android:autofillHints="" />
|
|
||||||
</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:visibility="gone"
|
|
||||||
android:hint="验证码">
|
|
||||||
<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" />
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/login"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:layout_marginTop="30dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:text="@string/login"
|
|
||||||
tools:ignore="ButtonStyle,DuplicateSpeakableTextCheck" />
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -1,29 +1,43 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.google.android.material.appbar.MaterialToolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
<com.muqingbfq.view.Text
|
<LinearLayout
|
||||||
android:id="@+id/title"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="26sp"
|
android:orientation="horizontal">
|
||||||
android:textColor="@color/text"/>
|
<com.muqingbfq.view.Text
|
||||||
|
android:id="@+id/title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/text"
|
||||||
|
android:textSize="26sp" />
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/edittext"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="输入需要搜索的音乐"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
</LinearLayout>
|
||||||
</com.google.android.material.appbar.MaterialToolbar>
|
</com.google.android.material.appbar.MaterialToolbar>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/lb"
|
android:id="@+id/lb"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1"/>
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<androidx.fragment.app.FragmentContainerView
|
<androidx.fragment.app.FragmentContainerView
|
||||||
android:id="@+id/bfq_db"
|
android:id="@+id/bfq_db"
|
||||||
|
android:name="com.muqingbfq.fragment.bfq_db"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:name="com.muqingbfq.fragment.bfq_db"
|
|
||||||
tools:layout="@layout/fragment_bfq_db" />
|
tools:layout="@layout/fragment_bfq_db" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -1,7 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="120dp"
|
android:layout_width="120dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
|
|
@ -4,32 +4,50 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:cardUseCompatPadding="true">
|
app:cardUseCompatPadding="true">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<com.muqingbfq.view.CardImage
|
||||||
|
android:id="@+id/image"
|
||||||
|
android:layout_width="76dp"
|
||||||
|
android:layout_height="76dp"
|
||||||
|
app:cardUseCompatPadding="true"
|
||||||
|
app:strokeWidth="0dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/kg"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:alpha="0.5"
|
||||||
|
android:src="@drawable/zt" />
|
||||||
|
</com.muqingbfq.view.CardImage>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
<com.muqingbfq.view.CardImage
|
android:layout_marginStart="6dp"
|
||||||
android:id="@+id/image"
|
android:layout_marginEnd="16dp"
|
||||||
android:layout_width="120dp"
|
android:orientation="vertical">
|
||||||
android:layout_height="120dp"
|
|
||||||
app:cardUseCompatPadding="true"
|
|
||||||
android:padding="16dp">
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/kg"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:alpha="0.5"
|
|
||||||
android:src="@drawable/zt"/>
|
|
||||||
</com.muqingbfq.view.CardImage>
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/wb1"
|
android:id="@+id/text1"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_horizontal"
|
android:maxLines="1"
|
||||||
android:paddingTop="16dp"
|
android:textSize="20sp"
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:lines="2"
|
|
||||||
android:maxLines="2"
|
|
||||||
android:text="@string/name"
|
android:text="@string/name"
|
||||||
android:textColor="@color/text" />
|
android:textColor="@color/text" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="@string/app_name"
|
||||||
|
android:textColor="@color/text" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</com.google.android.material.card.MaterialCardView>
|
|
@ -3,21 +3,44 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
android:background="?android:attr/selectableItemBackground"
|
||||||
android:padding="10dp">
|
android:padding="10dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text1"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="0"
|
||||||
|
android:textSize="26sp"/>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="3dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
app:cardCornerRadius="36dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:layout_marginEnd="6dp">
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/text" />
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
|
android:layout_weight="1"
|
||||||
tools:ignore="UselessParent">
|
tools:ignore="UselessParent">
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/wb1"
|
android:id="@+id/name"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:text="@string/name"
|
android:text="@string/name"
|
||||||
|
android:singleLine="true"
|
||||||
android:textColor="@color/text"
|
android:textColor="@color/text"
|
||||||
android:textSize="16sp" />
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
@ -26,6 +49,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="@color/text"
|
android:textColor="@color/text"
|
||||||
|
android:singleLine="true"
|
||||||
android:text="@string/zz" />
|
android:text="@string/zz" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -29,8 +29,4 @@
|
||||||
android:icon="@drawable/app_warning"
|
android:icon="@drawable/app_warning"
|
||||||
android:title="@string/guanyuruanjiang" />
|
android:title="@string/guanyuruanjiang" />
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/g"
|
|
||||||
android:icon="@drawable/icon"
|
|
||||||
android:title="绑定网易云" />
|
|
||||||
</menu>
|
</menu>
|
Loading…
Reference in New Issue
Block a user