修复了播放器UI显示异常
实现了搜索歌单的效果 修复了部分BUG
This commit is contained in:
parent
5645afe283
commit
93ce3bfd29
|
@ -8,7 +8,7 @@
|
|||
<inspection_tool class="ArgumentSelectionDefects" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ArrayIndexOutOfBounds" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="AutoCloseableResource" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="METHOD_MATCHER_CONFIG" value="java.util.Formatter,format,java.io.Writer,append,com.google.common.base.Preconditions,checkNotNull,org.hibernate.Session,close,java.io.PrintWriter,printf,java.io.PrintStream,printf,okhttp3.Call,execute,android.app.DownloadManager,query" />
|
||||
<option name="METHOD_MATCHER_CONFIG" value="java.util.Formatter,format,java.io.Writer,append,com.google.common.base.Preconditions,checkNotNull,org.hibernate.Session,close,java.io.PrintWriter,printf,java.io.PrintStream,printf,okhttp3.Call,execute,android.app.DownloadManager,query,android.content.Context,obtainStyledAttributes" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="ClangTidy" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ClangdErrorsAndWarnings" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
|
@ -39,6 +39,7 @@
|
|||
<inspection_tool class="IncompatibleEnums" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="IncompatibleInitializers" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="IncompatiblePointers" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="InnerClassMayBeStatic" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="KRUnspecifiedParameters" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="LocalValueEscapesScope" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="LoopDoesntUseConditionVariable" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
|
|
|
@ -18,7 +18,8 @@ android {
|
|||
//noinspection OldTargetApi
|
||||
targetSdk 31
|
||||
versionCode 1
|
||||
versionName "1.6.8"
|
||||
versionName "1.7.0"
|
||||
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
|
@ -37,6 +38,9 @@ android {
|
|||
outputFileName = "Cloud_music-${variant.name}-v${variant.versionName}.apk"
|
||||
}
|
||||
}
|
||||
viewBinding {
|
||||
enabled = true
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
|
|
Binary file not shown.
|
@ -12,8 +12,8 @@
|
|||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 1,
|
||||
"versionName": "1.6.8",
|
||||
"outputFile": "Cloud_music-debug-v1.6.8.apk"
|
||||
"versionName": "1.7.0",
|
||||
"outputFile": "Cloud_music-debug-v1.7.0.apk"
|
||||
}
|
||||
],
|
||||
"elementType": "File"
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<activity android:name=".activity_search" />
|
||||
<activity
|
||||
android:name=".bfq"
|
||||
android:configChanges="screenSize|smallestScreenSize|orientation|screenLayout"
|
||||
android:configChanges="orientation|screenLayout"
|
||||
android:theme="@style/fragment_dialog" />
|
||||
|
||||
<activity android:name=".fragment.mp3" />
|
||||
|
|
|
@ -18,7 +18,9 @@ import com.bumptech.glide.load.engine.GlideException;
|
|||
import com.bumptech.glide.request.RequestListener;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
import com.muqingbfq.fragment.Media;
|
||||
import com.muqingbfq.fragment.bflb_db;
|
||||
import com.muqingbfq.fragment.bfq_db;
|
||||
import com.muqingbfq.fragment.search;
|
||||
import com.muqingbfq.mq.gj;
|
||||
|
||||
public class MediaPlayer {
|
||||
|
@ -178,5 +180,12 @@ public class MediaPlayer {
|
|||
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) {
|
||||
bflb_db.adapter.notifyDataSetChanged();
|
||||
gj.sc(1);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -25,7 +25,9 @@ import com.google.android.flexbox.FlexDirection;
|
|||
import com.google.android.flexbox.FlexWrap;
|
||||
import com.google.android.flexbox.FlexboxLayoutManager;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.muqingbfq.databinding.ActivitySearchBinding;
|
||||
import com.muqingbfq.fragment.search;
|
||||
import com.muqingbfq.mq.ActivityToolbar;
|
||||
import com.muqingbfq.mq.gj;
|
||||
import com.muqingbfq.mq.wj;
|
||||
import com.muqingbfq.mq.wl;
|
||||
|
@ -37,25 +39,22 @@ import org.json.JSONObject;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class activity_search extends AppCompatActivity {
|
||||
public class activity_search extends ActivityToolbar {
|
||||
private EditText editText;
|
||||
private ArrayAdapter<String> adapter;
|
||||
|
||||
private SearchRecordAdapter recordAdapter;
|
||||
private JSONObject json = new JSONObject();
|
||||
private final List<String> json_list = new ArrayList<>();
|
||||
private final List<String> list = new ArrayList<>();
|
||||
ListView listPopupWindow;
|
||||
public static AppCompatActivity appCompatActivity;
|
||||
ActivitySearchBinding inflate;
|
||||
|
||||
@SuppressLint({"RestrictedApi", "NotifyDataSetChanged"})
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_search);
|
||||
appCompatActivity = this;
|
||||
setSupportActionBar(findViewById(R.id.toolbar));
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
inflate = ActivitySearchBinding.inflate(getLayoutInflater());
|
||||
setContentView(inflate.getRoot());
|
||||
RecyclerView recyclerView = findViewById(R.id.list_recycler);
|
||||
FlexboxLayoutManager manager = new FlexboxLayoutManager(this);
|
||||
//设置主轴排列方式
|
||||
|
@ -64,7 +63,7 @@ public class activity_search extends AppCompatActivity {
|
|||
manager.setFlexWrap(FlexWrap.WRAP);
|
||||
manager.setAlignItems(AlignItems.STRETCH);
|
||||
recyclerView.setLayoutManager(manager);
|
||||
SearchRecordAdapter recordAdapter = new SearchRecordAdapter();
|
||||
new SearchRecordAdapter();
|
||||
recyclerView.setAdapter(recordAdapter);
|
||||
|
||||
editText = findViewById(R.id.editview);
|
||||
|
@ -77,7 +76,7 @@ public class activity_search extends AppCompatActivity {
|
|||
}
|
||||
return false;
|
||||
});
|
||||
findViewById(R.id.deleat).setOnClickListener(v -> new MaterialAlertDialogBuilder(v.getContext())
|
||||
inflate.deleat.setOnClickListener(v -> new MaterialAlertDialogBuilder(v.getContext())
|
||||
.setTitle("删除")
|
||||
.setMessage("清空历史记录?")
|
||||
.setNegativeButton("取消", null)
|
||||
|
@ -146,6 +145,7 @@ public class activity_search extends AppCompatActivity {
|
|||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
}
|
||||
|
@ -221,8 +221,9 @@ public class activity_search extends AppCompatActivity {
|
|||
}
|
||||
}
|
||||
if (json_list.isEmpty()) {
|
||||
findViewById(R.id.xxbj1).setVisibility(View.INVISIBLE);
|
||||
inflate.xxbj1.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
recordAdapter = this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
@ -270,5 +271,6 @@ public class activity_search extends AppCompatActivity {
|
|||
} else {
|
||||
finish();
|
||||
}
|
||||
com.muqingbfq.fragment.search.lbspq = null;
|
||||
}
|
||||
}
|
|
@ -20,6 +20,11 @@ public class playlist extends Thread {
|
|||
public static final String api = "/playlist/track/all?id=";
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
public static boolean hq(List<xm> list, String uid) {
|
||||
if (uid.equals("mp3_xz.json")) {
|
||||
return playlist.hq_xz(list);
|
||||
} else if (uid.equals("mp3_like.json")) {
|
||||
return playlist.hq_like(list);
|
||||
}
|
||||
list.clear();
|
||||
try {
|
||||
String hq;
|
||||
|
@ -48,7 +53,6 @@ public class playlist extends Thread {
|
|||
String picUrl = al.getString("picUrl");
|
||||
list.add(new xm(id, name, zz.toString(), picUrl));
|
||||
}
|
||||
// main.handler.post(new mp3.lbspq_sx());
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
gj.sc("失败的错误 " + e);
|
||||
|
@ -56,7 +60,7 @@ public class playlist extends Thread {
|
|||
return false;
|
||||
}
|
||||
|
||||
public static void hq_like(List<xm> list) {
|
||||
public static boolean hq_like(List<xm> list) {
|
||||
list.clear();
|
||||
try {
|
||||
JSONObject json = gd.like;
|
||||
|
@ -69,12 +73,14 @@ public class playlist extends Thread {
|
|||
list.add(new xm(id, name, zz, picUrl));
|
||||
}
|
||||
main.handler.post(new mp3.lbspq_sx());
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
gj.sc("失败的错误 " + e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void hq_xz(List<xm> list) {
|
||||
public static boolean hq_xz(List<xm> list) {
|
||||
list.clear();
|
||||
try {
|
||||
JSONArray json = new JSONObject(wj.dqwb(wj.mp3_xz))
|
||||
|
@ -88,10 +94,11 @@ public class playlist extends Thread {
|
|||
String picUrl = jsonObject.getString("picUrl");
|
||||
list.add(new xm(id, name, zz, picUrl));
|
||||
}
|
||||
// main.handler.post(new mp3.lbspq_sx());
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
gj.sc("失败的错误 " + e);
|
||||
wj.sc(wj.mp3_xz);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,7 +77,6 @@ public class resource {
|
|||
list.add(new xm("mp3_like.json", "喜欢", R.mipmap.like, true));
|
||||
list.add(new xm("mp3_xz.json", "下载", R.drawable.icon, true));
|
||||
try {
|
||||
// JSONArray date = jsonObject.getJSONArray("");
|
||||
JSONObject date = new JSONObject(wj.dqwb(wj.gd_xz));
|
||||
for (Iterator<String> it = date.keys(); it.hasNext(); ) {
|
||||
String id = it.next();
|
||||
|
|
|
@ -3,44 +3,54 @@ package com.muqingbfq;
|
|||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import com.muqingbfq.databinding.ActivityBfqBinding;
|
||||
import com.muqingbfq.fragment.Media;
|
||||
import com.muqingbfq.mq.gj;
|
||||
|
||||
public class bfq extends AppCompatActivity {
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
public static AppCompatActivity context;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
context = this;
|
||||
setContentView(R.layout.activity_bfq);
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
toolbar.setNavigationIcon(R.drawable.end);
|
||||
ActivityBfqBinding inflate = ActivityBfqBinding.inflate(getLayoutInflater());
|
||||
setContentView(inflate.getRoot());
|
||||
Toolbar toolbar = inflate.toolbar;
|
||||
toolbar.setNavigationOnClickListener(view1 -> finish());
|
||||
toolbar.inflateMenu(R.menu.bfq);
|
||||
toolbar.setOnMenuItemClickListener(item -> {
|
||||
if (item.getItemId() == R.id.fx) {
|
||||
if (bfqkz.xm != null) {
|
||||
if (item.getItemId() == R.id.fx && bfqkz.xm != null) {
|
||||
com.muqingbfq.mq.gj.fx(this,
|
||||
"音乐名称:" + bfqkz.xm.name +
|
||||
"\n 作者:" + bfqkz.xm.zz +
|
||||
"\n 链接:https://music.163.com/#/song?id=" + bfqkz.xm.id);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
if (bfqkz.xm != null) {
|
||||
Media.setname(bfqkz.xm.name);
|
||||
Media.setzz(bfqkz.xm.zz);
|
||||
}
|
||||
inflate.name.setOnLongClickListener(view -> {
|
||||
gj.fz(bfq.this, inflate.name.getText().toString());
|
||||
gj.ts(bfq.this, "复制成功");
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
public static Bitmap bitmap;
|
||||
|
||||
public static void start(Context context) {
|
||||
Intent intent = new Intent();
|
||||
intent.setClass(context, bfq.class);
|
||||
|
@ -49,7 +59,8 @@ public class bfq extends AppCompatActivity {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void finish() {
|
||||
super.finish();
|
||||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
Media.view = null;
|
||||
}
|
||||
}
|
|
@ -8,6 +8,7 @@ import android.view.LayoutInflater;
|
|||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
@ -16,12 +17,13 @@ import androidx.annotation.Nullable;
|
|||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.muqingbfq.R;
|
||||
import com.muqingbfq.api.url;
|
||||
import com.muqingbfq.bfq;
|
||||
import com.muqingbfq.bfq_an;
|
||||
import com.muqingbfq.bfqkz;
|
||||
import com.muqingbfq.databinding.FragmentBfqBinding;
|
||||
import com.muqingbfq.home;
|
||||
import com.muqingbfq.main;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
@ -30,7 +32,7 @@ import me.wcy.lrcview.LrcView;
|
|||
|
||||
public class Media extends Fragment {
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
public static View view;
|
||||
public static LinearLayout view;
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private static TextView time_a, time_b;
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
|
@ -84,18 +86,22 @@ public class Media extends Fragment {
|
|||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
if (view != null) {
|
||||
main.handler.post(Media::setImageBitmap);
|
||||
return view;
|
||||
}
|
||||
view = inflater.inflate(R.layout.fragment_bfq, container, false);
|
||||
FragmentBfqBinding inflate = FragmentBfqBinding.inflate(inflater, container, false);
|
||||
view = inflate.getRoot();
|
||||
/* if (home.imageView == null) {
|
||||
home.imageView = new ImageView(home.appCompatActivity);
|
||||
home.imageView.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
home.imageView.setImageResource(R.drawable.icon);
|
||||
}*/
|
||||
inflate.cardview.addView(home.imageView);
|
||||
bfq_an.kz kz = new bfq_an.kz();
|
||||
ImageView kg = view.findViewById(R.id.kg);
|
||||
kg.setOnClickListener(kz);
|
||||
view.findViewById(R.id.xyq).setOnClickListener(kz);
|
||||
view.findViewById(R.id.syq).setOnClickListener(kz);
|
||||
ImageView tx = view.findViewById(R.id.mttx);
|
||||
|
||||
tdt = view.findViewById(R.id.tdt);
|
||||
tdt = inflate.tdt;
|
||||
tdt.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||
|
@ -116,10 +122,9 @@ public class Media extends Fragment {
|
|||
}
|
||||
});
|
||||
|
||||
time_a = view.findViewById(R.id.time_a);
|
||||
time_b = view.findViewById(R.id.time_b);
|
||||
time_a = inflate.timeA;
|
||||
time_b = inflate.timeB;
|
||||
//初始化歌词组件
|
||||
View kp = view.findViewById(R.id.kp1);
|
||||
lrcview = getlrcView();
|
||||
lrcview.setDraggable(true, (view, time) -> {
|
||||
bfqkz.mt.build.seekTo(Math.toIntExact(time));
|
||||
|
@ -127,6 +132,7 @@ public class Media extends Fragment {
|
|||
});
|
||||
if (!isTablet(bfq.context)) {
|
||||
lrcview.setOnTapListener((view, x, y) -> {
|
||||
View kp = inflate.kp1;
|
||||
if (kp.getVisibility() == View.VISIBLE) {
|
||||
kp.setVisibility(View.GONE);
|
||||
} else {
|
||||
|
@ -135,10 +141,10 @@ public class Media extends Fragment {
|
|||
});
|
||||
}
|
||||
//初始化播放器列表
|
||||
view.findViewById(R.id.bfq_list_mp3).
|
||||
inflate.bfqListMp3.
|
||||
setOnClickListener(view1 -> com.muqingbfq.fragment.bflb_db.start(bfq.context));
|
||||
|
||||
view.findViewById(R.id.like).setOnClickListener(view1 -> {
|
||||
inflate.like.setOnClickListener(view1 -> {
|
||||
ImageView like = (ImageView) view1;
|
||||
try {
|
||||
if (bfqkz.like_bool) {
|
||||
|
@ -160,8 +166,8 @@ public class Media extends Fragment {
|
|||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
ImageView control = view.findViewById(R.id.control);
|
||||
control.setOnClickListener(new bfq_an.control(control));
|
||||
|
||||
inflate.control.setOnClickListener(new bfq_an.control(inflate.control));
|
||||
if (bfqkz.xm != null) {
|
||||
main.handler.removeCallbacks(bfqkz.mt.updateSeekBar); // 在播放开始时启动更新进度
|
||||
long duration = bfqkz.mt.build.getDuration();
|
||||
|
@ -175,10 +181,6 @@ public class Media extends Fragment {
|
|||
if (bfqkz.mt.build.isPlaying()) {
|
||||
kg.setImageResource(R.drawable.bf);
|
||||
}
|
||||
Glide.with(getContext())
|
||||
.load(bfqkz.xm.picurl)
|
||||
.error(R.drawable.icon)//图片加载失败后,显示的图片
|
||||
.into(tx);
|
||||
bfq_an.islike(bfq.context);
|
||||
new Thread() {
|
||||
@Override
|
||||
|
@ -192,8 +194,7 @@ public class Media extends Fragment {
|
|||
}
|
||||
|
||||
private boolean isTablet(Context context) {
|
||||
return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK)
|
||||
>= Configuration.SCREENLAYOUT_SIZE_LARGE;
|
||||
return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
|
||||
}
|
||||
|
||||
public static LrcView getlrcView() {
|
||||
|
@ -202,9 +203,11 @@ public class Media extends Fragment {
|
|||
}
|
||||
return view.findViewById(R.id.gc);
|
||||
}
|
||||
|
||||
public static void loadLyric(String a, String b) {
|
||||
lrcview.loadLrc(a, b);
|
||||
}
|
||||
|
||||
public static void setlike(boolean bool) {
|
||||
ImageView imageView = view.findViewById(R.id.like);
|
||||
int color = R.color.text;
|
||||
|
@ -216,13 +219,10 @@ public class Media extends Fragment {
|
|||
}
|
||||
|
||||
public static void setImageBitmap() {
|
||||
if (view == null) {
|
||||
if (home.imageView == null) {
|
||||
return;
|
||||
}
|
||||
ImageView imageView = view.findViewById(R.id.mttx);
|
||||
if (imageView != null) {
|
||||
main.handler.post(() -> imageView.setImageBitmap(bfq.bitmap));
|
||||
}
|
||||
main.handler.post(() -> home.imageView.setImageBitmap(bfq.bitmap));
|
||||
}
|
||||
|
||||
public static void setname(String str) {
|
||||
|
|
|
@ -21,7 +21,7 @@ import com.muqingbfq.yc;
|
|||
|
||||
public class bflb_db extends BottomSheetDialog {
|
||||
public static String gdid;
|
||||
|
||||
public static RecyclerView.Adapter<MyViewHoder> adapter;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -55,6 +55,9 @@ public class bflb_db extends BottomSheetDialog {
|
|||
}
|
||||
|
||||
class spq extends RecyclerView.Adapter<MyViewHoder> {
|
||||
public spq() {
|
||||
adapter = this;
|
||||
}
|
||||
@NonNull
|
||||
@Override
|
||||
public MyViewHoder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
|
@ -73,7 +76,7 @@ public class bflb_db extends BottomSheetDialog {
|
|||
}
|
||||
holder.name.setTextColor(color);
|
||||
holder.zz.setTextColor(color);
|
||||
holder.view.setOnClickListener(view -> {
|
||||
holder.itemView.setOnClickListener(view -> {
|
||||
if (bfqkz.xm != x) {
|
||||
bfqkz.xm = x;
|
||||
new url(x);
|
||||
|
@ -87,4 +90,9 @@ public class bflb_db extends BottomSheetDialog {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
super.dismiss();
|
||||
adapter = null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,13 +7,14 @@ import android.os.Bundle;
|
|||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.GridView;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
|
@ -27,6 +28,7 @@ import com.muqingbfq.bfqkz;
|
|||
import com.muqingbfq.list.list_gd;
|
||||
import com.muqingbfq.main;
|
||||
import com.muqingbfq.mq.wj;
|
||||
import com.muqingbfq.xm;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
@ -34,22 +36,22 @@ import org.json.JSONObject;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.muqingbfq.xm;
|
||||
|
||||
public class gd extends Fragment {
|
||||
public static String gdid;
|
||||
public static BaseAdapter lbspq;
|
||||
public static List<xm> list;
|
||||
public static RecyclerView.Adapter<VH> lbspq;
|
||||
public List<xm> list = new ArrayList<>();
|
||||
public static JSONObject like = new JSONObject();
|
||||
GridView gridView;
|
||||
RecyclerView gridView;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_gd, container, false);
|
||||
list = new ArrayList<>();
|
||||
lbspq = new baseadapter(view.getContext());
|
||||
lbspq = new baseadapter(view.getContext(),list);
|
||||
gridView = view.findViewById(R.id.wgbj);
|
||||
int k = (int) (main.k / getResources().getDisplayMetrics().density + 0.5f);
|
||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(), k / 120);
|
||||
gridView.setLayoutManager(gridLayoutManager);
|
||||
gridView.setAdapter(lbspq);
|
||||
if (gdid == null) {
|
||||
gdid = main.mp3_csh;
|
||||
|
@ -64,13 +66,13 @@ public class gd extends Fragment {
|
|||
tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
list.clear();
|
||||
lbspq.notifyDataSetChanged();
|
||||
new thread(tab.getText().toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabUnselected(TabLayout.Tab tab) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabReselected(TabLayout.Tab tab) {
|
||||
}
|
||||
|
@ -85,53 +87,32 @@ public class gd extends Fragment {
|
|||
return view;
|
||||
}
|
||||
|
||||
class baseadapter extends BaseAdapter {
|
||||
public static class baseadapter extends RecyclerView.Adapter<VH> {
|
||||
Context context;
|
||||
LayoutInflater layoutInflater;
|
||||
|
||||
public baseadapter(Context context) {
|
||||
List<xm> list;
|
||||
public baseadapter(Context context, List<xm> list) {
|
||||
this.context = context;
|
||||
layoutInflater = LayoutInflater.from(context);
|
||||
this.list = list;
|
||||
}
|
||||
@NonNull
|
||||
@Override
|
||||
public VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(context)
|
||||
.inflate(R.layout.list_gd, parent, false);
|
||||
return new VH(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int i) {
|
||||
return list.get(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
@SuppressLint({"ResourceAsColor", "InflateParams", "ClickableViewAccessibility"})
|
||||
@Override
|
||||
public View getView(int i, View view, ViewGroup viewGroup) {
|
||||
ViewHoder viewHoder;
|
||||
xm xm = list.get(i);
|
||||
if (view == null) {
|
||||
viewHoder = new ViewHoder();
|
||||
view = layoutInflater.inflate(R.layout.list_gd, null, false);
|
||||
viewHoder.textView = view.findViewById(R.id.wb1);
|
||||
viewHoder.imageView = view.findViewById(R.id.fh);
|
||||
viewHoder.cardView = view.findViewById(R.id.cardview);
|
||||
viewHoder.kg = view.findViewById(R.id.kg);
|
||||
view.setTag(viewHoder);
|
||||
} else {
|
||||
viewHoder = (ViewHoder) view.getTag();
|
||||
}
|
||||
public void onBindViewHolder(@NonNull VH holder, int position) {
|
||||
xm xm = list.get(position);
|
||||
list_gd gd = new list_gd(xm);
|
||||
viewHoder.cardView.setOnClickListener(gd);
|
||||
viewHoder.cardView.setOnLongClickListener(gd);
|
||||
viewHoder.textView.setText(xm.name);
|
||||
viewHoder.kg.setOnClickListener(view1 -> {
|
||||
holder.cardView.setOnClickListener(gd);
|
||||
holder.cardView.setOnLongClickListener(gd);
|
||||
holder.textView.setText(xm.name);
|
||||
holder.kg.setOnClickListener(view1 -> {
|
||||
ImageView tx = (ImageView) view1;
|
||||
new Thread() {
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
@Override
|
||||
public void run() {
|
||||
super.run();
|
||||
|
@ -157,19 +138,31 @@ public class gd extends Fragment {
|
|||
} else if (xm.cz) {
|
||||
color = ContextCompat.getColor(context, R.color.text_cz_tm);
|
||||
}
|
||||
viewHoder.kg.setImageDrawable(color_kg);
|
||||
viewHoder.textView.setTextColor(color);
|
||||
holder.kg.setImageDrawable(color_kg);
|
||||
holder.textView.setTextColor(color);
|
||||
Glide.with(context).load(xm.picurl).apply(new RequestOptions().placeholder(R.drawable.icon))
|
||||
.into(viewHoder.imageView);
|
||||
// new wl(xm.picurl, Glide.with(context)).loadImage(bitmap -> viewHoder.imageView.setImageBitmap(bitmap));
|
||||
return view;
|
||||
}
|
||||
.into(holder.imageView);
|
||||
}
|
||||
|
||||
class ViewHoder {
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static class VH extends RecyclerView.ViewHolder {
|
||||
TextView textView;
|
||||
ImageView imageView, kg;
|
||||
MaterialCardView cardView;
|
||||
|
||||
public VH(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
textView = itemView.findViewById(R.id.wb1);
|
||||
imageView = itemView.findViewById(R.id.fh);
|
||||
cardView = itemView.findViewById(R.id.cardview);
|
||||
kg = itemView.findViewById(R.id.kg);
|
||||
}
|
||||
}
|
||||
|
||||
class thread extends Thread {
|
||||
|
@ -177,9 +170,11 @@ public class gd extends Fragment {
|
|||
|
||||
public thread(String name) {
|
||||
this.name = name;
|
||||
list.clear();
|
||||
start();
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
@Override
|
||||
public void run() {
|
||||
super.run();
|
||||
|
|
|
@ -107,16 +107,13 @@ public class mp3 extends AppCompatActivity {
|
|||
}
|
||||
holder.name.setTextColor(color);
|
||||
holder.zz.setTextColor(color);
|
||||
holder.view.setOnClickListener(view -> {
|
||||
holder.itemView.setOnClickListener(view -> {
|
||||
if (bfqkz.xm == null || !bfqkz.xm.id.equals(x.id)) {
|
||||
bfqkz.xm = x;
|
||||
new url(x);
|
||||
}
|
||||
bfqkz.list.clear();
|
||||
int size = list.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
bfqkz.list.add(list.get(i));
|
||||
}
|
||||
bfqkz.list.addAll(list);
|
||||
bfq.start(mp3.this);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -11,17 +11,20 @@ import androidx.annotation.NonNull;
|
|||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.muqingbfq.R;
|
||||
import com.muqingbfq.activity_search;
|
||||
import com.muqingbfq.api.url;
|
||||
import com.muqingbfq.bfq;
|
||||
import com.muqingbfq.bfqkz;
|
||||
import com.muqingbfq.databinding.FragmentSearchBinding;
|
||||
import com.muqingbfq.list.MyViewHoder;
|
||||
import com.muqingbfq.main;
|
||||
import com.muqingbfq.mq.gj;
|
||||
import com.muqingbfq.mq.wj;
|
||||
import com.muqingbfq.mq.wl;
|
||||
import com.muqingbfq.xm;
|
||||
|
||||
|
@ -32,50 +35,72 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
public class search extends Fragment {
|
||||
View view;
|
||||
RecyclerView.Adapter<MyViewHoder> lbspq;
|
||||
public static RecyclerView.Adapter<MyViewHoder> lbspq;
|
||||
List<xm> list = new ArrayList<>();
|
||||
|
||||
private String name;
|
||||
|
||||
FragmentSearchBinding inflate;
|
||||
private int i = 0;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
view = inflater.inflate(R.layout.fragment_search, container, false);
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
inflate = FragmentSearchBinding.inflate(inflater, container, false);
|
||||
View view = inflate.getRoot();
|
||||
TypedValue typedValue = new TypedValue();
|
||||
requireContext().getTheme().resolveAttribute(android.R.attr.windowBackground, typedValue, true);
|
||||
// 设置背景颜色
|
||||
view.setBackgroundColor(typedValue.data);
|
||||
RecyclerView lb = view.findViewById(R.id.recyclerview);
|
||||
LinearLayoutManager manager = new LinearLayoutManager(getContext());
|
||||
lb.setLayoutManager(manager);
|
||||
lbspq = new spq();
|
||||
lb.setAdapter(lbspq);
|
||||
view.setBackgroundColor(typedValue.data);
|
||||
inflate.tablayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
// 当用户再次选择已选择的选项卡时调用。
|
||||
search.this.i = tab.getPosition();
|
||||
setStart(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabUnselected(TabLayout.Tab tab) {
|
||||
// 当选项卡退出选定状态时调用。
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabReselected(TabLayout.Tab tab) {
|
||||
// 当选项卡进入选定状态时调用。
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
setVisibility(false);
|
||||
return view;
|
||||
}
|
||||
|
||||
public void setVisibility(boolean bool) {
|
||||
if (bool) {
|
||||
view.setVisibility(View.VISIBLE);
|
||||
inflate.getRoot().setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
view.setVisibility(View.GONE);
|
||||
inflate.getRoot().setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getVisibility() {
|
||||
return view.isShown();
|
||||
return inflate.getRoot().isShown();
|
||||
}
|
||||
|
||||
public void setStart(String name) {
|
||||
setVisibility(true);
|
||||
list.clear();
|
||||
gj.sc(i);
|
||||
new start(name);
|
||||
}
|
||||
|
||||
public class start extends Thread {
|
||||
String name;
|
||||
|
||||
public start(String name) {
|
||||
this.name = name;
|
||||
list.clear();
|
||||
search.this.name = name;
|
||||
|
||||
start();
|
||||
}
|
||||
|
||||
|
@ -83,7 +108,28 @@ public class search extends Fragment {
|
|||
@Override
|
||||
public void run() {
|
||||
super.run();
|
||||
String hq = wl.hq("/search?keywords=" + name);
|
||||
if (i == 0) {
|
||||
mp3();
|
||||
} else if (i == 1) {
|
||||
gd();
|
||||
}
|
||||
main.handler.post(() -> {
|
||||
if (i == 0) {
|
||||
inflate.recyclerview.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
inflate.recyclerview.setAdapter(new spq());
|
||||
} else if (i == 1) {
|
||||
int k = (int) (main.k / getResources().getDisplayMetrics().density + 0.5f);
|
||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(), 3);
|
||||
inflate.recyclerview.setLayoutManager(gridLayoutManager);
|
||||
inflate.recyclerview.setAdapter(new gd.baseadapter(getContext(), list));
|
||||
}
|
||||
// lbspq.notifyDataSetChanged();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void mp3() {
|
||||
String hq = wl.hq("/search?keywords=" + name + "&type=1");
|
||||
try {
|
||||
JSONArray jsonArray = new JSONObject(hq).getJSONObject("result")
|
||||
.getJSONArray("songs");
|
||||
|
@ -106,18 +152,41 @@ public class search extends Fragment {
|
|||
}
|
||||
list.add(new xm(id, name, zz.toString(), ""));
|
||||
}
|
||||
main.handler.post(() -> lbspq.notifyDataSetChanged());
|
||||
} catch (Exception e) {
|
||||
gj.sc(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void gd() {
|
||||
String hq = wl.hq("/search?keywords=" + name + "&type=1000");
|
||||
try {
|
||||
JSONArray jsonArray = new JSONObject(hq).getJSONObject("result")
|
||||
.getJSONArray("playlists");
|
||||
int length = jsonArray.length();
|
||||
for (int i = 0; i < length; i++) {
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||
String id = jsonObject.getString("id");
|
||||
String name = jsonObject.getString("name");
|
||||
String coverImgUrl = jsonObject.getString("coverImgUrl");
|
||||
// gj.sc(name);
|
||||
list.add(new xm(id, name, coverImgUrl, wj.cz(wj.gd + id)));
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
gj.sc(e);
|
||||
}
|
||||
}
|
||||
|
||||
class spq extends RecyclerView.Adapter<MyViewHoder> {
|
||||
public spq() {
|
||||
lbspq = this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -132,7 +201,7 @@ public class search extends Fragment {
|
|||
}
|
||||
holder.name.setTextColor(color);
|
||||
holder.zz.setTextColor(color);
|
||||
holder.view.setOnClickListener(view1 -> {
|
||||
holder.itemView.setOnClickListener(view1 -> {
|
||||
if (bfqkz.xm == null || !bfqkz.xm.id.equals(x.id)) {
|
||||
bfqkz.xm = x;
|
||||
new url(x);
|
||||
|
@ -145,7 +214,7 @@ public class search extends Fragment {
|
|||
}
|
||||
}
|
||||
bfqkz.mt.start();
|
||||
bfq.start(activity_search.appCompatActivity);
|
||||
bfq.start(getContext());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import android.content.SharedPreferences;
|
|||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.appcompat.app.ActionBarDrawerToggle;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
@ -21,6 +22,7 @@ import com.muqingbfq.mq.gj;
|
|||
public class home extends AppCompatActivity {
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
public static AppCompatActivity appCompatActivity;
|
||||
public static ImageView imageView;
|
||||
|
||||
@SuppressLint({"CommitTransaction", "ObsoleteSdkInt"})
|
||||
@Override
|
||||
|
@ -30,7 +32,14 @@ public class home extends AppCompatActivity {
|
|||
setContentView(R.layout.activity_home);
|
||||
appCompatActivity = this;
|
||||
new start();
|
||||
Media.view = null;
|
||||
if (imageView == null) {
|
||||
imageView = new ImageView(this);
|
||||
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
imageView.setImageResource(R.drawable.icon);
|
||||
}
|
||||
if (bfq.bitmap != null) {
|
||||
Media.setImageBitmap();
|
||||
}
|
||||
try {
|
||||
//初始化工具栏
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
|
@ -61,6 +70,7 @@ public class home extends AppCompatActivity {
|
|||
}
|
||||
|
||||
private static Intent serviceIntent;
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
|
@ -81,6 +91,7 @@ public class home extends AppCompatActivity {
|
|||
}
|
||||
|
||||
private long time;
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (bfqkz.mt.isPlaying()) {
|
||||
|
|
|
@ -11,16 +11,13 @@ import com.muqingbfq.R;
|
|||
|
||||
public class MyViewHoder extends RecyclerView.ViewHolder {
|
||||
public TextView name, zz;
|
||||
public View view;
|
||||
|
||||
public MyViewHoder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
view = itemView;
|
||||
name = itemView.findViewById(R.id.wb1);
|
||||
zz = itemView.findViewById(R.id.zz);
|
||||
}
|
||||
|
||||
public Context getContext() {
|
||||
return view.getContext();
|
||||
return itemView.getContext();
|
||||
}
|
||||
}
|
|
@ -23,6 +23,7 @@ import androidx.core.content.ContextCompat;
|
|||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.muqingbfq.R;
|
||||
import com.muqingbfq.databinding.ActivityUserEditingBinding;
|
||||
import com.muqingbfq.main;
|
||||
import com.muqingbfq.mq.ActivityToolbar;
|
||||
import com.muqingbfq.mq.gj;
|
||||
|
@ -46,9 +47,9 @@ public class user_editing extends ActivityToolbar {
|
|||
//头像,用户名,签名,性别,背景
|
||||
ImageView imageViewa;
|
||||
EditText edit_name, edit_qianming;
|
||||
AutoCompleteTextView autoCompleteTextView;
|
||||
ImageView imageViewb;
|
||||
String file_a, file_b;
|
||||
ActivityUserEditingBinding binding;
|
||||
@SuppressLint("CheckResult")
|
||||
ActivityResultLauncher<Intent> setimagea =
|
||||
registerForActivityResult(new ActivityResultContracts.StartActivityForResult(),
|
||||
|
@ -86,11 +87,11 @@ public class user_editing extends ActivityToolbar {
|
|||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_user_editing);
|
||||
binding = ActivityUserEditingBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
imageViewa = findViewById(R.id.image1);
|
||||
edit_name = findViewById(R.id.edit_name);
|
||||
edit_qianming = findViewById(R.id.edit_qianming);
|
||||
autoCompleteTextView = findViewById(R.id.autoComplete);
|
||||
imageViewb = findViewById(R.id.image2);
|
||||
new Thread() {
|
||||
@Override
|
||||
|
@ -110,6 +111,13 @@ public class user_editing extends ActivityToolbar {
|
|||
Glide.with(user_editing.this)
|
||||
.load(string.cover())
|
||||
.into(imageViewb);
|
||||
String gender = string.gender();
|
||||
if (gender.equals("1")) {
|
||||
gender = "男";
|
||||
} else {
|
||||
gender = "女";
|
||||
}
|
||||
binding.autoComplete.setText(gender);
|
||||
});
|
||||
} catch (Exception e) {
|
||||
gj.sc(e);
|
||||
|
|
|
@ -28,6 +28,8 @@ import com.muqingbfq.mq.wl;
|
|||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class user_logs extends AppCompatActivity {
|
||||
|
||||
EditText edituser, editpassword;
|
||||
|
@ -98,7 +100,7 @@ public class user_logs extends AppCompatActivity {
|
|||
return bitmap;
|
||||
}
|
||||
|
||||
|
||||
String isEmail="false";
|
||||
public String account, password;
|
||||
class CloudUser extends Thread {
|
||||
|
||||
|
@ -110,6 +112,10 @@ public class user_logs extends AppCompatActivity {
|
|||
}
|
||||
user_logs.this.account = account;
|
||||
user_logs.this.password = password;
|
||||
Pattern pattern = Pattern.compile("^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$");
|
||||
if (pattern.matcher(account).matches()) {
|
||||
isEmail = "true";
|
||||
}
|
||||
start();
|
||||
}
|
||||
|
||||
|
@ -122,7 +128,7 @@ public class user_logs extends AppCompatActivity {
|
|||
"account", "passWord", "appID", "isEmail"
|
||||
},
|
||||
new String[]{
|
||||
account, password, UUID, ""
|
||||
account, password, UUID, isEmail
|
||||
});
|
||||
gj.sc(post);
|
||||
if (TextUtils.isEmpty(post)) {
|
||||
|
@ -148,7 +154,7 @@ public class user_logs extends AppCompatActivity {
|
|||
"account", "passWord", "appID", "isEmail"
|
||||
},
|
||||
new String[]{
|
||||
account, password, UUID, ""
|
||||
account, password, UUID, isEmail
|
||||
});
|
||||
gj.sc(jsonpost);
|
||||
if (!TextUtils.isEmpty(jsonpost.toString()) &&
|
||||
|
@ -170,8 +176,9 @@ public class user_logs extends AppCompatActivity {
|
|||
"account", "key", "appID", "isEmail"
|
||||
},
|
||||
new String[]{
|
||||
account, editViewDialog.getEditText(), UUID, "false"
|
||||
account, editViewDialog.getEditText(), UUID, isEmail
|
||||
});
|
||||
|
||||
gj.sc(jsonpost.toString());
|
||||
if (!TextUtils.isEmpty(jsonpost.toString())) {
|
||||
try {
|
||||
|
|
|
@ -69,8 +69,9 @@ public class user_message extends Thread {
|
|||
if (cover.startsWith("..")) {
|
||||
cover = "https://rust.coldmint.top" + cover.substring(2);
|
||||
}
|
||||
String gender = data.getString("gender");
|
||||
return new string(new String[]{
|
||||
headIcon, account, userName, introduce, cover
|
||||
headIcon, account, userName, introduce, cover, gender
|
||||
});
|
||||
}
|
||||
return null;
|
||||
|
@ -101,6 +102,8 @@ public class user_message extends Thread {
|
|||
public String cover() {
|
||||
return strings[4];
|
||||
}
|
||||
|
||||
public String gender() {
|
||||
return strings[5];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,4 +28,10 @@ public class ActivityToolbar extends AppCompatActivity {
|
|||
super.setContentView(view);
|
||||
setToolbar();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setContentView(View view) {
|
||||
super.setContentView(view);
|
||||
setToolbar();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@ import android.content.ComponentName;
|
|||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.os.Build;
|
||||
import android.support.v4.media.session.PlaybackStateCompat;
|
||||
|
@ -24,7 +23,7 @@ import com.muqingbfq.R;
|
|||
import com.muqingbfq.bfq;
|
||||
import com.muqingbfq.bfqkz;
|
||||
import com.muqingbfq.fragment.Media;
|
||||
import com.muqingbfq.start;
|
||||
import com.muqingbfq.home;
|
||||
import com.muqingbfq.yc;
|
||||
|
||||
public class NotificationManagerCompat {
|
||||
|
@ -52,7 +51,7 @@ public class NotificationManagerCompat {
|
|||
// 设置启动的程序,如果存在则找出,否则新的启动
|
||||
Intent intent = new Intent(Intent.ACTION_MAIN);
|
||||
intent.addCategory(Intent.CATEGORY_LAUNCHER);
|
||||
intent.setComponent(new ComponentName(context, start.class));//用ComponentName得到class对象
|
||||
intent.setComponent(new ComponentName(context, home.class));//用ComponentName得到class对象
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);// 关键的一步,设置启动模式,两种情况
|
||||
PendingIntent pendingIntent = getActivity(context, intent);
|
||||
|
@ -133,15 +132,10 @@ public class NotificationManagerCompat {
|
|||
|
||||
private NotificationCompat.Builder getNotificationBuilder(Context context) {
|
||||
// 适用于Android 8.0及以上版本
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
||||
return new NotificationCompat.Builder(context, CHANNEL_ID);
|
||||
} else {
|
||||
// Android 7.1及以下版本
|
||||
return new NotificationCompat.Builder(context);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("UnspecifiedImmutableFlag")
|
||||
private PendingIntent getBroadcast(Context context, Intent intent) {
|
||||
int flag;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
|
@ -150,13 +144,8 @@ public class NotificationManagerCompat {
|
|||
flag = PendingIntent.FLAG_UPDATE_CURRENT;
|
||||
}
|
||||
return PendingIntent.getBroadcast(context, 0, intent, flag);
|
||||
/* if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) {
|
||||
return PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
|
||||
} else {
|
||||
return PendingIntent.getBroadcast(context, 0, intent, 0);
|
||||
}*/
|
||||
}
|
||||
@SuppressLint("UnspecifiedImmutableFlag")
|
||||
|
||||
private PendingIntent getActivity(Context context, Intent intent) {
|
||||
int flag;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.muqingbfq.mq;
|
||||
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
|
@ -45,6 +47,19 @@ public class gj {
|
|||
shareIntent.putExtra(Intent.EXTRA_TEXT, str);
|
||||
context.startActivity(shareIntent);
|
||||
}
|
||||
/**
|
||||
* 复制文字到剪切板
|
||||
* @param text
|
||||
*/
|
||||
public static void fz(Context context,String text){
|
||||
ClipboardManager systemService =
|
||||
(ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
// 创建能够存入剪贴板的ClipData对象
|
||||
//‘Label’这是任意文字标签
|
||||
ClipData mClipData = ClipData.newPlainText("Label", text);
|
||||
//将ClipData数据复制到剪贴板:
|
||||
systemService.setPrimaryClip(mClipData);
|
||||
}
|
||||
|
||||
public static boolean isWiFiConnected() {
|
||||
try {
|
||||
|
|
|
@ -1,16 +1,8 @@
|
|||
package com.muqingbfq;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.DisplayMetrics;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.muqingbfq.login.visitor;
|
||||
import com.muqingbfq.mq.wj;
|
||||
import com.muqingbfq.mq.wl;
|
||||
|
||||
public class start {
|
||||
public start() {
|
||||
|
|
36
app/src/main/java/com/muqingbfq/view/TextView.java
Normal file
36
app/src/main/java/com/muqingbfq/view/TextView.java
Normal file
|
@ -0,0 +1,36 @@
|
|||
package com.muqingbfq.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
public class TextView extends androidx.appcompat.widget.AppCompatTextView {
|
||||
public TextView(@NonNull Context context) {
|
||||
super(context);
|
||||
initView();
|
||||
}
|
||||
|
||||
|
||||
public TextView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
initView();
|
||||
}
|
||||
|
||||
public TextView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
initView();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
this.setEllipsize(TextUtils.TruncateAt.MARQUEE);
|
||||
this.setSingleLine(true);
|
||||
this.setMarqueeRepeatLimit(-1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFocused() {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -2,11 +2,8 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/bfq"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true"
|
||||
android:fitsSystemWindows="true"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -14,6 +11,7 @@
|
|||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
<LinearLayout
|
||||
android:id="@+id/kp1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
|
@ -21,19 +19,11 @@
|
|||
android:orientation="vertical"
|
||||
tools:ignore="NestedWeights">
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/kp1"
|
||||
android:id="@+id/cardview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardUseCompatPadding="true">
|
||||
<ImageView
|
||||
android:id="@+id/mttx"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:importantForAccessibility="no"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
app:cardUseCompatPadding="true" />
|
||||
</LinearLayout>
|
||||
<me.wcy.lrcview.LrcView
|
||||
android:id="@+id/gc"
|
||||
|
|
|
@ -1,20 +1,22 @@
|
|||
<?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_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical">
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
app:navigationIcon="@drawable/end"
|
||||
app:menu="@menu/bfq">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
<com.muqingbfq.view.TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -1,40 +1,48 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/home"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:fitsSystemWindows="true"
|
||||
android:orientation="vertical"
|
||||
tools:context=".home">
|
||||
|
||||
<androidx.drawerlayout.widget.DrawerLayout
|
||||
android:id="@+id/chct"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/gd"
|
||||
android:name="com.muqingbfq.fragment.gd"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:name="com.muqingbfq.fragment.gd"
|
||||
app:layout_constraintBottom_toTopOf="@+id/bfq_db"
|
||||
app:layout_constraintTop_toBottomOf="@+id/toolbar"
|
||||
tools:layout="@layout/fragment_gd" />
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/bfq_db"
|
||||
android:name="com.muqingbfq.fragment.bfq_db"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:name="com.muqingbfq.fragment.bfq_db"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
tools:layout="@layout/fragment_bfq_db" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.navigation.NavigationView
|
||||
android:id="@+id/chb"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -42,7 +50,6 @@
|
|||
android:layout_gravity="start"
|
||||
app:headerLayout="@layout/fragment_sz"
|
||||
app:itemTextColor="@color/text"
|
||||
app:menu="@menu/sz"
|
||||
tools:ignore="VisualLintBounds" />
|
||||
app:menu="@menu/sz" />
|
||||
</androidx.drawerlayout.widget.DrawerLayout>
|
||||
</RelativeLayout>
|
||||
</FrameLayout>
|
|
@ -89,16 +89,19 @@
|
|||
android:id="@+id/menu"
|
||||
style="@style/Widget.Material3.TextInputLayout.FilledBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:hint="性别"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/autoComplete"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="性别"
|
||||
android:inputType="none"
|
||||
android:completionThreshold="1"
|
||||
android:imeOptions="actionSearch"
|
||||
android:maxLength="1"
|
||||
android:singleLine="true"
|
||||
app:simpleItems="@array/xingbie"
|
||||
tools:ignore="SpeakableTextPresentCheck,VisualLintTextFieldSize" />
|
||||
tools:ignore="VisualLintTextFieldSize,SpeakableTextPresentCheck" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
|
|
@ -19,17 +19,10 @@
|
|||
android:layout_weight="1"
|
||||
android:gravity="center">
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cardview"
|
||||
android:layout_width="260dp"
|
||||
android:layout_height="260dp"
|
||||
app:cardCornerRadius="16dp">
|
||||
<ImageView
|
||||
android:id="@+id/mttx"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:importantForAccessibility="no"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
app:cardCornerRadius="16dp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<me.wcy.lrcview.LrcView
|
||||
|
|
|
@ -2,17 +2,15 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical">
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tablayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/Playlist" />
|
||||
<GridView
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/wgbj"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:columnWidth="120dp"
|
||||
android:numColumns="auto_fit"
|
||||
android:stretchMode="columnWidth" />
|
||||
android:layout_height="match_parent"/>
|
||||
</LinearLayout>
|
|
@ -2,6 +2,7 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical">
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tablayout"
|
||||
|
@ -19,5 +20,6 @@
|
|||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="match_parent"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>
|
||||
</LinearLayout>
|
|
@ -2,14 +2,16 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:background="@null">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:id="@+id/relativeLayout"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cardview"
|
||||
|
@ -23,6 +25,7 @@
|
|||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/kg"
|
||||
android:layout_width="36dp"
|
||||
|
@ -34,6 +37,7 @@
|
|||
android:src="@drawable/zt"
|
||||
tools:ignore="RtlSymmetry" />
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/wb1"
|
||||
android:layout_width="match_parent"
|
||||
|
|
Loading…
Reference in New Issue
Block a user