增加混淆,优化ui
This commit is contained in:
parent
bdbf4b0eae
commit
7ce64b8530
BIN
app/MusicPlayer.jks
Normal file
BIN
app/MusicPlayer.jks
Normal file
Binary file not shown.
@ -1,3 +1,7 @@
|
||||
import java.util.Date
|
||||
import java.text.SimpleDateFormat
|
||||
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
// id("org.jetbrains.kotlin.android")
|
||||
@ -5,6 +9,8 @@ plugins {
|
||||
id("io.objectbox")
|
||||
}
|
||||
|
||||
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
|
||||
|
||||
android {
|
||||
namespace = "com.hi.music.player"
|
||||
compileSdk = 34
|
||||
@ -16,13 +22,14 @@ android {
|
||||
targetSdk = 34
|
||||
versionCode = 1
|
||||
versionName = "1.0.0"
|
||||
|
||||
setProperty("archivesBaseName", "Music Player" + versionName + "(${versionCode})_$timestamp")
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
isMinifyEnabled = true
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
@ -44,9 +51,9 @@ android {
|
||||
dependencies {
|
||||
|
||||
implementation("androidx.appcompat:appcompat:1.7.0")
|
||||
implementation("com.google.android.material:material:1.11.0")
|
||||
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
||||
implementation("androidx.activity:activity:1.9.1")
|
||||
implementation("com.google.android.material:material:1.12.0")
|
||||
implementation("androidx.constraintlayout:constraintlayout:2.2.0")
|
||||
implementation("androidx.activity:activity:1.9.3")
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
androidTestImplementation("androidx.test.ext:junit:1.2.1")
|
||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
|
||||
@ -71,7 +78,7 @@ dependencies {
|
||||
implementation ("androidx.palette:palette:1.0.0")
|
||||
|
||||
//动画
|
||||
implementation ("com.airbnb.android:lottie:5.2.0")
|
||||
implementation ("com.airbnb.android:lottie:6.5.0")
|
||||
|
||||
//----------media3
|
||||
implementation("androidx.media3:media3-exoplayer:1.4.1")
|
||||
|
||||
6
app/keystore.properties
Normal file
6
app/keystore.properties
Normal file
@ -0,0 +1,6 @@
|
||||
app_name=Music Player
|
||||
package_name=com.hi.music.player.test
|
||||
keystoreFile=app/MusicPlayer.jks
|
||||
key_alias=MusicPlayerkey0
|
||||
key_store_password=MusicPlayer
|
||||
key_password=MusicPlayer
|
||||
16
app/proguard-rules.pro
vendored
16
app/proguard-rules.pro
vendored
@ -18,4 +18,18 @@
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
-keep class com.hi.music.player.javabean.A_data.AudioItem { *; }
|
||||
|
||||
# 保持 Context、Intent 和权限相关的公共方法
|
||||
-keep class android.content.Context { *; }
|
||||
-keep class android.content.Intent { *; }
|
||||
-keep class android.content.pm.PackageManager { *; }
|
||||
-keep class android.net.Uri { *; }
|
||||
|
||||
-keep class com.google.gson.** { *; }
|
||||
-keepattributes Signature
|
||||
-keep class com.google.gson.reflect.TypeToken { *; }
|
||||
-keep class * extends com.google.gson.reflect.TypeToken
|
||||
-keepattributes AnnotationDefault,RuntimeVisibleAnnotations
|
||||
|
||||
@ -5,10 +5,17 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.Looper;
|
||||
import android.renderscript.Allocation;
|
||||
import android.renderscript.Element;
|
||||
import android.renderscript.RenderScript;
|
||||
import android.renderscript.ScriptIntrinsicBlur;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@ -17,7 +24,13 @@ import android.widget.SeekBar;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.target.CustomTarget;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||
import com.hi.music.player.R;
|
||||
import com.hi.music.player.databinding.ActivityAplayBinding;
|
||||
@ -62,7 +75,7 @@ public class A_PlayActivity extends BaseActivity<ActivityAplayBinding> {
|
||||
// 更新播放按钮状态
|
||||
private void updatePlayButton(Boolean isPlaying) {
|
||||
if (isPlaying != null) {
|
||||
vb.playButton.setBackgroundResource(isPlaying ? R.drawable.pause : R.drawable.play);
|
||||
vb.playButton.setBackgroundResource(isPlaying ? R.drawable.pause_green : R.drawable.play_green);
|
||||
if (isPlaying) {
|
||||
musicService.resumeTimer();
|
||||
} else {
|
||||
@ -97,15 +110,68 @@ public class A_PlayActivity extends BaseActivity<ActivityAplayBinding> {
|
||||
|
||||
Glide.with(this)
|
||||
.load("file:///android_asset/" + audioItem.getImage())
|
||||
.placeholder(R.mipmap.default_image) // 默认图片
|
||||
.placeholder(R.mipmap.playing_background) // 默认图片
|
||||
.into(vb.recordImage); // 加载专辑图片
|
||||
|
||||
Glide.with(this)
|
||||
.asBitmap()
|
||||
.load("file:///android_asset/" + audioItem.getImage())
|
||||
.into(new CustomTarget<Bitmap>() {
|
||||
@Override
|
||||
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
|
||||
// 对图片进行高斯模糊处理
|
||||
Bitmap blurredBitmap = blurBitmap(A_PlayActivity.this, resource,5);
|
||||
|
||||
// 将模糊后的图片作为背景设置到 vb.topContainer
|
||||
Drawable blurredDrawable = new BitmapDrawable(getResources(), blurredBitmap);
|
||||
vb.topContainer.setBackground(blurredDrawable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadCleared(@Nullable Drawable placeholder) {
|
||||
// 可选:处理图片加载被清除的情况
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
startMusicService(audioItem); // 启动音乐服务
|
||||
setupPlayButtonClickListener(); // 设置播放按钮的点击事件
|
||||
|
||||
}
|
||||
|
||||
|
||||
public Bitmap blurBitmap(Context context, Bitmap originalBitmap, int iterations) {
|
||||
// 创建 RenderScript 对象
|
||||
RenderScript renderScript = RenderScript.create(context);
|
||||
|
||||
// 创建 Allocation 对象
|
||||
Allocation input = Allocation.createFromBitmap(renderScript, originalBitmap);
|
||||
Allocation output = Allocation.createTyped(renderScript, input.getType());
|
||||
|
||||
// 创建模糊脚本对象
|
||||
ScriptIntrinsicBlur blurScript = ScriptIntrinsicBlur.create(renderScript, Element.U8_4(renderScript));
|
||||
|
||||
// 设置模糊半径
|
||||
blurScript.setRadius(25); // 设置最大模糊半径
|
||||
|
||||
// 执行多次模糊操作
|
||||
for (int i = 0; i < iterations; i++) {
|
||||
blurScript.setInput(input);
|
||||
blurScript.forEach(output);
|
||||
// 将结果复制到输入 Allocation
|
||||
input.copyFrom(output);
|
||||
}
|
||||
|
||||
// 将模糊后的结果写入到 Bitmap 中
|
||||
output.copyTo(originalBitmap);
|
||||
|
||||
renderScript.destroy(); // 释放 RenderScript 对象
|
||||
|
||||
return originalBitmap;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onInitClick() {
|
||||
vb.songSeekbar.setOnSeekBarChangeListener(new SeekBarListener()); // 设置进度条监听
|
||||
@ -166,22 +232,54 @@ public class A_PlayActivity extends BaseActivity<ActivityAplayBinding> {
|
||||
// 切换背景
|
||||
private void toggleBackground() {
|
||||
isBackground = !isBackground; // 切换背景状态
|
||||
|
||||
// 根据背景状态设置背景和控件的样式
|
||||
if (isBackground) {
|
||||
vb.rootLayout.setBackgroundResource(R.color.dark_music); // 切换为暗色背景
|
||||
vb.backButton.setImageResource(R.drawable.arrow_left);
|
||||
setTextColor(Color.WHITE); // 设置文字颜色为白色
|
||||
vb.prevButton.setImageResource(R.drawable.sleep);
|
||||
vb.repeatButton.setImageResource(R.drawable.timing);
|
||||
setDarkTheme(); // 暗色主题
|
||||
} else {
|
||||
vb.rootLayout.setBackgroundResource(R.color.white); // 切换为亮色背景
|
||||
vb.backButton.setImageResource(R.drawable.arrow_left_black);
|
||||
setTextColor(Color.BLACK); // 设置文字颜色为黑色
|
||||
vb.prevButton.setImageResource(R.drawable.light);
|
||||
vb.repeatButton.setImageResource(R.drawable.timing_drak);
|
||||
setLightTheme(); // 亮色主题
|
||||
}
|
||||
|
||||
saveBackgroundPreference(); // 保存当前背景状态
|
||||
}
|
||||
|
||||
private void setDarkTheme() {
|
||||
vb.topContainer.setBackgroundResource(R.mipmap.blur);
|
||||
vb.bottomContainer.setBackgroundResource(R.color.black);
|
||||
// vb.recordImage.setBackgroundResource(R.mipmap.playing_background);
|
||||
setTextColor(Color.WHITE);
|
||||
vb.prevButton.setImageResource(R.drawable.sleep);
|
||||
vb.repeatButton.setImageResource(R.drawable.timing);
|
||||
updateSeekBarColor(Color.WHITE, Color.parseColor("#4DFFFFFF"));
|
||||
}
|
||||
|
||||
private void setLightTheme() {
|
||||
vb.topContainer.setBackgroundColor(Color.WHITE);
|
||||
vb.bottomContainer.setBackgroundColor(Color.WHITE);
|
||||
vb.backButton.setImageResource(R.drawable.arrow_left_black);
|
||||
// vb.recordImage.setBackgroundResource(R.mipmap.playing_background_light);
|
||||
setTextColor(Color.BLACK);
|
||||
vb.prevButton.setImageResource(R.drawable.light);
|
||||
vb.repeatButton.setImageResource(R.drawable.timing_drak);
|
||||
updateSeekBarColor(Color.parseColor("#2680F988"), Color.parseColor("#2680F988"));
|
||||
}
|
||||
|
||||
private void updateSeekBarColor(int thumbColor, int progressColor) {
|
||||
Drawable thumbDrawable = vb.songSeekbar.getThumb();
|
||||
if (thumbDrawable != null) {
|
||||
DrawableCompat.setTint(thumbDrawable, thumbColor);
|
||||
vb.songSeekbar.setThumb(thumbDrawable);
|
||||
}
|
||||
|
||||
Drawable progressDrawable = vb.songSeekbar.getProgressDrawable();
|
||||
if (progressDrawable != null) {
|
||||
DrawableCompat.setTint(progressDrawable, progressColor);
|
||||
vb.songSeekbar.setProgressDrawable(progressDrawable);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 保存背景状态到SharedPreferences
|
||||
private void saveBackgroundPreference() {
|
||||
SharedPreferences sharedPreferences = getSharedPreferences("AppPreferences", MODE_PRIVATE);
|
||||
@ -231,7 +329,7 @@ public class A_PlayActivity extends BaseActivity<ActivityAplayBinding> {
|
||||
musicService.stopTimer();
|
||||
time.setText("Timing off");
|
||||
isTimerOff = true; // 设置标志位为 true
|
||||
Toast.makeText(getApplicationContext(), "定时关闭已取消", Toast.LENGTH_SHORT).show();
|
||||
// Toast.makeText(getApplicationContext(), "定时关闭已取消", Toast.LENGTH_SHORT).show();
|
||||
} else if (checkedId == R.id.radio10) {
|
||||
duration = 10 * 60 * 1000; // 10分钟
|
||||
isTimerOff = false;
|
||||
@ -249,7 +347,7 @@ public class A_PlayActivity extends BaseActivity<ActivityAplayBinding> {
|
||||
isTimerOff = false;
|
||||
}
|
||||
if (duration > 0) {
|
||||
Toast.makeText(getApplicationContext(), "定时设置为 " + (duration / 60000) + " 分钟", Toast.LENGTH_SHORT).show();
|
||||
// Toast.makeText(getApplicationContext(), "定时设置为 " + (duration / 60000) + " 分钟", Toast.LENGTH_SHORT).show();
|
||||
musicService.startTimer(duration);
|
||||
}
|
||||
|
||||
|
||||
@ -58,7 +58,7 @@ public class A_ImportFragment extends BaseFragment<FragmentAImportBinding> {
|
||||
adapter = new A_ImportFragmentAdapter(requireContext());
|
||||
|
||||
setupRecyclerView();
|
||||
observeAudioFiles();
|
||||
// observeAudioFiles();
|
||||
initEvent();
|
||||
}
|
||||
|
||||
@ -138,7 +138,7 @@ public class A_ImportFragment extends BaseFragment<FragmentAImportBinding> {
|
||||
confirm.setOnClickListener(view -> {
|
||||
String newName = inputField.getText().toString();
|
||||
adapter.updateTitle(position, newName);
|
||||
Toast.makeText(requireContext(), "新名称: " + newName + ", 项目: " + position, Toast.LENGTH_SHORT).show();
|
||||
// Toast.makeText(requireContext(), "新名称: " + newName + ", 项目: " + position, Toast.LENGTH_SHORT).show();
|
||||
subDialog.dismiss();
|
||||
});
|
||||
|
||||
@ -149,7 +149,7 @@ public class A_ImportFragment extends BaseFragment<FragmentAImportBinding> {
|
||||
|
||||
private void deleteAudioFile(int position, String filePath, PopupWindow popupWindow) {
|
||||
viewModel.markAudioAsDeleted(filePath);
|
||||
Toast.makeText(requireContext(), "删除按钮被点击, 项目: " + position, Toast.LENGTH_SHORT).show();
|
||||
// Toast.makeText(requireContext(), "删除按钮被点击, 项目: " + position, Toast.LENGTH_SHORT).show();
|
||||
popupWindow.dismiss();
|
||||
}
|
||||
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
package com.hi.music.player.ui.fragmnt.viewmodel;
|
||||
|
||||
import android.app.Application;
|
||||
import android.database.Cursor;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.media.MediaMetadataRetriever;
|
||||
import android.net.Uri;
|
||||
import android.provider.MediaStore;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.lifecycle.AndroidViewModel;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
@ -19,11 +21,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
public class A_VMImport extends AndroidViewModel {
|
||||
|
||||
private static final String PREFS_NAME = "audio_files_prefs";
|
||||
|
||||
21
app/src/main/res/drawable/custom_seekbar_progress.xml
Normal file
21
app/src/main/res/drawable/custom_seekbar_progress.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<!-- res/drawable/custom_seekbar_progress.xml -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<solid android:color="#4DFFFFFF" />
|
||||
<corners android:radius="4dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:id="@android:id/secondaryProgress">
|
||||
<shape>
|
||||
<solid android:color="#4DFFFFFF" />
|
||||
<corners android:radius="4dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:id="@android:id/progress">
|
||||
<shape>
|
||||
<solid android:color="#4DFFFFFF" />
|
||||
<corners android:radius="4dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
11
app/src/main/res/drawable/custom_seekbar_thumb.xml
Normal file
11
app/src/main/res/drawable/custom_seekbar_thumb.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<!-- res/drawable/custom_seekbar_thumb.xml -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<size
|
||||
android:width="20dp"
|
||||
android:height="20dp" />
|
||||
<solid android:color="#FFFFFF" /> <!-- Thumb的颜色 -->
|
||||
<stroke
|
||||
android:width="2dp"
|
||||
android:color="#FFFFFF" /> <!-- Thumb的边框颜色 -->
|
||||
<corners android:radius="10dp" /> <!-- 圆形 -->
|
||||
</shape>
|
||||
9
app/src/main/res/drawable/gradientdrawable.xml
Normal file
9
app/src/main/res/drawable/gradientdrawable.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:dither="true"
|
||||
android:endColor="#00FFFFFF"
|
||||
android:gradientRadius="90"
|
||||
android:startColor="#CC000000"
|
||||
android:type="linear" />
|
||||
</shape>
|
||||
@ -1,12 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="200.2dp"
|
||||
android:height="200dp"
|
||||
android:viewportWidth="1025"
|
||||
android:viewportHeight="1024">
|
||||
android:width="18dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="18"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M512.6,798a289,289 0,1 1,288.1 -289A289.4,289.4 0,0 1,512.6 798zM512.6,284.1a224.9,224.9 0,1 0,224.1 224.9A225.1,225.1 0,0 0,512.6 284.1zM274.5,291.6a32,32 0,0 1,-21.4 -8.5L178.1,213.6a32,32 0,0 1,43.8 -46.8l74.5,69.8a32,32 0,0 1,-21.4 55.3zM64.1,537a32,32 0,0 1,0 -64.1L165.1,469.9a32,32 0,0 1,1.9 64.1l-101.9,3.2zM191,856.1a31.8,31.8 0,0 1,-23.5 -53.8l69.8,-74.5a32.3,32.3 0,0 1,45.3 -1.5,31.8 31.8,0 0,1 1.5,45.3L213.6,846.1a32.3,32.3 0,0 1,-22.6 10zM506.2,992.2A32,32 0,0 1,474.2 961.2l-3.2,-101.9a32,32 0,1 1,64.1 -2.1l3.4,102.1a32.3,32.3 0,0 1,-31.2 33.1zM825.4,865.3a31.4,31.4 0,0 1,-21.4 -8.8l-74.5,-69.8a32,32 0,0 1,44 -46.6l74.3,69.8a31.8,31.8 0,0 1,0.9 44.4,32.7 32.7,0 0,1 -23.3,10.9zM859.1,553.2a32,32 0,0 1,0 -64.1l102.1,-3.2a32,32 0,0 1,2.1 64.1l-102.1,3.2zM764.5,305.4a32.3,32.3 0,0 1,-21.4 -8.8,31.8 31.8,0 0,1 -1.5,-45.3L811.7,177.1a32,32 0,1 1,46.8 43.8l-69.8,74.3a32,32 0,0 1,-24.1 10.3z"/>
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M522.3,196.9A31.8,31.8 0,0 1,491.3 166L487,64.1a32,32 0,0 1,31.2 -32.9A31.4,31.4 0,0 1,551.1 61.9l4.3,102.1a31.8,31.8 0,0 1,-32 32.9z"/>
|
||||
android:pathData="M8.842,1.659C12.703,1.659 15.776,4.732 15.776,8.592C15.776,11.035 14.436,13.32 12.309,14.58C11.836,14.896 11.521,15.368 11.521,15.92V17.968C11.521,18.047 11.443,18.126 11.364,18.126H6.242C6.164,18.126 6.085,18.047 6.085,17.968V15.92C6.085,15.368 5.77,14.817 5.297,14.58C3.17,13.32 1.83,11.035 1.83,8.592C1.909,4.811 4.982,1.659 8.842,1.659ZM8.842,0.083C4.115,0.083 0.333,3.865 0.333,8.592C0.333,11.744 2.067,14.502 4.588,15.92V17.968C4.588,18.914 5.376,19.701 6.321,19.701H11.443C12.388,19.701 13.176,18.914 13.176,17.968V15.92C15.697,14.423 17.43,11.744 17.43,8.592C17.352,3.865 13.57,0.083 8.842,0.083ZM11.994,23.089H5.691C5.218,23.089 4.903,22.774 4.903,22.302C4.903,21.829 5.218,21.514 5.691,21.514H11.994C12.467,21.514 12.782,21.829 12.782,22.302C12.782,22.774 12.467,23.089 11.994,23.089Z"
|
||||
android:fillColor="#000000"/>
|
||||
</vector>
|
||||
|
||||
21
app/src/main/res/drawable/pause_green.xml
Normal file
21
app/src/main/res/drawable/pause_green.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="72dp"
|
||||
android:height="72dp"
|
||||
android:viewportWidth="72"
|
||||
android:viewportHeight="72">
|
||||
<path
|
||||
android:pathData="M36,36m-36,0a36,36 0,1 1,72 0a36,36 0,1 1,-72 0"
|
||||
android:fillColor="#80F988"/>
|
||||
<path
|
||||
android:pathData="M42,28V44"
|
||||
android:strokeWidth="5"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#000000"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M30,28V44"
|
||||
android:strokeWidth="5"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#000000"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
||||
12
app/src/main/res/drawable/play_green.xml
Normal file
12
app/src/main/res/drawable/play_green.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="72dp"
|
||||
android:height="72dp"
|
||||
android:viewportWidth="72"
|
||||
android:viewportHeight="72">
|
||||
<path
|
||||
android:pathData="M36,36m-36,0a36,36 0,1 1,72 0a36,36 0,1 1,-72 0"
|
||||
android:fillColor="#80F988"/>
|
||||
<path
|
||||
android:pathData="M46.531,38.326L33.826,46.844C32.542,47.705 30.802,47.362 29.941,46.078C29.632,45.616 29.467,45.074 29.467,44.518V27.482C29.467,25.935 30.72,24.682 32.267,24.682C32.822,24.682 33.365,24.847 33.826,25.156L46.531,33.674C47.815,34.535 48.159,36.275 47.298,37.559C47.095,37.862 46.834,38.123 46.531,38.326Z"
|
||||
android:fillColor="#000000"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/rounded_dark.xml
Normal file
9
app/src/main/res/drawable/rounded_dark.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="#80333333"/> <!-- 半透明白色 (80 是透明度,范围 00-FF) -->
|
||||
<size android:width="100dp" android:height="100dp"/> <!-- 设置圆形大小 -->
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
9
app/src/main/res/drawable/rounded_light.xml
Normal file
9
app/src/main/res/drawable/rounded_light.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="#F2F2F2"/> <!-- 半透明白色 (80 是透明度,范围 00-FF) -->
|
||||
<size android:width="100dp" android:height="100dp"/> <!-- 设置圆形大小 -->
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@ -5,7 +5,7 @@
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/home_background"
|
||||
android:background="@mipmap/bg_profile"
|
||||
tools:context=".ui.activity.A_HomeActivity">
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
|
||||
@ -4,136 +4,176 @@
|
||||
android:id="@+id/root_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/dark_music"
|
||||
tools:context=".ui.activity.A_PlayActivity">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="28dp"
|
||||
android:src="@drawable/arrow_left"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/top_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@mipmap/blur"
|
||||
app:layout_constraintBottom_toTopOf="@id/bottom_container"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_percent="0.76"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/now_playing_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="28dp"
|
||||
android:text="Now Playing"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="16sp"
|
||||
<ImageView
|
||||
android:id="@+id/back_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="28dp"
|
||||
android:src="@drawable/arrow_left"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/now_playing_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="28dp"
|
||||
android:text="Now Playing"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/record_image"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="300dp"
|
||||
android:layout_marginTop="66dp"
|
||||
android:src="@mipmap/playing_background"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/now_playing_text" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/song_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="18dp"
|
||||
android:text="Blow Your Mind"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/record_image" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/artist_album_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="7dp"
|
||||
android:text="Wonder Where We Land"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/song_title" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="@drawable/gradientdrawable"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/bottom_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="#000000"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toBottomOf="@id/top_container">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/record_image"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="300dp"
|
||||
android:layout_marginTop="66dp"
|
||||
android:src="@mipmap/default_image"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/now_playing_text" />
|
||||
<TextView
|
||||
android:id="@+id/current"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginBottom="17.5dp"
|
||||
android:text="00:00"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/linear"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/song_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="18dp"
|
||||
android:text="Blow Your Mind"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/record_image" />
|
||||
<TextView
|
||||
android:id="@+id/time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="92dp"
|
||||
android:layout_marginBottom="17.5dp"
|
||||
android:text="4:08"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/linear"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linear"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="69dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/prev_button"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:background="@drawable/rounded_dark"
|
||||
android:padding="13dp"
|
||||
android:src="@drawable/sleep"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/repeat_button"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginStart="14dp"
|
||||
android:background="@drawable/rounded_dark"
|
||||
android:padding="13dp"
|
||||
android:src="@drawable/timing" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/artist_album_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="7dp"
|
||||
android:text="Woneder Where We Land"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/song_title" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/song_seekbar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:max="100"
|
||||
android:padding="8dp"
|
||||
android:progress="50"
|
||||
app:layout_constraintBottom_toTopOf="@+id/current"
|
||||
android:progressDrawable="@drawable/custom_seekbar_progress"
|
||||
android:thumb="@drawable/custom_seekbar_thumb"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/top_container"
|
||||
app:layout_constraintEnd_toStartOf="@+id/play_button"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/top_container" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/play_button"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="@drawable/play"
|
||||
android:background="@drawable/play_green"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/song_seekbar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/song_seekbar" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/current"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="17.5dp"
|
||||
android:text="00:00"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/linear"
|
||||
app:layout_constraintStart_toStartOf="@id/song_seekbar" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="17.5dp"
|
||||
android:text="4:08"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/linear"
|
||||
app:layout_constraintEnd_toEndOf="@id/song_seekbar" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linear"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="69dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/prev_button"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:src="@drawable/sleep" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/repeat_button"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginStart="14dp"
|
||||
android:src="@drawable/timing" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#001c0e"
|
||||
android:background="@mipmap/bg_profile"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginTop="4dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
@ -79,6 +80,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:visibility="gone"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp">
|
||||
|
||||
@ -140,6 +142,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:visibility="gone"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp">
|
||||
|
||||
@ -171,6 +174,7 @@
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
android:padding="16dp">
|
||||
|
||||
<ImageView
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@mipmap/bg_profile"
|
||||
tools:context=".ui.fragmnt.A_HomeFragment">
|
||||
|
||||
<!-- 使用 NestedScrollView 来实现垂直滚动 -->
|
||||
@ -14,6 +15,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginTop="4dp"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@mipmap/bg_profile"
|
||||
tools:context=".ui.fragmnt.A_ImportFragment">
|
||||
|
||||
<TextView
|
||||
@ -14,7 +15,7 @@
|
||||
android:layout_marginTop="32sp"
|
||||
android:text="Parents voice"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="32sp"
|
||||
android:textSize="28sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@ -25,7 +26,7 @@
|
||||
android:layout_marginTop="32sp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="@drawable/rounded"
|
||||
android:padding="5dp"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/category"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@ -45,6 +46,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="127dp"
|
||||
android:src="@drawable/add"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
|
||||
@ -52,8 +52,8 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/options"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:src="@drawable/options"
|
||||
android:padding="5dp"
|
||||
|
||||
BIN
app/src/main/res/mipmap-xxxhdpi/blur.png
Normal file
BIN
app/src/main/res/mipmap-xxxhdpi/blur.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 MiB |
BIN
app/src/main/res/mipmap-xxxhdpi/playing_background.png
Normal file
BIN
app/src/main/res/mipmap-xxxhdpi/playing_background.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 659 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/playing_background_light.png
Normal file
BIN
app/src/main/res/mipmap-xxxhdpi/playing_background_light.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
BIN
app/src/main/res/mipmap-xxxhdpi/thumb.png
Normal file
BIN
app/src/main/res/mipmap-xxxhdpi/thumb.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
Loading…
Reference in New Issue
Block a user