Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
5fe2d1fdfe | |||
7a49dc638b |
|
@ -1,5 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DesignSurface">
|
||||
<option name="filePathToZoomLevelMap">
|
||||
<map>
|
||||
<entry key="..\:/My Codes/Android Code/HappyPlayer5-happy_player6/app/src/main/res/drawable/ios_back_drawable.xml" value="0.1785" />
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="NullableNotNullManager">
|
||||
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
|
||||
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
- *.[改进]本地音乐排序为按创建时间倒序。
|
||||
|
||||
#### 2020-12-17 V7.0.1
|
||||
|
||||
- *.[改进]暂停播放视频时,左上角的时间依旧在更新。
|
||||
- *.[新增]音频歌曲歌词界面新增左上角时间显示。
|
||||
- *.[新增]打开歌词界面过几秒后,自动进入全屏写真模式显示。
|
||||
|
|
|
@ -131,4 +131,4 @@ dependencies {
|
|||
*/
|
||||
implementation 'com.github.zhangliangming:Subtitle:v1.2'
|
||||
|
||||
}
|
||||
}
|
2
app/proguard-rules.pro
vendored
2
app/proguard-rules.pro
vendored
|
@ -172,7 +172,7 @@ public static java.lang.String TABLENAME;
|
|||
|
||||
#implementation 'com.github.zhangliangming:Subtitle:v1.0'
|
||||
-keep class com.zlm.subtitlelibrary.** { *; }
|
||||
-keep class com.xuexiang.xui.widget.edittext.materialedittext.** { *; }
|
||||
|
||||
#6混淆项目代码
|
||||
-keep class com.zlm.**
|
||||
-keepclassmembers class com.zlm.** {
|
||||
|
|
|
@ -5,8 +5,6 @@ import android.support.test.InstrumentationRegistry;
|
|||
import android.support.test.runner.AndroidJUnit4;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.zlm.down.entity.DownloadTask;
|
||||
import com.zlm.down.interfaces.IDownloadTaskEvent;
|
||||
import com.zlm.down.manager.DownloadTaskManager;
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
<!-- 存储权限 -->
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
|
||||
<!-- 显示悬浮窗口权限 -->
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
||||
|
||||
|
@ -41,7 +42,7 @@
|
|||
android:name="android.max_aspect"
|
||||
android:value="2.1" />
|
||||
|
||||
<activity android:name=".SplashActivity">
|
||||
<activity android:name=".SplashActivity" android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
|
@ -50,6 +51,7 @@
|
|||
</activity>
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:configChanges="screenSize|keyboardHidden|orientation" />
|
||||
<activity android:name=".SettingActivity" />
|
||||
<activity android:name=".AboutActivity" />
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
package com.zlm.hp.adapter;
|
||||
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.zlm.hp.adapter;
|
||||
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
|
|
|
@ -88,10 +88,10 @@ public class HPApplication extends MultiDexApplication {
|
|||
initLog(ResourceConstants.PATH_LOGCAT);
|
||||
|
||||
//初始化bugly
|
||||
//initBugly();
|
||||
initBugly();
|
||||
|
||||
//初始化LeakCanary
|
||||
//initLeakCanary();
|
||||
initLeakCanary();
|
||||
|
||||
// 获取当前进程名
|
||||
String processName = getProcessName(android.os.Process.myPid());
|
||||
|
|
|
@ -251,6 +251,7 @@ public class AudioInfoDB {
|
|||
*/
|
||||
public static List<AudioInfo> getLocalAudios(Context context) {
|
||||
try {
|
||||
//按创建时间倒序
|
||||
List<AudioInfo> audioInfos = DBHelper.getInstance(context).getDaoSession().getAudioInfoDao().queryBuilder().where(new WhereCondition.StringCondition(AudioInfoDao.Properties.Type.columnName + "=? or ( " + AudioInfoDao.Properties.Type.columnName + "=? and " + AudioInfoDao.Properties.Status.columnName +
|
||||
"=? )", AudioInfo.TYPE_LOCAL + "", AudioInfo.TYPE_NET + "", AudioInfo.STATUS_FINISH + "")).orderDesc(AudioInfoDao.Properties.CreateTime).list();
|
||||
return audioInfos;
|
||||
|
|
|
@ -130,11 +130,6 @@ public class AudioInfo implements Parcelable {
|
|||
* MV路径
|
||||
*/
|
||||
private String mvPath;
|
||||
/**
|
||||
* 是否播放MV
|
||||
*/
|
||||
@Transient
|
||||
private boolean IsPlayMV;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@ -377,13 +372,7 @@ public class AudioInfo implements Parcelable {
|
|||
public void setMvPath(String mvPath) {
|
||||
this.mvPath = mvPath;
|
||||
}
|
||||
public boolean getIsPlayMV() {
|
||||
return IsPlayMV;
|
||||
}
|
||||
|
||||
public void setIsPlayMV(boolean isPlayMv) {
|
||||
this.IsPlayMV = isPlayMv;
|
||||
}
|
||||
public int getPlayProgress() {
|
||||
return playProgress;
|
||||
}
|
||||
|
|
|
@ -7,11 +7,6 @@ import android.os.HandlerThread;
|
|||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.os.Process;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -24,6 +19,10 @@ import android.widget.FrameLayout;
|
|||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.zlm.hp.handler.WeakRefHandler;
|
||||
import com.zlm.hp.ui.R;
|
||||
import com.zlm.hp.util.AppBarUtil;
|
||||
|
|
|
@ -41,15 +41,7 @@ public class ActivityManager {
|
|||
public void removeActivity(Activity activity) {
|
||||
activityList.remove(activity);
|
||||
}
|
||||
public boolean existActivity(Class<?> classinfo)
|
||||
{
|
||||
for (Activity item : activityList) {
|
||||
if (!item.isFinishing() && item != null) {
|
||||
if(item.getClass()==classinfo){return true;}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出
|
||||
*/
|
||||
|
|
|
@ -57,6 +57,7 @@ public class AudioBroadcastReceiver {
|
|||
* 播放
|
||||
*/
|
||||
public static final int ACTION_CODE_PLAYING = 3;
|
||||
|
||||
/**
|
||||
* 播放本地歌曲
|
||||
*/
|
||||
|
@ -242,14 +243,7 @@ public class AudioBroadcastReceiver {
|
|||
* 播放网络视频
|
||||
*/
|
||||
public static final int ACTION_CODE_PLAYNETVIDEO = 40;
|
||||
/**
|
||||
* 显示歌词界面
|
||||
*/
|
||||
public static final int ACTION_CODE_SHOWLRCVIEW = 42;
|
||||
/**
|
||||
* 关闭歌词窗体
|
||||
*/
|
||||
public static final int ACTION_LRC_CLOSE = 43;
|
||||
|
||||
private BroadcastReceiver mBroadcastReceiver;
|
||||
private IntentFilter mIntentFilter;
|
||||
private AudioReceiverListener mReceiverListener;
|
||||
|
@ -406,22 +400,6 @@ public class AudioBroadcastReceiver {
|
|||
public static void sendVideoCloserReceiver(Context context) {
|
||||
sendReceiver(context, ACTION_VIDEO_CLOSE, null, null);
|
||||
}
|
||||
/**
|
||||
* 显示歌词界面
|
||||
*
|
||||
* @param context
|
||||
*/
|
||||
public static void sendShowLrcViewReceiver(Context context) {
|
||||
sendReceiver(context, ACTION_CODE_SHOWLRCVIEW, null, null);
|
||||
}
|
||||
/**
|
||||
* 关闭歌词界面
|
||||
*
|
||||
* @param context
|
||||
*/
|
||||
public static void sendCloseLrcViewReceiver(Context context) {
|
||||
sendReceiver(context, ACTION_LRC_CLOSE, null, null);
|
||||
}
|
||||
/**
|
||||
* 在线歌曲下载完成
|
||||
*
|
||||
|
|
|
@ -621,7 +621,6 @@ public class AudioPlayerService extends Service {
|
|||
isPlayMV = true;
|
||||
}
|
||||
}
|
||||
audioInfo.setIsPlayMV(isPlayMV);
|
||||
if ((isPlayMV && MvPath != null) || filePath == null || filePath.isEmpty()) { //如果会播放MV,则进入下一步操作
|
||||
|
||||
File MVFile = new File(MvPath);
|
||||
|
@ -693,8 +692,9 @@ public class AudioPlayerService extends Service {
|
|||
AudioBroadcastReceiver.sendPlayReceiver(mContext, audioInfo);
|
||||
mWorkerHandler.removeMessages(MESSAGE_WHAT_LOADPLAYPROGRESSDATA);
|
||||
mWorkerHandler.sendEmptyMessage(MESSAGE_WHAT_LOADPLAYPROGRESSDATA);
|
||||
|
||||
mMediaPlayer.start();
|
||||
AudioBroadcastReceiver.sendShowLrcViewReceiver(mContext);
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -7,11 +7,6 @@ import android.os.HandlerThread;
|
|||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.os.Process;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -20,6 +15,11 @@ import android.widget.FrameLayout;
|
|||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.zlm.hp.handler.WeakRefHandler;
|
||||
import com.zlm.hp.manager.ActivityManager;
|
||||
import com.zlm.hp.util.AppBarUtil;
|
||||
|
|
|
@ -329,7 +329,6 @@ public class LocalVideoActivity extends BaseActivity {
|
|||
mUIHandler.sendEmptyMessage(MESSAGE_WHAT_TIMECHANGE);
|
||||
//播放视频
|
||||
playVideo();
|
||||
AudioBroadcastReceiver.sendCloseLrcViewReceiver(mContext);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1946,9 +1946,6 @@ public class LrcActivity extends BaseActivity {
|
|||
*/
|
||||
private void handleAudioBroadcastReceiver(Intent intent, int code) {
|
||||
switch (code) {
|
||||
case AudioBroadcastReceiver.ACTION_LRC_CLOSE:
|
||||
this.finish();
|
||||
break;
|
||||
case AudioBroadcastReceiver.ACTION_CODE_NULL:
|
||||
|
||||
//空数据
|
||||
|
|
|
@ -10,12 +10,6 @@ import android.media.MediaMetadataRetriever;
|
|||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.Display;
|
||||
|
@ -34,6 +28,12 @@ import android.widget.RelativeLayout;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.dou361.dialogui.DialogUIUtils;
|
||||
import com.dou361.dialogui.listener.DialogUIListener;
|
||||
import com.suke.widget.SwitchButton;
|
||||
|
@ -84,7 +84,6 @@ import com.zlm.libs.widget.MusicSeekBar;
|
|||
import com.zlm.libs.widget.SlidingMenuLayout;
|
||||
|
||||
import java.io.File;
|
||||
import java.security.cert.CertPathValidatorException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -280,10 +279,10 @@ public class MainActivity extends BaseActivity {
|
|||
protected int setContentLayoutResID() {
|
||||
return R.layout.activity_main;
|
||||
}
|
||||
//是否第一次使用
|
||||
private boolean isFirst=true;
|
||||
|
||||
@Override
|
||||
protected void initViews(Bundle savedInstanceState) {
|
||||
|
||||
initSlidingMenu();
|
||||
initViewPage();
|
||||
initTitleViews();
|
||||
|
@ -292,7 +291,6 @@ public class MainActivity extends BaseActivity {
|
|||
initReceiver();
|
||||
initService();
|
||||
loadData();
|
||||
AudioPlayerManager.newInstance(mContext).play(mMusicSeekBar.getProgress());
|
||||
}
|
||||
|
||||
|
||||
|
@ -302,24 +300,7 @@ public class MainActivity extends BaseActivity {
|
|||
private void initService() {
|
||||
AudioPlayerService.startService(this);
|
||||
}
|
||||
private void ShowLrcView()
|
||||
{
|
||||
if (mSlidingMenuLayout.isShowingMenu()) {
|
||||
mSlidingMenuLayout.hideMenu();
|
||||
return;
|
||||
}
|
||||
|
||||
if (mIsShowPopPlayList) {
|
||||
hidePopPlayListView();
|
||||
return;
|
||||
}
|
||||
if(!ActivityManager.getInstance().existActivity(LrcActivity.class)) {
|
||||
Intent intent = new Intent(MainActivity.this, LrcActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
//去掉动画
|
||||
overridePendingTransition(0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化广播
|
||||
|
@ -443,6 +424,11 @@ public class MainActivity extends BaseActivity {
|
|||
MediaMetadataRetriever mediaMetadataRetriever = new MediaMetadataRetriever();
|
||||
mediaMetadataRetriever.setDataSource(initAudioInfo.getFilePath());
|
||||
byte[] cover = mediaMetadataRetriever.getEmbeddedPicture();
|
||||
Bitmap singer_bitmap = BitmapFactory.decodeByteArray(cover, 0, cover.length);
|
||||
if(singer_bitmap!=null)
|
||||
{
|
||||
mArtistImageView.setImageDrawable(new BitmapDrawable(singer_bitmap));
|
||||
mArtistImageView.setTag(initAudioInfo.getFilePath().hashCode() + "");
|
||||
if(cover!=null) {
|
||||
Bitmap singer_bitmap = BitmapFactory.decodeByteArray(cover, 0, cover.length);
|
||||
mArtistImageView.setImageDrawable(new BitmapDrawable(singer_bitmap));
|
||||
|
@ -479,8 +465,7 @@ public class MainActivity extends BaseActivity {
|
|||
if (mAdapter != null)
|
||||
mAdapter.reshViewHolder(null);
|
||||
}
|
||||
//region 加载歌词界面
|
||||
//endregion
|
||||
|
||||
break;
|
||||
case AudioBroadcastReceiver.ACTION_CODE_PLAY:
|
||||
if (mPauseImageView.getVisibility() != View.VISIBLE)
|
||||
|
@ -488,9 +473,7 @@ public class MainActivity extends BaseActivity {
|
|||
|
||||
if (mPlayImageView.getVisibility() != View.INVISIBLE)
|
||||
mPlayImageView.setVisibility(View.INVISIBLE);
|
||||
break;
|
||||
case AudioBroadcastReceiver.ACTION_CODE_SHOWLRCVIEW:
|
||||
ShowLrcView();
|
||||
|
||||
break;
|
||||
case AudioBroadcastReceiver.ACTION_CODE_PLAYING:
|
||||
|
||||
|
@ -807,7 +790,20 @@ public class MainActivity extends BaseActivity {
|
|||
mPlayerBarLL.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
ShowLrcView();
|
||||
if (mSlidingMenuLayout.isShowingMenu()) {
|
||||
mSlidingMenuLayout.hideMenu();
|
||||
return;
|
||||
}
|
||||
|
||||
if (mIsShowPopPlayList) {
|
||||
hidePopPlayListView();
|
||||
return;
|
||||
}
|
||||
|
||||
Intent intent = new Intent(MainActivity.this, LrcActivity.class);
|
||||
startActivity(intent);
|
||||
//去掉动画
|
||||
overridePendingTransition(0, 0);
|
||||
}
|
||||
});
|
||||
//mSlidingMenuLayout.addIgnoreHorizontalView(mPlayerBarLL);
|
||||
|
@ -1037,17 +1033,6 @@ public class MainActivity extends BaseActivity {
|
|||
if (!file.exists()) {
|
||||
AudioInfoDB.deleteAudio(mContext, temp.getHash(), false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(temp.getMvPath().length()>0) {
|
||||
File file_mv = new File(temp.getMvPath());
|
||||
if (!file_mv.exists()) { //如果歌曲存在,但MV不存在
|
||||
temp.setMvHash("");
|
||||
temp.setMvPath("");
|
||||
AudioInfoDB.updateVideo(mContext, temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -8,7 +8,6 @@ import android.view.MotionEvent;
|
|||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
|
@ -16,7 +15,6 @@ import android.widget.TextView;
|
|||
import com.dou361.dialogui.DialogUIUtils;
|
||||
import com.dou361.dialogui.listener.DialogUIListener;
|
||||
import com.suke.widget.SwitchButton;
|
||||
import com.xuexiang.xui.utils.WidgetUtils;
|
||||
import com.zlm.hp.constants.ConfigInfo;
|
||||
import com.zlm.hp.constants.ResourceConstants;
|
||||
import com.zlm.hp.db.util.DownloadThreadInfoDB;
|
||||
|
@ -58,7 +56,7 @@ public class SettingActivity extends BaseActivity {
|
|||
/**
|
||||
* 歌手歌曲名居中显示开关
|
||||
*/
|
||||
private com.xuexiang.xui.widget.button.switchbutton.SwitchButton mCenterSingerSongSwitchButton;
|
||||
private SwitchButton mCenterSingerSongSwitchButton;
|
||||
/**
|
||||
* MV播放模式
|
||||
*/
|
||||
|
@ -196,9 +194,9 @@ public class SettingActivity extends BaseActivity {
|
|||
}
|
||||
});
|
||||
mCenterSingerSongSwitchButton = findViewById(R.id.center_singersongname_switch);
|
||||
mCenterSingerSongSwitchButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
mCenterSingerSongSwitchButton.setOnCheckedChangeListener(new SwitchButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton view, boolean isChecked) {
|
||||
public void onCheckedChanged(SwitchButton view, boolean isChecked) {
|
||||
if (mConfigInfo.isCenterSingerSongName() != isChecked)
|
||||
mConfigInfo.setIsCenterSingerSongName(isChecked).save();
|
||||
}
|
||||
|
@ -208,14 +206,13 @@ public class SettingActivity extends BaseActivity {
|
|||
list.add("只播放MV");
|
||||
list.add("随机选择播放MV和歌曲");
|
||||
mMVPlayMode=findViewById(R.id.mvplaymode_spinner);
|
||||
WidgetUtils.initSpinnerStyle(mMVPlayMode);
|
||||
//第二步:为下拉列表定义一个适配器
|
||||
adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, list);
|
||||
//第三步:设置下拉列表下拉时的菜单样式
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
adapter.notifyDataSetChanged();
|
||||
//第四步:将适配器添加到下拉列表上
|
||||
mMVPlayMode.setAdapter(adapter);
|
||||
adapter.notifyDataSetChanged();
|
||||
//第五步:添加监听器,为下拉列表设置事件的响应
|
||||
mMVPlayMode.setOnItemSelectedListener(new Spinner.OnItemSelectedListener() {
|
||||
@Override
|
||||
|
|
|
@ -9,11 +9,12 @@ import android.graphics.Color;
|
|||
import android.media.MediaPlayer;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.PermissionChecker;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.PermissionChecker;
|
||||
|
||||
import com.dou361.dialogui.DialogUIUtils;
|
||||
import com.dou361.dialogui.listener.DialogUIListener;
|
||||
import com.zlm.hp.constants.ConfigInfo;
|
||||
|
@ -203,6 +204,7 @@ public class SplashActivity extends BaseActivity {
|
|||
|
||||
boolean isFrist = PreferencesUtil.getBoolean(getApplicationContext(), Constants.IS_FRIST_KEY, true);
|
||||
if (isFrist) {
|
||||
|
||||
//1.扫描本地歌曲列表
|
||||
List<AudioInfo> audioInfos = MediaUtil.scanLocalMusic(getApplicationContext(), null);
|
||||
if (audioInfos != null && audioInfos.size() > 0) {
|
||||
|
@ -235,11 +237,6 @@ public class SplashActivity extends BaseActivity {
|
|||
mUIHandler.sendEmptyMessageDelayed(GOHOME, 5000);
|
||||
}
|
||||
}
|
||||
if (isFrist) {
|
||||
configInfo.setWire(true);//支持线控
|
||||
configInfo.setStatusBarShow(false);//不显示状态栏
|
||||
configInfo.save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -37,7 +37,6 @@ import java.util.ArrayList;
|
|||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
|
@ -280,7 +279,7 @@ public class ImageUtil {
|
|||
SingerInfo singerInfo = new SingerInfo();
|
||||
singerInfo.setImageUrl(temp.getAbsolutePath());
|
||||
singerInfo.setSingerName(singerName);
|
||||
listResult.add(RandomUtil.RandomInt(0,listResult.size()), singerInfo);
|
||||
listResult.add(singerInfo);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -350,12 +349,30 @@ public class ImageUtil {
|
|||
*/
|
||||
private static void addAndSortData(List<SingerInfo> returnResult, List<List<SingerInfo>> tempReturnResult, List<String> singerNames) {
|
||||
for (int i = 0; i < singerNames.size(); i++) {
|
||||
List<SingerInfo> tempList = tempReturnResult.get(i);
|
||||
while(tempList.size()>0){
|
||||
int max=tempList.size()-1,min=0;
|
||||
int ran2 = (int) (Math.random()*(max-min)+min);
|
||||
returnResult.add(tempList.get(ran2));
|
||||
tempList.remove(ran2);
|
||||
if (i == 0) {
|
||||
returnResult.addAll(tempReturnResult.get(i));
|
||||
} else {
|
||||
String tag = singerNames.get(i - 1);
|
||||
List<SingerInfo> tempList = tempReturnResult.get(i);
|
||||
|
||||
boolean flag = tempList.size() - returnResult.size() > 0 ? true : false;
|
||||
int minSize = tempList.size() > returnResult.size() ? returnResult.size() : tempList.size();
|
||||
int modSize = Math.abs(tempList.size() - returnResult.size());
|
||||
int z = 0;
|
||||
for (int j = 0; j < minSize; j++) {
|
||||
for (; z < returnResult.size(); z++) {
|
||||
SingerInfo temp = returnResult.get(z);
|
||||
if (temp.getSingerName().equals(tag)) {
|
||||
returnResult.add(++z, tempList.get(j));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag) {
|
||||
for (int k = modSize; k < tempList.size(); k++) {
|
||||
returnResult.add(tempList.get(k));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,10 +34,7 @@ public class RandomUtil {
|
|||
}
|
||||
mLastNum = mSize - 1;
|
||||
}
|
||||
public static int RandomInt(int min,int max)
|
||||
{
|
||||
return (new Random()).nextInt((max - min) + 1) + min;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成随机数
|
||||
* @return
|
||||
|
|
|
@ -82,9 +82,8 @@ public class StorageUtil {
|
|||
String path = (String) getPath.invoke(obj);
|
||||
info = new StorageInfo(path);
|
||||
File file = new File(info.getPath());
|
||||
Boolean result= file.canWrite();
|
||||
if ((file.exists()) && (file.isDirectory())
|
||||
) {
|
||||
&& (file.canWrite())) {
|
||||
Method isRemovable = obj.getClass().getMethod(
|
||||
"isRemovable");
|
||||
String state = null;
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_enabled="false" android:state_checked="true">
|
||||
<shape>
|
||||
<solid android:color="#b3ecbc"/>
|
||||
<corners android:radius="99dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item android:state_enabled="false" android:state_checked="false">
|
||||
<shape>
|
||||
<solid android:color="#FEFEFE"/>
|
||||
<corners android:radius="99dp"/>
|
||||
<stroke
|
||||
android:width="1.5dp"
|
||||
android:color="#F0F0F0"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item android:state_checked="true">
|
||||
<shape>
|
||||
<solid android:color="@color/xui_config_color_main_theme"/>
|
||||
<corners android:radius="99dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="#FEFEFE"/>
|
||||
<corners android:radius="99dp"/>
|
||||
<stroke
|
||||
android:width="1.5dp"
|
||||
android:color="#E6E6E6"/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
|
@ -64,12 +64,12 @@
|
|||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/file_recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@+id/selectFile"
|
||||
android:layout_below="@+id/op_heaad"></androidx.recyclerview.widget.RecyclerView>
|
||||
android:layout_below="@+id/op_heaad"></android.support.v7.widget.RecyclerView>
|
||||
|
||||
|
||||
<Button
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
|
||||
<include layout="@layout/layout_lrc"></include>
|
||||
|
||||
<ViewStub
|
||||
|
|
|
@ -203,11 +203,11 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
<android.support.v4.view.ViewPager
|
||||
android:id="@+id/viewpage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="20dp"></androidx.viewpager.widget.ViewPager>
|
||||
android:layout_margin="20dp"></android.support.v4.view.ViewPager>
|
||||
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -54,11 +54,11 @@
|
|||
android:layout_height="match_parent"
|
||||
android:visibility="gone">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@+id/bottomlayout"></androidx.recyclerview.widget.RecyclerView>
|
||||
android:layout_above="@+id/bottomlayout"></android.support.v7.widget.RecyclerView>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/bottomlayout"
|
||||
|
|
|
@ -146,14 +146,14 @@
|
|||
android:textSize="@dimen/title_size" />
|
||||
|
||||
|
||||
<com.xuexiang.xui.widget.button.switchbutton.SwitchButton
|
||||
<com.suke.widget.SwitchButton
|
||||
android:id="@+id/center_singersongname_switch"
|
||||
style="@style/SwitchButtonStyleMD"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="5dp"/>
|
||||
android:layout_marginRight="5dp"
|
||||
app:sb_checked_color="@color/defColor" />
|
||||
|
||||
</com.zlm.hp.widget.ListItemRelativeLayout>
|
||||
<com.zlm.hp.widget.DividerView
|
||||
|
@ -178,7 +178,6 @@
|
|||
|
||||
<Spinner
|
||||
android:id="@+id/mvplaymode_spinner"
|
||||
style="@style/SpinnerStyle"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="5dp"
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#fff"
|
||||
android:paddingBottom="@dimen/bar_height"></androidx.recyclerview.widget.RecyclerView>
|
||||
android:paddingBottom="@dimen/bar_height"></android.support.v7.widget.RecyclerView>
|
||||
</LinearLayout>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
@ -11,4 +11,4 @@
|
|||
android:paddingBottom="@dimen/bar_height"></com.github.jdsjlzx.recyclerview.LRecyclerView>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
@ -18,4 +18,4 @@
|
|||
app:layout_constraintTop_toBottomOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<RecyclerView
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/listview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
@ -274,4 +274,4 @@
|
|||
android:background="#f3f3f3"></View>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/net_layout"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -30,4 +30,4 @@
|
|||
app:layout_constraintBottom_toBottomOf="@+id/nonet_img" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
@ -10,4 +10,4 @@
|
|||
android:paddingBottom="@dimen/bar_height"></com.github.jdsjlzx.recyclerview.LRecyclerView>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
|
|
@ -3,8 +3,16 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/TimeStr"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_above="@id/title"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:textSize="22sp"
|
||||
android:text="乐MV" />
|
||||
<com.github.jdsjlzx.recyclerview.LRecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
@ -10,4 +10,4 @@
|
|||
android:paddingBottom="@dimen/bar_height"></com.github.jdsjlzx.recyclerview.LRecyclerView>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<LinearLayoutRecyclerView
|
||||
<com.zlm.hp.widget.LinearLayoutRecyclerView
|
||||
android:id="@+id/listview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
android:textColor="@color/bg_white"
|
||||
android:textSize="22sp"
|
||||
android:text="乐MV" />
|
||||
|
||||
<View
|
||||
android:id="@+id/status_bar_view"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -51,10 +51,10 @@
|
|||
android:layout_below="@+id/splline"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RecyclerView
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/singerlist_recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"></RecyclerView>
|
||||
android:layout_height="match_parent"></android.support.v7.widget.RecyclerView>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
android:layout_height="@dimen/title_height"></include>
|
||||
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
<android.support.v4.view.ViewPager
|
||||
android:id="@+id/viewpage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"></androidx.viewpager.widget.ViewPager>
|
||||
android:layout_height="match_parent"></android.support.v4.view.ViewPager>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -101,12 +101,12 @@
|
|||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/line">
|
||||
|
||||
<RecyclerView
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/curplaylist_recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@+id/poplistcancel"
|
||||
android:overScrollMode="never"></RecyclerView>
|
||||
android:overScrollMode="never"></android.support.v7.widget.RecyclerView>
|
||||
|
||||
|
||||
<com.zlm.hp.widget.ListItemRelativeLayout
|
||||
|
|
|
@ -18,34 +18,7 @@
|
|||
<item name="android:windowIsTranslucent">true</item>
|
||||
|
||||
</style>
|
||||
<style name="AppTheme2" parent="XUITheme.Tablet.Big">
|
||||
<!-- 自定义自己的主题样式 -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
</style>
|
||||
<!--系统默认Spinner样式-->
|
||||
<style name="SpinnerStyle" parent="@style/Widget.AppCompat.Spinner">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">?attr/ms_item_height_size</item>
|
||||
<item name="android:spinnerMode">dropdown</item>
|
||||
<item name="android:background">@drawable/xui_config_bg_spinner</item>
|
||||
<item name="android:popupBackground">@drawable/ms_drop_down_bg_radius</item>
|
||||
<item name="android:paddingEnd">@dimen/default_spinner_icon_padding_size</item>
|
||||
</style>
|
||||
<style name="SwitchButtonStyleMD" parent="SwitchButtonMD">
|
||||
<item name="android:paddingStart">10dp</item>
|
||||
<item name="android:paddingEnd">10dp</item>
|
||||
<item name="android:paddingTop">4dp</item>
|
||||
<item name="android:paddingBottom">4dp</item>
|
||||
</style>
|
||||
<!-- SwitchButton -->
|
||||
<style name="SwitchButtonStyle">
|
||||
<item name="android:paddingStart">?attr/xui_config_content_spacing_horizontal</item>
|
||||
<item name="android:paddingEnd">?attr/xui_config_content_spacing_horizontal</item>
|
||||
<item name="android:paddingTop">?attr/xui_config_content_spacing_vertical</item>
|
||||
<item name="android:paddingBottom">?attr/xui_config_content_spacing_vertical</item>
|
||||
</style>
|
||||
|
||||
<style name="MakeLrcTheme" parent="Base.Theme.AppCompat.Light">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
|
|
|
@ -10,7 +10,7 @@ buildscript {
|
|||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:4.1.0-rc01'
|
||||
classpath 'com.android.tools.build:gradle:4.2.2'
|
||||
classpath 'org.greenrobot:greendao-gradle-plugin:3.3.0'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
|
|
|
@ -1,19 +1,17 @@
|
|||
# Project-wide Gradle settings.
|
||||
|
||||
# IDE (e.g. Android Studio) users:
|
||||
# Gradle settings configured through the IDE *will override*
|
||||
# any settings specified in this file.
|
||||
|
||||
# For more details on how to configure your build environment visit
|
||||
## For more details on how to configure your build environment visit
|
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||
|
||||
#
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
android.enableJetifier=true
|
||||
android.useAndroidX=true
|
||||
org.gradle.jvmargs=-Xmx1536m
|
||||
|
||||
# Default value: -Xmx1024m -XX:MaxPermSize=256m
|
||||
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||
#
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. More details, visit
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
||||
#Sun Jan 03 23:45:32 CST 2021
|
||||
org.gradle.jvmargs=-Xmx1536m
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
android.injected.testOnly=false
|
Loading…
Reference in New Issue
Block a user