#### 2021-02-18 V7.0.4
- *.[改进]修复部分布局控件未改成支持AndroidX的控件导致的闪退问题。 - *.[改进]更新歌曲时,新增如果MV已删除,但歌曲还存在时的解决方案。 - *.[改进]写真图片随机顺序展现。
This commit is contained in:
parent
bd37d661cd
commit
ee029bcf85
|
@ -1,3 +1,9 @@
|
|||
#### 2021-02-18 V7.0.4
|
||||
|
||||
- *.[改进]修复部分布局控件未改成支持AndroidX的控件导致的闪退问题。
|
||||
- *.[改进]更新歌曲时,新增如果MV已删除,但歌曲还存在时的解决方案。
|
||||
- *.[改进]写真图片随机顺序展现。
|
||||
|
||||
#### 2021-02-18 V7.0.3
|
||||
|
||||
- *.[改进]项目改成基于AndroidX。
|
||||
|
|
|
@ -51,9 +51,12 @@ dependencies {
|
|||
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
|
||||
exclude group: 'com.android.support', module: 'support-annotations'
|
||||
})
|
||||
implementation 'androidx.appcompat:appcompat:1.0.0'
|
||||
implementation 'com.github.xuexiangjys:XUI:1.1.6'
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.0.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'com.github.bumptech.glide:glide:4.11.0'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
implementation 'androidx.multidex:multidex:2.0.0'
|
||||
//第三方bugly
|
||||
|
|
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.** {
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
<!-- 存储权限 -->
|
||||
<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" />
|
||||
|
||||
|
|
28
app/src/main/java/com/zlm/hp/ui/CardActivity.java
Normal file
28
app/src/main/java/com/zlm/hp/ui/CardActivity.java
Normal file
|
@ -0,0 +1,28 @@
|
|||
package com.zlm.hp.ui;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
|
||||
import com.dou361.dialogui.DialogUIUtils;
|
||||
import com.zlm.hp.constants.ConfigInfo;
|
||||
import com.zlm.hp.constants.ResourceConstants;
|
||||
import com.zlm.hp.util.FileUtil;
|
||||
import com.zlm.hp.util.ResourceUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class CardActivity extends BaseActivity {
|
||||
@Override
|
||||
protected int setContentLayoutResID() {
|
||||
return R.layout.activity_setting;
|
||||
}
|
||||
@Override
|
||||
protected void initViews(Bundle savedInstanceState) {
|
||||
}
|
||||
@Override
|
||||
protected void handleUIMessage(Message msg) {
|
||||
}
|
||||
@Override
|
||||
protected void handleWorkerMessage(Message msg) {
|
||||
}
|
||||
}
|
|
@ -1019,6 +1019,17 @@ 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,6 +8,7 @@ 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;
|
||||
|
@ -15,6 +16,7 @@ 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;
|
||||
|
@ -56,7 +58,7 @@ public class SettingActivity extends BaseActivity {
|
|||
/**
|
||||
* 歌手歌曲名居中显示开关
|
||||
*/
|
||||
private SwitchButton mCenterSingerSongSwitchButton;
|
||||
private com.xuexiang.xui.widget.button.switchbutton.SwitchButton mCenterSingerSongSwitchButton;
|
||||
/**
|
||||
* MV播放模式
|
||||
*/
|
||||
|
@ -194,9 +196,9 @@ public class SettingActivity extends BaseActivity {
|
|||
}
|
||||
});
|
||||
mCenterSingerSongSwitchButton = findViewById(R.id.center_singersongname_switch);
|
||||
mCenterSingerSongSwitchButton.setOnCheckedChangeListener(new SwitchButton.OnCheckedChangeListener() {
|
||||
mCenterSingerSongSwitchButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(SwitchButton view, boolean isChecked) {
|
||||
public void onCheckedChanged(CompoundButton view, boolean isChecked) {
|
||||
if (mConfigInfo.isCenterSingerSongName() != isChecked)
|
||||
mConfigInfo.setIsCenterSingerSongName(isChecked).save();
|
||||
}
|
||||
|
@ -206,13 +208,14 @@ 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
|
||||
|
|
|
@ -203,7 +203,6 @@ 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) {
|
||||
|
@ -236,6 +235,11 @@ public class SplashActivity extends BaseActivity {
|
|||
mUIHandler.sendEmptyMessageDelayed(GOHOME, 5000);
|
||||
}
|
||||
}
|
||||
if (isFrist) {
|
||||
configInfo.setWire(true);//支持线控
|
||||
configInfo.setStatusBarShow(false);//不显示状态栏
|
||||
configInfo.save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -37,6 +37,7 @@ import java.util.ArrayList;
|
|||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
|
@ -279,7 +280,7 @@ public class ImageUtil {
|
|||
SingerInfo singerInfo = new SingerInfo();
|
||||
singerInfo.setImageUrl(temp.getAbsolutePath());
|
||||
singerInfo.setSingerName(singerName);
|
||||
listResult.add(singerInfo);
|
||||
listResult.add(RandomUtil.RandomInt(0,listResult.size()), singerInfo);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,10 @@ public class RandomUtil {
|
|||
}
|
||||
mLastNum = mSize - 1;
|
||||
}
|
||||
|
||||
public static int RandomInt(int min,int max)
|
||||
{
|
||||
return (new Random()).nextInt((max - min) + 1) + min;
|
||||
}
|
||||
/**
|
||||
* 生成随机数
|
||||
* @return
|
||||
|
|
|
@ -82,8 +82,9 @@ 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;
|
||||
|
|
BIN
app/src/main/res/drawable/icon_ios_thumb.png
Normal file
BIN
app/src/main/res/drawable/icon_ios_thumb.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
BIN
app/src/main/res/drawable/icon_ios_thumb_disable.png
Normal file
BIN
app/src/main/res/drawable/icon_ios_thumb_disable.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
33
app/src/main/res/drawable/ios_back_drawable.xml
Normal file
33
app/src/main/res/drawable/ios_back_drawable.xml
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?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>
|
5
app/src/main/res/drawable/ios_thumb_selector.xml
Normal file
5
app/src/main/res/drawable/ios_thumb_selector.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_enabled="false" android:drawable="@drawable/icon_ios_thumb_disable"/>
|
||||
<item android:drawable="@drawable/icon_ios_thumb"/>
|
||||
</selector>
|
|
@ -64,12 +64,12 @@
|
|||
|
||||
</RelativeLayout>
|
||||
|
||||
<RecyclerView
|
||||
<androidx.recyclerview.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"></RecyclerView>
|
||||
android:layout_below="@+id/op_heaad"></androidx.recyclerview.widget.RecyclerView>
|
||||
|
||||
|
||||
<Button
|
||||
|
|
|
@ -54,11 +54,11 @@
|
|||
android:layout_height="match_parent"
|
||||
android:visibility="gone">
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@+id/bottomlayout"></android.support.v7.widget.RecyclerView>
|
||||
android:layout_above="@+id/bottomlayout"></androidx.recyclerview.widget.RecyclerView>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/bottomlayout"
|
||||
|
|
|
@ -146,14 +146,14 @@
|
|||
android:textSize="@dimen/title_size" />
|
||||
|
||||
|
||||
<com.suke.widget.SwitchButton
|
||||
<com.xuexiang.xui.widget.button.switchbutton.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"
|
||||
app:sb_checked_color="@color/defColor" />
|
||||
android:layout_marginRight="5dp"/>
|
||||
|
||||
</com.zlm.hp.widget.ListItemRelativeLayout>
|
||||
<com.zlm.hp.widget.DividerView
|
||||
|
@ -178,6 +178,7 @@
|
|||
|
||||
<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">
|
||||
|
||||
<RecyclerView
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#fff"
|
||||
android:paddingBottom="@dimen/bar_height"></RecyclerView>
|
||||
android:paddingBottom="@dimen/bar_height"></androidx.recyclerview.widget.RecyclerView>
|
||||
</LinearLayout>
|
||||
|
|
|
@ -18,7 +18,34 @@
|
|||
<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>
|
||||
|
|
Loading…
Reference in New Issue
Block a user