V1.0.0(1)
15
.gitignore
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
local.properties
|
||||
1
app/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/build
|
||||
1
app/Animation - 1721805181851.json
Normal file
49
app/build.gradle.kts
Normal file
@ -0,0 +1,49 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.sound.prankparty"
|
||||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.sound.prankparty.test"
|
||||
minSdk = 23
|
||||
targetSdk = 34
|
||||
versionCode = 1
|
||||
versionName = "1.0.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = true
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation(libs.appcompat)
|
||||
implementation(libs.material)
|
||||
implementation(libs.activity)
|
||||
implementation(libs.constraintlayout)
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.ext.junit)
|
||||
androidTestImplementation(libs.espresso.core)
|
||||
implementation("com.github.bumptech.glide:glide:4.16.0")
|
||||
annotationProcessor("com.github.bumptech.glide:compiler:4.16.0")
|
||||
implementation("com.google.android.material:material:1.12.0")
|
||||
implementation("com.airbnb.android:lottie:6.5.0")
|
||||
implementation ("androidx.room:room-runtime:2.6.1")
|
||||
annotationProcessor ("androidx.room:room-compiler:2.6.1")
|
||||
}
|
||||
21
app/proguard-rules.pro
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
@ -0,0 +1,26 @@
|
||||
package com.sound.prankparty;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("com.example.prankpartydemo", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
51
app/src/main/AndroidManifest.xml
Normal file
@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO"/>
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
|
||||
android:maxSdkVersion="32" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
||||
android:maxSdkVersion="32" />
|
||||
|
||||
<application
|
||||
android:name=".Application.MainApplication"
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.PrankPartyDemo"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".SecondFragment.SaveRecordActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".SecondFragment.NewRecordActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".FirstFragment.PlaySoundActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".FirstFragment.AirHornActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".StartUp.SplashActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/Theme.StartUp" />
|
||||
<activity
|
||||
android:name=".Main.MainActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
1
app/src/main/assets/Animation.json
Normal file
BIN
app/src/main/assets/FrancoisOne-Regular.ttf
Normal file
3899
app/src/main/assets/prank.json
Normal file
BIN
app/src/main/ic_launcher-playstore.png
Normal file
|
After Width: | Height: | Size: 362 KiB |
BIN
app/src/main/ic_launcher_start_up-playstore.png
Normal file
|
After Width: | Height: | Size: 71 KiB |
@ -0,0 +1,33 @@
|
||||
package com.sound.prankparty.Application;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
public class MainApplication extends Application {
|
||||
/**
|
||||
* 全局的上下文
|
||||
*/
|
||||
private static Context mContext;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
//获取应用的上下文并赋值给 mContext
|
||||
mContext = getApplicationContext();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取context
|
||||
* @return
|
||||
*/
|
||||
public static Context getContext(){
|
||||
return mContext;
|
||||
}
|
||||
|
||||
//重写 onLowMemory 方法,在系统内存不足时调用。这里只是调用了父类的 onLowMemory 方法,没有做其他处理
|
||||
@Override
|
||||
public void onLowMemory() {
|
||||
super.onLowMemory();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package com.sound.prankparty.FirstFragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.sound.prankparty.JSON.Category;
|
||||
import com.sound.prankparty.JSON.SoundItem;
|
||||
import com.sound.prankparty.R;
|
||||
import com.sound.prankparty.Utils.ItemDecoration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class AirHornActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.activity_airhonr);
|
||||
|
||||
RecyclerView recyclerView = findViewById(R.id.air_horn_recyclerview);
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(this, 2));
|
||||
|
||||
// 接收传递的 List<Category> 对象
|
||||
Category categories = (Category) getIntent().getSerializableExtra("123");
|
||||
|
||||
if (categories == null) {
|
||||
// 处理 categories 为 null 的情况
|
||||
return;
|
||||
}
|
||||
List<SoundItem> soundItemList = categories.getSoundItemList();
|
||||
|
||||
recyclerView.setAdapter(new AirHornRecyclerViewAdapter(this, soundItemList));
|
||||
|
||||
// 为 RecyclerView 添加自定义的间距装饰。
|
||||
ItemDecoration itemDecoration = new ItemDecoration(16, 19, 10);
|
||||
recyclerView.addItemDecoration(itemDecoration);
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,98 @@
|
||||
package com.sound.prankparty.FirstFragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Typeface;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
|
||||
import com.sound.prankparty.Application.MainApplication;
|
||||
import com.sound.prankparty.JSON.SoundItem;
|
||||
import com.sound.prankparty.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class AirHornRecyclerViewAdapter extends RecyclerView.Adapter<AirHornRecyclerViewAdapter.AirhonrViewHolder> {
|
||||
|
||||
private Context context;
|
||||
private List<SoundItem> soundItemList;
|
||||
|
||||
public AirHornRecyclerViewAdapter(Context context, List<SoundItem> soundItemList) {
|
||||
this.context = context;
|
||||
this.soundItemList = soundItemList;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public AirhonrViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_sound, parent, false);
|
||||
return new AirHornRecyclerViewAdapter.AirhonrViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull AirhonrViewHolder holder, int position) {
|
||||
|
||||
SoundItem soundItem = soundItemList.get(position);
|
||||
|
||||
String originalName = soundItem.getTitle();
|
||||
// 检查名称是否为空,以避免空指针异常
|
||||
if (originalName != null && !originalName.isEmpty()) {
|
||||
// // 将首字母大写
|
||||
// String capitalizedName = originalName.substring(0, 1).toUpperCase() + originalName.substring(1);
|
||||
// 设置文本字体
|
||||
holder.textView.setTypeface(Typeface.createFromAsset(context.getAssets(), "FrancoisOne-Regular.ttf"));
|
||||
//设置文本
|
||||
holder.textView.setText(originalName);
|
||||
} else {
|
||||
// 如果名称为空,可以设置一个默认值或者不设置
|
||||
holder.textView.setText("");
|
||||
}
|
||||
|
||||
if (soundItem != null) {
|
||||
Glide.with(MainApplication.getContext())
|
||||
//指定加载的资源类型为Drawable
|
||||
.asDrawable()
|
||||
//设置跳过内存缓存,即加载的图片不会存储在内存缓存中
|
||||
.skipMemoryCache(true)
|
||||
//设置磁盘缓存策略为DiskCacheStrategy.ALL,即缓存原始图片和转换后的图片
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
.load(soundItem.getPreUrl())
|
||||
.transform(new CenterCrop())
|
||||
.into(holder.imageView);
|
||||
|
||||
holder.imageView.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(context, PlaySoundActivity.class);
|
||||
intent.putExtra("1234", soundItem);
|
||||
context.startActivity(intent);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return soundItemList.size();
|
||||
}
|
||||
|
||||
static class AirhonrViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
ImageView imageView;
|
||||
TextView textView;
|
||||
|
||||
public AirhonrViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
imageView = itemView.findViewById(R.id.item_imageview_sound);
|
||||
textView = itemView.findViewById(R.id.item_textview_sound);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,257 @@
|
||||
package com.sound.prankparty.FirstFragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.media.AudioManager;
|
||||
import android.media.MediaPlayer;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
|
||||
import com.sound.prankparty.Application.MainApplication;
|
||||
import com.sound.prankparty.JSON.SoundItem;
|
||||
import com.sound.prankparty.R;
|
||||
import com.sound.prankparty.Room.AppDatabase;
|
||||
import com.sound.prankparty.Room.FavoriteSounds;
|
||||
import com.sound.prankparty.Room.FavoriteSoundsDao;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class PlaySoundActivity extends AppCompatActivity {
|
||||
|
||||
private MediaPlayer mediaPlayer;
|
||||
private ImageView playBack;
|
||||
private SoundItem soundItemList;
|
||||
private ImageView imageView;
|
||||
private SeekBar seekBar;
|
||||
private AudioManager audioManager;
|
||||
private boolean isPlaying = false; // 默认未播放
|
||||
private ImageView loop;
|
||||
private boolean isLooping = false; // 默认不循环
|
||||
private TextView textView;
|
||||
private AppDatabase appDatabase;
|
||||
private FavoriteSoundsDao favoriteSoundsDao;
|
||||
private ImageView favorite;
|
||||
private boolean isFavorite = false; //默认不收藏
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_play_sound);
|
||||
|
||||
// 获取音频管理器
|
||||
audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
|
||||
|
||||
// 获取控件实例
|
||||
imageView = findViewById(R.id.image);
|
||||
playBack = findViewById(R.id.playback);
|
||||
seekBar = findViewById(R.id.progress);
|
||||
loop = findViewById(R.id.loop);
|
||||
textView = findViewById(R.id.text);
|
||||
favorite = findViewById(R.id.favorite);
|
||||
|
||||
appDatabase = AppDatabase.getDatabase(this);
|
||||
favoriteSoundsDao = appDatabase.favoriteSoundsDao();
|
||||
|
||||
// 接收传递的 SoundItem 对象
|
||||
soundItemList = (SoundItem) getIntent().getSerializableExtra("1234");
|
||||
if (soundItemList == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
textView.setText(soundItemList.getTitle());
|
||||
|
||||
// 检查数据库中是否存在该音频的收藏记录
|
||||
checkFavoriteStatus();
|
||||
|
||||
//设置收藏点击事件
|
||||
favorite.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
isFavorite = !isFavorite;
|
||||
updateFavoriteIcon();
|
||||
updateDatabase();
|
||||
}
|
||||
});
|
||||
|
||||
// 设置循环图标的点击事件
|
||||
loop.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
isLooping = !isLooping;
|
||||
loop.setImageResource(isLooping ? R.drawable.true_loop : R.drawable.loop);
|
||||
if (mediaPlayer != null) {
|
||||
mediaPlayer.setLooping(isLooping);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 设置播放/暂停图标的点击事件
|
||||
playBack.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
playAudio();
|
||||
}
|
||||
});
|
||||
|
||||
// 获取设备的最大音量值
|
||||
int maxVolume = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
|
||||
// 设置SeekBar的最大值
|
||||
seekBar.setMax(maxVolume);
|
||||
|
||||
// 获取当前音量值
|
||||
int currentVolume = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
|
||||
// 设置SeekBar的初始进度
|
||||
seekBar.setProgress(currentVolume);
|
||||
|
||||
// 设置SeekBar监听器
|
||||
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||
// 调整音量
|
||||
audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, progress, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||
// 用户开始拖动进度条时执行的操作
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||
// 用户停止拖动进度条时执行的操作
|
||||
}
|
||||
});
|
||||
|
||||
// 使用 Glide 加载图片
|
||||
Glide.with(MainApplication.getContext())
|
||||
.asDrawable()
|
||||
.skipMemoryCache(true)
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
.load(soundItemList.getPreUrl())
|
||||
.transform(new CenterCrop())
|
||||
.into(imageView);
|
||||
}
|
||||
|
||||
private void checkFavoriteStatus() {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// 检查数据库中是否存在该音频的收藏记录
|
||||
FavoriteSounds favoriteSound = favoriteSoundsDao.getByPath(soundItemList.getMp3Url());
|
||||
isFavorite = favoriteSound != null;
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
updateFavoriteIcon();
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
private void updateFavoriteIcon() {
|
||||
favorite.setImageResource(isFavorite ? R.drawable.favorite : R.drawable.unfavorite);
|
||||
}
|
||||
|
||||
private void updateDatabase() {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// 判断是否收藏
|
||||
if (isFavorite) {
|
||||
// 插入数据到数据库
|
||||
FavoriteSounds favoriteSound = new FavoriteSounds(
|
||||
soundItemList.getTitle(),
|
||||
soundItemList.getMp3Url(),
|
||||
soundItemList.getPreUrl()
|
||||
);
|
||||
favoriteSoundsDao.insertSound(favoriteSound);
|
||||
} else {
|
||||
// 从数据库删除数据,先根据路径检索出要删除的对象
|
||||
FavoriteSounds favoriteSound = favoriteSoundsDao.getByPath(soundItemList.getMp3Url());
|
||||
if (favoriteSound != null) {
|
||||
favoriteSoundsDao.delete(favoriteSound);
|
||||
}
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
|
||||
private void playAudio() {
|
||||
String audioUrl = soundItemList.getMp3Url(); // 获取音频的URL
|
||||
|
||||
if (mediaPlayer == null) {
|
||||
// 如果MediaPlayer对象为空,则创建一个新的MediaPlayer对象
|
||||
mediaPlayer = new MediaPlayer();
|
||||
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); // 设置音频流类型为音乐
|
||||
|
||||
try {
|
||||
mediaPlayer.setDataSource(audioUrl); // 设置音频数据源
|
||||
mediaPlayer.prepareAsync(); // 异步准备MediaPlayer
|
||||
|
||||
// 设置MediaPlayer准备完成监听器
|
||||
mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
|
||||
@Override
|
||||
public void onPrepared(MediaPlayer mp) {
|
||||
mediaPlayer.start(); // 开始播放音频
|
||||
playBack.setImageResource(R.drawable.pause); // 播放时显示暂停图标
|
||||
isPlaying = true; // 设置播放状态为正在播放
|
||||
mediaPlayer.setLooping(isLooping); // 设置是否循环播放
|
||||
}
|
||||
});
|
||||
|
||||
// 设置MediaPlayer错误监听器
|
||||
mediaPlayer.setOnErrorListener(new MediaPlayer.OnErrorListener() {
|
||||
@Override
|
||||
public boolean onError(MediaPlayer mp, int what, int extra) {
|
||||
Toast.makeText(PlaySoundActivity.this, "Error playing audio", Toast.LENGTH_SHORT).show(); // 显示错误提示
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// 设置MediaPlayer播放完成监听器
|
||||
mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
|
||||
@Override
|
||||
public void onCompletion(MediaPlayer mp) {
|
||||
if (!isLooping) {
|
||||
playBack.setImageResource(R.drawable.playback); // 播放完成时显示播放图标
|
||||
isPlaying = false; // 设置播放状态为未播放
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace(); // 打印异常堆栈信息
|
||||
Toast.makeText(PlaySoundActivity.this, "Error setting data source", Toast.LENGTH_SHORT).show(); // 显示错误提示
|
||||
}
|
||||
} else {
|
||||
// 如果MediaPlayer对象已经存在
|
||||
if (isPlaying) {
|
||||
mediaPlayer.pause(); // 暂停播放
|
||||
playBack.setImageResource(R.drawable.playback); // 暂停时显示播放图标
|
||||
} else {
|
||||
mediaPlayer.start(); // 继续播放
|
||||
playBack.setImageResource(R.drawable.pause); // 播放时显示暂停图标
|
||||
}
|
||||
isPlaying = !isPlaying; // 切换播放状态
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mediaPlayer != null) {
|
||||
mediaPlayer.release();
|
||||
mediaPlayer = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
package com.sound.prankparty.FirstFragment;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.sound.prankparty.JSON.Category;
|
||||
import com.sound.prankparty.R;
|
||||
import com.sound.prankparty.SecondFragment.NewRecordActivity;
|
||||
import com.sound.prankparty.Utils.ItemDecoration;
|
||||
import com.sound.prankparty.Utils.JsonParser;
|
||||
import com.sound.prankparty.Utils.LoadJSON;
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class SoundFragment extends Fragment {
|
||||
|
||||
ImageView btnBack;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
|
||||
View view = inflater.inflate(R.layout.fragment_sound, container, false);
|
||||
|
||||
RecyclerView recyclerView = view.findViewById(R.id.sound_recyclerview);
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(getContext(), 2));
|
||||
|
||||
btnBack = view.findViewById(R.id.fragment_sound_setting);
|
||||
|
||||
// 从assets文件夹中读取JSON文件
|
||||
String jsonString = LoadJSON.loadJSONFromAsset("prank.json");
|
||||
//解析读取的String
|
||||
List<Category> categories = JsonParser.parseJson(jsonString);
|
||||
|
||||
recyclerView.setAdapter(new SoundRecyclerViewAdapter(getContext(), categories));
|
||||
|
||||
// 为 RecyclerView 添加自定义的间距装饰。
|
||||
ItemDecoration itemDecoration = new ItemDecoration(16, 19, 10);
|
||||
recyclerView.addItemDecoration(itemDecoration);
|
||||
|
||||
btnBack.setOnClickListener(v -> showCustomBottomSheetDialog());
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
private void showCustomBottomSheetDialog() {
|
||||
BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(requireContext());
|
||||
View dialogView = LayoutInflater.from(requireContext()).inflate(R.layout.setting_dialog, null);
|
||||
//禁止点击其他页面取消
|
||||
bottomSheetDialog.setCanceledOnTouchOutside(false);
|
||||
|
||||
dialogView.findViewById(R.id.privacy).setOnClickListener(v -> {
|
||||
// 处理选项 1
|
||||
Intent intent = new Intent(getActivity(), NewRecordActivity.class);
|
||||
startActivity(intent);
|
||||
//销毁BottomSheetDialog对象
|
||||
bottomSheetDialog.dismiss();
|
||||
});
|
||||
|
||||
dialogView.findViewById(R.id.share).setOnClickListener(v -> {
|
||||
// 处理选项 2
|
||||
bottomSheetDialog.dismiss();
|
||||
});
|
||||
|
||||
dialogView.findViewById(R.id.version).setOnClickListener(v -> {
|
||||
// 处理取消按钮
|
||||
bottomSheetDialog.dismiss();
|
||||
});
|
||||
|
||||
bottomSheetDialog.setContentView(dialogView);
|
||||
bottomSheetDialog.show();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,112 @@
|
||||
package com.sound.prankparty.FirstFragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Typeface;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
|
||||
import com.sound.prankparty.Application.MainApplication;
|
||||
import com.sound.prankparty.JSON.Category;
|
||||
import com.sound.prankparty.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SoundRecyclerViewAdapter extends RecyclerView.Adapter<SoundRecyclerViewAdapter.SoundViewHolder> {
|
||||
|
||||
private Context context;
|
||||
private List<Category> categoryList;
|
||||
private final int[] colors;
|
||||
|
||||
public SoundRecyclerViewAdapter(Context context, List<Category> categoryList) {
|
||||
this.context = context;
|
||||
this.categoryList = categoryList;
|
||||
|
||||
colors = new int[]{
|
||||
ContextCompat.getColor(context, R.color.color1),
|
||||
ContextCompat.getColor(context, R.color.color2),
|
||||
ContextCompat.getColor(context, R.color.color3)
|
||||
// 添加更多颜色
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public SoundViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_sound, parent, false);
|
||||
return new SoundViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull SoundViewHolder holder, int position) {
|
||||
|
||||
Category category = categoryList.get(position);
|
||||
|
||||
// 使用取模运算来循环使用颜色
|
||||
holder.imageView.setBackgroundColor(colors[position % colors.length]);
|
||||
|
||||
String originalName = category.getCategoryName();
|
||||
// 检查名称是否为空,以避免空指针异常
|
||||
if (originalName != null && !originalName.isEmpty()) {
|
||||
// // 将首字母大写
|
||||
// String capitalizedName = originalName.substring(0, 1).toUpperCase() + originalName.substring(1);
|
||||
// 设置文本字体
|
||||
holder.textView.setTypeface(Typeface.createFromAsset(context.getAssets(), "FrancoisOne-Regular.ttf"));
|
||||
//设置文本
|
||||
holder.textView.setText(originalName);
|
||||
} else {
|
||||
// 如果名称为空,可以设置一个默认值或者不设置
|
||||
holder.textView.setText("");
|
||||
}
|
||||
|
||||
if (category != null) {
|
||||
Glide.with(MainApplication.getContext())
|
||||
//指定加载的资源类型为Drawable
|
||||
.asDrawable()
|
||||
//设置跳过内存缓存,即加载的图片不会存储在内存缓存中
|
||||
.skipMemoryCache(true)
|
||||
//设置磁盘缓存策略为DiskCacheStrategy.ALL,即缓存原始图片和转换后的图片
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
.load(category.getCategoryUrl())
|
||||
.transform(new CenterCrop())
|
||||
.into(holder.imageView);
|
||||
|
||||
holder.imageView.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(context, AirHornActivity.class);
|
||||
intent.putExtra("123",category);
|
||||
context.startActivity(intent);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return categoryList.size();
|
||||
}
|
||||
|
||||
static class SoundViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
ImageView imageView;
|
||||
TextView textView;
|
||||
|
||||
public SoundViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
imageView = itemView.findViewById(R.id.item_imageview_sound);
|
||||
textView = itemView.findViewById(R.id.item_textview_sound);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
35
app/src/main/java/com/sound/prankparty/JSON/Category.java
Normal file
@ -0,0 +1,35 @@
|
||||
package com.sound.prankparty.JSON;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class Category implements Serializable {
|
||||
|
||||
private String categoryId;
|
||||
private String categoryName;
|
||||
private String categoryUrl;
|
||||
private List<SoundItem> soundItemList;
|
||||
|
||||
public Category(String categoryId, String categoryName, String categoryUrl, List<SoundItem> soundItemList) {
|
||||
this.categoryId = categoryId;
|
||||
this.categoryName = categoryName;
|
||||
this.categoryUrl = categoryUrl;
|
||||
this.soundItemList = soundItemList;
|
||||
}
|
||||
|
||||
public String getCategoryId() {
|
||||
return categoryId;
|
||||
}
|
||||
|
||||
public String getCategoryName() {
|
||||
return categoryName;
|
||||
}
|
||||
|
||||
public String getCategoryUrl() {
|
||||
return categoryUrl;
|
||||
}
|
||||
|
||||
public List<SoundItem> getSoundItemList() {
|
||||
return soundItemList;
|
||||
}
|
||||
}
|
||||
28
app/src/main/java/com/sound/prankparty/JSON/SoundItem.java
Normal file
@ -0,0 +1,28 @@
|
||||
package com.sound.prankparty.JSON;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class SoundItem implements Serializable {
|
||||
|
||||
private String mp3Url;
|
||||
private String preUrl;
|
||||
private String title;
|
||||
|
||||
public SoundItem(String mp3Url, String preUrl, String title) {
|
||||
this.mp3Url = mp3Url;
|
||||
this.preUrl = preUrl;
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getMp3Url() {
|
||||
return mp3Url;
|
||||
}
|
||||
|
||||
public String getPreUrl() {
|
||||
return preUrl;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
}
|
||||
106
app/src/main/java/com/sound/prankparty/Main/MainActivity.java
Normal file
@ -0,0 +1,106 @@
|
||||
package com.sound.prankparty.Main;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.sound.prankparty.R;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.google.android.material.tabs.TabLayoutMediator;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
private ViewPager2 viewPager2;
|
||||
private TabLayout tabLayout;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
viewPager2 = findViewById(R.id.main_viewpager);
|
||||
tabLayout = findViewById(R.id.main_tablayout);
|
||||
|
||||
MainViewPager2Adapter adapter = new MainViewPager2Adapter(this);
|
||||
viewPager2.setAdapter(adapter);
|
||||
|
||||
// viewPager2.setUserInputEnabled(false); //true:滑动,false:禁止滑动
|
||||
|
||||
new TabLayoutMediator(tabLayout, viewPager2, (tab, position) -> {
|
||||
View customView = LayoutInflater.from(this).inflate(R.layout.main_tab_item_custom, null);
|
||||
tab.setCustomView(customView);
|
||||
|
||||
ImageView tabIcon = customView.findViewById(R.id.icon_custom);
|
||||
if (tabIcon != null) {
|
||||
if (position == 0) {
|
||||
tabIcon.setImageResource(R.drawable.main_sound_select);
|
||||
} else if (position == 1) {
|
||||
tabIcon.setImageResource(R.drawable.main_radio_unselect);
|
||||
} else {
|
||||
tabIcon.setImageResource(R.drawable.main_favorite_unselect);
|
||||
}
|
||||
}
|
||||
|
||||
}).attach();
|
||||
|
||||
|
||||
//设置标签选中事件
|
||||
tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
View customView = tab.getCustomView();
|
||||
if (customView != null) {
|
||||
ImageView tabIcon = customView.findViewById(R.id.icon_custom);
|
||||
if (tabIcon != null) {
|
||||
if (tab.getPosition() == 0) {
|
||||
tabIcon.setImageResource(R.drawable.main_sound_select);
|
||||
} else if (tab.getPosition() == 1) {
|
||||
tabIcon.setImageResource(R.drawable.main_radio_select);
|
||||
} else {
|
||||
tabIcon.setImageResource(R.drawable.main_favorite_select);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabUnselected(TabLayout.Tab tab) {
|
||||
View customView = tab.getCustomView();
|
||||
if (customView != null) {
|
||||
ImageView tabIcon = customView.findViewById(R.id.icon_custom);
|
||||
if (tabIcon != null) {
|
||||
if (tab.getPosition() == 0) {
|
||||
tabIcon.setImageResource(R.drawable.main_sound_unselect);
|
||||
} else if (tab.getPosition() == 1) {
|
||||
tabIcon.setImageResource(R.drawable.main_radio_unselect);
|
||||
} else {
|
||||
tabIcon.setImageResource(R.drawable.main_favorite_unselect);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabReselected(TabLayout.Tab tab) {
|
||||
// 处理Tab重新选中事件
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//处理返回的flag,返回当前fragment
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
if ((intent.getFlags() & Intent.FLAG_ACTIVITY_CLEAR_TOP) != 0) {
|
||||
// 返回到ViewPager2的当前Fragment
|
||||
viewPager2.setCurrentItem(viewPager2.getCurrentItem());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package com.sound.prankparty.Main;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
|
||||
import com.sound.prankparty.FirstFragment.SoundFragment;
|
||||
import com.sound.prankparty.SecondFragment.RadioFragment;
|
||||
import com.sound.prankparty.ThirdFragment.FavoriteFragment;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MainViewPager2Adapter extends FragmentStateAdapter {
|
||||
|
||||
private List<Fragment> fragmentList;
|
||||
|
||||
public MainViewPager2Adapter(@NonNull FragmentActivity fragmentActivity) {
|
||||
super(fragmentActivity);
|
||||
// 初始化fragmentList并添加Fragment对象
|
||||
fragmentList = new ArrayList<>();
|
||||
fragmentList.add(new SoundFragment());
|
||||
fragmentList.add(new RadioFragment());
|
||||
fragmentList.add(new FavoriteFragment());
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment createFragment(int position) {
|
||||
// 根据位置返回相应的Fragment
|
||||
return fragmentList.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
// 返回Fragment列表的大小
|
||||
return fragmentList.size();
|
||||
}
|
||||
}
|
||||
29
app/src/main/java/com/sound/prankparty/Room/AppDatabase.java
Normal file
@ -0,0 +1,29 @@
|
||||
package com.sound.prankparty.Room;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.room.Database;
|
||||
import androidx.room.Room;
|
||||
import androidx.room.RoomDatabase;
|
||||
|
||||
@Database(entities = {SaveSounds.class,FavoriteSounds.class}, version = 1)
|
||||
public abstract class AppDatabase extends RoomDatabase {
|
||||
|
||||
public abstract SaveSoundsDao saveSoundsDao();
|
||||
public abstract FavoriteSoundsDao favoriteSoundsDao();
|
||||
|
||||
private static volatile AppDatabase INSTANCE;
|
||||
|
||||
public static AppDatabase getDatabase(final Context context) {
|
||||
if (INSTANCE == null) {
|
||||
synchronized (AppDatabase.class) {
|
||||
if (INSTANCE == null) {
|
||||
INSTANCE = Room.databaseBuilder(context.getApplicationContext(),
|
||||
AppDatabase.class, "save_sound_database")
|
||||
.fallbackToDestructiveMigration() // 当数据库版本升级时,删除现有数据
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return INSTANCE;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package com.sound.prankparty.Room;
|
||||
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Entity(tableName = "favorite_sounds")
|
||||
public class FavoriteSounds implements Serializable {
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
public int id;
|
||||
|
||||
public String name;
|
||||
public String path;
|
||||
public String imagePath;
|
||||
|
||||
public FavoriteSounds(String name, String path, String imagePath) {
|
||||
this.name = name;
|
||||
this.path = path;
|
||||
this.imagePath = imagePath;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public String getImagePath() {
|
||||
return imagePath;
|
||||
}
|
||||
|
||||
public void setImagePath(String imagePath) {
|
||||
this.imagePath = imagePath;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,28 @@
|
||||
package com.sound.prankparty.Room;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Delete;
|
||||
import androidx.room.Insert;
|
||||
import androidx.room.Query;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Dao
|
||||
public interface FavoriteSoundsDao {
|
||||
|
||||
@Insert
|
||||
void insertSound(FavoriteSounds sound);
|
||||
|
||||
@Query("SELECT * FROM favorite_sounds")
|
||||
List<FavoriteSounds> getAllSounds();
|
||||
|
||||
@Query("SELECT * FROM favorite_sounds")
|
||||
LiveData<List<FavoriteSounds>> getAllSoundsLiveData();
|
||||
|
||||
@Query("SELECT * FROM favorite_sounds WHERE path = :path")
|
||||
FavoriteSounds getByPath(String path);
|
||||
|
||||
@Delete
|
||||
void delete(FavoriteSounds sound);
|
||||
}
|
||||
59
app/src/main/java/com/sound/prankparty/Room/SaveSounds.java
Normal file
@ -0,0 +1,59 @@
|
||||
package com.sound.prankparty.Room;
|
||||
|
||||
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
@Entity(tableName = "save_sounds")
|
||||
public class SaveSounds {
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
public int id;
|
||||
|
||||
public String name;
|
||||
public String path;
|
||||
public String date;
|
||||
public String time;
|
||||
public String duration;
|
||||
|
||||
public SaveSounds(String name, String path, String date, String time, String duration) {
|
||||
this.name = name;
|
||||
this.path = path;
|
||||
this.date = date;
|
||||
this.time = time;
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public SaveSounds() {
|
||||
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public String getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public String getDuration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
package com.sound.prankparty.Room;
|
||||
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Delete;
|
||||
import androidx.room.Insert;
|
||||
import androidx.room.Query;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Dao
|
||||
public interface SaveSoundsDao {
|
||||
@Insert
|
||||
void insertSound(SaveSounds sound);
|
||||
|
||||
@Query("SELECT * FROM save_sounds")
|
||||
List<SaveSounds> getAllSounds();
|
||||
|
||||
@Delete
|
||||
void deleteSound(SaveSounds sound);
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,156 @@
|
||||
package com.sound.prankparty.SecondFragment;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.media.MediaRecorder;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.View;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.airbnb.lottie.LottieAnimationView;
|
||||
import com.sound.prankparty.R;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class NewRecordActivity extends AppCompatActivity {
|
||||
|
||||
private static final int REQUEST_RECORD_AUDIO_PERMISSION = 200;
|
||||
|
||||
private ImageButton button;
|
||||
private Boolean isStarted = false;
|
||||
private LottieAnimationView animationView;
|
||||
private TextView timeTextView;
|
||||
private Handler handler = new Handler();
|
||||
private long startTime;
|
||||
private MediaRecorder mediaRecorder;
|
||||
private File outputFile;
|
||||
private Runnable updateTimeTask = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
long currentTime = System.currentTimeMillis();
|
||||
long elapsedTime = currentTime - startTime;
|
||||
timeTextView.setText(formatTime(elapsedTime));
|
||||
handler.postDelayed(this, 1000);
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_new_record);
|
||||
|
||||
animationView = findViewById(R.id.animation_view);
|
||||
button = findViewById(R.id.new_record_record);
|
||||
timeTextView = findViewById(R.id.new_record_time);
|
||||
|
||||
button.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// 检查是否授予了RECORD_AUDIO权限
|
||||
if (ContextCompat.checkSelfPermission(NewRecordActivity.this, Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED) {
|
||||
// 如果未被授予,则请求该权限
|
||||
ActivityCompat.requestPermissions(NewRecordActivity.this, new String[]{Manifest.permission.RECORD_AUDIO}, REQUEST_RECORD_AUDIO_PERMISSION);
|
||||
} else {
|
||||
// 如果获得权限,就开始录音
|
||||
toggleRecording();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void toggleRecording() {
|
||||
if (isStarted) {
|
||||
// 停止录音
|
||||
stopRecording();
|
||||
} else {
|
||||
// 开始录音
|
||||
startRecording();
|
||||
}
|
||||
isStarted = !isStarted; // 切换录音状态
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
if (requestCode == REQUEST_RECORD_AUDIO_PERMISSION) {
|
||||
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||
// 获得许可,开始录音
|
||||
toggleRecording();
|
||||
} else {
|
||||
// 权限被拒绝,通知用户
|
||||
Toast.makeText(this, "录音权限被拒绝,请在设置中启用权限", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void startRecording() {
|
||||
try {
|
||||
// 初始化MediaRecorder
|
||||
mediaRecorder = new MediaRecorder();
|
||||
mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
|
||||
mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
|
||||
mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
|
||||
|
||||
// 设置输出文件路径
|
||||
String fileName = "recording_" + System.currentTimeMillis() + ".m4a";
|
||||
outputFile = new File(getFilesDir(), fileName);
|
||||
mediaRecorder.setOutputFile(outputFile.getAbsolutePath());
|
||||
|
||||
// 准备并开始录音
|
||||
mediaRecorder.prepare();
|
||||
mediaRecorder.start();
|
||||
|
||||
// 更新UI
|
||||
startTime = System.currentTimeMillis();
|
||||
handler.post(updateTimeTask);
|
||||
animationView.playAnimation();
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
// 处理异常
|
||||
}
|
||||
}
|
||||
|
||||
private void stopRecording() {
|
||||
// 停止录音并释放MediaRecorder
|
||||
if (mediaRecorder != null) {
|
||||
mediaRecorder.stop();
|
||||
mediaRecorder.release();
|
||||
mediaRecorder = null;
|
||||
}
|
||||
|
||||
// 更新UI
|
||||
handler.removeCallbacks(updateTimeTask);
|
||||
animationView.cancelAnimation();
|
||||
animationView.setFrame(0);
|
||||
timeTextView.setText("00:00:00");
|
||||
|
||||
Intent intent = new Intent(NewRecordActivity.this, SaveRecordActivity.class);
|
||||
intent.putExtra("audioFilePath", outputFile.getAbsolutePath());
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
private String formatTime(long elapsedTime) {
|
||||
int seconds = (int) (elapsedTime / 1000) % 60;
|
||||
int minutes = (int) ((elapsedTime / (1000 * 60)) % 60);
|
||||
int hours = (int) ((elapsedTime / (1000 * 60 * 60)) % 24);
|
||||
return String.format("%02d:%02d:%02d", hours, minutes, seconds);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
handler.removeCallbacks(updateTimeTask);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,326 @@
|
||||
package com.sound.prankparty.SecondFragment;
|
||||
|
||||
import static android.app.Activity.RESULT_OK;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.database.Cursor;
|
||||
import android.media.MediaMetadataRetriever;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.MediaStore;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.ItemTouchHelper;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||
import com.sound.prankparty.FirstFragment.PlaySoundActivity;
|
||||
import com.sound.prankparty.R;
|
||||
import com.sound.prankparty.Room.AppDatabase;
|
||||
import com.sound.prankparty.Room.FavoriteSoundsDao;
|
||||
import com.sound.prankparty.Room.SaveSounds;
|
||||
import com.sound.prankparty.Room.SaveSoundsDao;
|
||||
import com.sound.prankparty.Utils.MyItemTouchHelperCallback;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
public class RadioFragment extends Fragment {
|
||||
|
||||
private RecyclerView recyclerView;
|
||||
private RadioRecyclerViewAdapter radioRecyclerViewAdapter;
|
||||
private ImageView add;
|
||||
private ImageView backgroundTitle;
|
||||
private SaveSoundsDao saveSoundsDao;
|
||||
private MyItemTouchHelperCallback myItemTouchHelperCallback;
|
||||
private ItemTouchHelper itemTouchHelper;
|
||||
private Uri audioUri;
|
||||
private String fileName;
|
||||
private AppDatabase appDatabase;
|
||||
private FavoriteSoundsDao favoriteSoundsDao;
|
||||
private List<SaveSounds> saveSoundsList;
|
||||
private static final int REQUEST_CODE_READ_MEDIA_AUDIO = 1001;
|
||||
private static final int REQUEST_CODE_PICK_AUDIO = 1002;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
// 初始化视图
|
||||
View view = inflater.inflate(R.layout.fragment_radio, container, false);
|
||||
|
||||
// 初始化数据库
|
||||
appDatabase = AppDatabase.getDatabase(requireContext());
|
||||
saveSoundsDao = appDatabase.saveSoundsDao();
|
||||
favoriteSoundsDao = appDatabase.favoriteSoundsDao();
|
||||
|
||||
// 初始化视图组件
|
||||
add = view.findViewById(R.id.fragment_radio_add);
|
||||
backgroundTitle = view.findViewById(R.id.empty_radio_image);
|
||||
recyclerView = view.findViewById(R.id.radio_recyclerview);
|
||||
|
||||
// 设置RecyclerView的布局管理器
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(getContext(), 1));
|
||||
|
||||
// 初始化适配器
|
||||
radioRecyclerViewAdapter = new RadioRecyclerViewAdapter(requireContext(), this, favoriteSoundsDao);
|
||||
recyclerView.setAdapter(radioRecyclerViewAdapter);
|
||||
|
||||
// 初始化 MyItemTouchHelperCallback
|
||||
myItemTouchHelperCallback = new MyItemTouchHelperCallback();
|
||||
itemTouchHelper = new ItemTouchHelper(myItemTouchHelperCallback);
|
||||
itemTouchHelper.attachToRecyclerView(recyclerView);
|
||||
|
||||
// itemTouchHelper.setSwipeEnabled(false);
|
||||
|
||||
|
||||
// 设置添加按钮的点击事件
|
||||
add.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
showCustomBottomSheetDialog();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
recyclerView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
playSound();
|
||||
}
|
||||
});
|
||||
|
||||
// 刷新数据
|
||||
refreshData();
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
refreshData();
|
||||
}
|
||||
|
||||
// 显示自定义底部弹窗
|
||||
private void showCustomBottomSheetDialog() {
|
||||
BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(requireContext());
|
||||
View dialogView = LayoutInflater.from(requireContext()).inflate(R.layout.bottom_sheet_dialog, null);
|
||||
|
||||
bottomSheetDialog.setCanceledOnTouchOutside(false);
|
||||
|
||||
// 设置选项1的点击事件
|
||||
dialogView.findViewById(R.id.option1).setOnClickListener(v -> {
|
||||
// 处理选项 1
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
openAudioPicker();
|
||||
} else {
|
||||
if (ContextCompat.checkSelfPermission(requireContext(), Manifest.permission.READ_EXTERNAL_STORAGE)
|
||||
!= PackageManager.PERMISSION_GRANTED) {
|
||||
ActivityCompat.requestPermissions(requireActivity(),
|
||||
new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
|
||||
REQUEST_CODE_READ_MEDIA_AUDIO);
|
||||
} else {
|
||||
openAudioPicker();
|
||||
}
|
||||
}
|
||||
// 销毁BottomSheetDialog对象
|
||||
bottomSheetDialog.dismiss();
|
||||
});
|
||||
|
||||
// 设置选项2的点击事件
|
||||
dialogView.findViewById(R.id.option2).setOnClickListener(v -> {
|
||||
// 处理选项 2
|
||||
Intent intent = new Intent(getActivity(), NewRecordActivity.class);
|
||||
startActivity(intent);
|
||||
bottomSheetDialog.dismiss();
|
||||
});
|
||||
|
||||
// 设置取消按钮的点击事件
|
||||
dialogView.findViewById(R.id.cancel_button).setOnClickListener(v -> {
|
||||
// 处理取消按钮
|
||||
bottomSheetDialog.dismiss();
|
||||
});
|
||||
|
||||
bottomSheetDialog.setContentView(dialogView);
|
||||
bottomSheetDialog.show();
|
||||
}
|
||||
|
||||
// 处理权限请求结果
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
if (requestCode == REQUEST_CODE_READ_MEDIA_AUDIO) {
|
||||
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||
openAudioPicker();
|
||||
} else {
|
||||
Toast.makeText(requireContext(), "Permission denied", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 打开音频选择器
|
||||
private void openAudioPicker() {
|
||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
intent.setType("audio/*");
|
||||
startActivityForResult(intent, REQUEST_CODE_PICK_AUDIO);
|
||||
}
|
||||
|
||||
// 处理Activity结果
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == REQUEST_CODE_PICK_AUDIO && resultCode == RESULT_OK) {
|
||||
if (data != null) {
|
||||
audioUri = data.getData();
|
||||
assert audioUri != null;
|
||||
fileName = getFileName(audioUri);
|
||||
long duration = 0;
|
||||
try {
|
||||
duration = getAudioDuration(audioUri);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
String[] currentDateTime = getCurrentDateTime();
|
||||
|
||||
long finalDuration = duration;
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
saveSoundsDao.insertSound(new SaveSounds(fileName, audioUri.toString(), currentDateTime[0], currentDateTime[1], formatDuration(finalDuration)));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
// 在主线程中显示错误信息
|
||||
requireActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast.makeText(requireContext(), "插入数据库失败: " + e.getMessage(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void playSound(){
|
||||
|
||||
// SoundItem soundItem = new SoundItem(audioUri.toString(),"https://resource-sg-public.lux-ad.com/prank/7f35214ab21c8edb7afd193442126aca.png","Baby Sneeze 1");
|
||||
|
||||
String ine = "un";
|
||||
Log.d("dskod",ine);
|
||||
Intent intent = new Intent(requireActivity(), PlaySoundActivity.class);
|
||||
// intent.putExtra("1234", soundItem);
|
||||
requireActivity().startActivity(intent);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 获取文件名
|
||||
private String getFileName(Uri uri) {
|
||||
String result = null;
|
||||
if (Objects.equals(uri.getScheme(), "content")) {
|
||||
try (Cursor cursor = requireActivity().getContentResolver().query(uri, null, null, null, null)) {
|
||||
if (cursor != null && cursor.moveToFirst()) {
|
||||
int displayNameIndex = cursor.getColumnIndex(MediaStore.MediaColumns.DISPLAY_NAME);
|
||||
if (displayNameIndex != -1) {
|
||||
result = cursor.getString(displayNameIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (result == null) {
|
||||
result = uri.getPath();
|
||||
assert result != null;
|
||||
int cut = result.lastIndexOf('/');
|
||||
if (cut != -1) {
|
||||
result = result.substring(cut + 1);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// 获取音频时长
|
||||
private long getAudioDuration(Uri uri) throws IOException {
|
||||
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
|
||||
retriever.setDataSource(requireContext(), uri);
|
||||
String duration = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION);
|
||||
retriever.release();
|
||||
return duration != null ? Long.parseLong(duration) : 0;
|
||||
}
|
||||
|
||||
// 格式化时长
|
||||
private String formatDuration(long duration) {
|
||||
long minutes = (duration / 1000) / 60;
|
||||
long seconds = (duration / 1000) % 60;
|
||||
return String.format(Locale.getDefault(), "%d:%02d", minutes, seconds);
|
||||
}
|
||||
|
||||
// 获取当前日期和时间
|
||||
public static String[] getCurrentDateTime() {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault());
|
||||
SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss", Locale.getDefault());
|
||||
Date now = new Date();
|
||||
String currentDate = dateFormat.format(now);
|
||||
String currentTime = timeFormat.format(now);
|
||||
return new String[]{currentDate, currentTime};
|
||||
}
|
||||
|
||||
// 刷新数据
|
||||
public void refreshData() {
|
||||
new Thread(() -> {
|
||||
saveSoundsList = saveSoundsDao.getAllSounds();
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
ConstraintLayout.LayoutParams layoutParams = (ConstraintLayout.LayoutParams) add.getLayoutParams();
|
||||
if (saveSoundsList.isEmpty()) {
|
||||
recyclerView.setVisibility(View.GONE);
|
||||
backgroundTitle.setVisibility(View.VISIBLE);
|
||||
|
||||
// 清除与底部对齐的约束
|
||||
layoutParams.topToBottom = ConstraintLayout.LayoutParams.UNSET;
|
||||
layoutParams.bottomToTop = ConstraintLayout.LayoutParams.UNSET;
|
||||
|
||||
// 将add移动到屏幕中央
|
||||
layoutParams.topToTop = ConstraintLayout.LayoutParams.PARENT_ID;
|
||||
layoutParams.bottomToBottom = ConstraintLayout.LayoutParams.PARENT_ID;
|
||||
layoutParams.startToStart = ConstraintLayout.LayoutParams.PARENT_ID;
|
||||
layoutParams.endToEnd = ConstraintLayout.LayoutParams.PARENT_ID;
|
||||
} else {
|
||||
recyclerView.setVisibility(View.VISIBLE);
|
||||
backgroundTitle.setVisibility(View.GONE);
|
||||
|
||||
// 清除与中央对齐的约束
|
||||
layoutParams.topToTop = ConstraintLayout.LayoutParams.UNSET;
|
||||
layoutParams.bottomToTop = ConstraintLayout.LayoutParams.UNSET;
|
||||
|
||||
// 将add移动到屏幕底部
|
||||
layoutParams.topToBottom = R.id.radio_recyclerview;
|
||||
layoutParams.bottomToBottom = ConstraintLayout.LayoutParams.PARENT_ID;
|
||||
layoutParams.startToStart = ConstraintLayout.LayoutParams.PARENT_ID;
|
||||
layoutParams.endToEnd = ConstraintLayout.LayoutParams.PARENT_ID;
|
||||
}
|
||||
|
||||
add.setLayoutParams(layoutParams);
|
||||
radioRecyclerViewAdapter.updateData(saveSoundsList);
|
||||
});
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,110 @@
|
||||
package com.sound.prankparty.SecondFragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.sound.prankparty.R;
|
||||
import com.sound.prankparty.Room.FavoriteSounds;
|
||||
import com.sound.prankparty.Room.FavoriteSoundsDao;
|
||||
import com.sound.prankparty.Room.SaveSounds;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
public class RadioRecyclerViewAdapter extends RecyclerView.Adapter<RadioRecyclerViewAdapter.RadioViewHolder> {
|
||||
|
||||
private List<SaveSounds> saveSoundsList;
|
||||
private Context context;
|
||||
private Fragment fragment;
|
||||
private FavoriteSoundsDao favoriteSoundsDao;
|
||||
|
||||
public RadioRecyclerViewAdapter(Context context, Fragment fragment, FavoriteSoundsDao favoriteSoundsDao) {
|
||||
this.context = context;
|
||||
this.fragment = fragment;
|
||||
this.favoriteSoundsDao = favoriteSoundsDao;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RadioViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_radio, parent, false);
|
||||
return new RadioViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RadioViewHolder holder, int position) {
|
||||
SaveSounds saveSound = saveSoundsList.get(position);
|
||||
holder.title.setText(saveSound.getName());
|
||||
holder.date.setText(saveSound.getDate());
|
||||
holder.time.setText(saveSound.getTime());
|
||||
holder.duration.setText(saveSound.getDuration());
|
||||
|
||||
Executors.newSingleThreadExecutor().execute(() -> {
|
||||
final boolean[] isFavorite = {checkFavoriteStatus(saveSound)};
|
||||
// 更新 UI 需要在主线程中执行
|
||||
fragment.requireActivity().runOnUiThread(() -> {
|
||||
updateFavoriteIcon(holder, isFavorite[0]);
|
||||
holder.favorite.setOnClickListener(v -> {
|
||||
isFavorite[0] = !isFavorite[0];
|
||||
updateFavoriteIcon(holder, isFavorite[0]);
|
||||
updateDatabase(saveSound, isFavorite[0]);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return saveSoundsList != null ? saveSoundsList.size() : 0;
|
||||
}
|
||||
|
||||
public void updateData(List<SaveSounds> newSaveSoundsList) {
|
||||
this.saveSoundsList = newSaveSoundsList;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
private boolean checkFavoriteStatus(SaveSounds saveSound) {
|
||||
FavoriteSounds favoriteSound = favoriteSoundsDao.getByPath(saveSound.getPath());
|
||||
return favoriteSound != null;
|
||||
}
|
||||
|
||||
private void updateDatabase(SaveSounds saveSound, boolean isFavorite) {
|
||||
Executors.newSingleThreadExecutor().execute(() -> {
|
||||
if (isFavorite) {
|
||||
favoriteSoundsDao.insertSound(new FavoriteSounds(saveSound.getName(), saveSound.getPath(), ""));
|
||||
} else {
|
||||
favoriteSoundsDao.delete(favoriteSoundsDao.getByPath(saveSound.getPath()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void updateFavoriteIcon(RadioViewHolder holder, boolean isFavorite) {
|
||||
holder.favorite.setImageResource(isFavorite ? R.drawable.favorite : R.drawable.unfavorite);
|
||||
}
|
||||
|
||||
static class RadioViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
TextView title;
|
||||
TextView date;
|
||||
TextView time;
|
||||
TextView duration;
|
||||
ImageView favorite;
|
||||
|
||||
public RadioViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
title = itemView.findViewById(R.id.title);
|
||||
date = itemView.findViewById(R.id.date);
|
||||
time = itemView.findViewById(R.id.time);
|
||||
duration = itemView.findViewById(R.id.duration);
|
||||
favorite = itemView.findViewById(R.id.favorite);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,218 @@
|
||||
package com.sound.prankparty.SecondFragment;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.media.MediaPlayer;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.sound.prankparty.Main.MainActivity;
|
||||
import com.sound.prankparty.R;
|
||||
import com.sound.prankparty.Room.AppDatabase;
|
||||
import com.sound.prankparty.Room.SaveSounds;
|
||||
import com.sound.prankparty.Room.SaveSoundsDao;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
public class SaveRecordActivity extends AppCompatActivity {
|
||||
|
||||
private String audioFilePath;
|
||||
private String inputText;
|
||||
private MediaPlayer mediaPlayer;
|
||||
private TextView durationTextView;
|
||||
private String datePart;
|
||||
private String timePart;
|
||||
private ImageView playButton;
|
||||
private EditText editText;
|
||||
private Button saveButton;
|
||||
private boolean isPlaying = false;
|
||||
private AppDatabase appDatabase;
|
||||
private SaveSoundsDao saveSoundsDao;
|
||||
private int duration;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_save_record);
|
||||
|
||||
// 获取传递过来的录音文件路径
|
||||
audioFilePath = getIntent().getStringExtra("audioFilePath");
|
||||
if (audioFilePath == null) {
|
||||
Toast.makeText(this, "音频文件路径无效", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
Log.d("SaveRecordActivity", audioFilePath);
|
||||
|
||||
playButton = findViewById(R.id.save_record_play);
|
||||
durationTextView = findViewById(R.id.save_record_time);
|
||||
editText = findViewById(R.id.save_record_name);
|
||||
saveButton = findViewById(R.id.save_record_save);
|
||||
|
||||
// 初始化数据库和 DAO
|
||||
appDatabase = AppDatabase.getDatabase(this); // 获取数据库实例
|
||||
saveSoundsDao = appDatabase.saveSoundsDao();
|
||||
|
||||
// 设置焦点变化监听器
|
||||
editText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
editText.setCursorVisible(hasFocus);
|
||||
}
|
||||
});
|
||||
|
||||
// 处理全局点击事件
|
||||
findViewById(R.id.main).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v instanceof ViewGroup) {
|
||||
clearFocusFromAllChildren((ViewGroup) v);
|
||||
} else {
|
||||
clearFocus();
|
||||
}
|
||||
// 获取输入文本
|
||||
inputText = editText.getText().toString();
|
||||
Log.d("lux231", "13" + inputText);
|
||||
}
|
||||
});
|
||||
|
||||
// 显示音频文件的时长
|
||||
displayAudioDuration();
|
||||
|
||||
playButton.setOnClickListener(v -> playOrPauseAudio());
|
||||
|
||||
saveButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
inputText = editText.getText().toString();
|
||||
if (inputText == null || inputText.trim().isEmpty()) {
|
||||
Toast.makeText(getApplicationContext(), "名称不能为空", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
formatDateTime();
|
||||
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
saveSoundsDao.insertSound(new SaveSounds(inputText, audioFilePath, datePart, timePart, formatTime(duration)));
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
//FLAG_ACTIVITY_CLEAR_TOP标志来清除栈中的Activity,传递Intent.FLAG_ACTIVITY_SINGLE_TOP
|
||||
Intent intent = new Intent(SaveRecordActivity.this, MainActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void clearFocusFromAllChildren(ViewGroup parent) {
|
||||
for (int i = 0; i < parent.getChildCount(); i++) {
|
||||
View child = parent.getChildAt(i);
|
||||
if (child instanceof ViewGroup) {
|
||||
clearFocusFromAllChildren((ViewGroup) child);
|
||||
} else {
|
||||
child.clearFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void clearFocus() {
|
||||
editText.clearFocus();
|
||||
}
|
||||
|
||||
private void displayAudioDuration() {
|
||||
if (audioFilePath != null) {
|
||||
mediaPlayer = new MediaPlayer();
|
||||
try {
|
||||
mediaPlayer.setDataSource(audioFilePath);
|
||||
mediaPlayer.prepare();
|
||||
|
||||
// 获取音频文件的时长
|
||||
duration = mediaPlayer.getDuration();
|
||||
durationTextView.setText(formatTime(duration));
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
Toast.makeText(this, "无法加载音频", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(this, "音频文件路径无效", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
private void playOrPauseAudio() {
|
||||
if (isPlaying) {
|
||||
mediaPlayer.pause();
|
||||
playButton.setImageResource(R.drawable.playback); // 更新按钮为播放图标
|
||||
isPlaying = false;
|
||||
} else {
|
||||
if (mediaPlayer == null) {
|
||||
mediaPlayer = new MediaPlayer();
|
||||
try {
|
||||
mediaPlayer.setDataSource(audioFilePath);
|
||||
mediaPlayer.prepare();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
Toast.makeText(this, "无法播放音频", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
}
|
||||
mediaPlayer.start();
|
||||
playButton.setImageResource(R.drawable.pause); // 更新按钮为暂停图标
|
||||
isPlaying = true;
|
||||
|
||||
mediaPlayer.setOnCompletionListener(mp -> {
|
||||
Toast.makeText(this, "播放完成", Toast.LENGTH_SHORT).show();
|
||||
playButton.setImageResource(R.drawable.playback); // 恢复播放图标
|
||||
isPlaying = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mediaPlayer != null) {
|
||||
if (isPlaying) {
|
||||
mediaPlayer.stop();
|
||||
}
|
||||
mediaPlayer.release();
|
||||
mediaPlayer = null;
|
||||
}
|
||||
}
|
||||
|
||||
private String formatTime(int duration) {
|
||||
int seconds = (duration / 1000) % 60;
|
||||
int minutes = (duration / (1000 * 60)) % 60;
|
||||
int hours = (duration / (1000 * 60 * 60)) % 24;
|
||||
return String.format("%02d:%02d:%02d", hours, minutes, seconds);
|
||||
}
|
||||
|
||||
private void formatDateTime() {
|
||||
Date currentDate = new Date();
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault());
|
||||
datePart = dateFormat.format(currentDate);
|
||||
SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss", Locale.getDefault());
|
||||
timePart = timeFormat.format(currentDate);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.sound.prankparty.StartUp;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.widget.ProgressBar;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.sound.prankparty.Main.MainActivity;
|
||||
import com.sound.prankparty.R;
|
||||
|
||||
public class SplashActivity extends AppCompatActivity {
|
||||
|
||||
private static final int SPLASH_TIME_OUT = 5000;
|
||||
private ProgressBar progressBar;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_splash);
|
||||
|
||||
// ImageView imageView = findViewById(R.id.splash_image);
|
||||
// Bitmap originalBitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.startup_background);
|
||||
// int targetWidth = imageView.getWidth();
|
||||
// int targetHeight = imageView.getHeight();
|
||||
// Bitmap scaledBitmap = Bitmap.createScaledBitmap(originalBitmap, targetWidth, targetHeight, true);
|
||||
// imageView.setImageBitmap(scaledBitmap);
|
||||
|
||||
|
||||
progressBar = findViewById(R.id.progressBar);
|
||||
|
||||
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Intent intent = new Intent(SplashActivity.this, MainActivity.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
}, SPLASH_TIME_OUT);
|
||||
|
||||
// 进度条进展
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (int i = 0; i <= 100; i++) {
|
||||
final int progress = i;
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
progressBar.setProgress(progress);
|
||||
}
|
||||
});
|
||||
try {
|
||||
Thread.sleep(50);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,82 @@
|
||||
package com.sound.prankparty.ThirdFragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.sound.prankparty.R;
|
||||
import com.sound.prankparty.Room.AppDatabase;
|
||||
import com.sound.prankparty.Room.FavoriteSounds;
|
||||
import com.sound.prankparty.Room.FavoriteSoundsDao;
|
||||
import com.sound.prankparty.Utils.FavoriteSoundsViewModel;
|
||||
import com.sound.prankparty.Utils.ItemDecoration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class FavoriteFragment extends Fragment {
|
||||
|
||||
private AppDatabase appDatabase;
|
||||
private FavoriteSoundsDao favoriteSoundsDao;
|
||||
private List<FavoriteSounds> favoriteSoundsList;
|
||||
private RecyclerView recyclerView;
|
||||
private FavoriteRecyclerViewAdapter favoriteRecyclerViewAdapter;
|
||||
private ImageView tips;
|
||||
private ImageView image;
|
||||
private FavoriteSoundsViewModel viewModel;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_favorite, container, false);
|
||||
|
||||
// 使用 ApplicationContext 来获取 ViewModel
|
||||
viewModel = new ViewModelProvider(this, new ViewModelProvider.AndroidViewModelFactory(getActivity().getApplication())).get(FavoriteSoundsViewModel.class);
|
||||
|
||||
recyclerView = view.findViewById(R.id.favorite_recyclerview);
|
||||
tips = view.findViewById(R.id.fragment_favorite_tips);
|
||||
image = view.findViewById(R.id.fragment_favorite_image);
|
||||
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(getContext(), 3));
|
||||
|
||||
favoriteRecyclerViewAdapter = new FavoriteRecyclerViewAdapter(requireContext(), this);
|
||||
recyclerView.setAdapter(favoriteRecyclerViewAdapter);
|
||||
|
||||
// 为 RecyclerView 添加自定义的间距装饰。
|
||||
ItemDecoration itemDecoration = new ItemDecoration(16, 19, 10);
|
||||
recyclerView.addItemDecoration(itemDecoration);
|
||||
|
||||
appDatabase = AppDatabase.getDatabase(requireContext());
|
||||
favoriteSoundsDao = appDatabase.favoriteSoundsDao();
|
||||
|
||||
// 观察 LiveData 的变化
|
||||
viewModel.getFavoriteSoundsLiveData().observe(getViewLifecycleOwner(), favoriteSoundsList -> {
|
||||
if (favoriteSoundsList == null || favoriteSoundsList.isEmpty()) {
|
||||
recyclerView.setVisibility(View.GONE);
|
||||
tips.setVisibility(View.VISIBLE);
|
||||
image.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
recyclerView.setVisibility(View.VISIBLE);
|
||||
tips.setVisibility(View.GONE);
|
||||
image.setVisibility(View.GONE);
|
||||
}
|
||||
favoriteRecyclerViewAdapter.updateData(favoriteSoundsList);
|
||||
});
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
// 触发数据刷新
|
||||
viewModel.refreshData();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,81 @@
|
||||
package com.sound.prankparty.ThirdFragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.DiffUtil;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
|
||||
import com.sound.prankparty.Application.MainApplication;
|
||||
import com.sound.prankparty.R;
|
||||
import com.sound.prankparty.Room.FavoriteSounds;
|
||||
import com.sound.prankparty.Utils.FavoriteSoundsDiffCallback;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class FavoriteRecyclerViewAdapter extends RecyclerView.Adapter<FavoriteRecyclerViewAdapter.FavoriteRecyclerViewHolder> {
|
||||
|
||||
private List<FavoriteSounds> favoriteSoundsList = new ArrayList<>();
|
||||
private Context context;
|
||||
private Fragment fragment;
|
||||
|
||||
public FavoriteRecyclerViewAdapter(Context context, Fragment fragment) {
|
||||
this.context = context;
|
||||
this.fragment = fragment;
|
||||
}
|
||||
|
||||
public void updateData(List<FavoriteSounds> newFavoriteSoundsList) {
|
||||
DiffUtil.DiffResult diffResult = DiffUtil.calculateDiff(new FavoriteSoundsDiffCallback(favoriteSoundsList, newFavoriteSoundsList));
|
||||
favoriteSoundsList.clear();
|
||||
favoriteSoundsList.addAll(newFavoriteSoundsList);
|
||||
diffResult.dispatchUpdatesTo(this);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public FavoriteRecyclerViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_favorite, parent, false);
|
||||
return new FavoriteRecyclerViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull FavoriteRecyclerViewHolder holder, int position) {
|
||||
FavoriteSounds favoriteSounds = favoriteSoundsList.get(position);
|
||||
holder.textView.setText(favoriteSounds.getName());
|
||||
|
||||
Glide.with(MainApplication.getContext())
|
||||
.asDrawable()
|
||||
.skipMemoryCache(true)
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
.load(favoriteSounds.getImagePath())
|
||||
.transform(new CenterCrop())
|
||||
.into(holder.imageView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return favoriteSoundsList != null ? favoriteSoundsList.size() : 0;
|
||||
}
|
||||
|
||||
static class FavoriteRecyclerViewHolder extends RecyclerView.ViewHolder {
|
||||
ImageView imageView;
|
||||
TextView textView;
|
||||
|
||||
public FavoriteRecyclerViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
imageView = itemView.findViewById(R.id.item_imageview_favorite);
|
||||
textView = itemView.findViewById(R.id.item_imageview_text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,39 @@
|
||||
package com.sound.prankparty.Utils;
|
||||
|
||||
import java.util.List;
|
||||
import androidx.recyclerview.widget.DiffUtil;
|
||||
|
||||
import com.sound.prankparty.Room.FavoriteSounds;
|
||||
|
||||
public class FavoriteSoundsDiffCallback extends DiffUtil.Callback {
|
||||
private final List<FavoriteSounds> oldList;
|
||||
private final List<FavoriteSounds> newList;
|
||||
|
||||
public FavoriteSoundsDiffCallback(List<FavoriteSounds> oldList, List<FavoriteSounds> newList) {
|
||||
this.oldList = oldList;
|
||||
this.newList = newList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOldListSize() {
|
||||
return oldList.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNewListSize() {
|
||||
return newList.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) {
|
||||
// 比较条目的唯一标识符,例如 ID
|
||||
return oldList.get(oldItemPosition).getPath() == newList.get(newItemPosition).getPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) {
|
||||
// 比较条目的内容是否相同
|
||||
return oldList.get(oldItemPosition).equals(newList.get(newItemPosition));
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
package com.sound.prankparty.Utils;
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.AndroidViewModel;
|
||||
import androidx.lifecycle.LiveData;
|
||||
|
||||
import com.sound.prankparty.Room.AppDatabase;
|
||||
import com.sound.prankparty.Room.FavoriteSounds;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class FavoriteSoundsViewModel extends AndroidViewModel {
|
||||
|
||||
private LiveData<List<FavoriteSounds>> favoriteSoundsLiveData;
|
||||
private AppDatabase appDatabase;
|
||||
|
||||
public FavoriteSoundsViewModel(@NonNull Application application) {
|
||||
super(application);
|
||||
appDatabase = AppDatabase.getDatabase(application);
|
||||
favoriteSoundsLiveData = appDatabase.favoriteSoundsDao().getAllSoundsLiveData();
|
||||
}
|
||||
|
||||
public LiveData<List<FavoriteSounds>> getFavoriteSoundsLiveData() {
|
||||
return favoriteSoundsLiveData;
|
||||
}
|
||||
|
||||
public void refreshData() {
|
||||
// 这里不需要做任何事情,因为 LiveData 会自动更新
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,98 @@
|
||||
package com.sound.prankparty.Utils;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
|
||||
|
||||
import com.sound.prankparty.Application.MainApplication;
|
||||
|
||||
|
||||
// ItemDecoration 是一个自定义的 RecyclerView.ItemDecoration 类,用于在 RecyclerView 中为每个子项设置间距。
|
||||
public class ItemDecoration extends RecyclerView.ItemDecoration {
|
||||
|
||||
// 垂直间距 (vertical spacing)、水平间距 (horizontal spacing) 和额外间距 (extra spacing):这里设置的是第一个的左边距,其它item根据剩余的距离均匀显示。
|
||||
private int v, h, ex;
|
||||
|
||||
// 构造函数,传入 dp 值的垂直、水平和额外间距,并将它们转换为像素值。
|
||||
public ItemDecoration(int v, int h, int ex) {
|
||||
// 将 dp 值转换为像素值并四舍五入
|
||||
this.v = Math.round(dpToPx(v));
|
||||
this.h = Math.round(dpToPx(h));
|
||||
this.ex = Math.round(dpToPx(ex));
|
||||
}
|
||||
|
||||
// 重写 getItemOffsets 方法,用于为每个子项设置偏移量(间距)。
|
||||
@Override
|
||||
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
|
||||
super.getItemOffsets(outRect, view, parent, state);
|
||||
|
||||
// 定义网格的列数(spanCount)、子项所占的列数(spanSize)以及子项在网格中的索引(spanIndex)
|
||||
int spanCount = 1; // 列数默认为 1
|
||||
int spanSize = 1; // 子项所占列数默认为 1
|
||||
int spanIndex = 0; // 子项在网格中的索引默认为 0
|
||||
|
||||
// 获取子项在 Adapter 中的位置
|
||||
int childAdapterPosition = parent.getChildAdapterPosition(view);
|
||||
// 获取 RecyclerView 的布局管理器
|
||||
RecyclerView.LayoutManager layoutManager = parent.getLayoutManager();
|
||||
|
||||
// 如果布局管理器是 StaggeredGridLayoutManager(交错网格布局管理器)
|
||||
if (layoutManager instanceof StaggeredGridLayoutManager) {
|
||||
StaggeredGridLayoutManager staggeredGridLayoutManager = (StaggeredGridLayoutManager) layoutManager;
|
||||
StaggeredGridLayoutManager.LayoutParams layoutParams = (StaggeredGridLayoutManager.LayoutParams) view.getLayoutParams();
|
||||
spanCount = staggeredGridLayoutManager.getSpanCount(); // 获取列数
|
||||
// 如果子项占据整行(isFullSpan),将 spanSize 设置为列数
|
||||
if (layoutParams.isFullSpan()) {
|
||||
spanSize = spanCount;
|
||||
}
|
||||
spanIndex = layoutParams.getSpanIndex(); // 获取子项的索引
|
||||
|
||||
// 如果布局管理器是 GridLayoutManager(网格布局管理器)
|
||||
} else if (layoutManager instanceof GridLayoutManager) {
|
||||
GridLayoutManager gridLayoutManager = (GridLayoutManager) layoutManager;
|
||||
GridLayoutManager.LayoutParams layoutParams = (GridLayoutManager.LayoutParams) view.getLayoutParams();
|
||||
spanCount = gridLayoutManager.getSpanCount(); // 获取列数
|
||||
spanSize = gridLayoutManager.getSpanSizeLookup().getSpanSize(childAdapterPosition); // 获取子项占据的列数
|
||||
spanIndex = layoutParams.getSpanIndex(); // 获取子项的索引
|
||||
|
||||
// 如果布局管理器是 LinearLayoutManager(线性布局管理器)
|
||||
} else if (layoutManager instanceof LinearLayoutManager) {
|
||||
// 设置子项的左、右和底部的间距
|
||||
outRect.left = v;
|
||||
outRect.right = v;
|
||||
outRect.bottom = h;
|
||||
}
|
||||
|
||||
// 如果子项占据整行(spanSize == spanCount),设置左、右和底部的间距
|
||||
if (spanSize == spanCount) {
|
||||
outRect.left = v + ex;
|
||||
outRect.right = v + ex;
|
||||
outRect.bottom = h;
|
||||
|
||||
// 如果子项不占据整行,根据网格布局计算左右间距
|
||||
} else {
|
||||
// 计算每个子项的总间距(包括额外间距)
|
||||
int itemAllSpacing = (v * (spanCount + 1) + ex * 2) / spanCount;
|
||||
// 计算子项的左边距
|
||||
int left = v * (spanIndex + 1) - itemAllSpacing * spanIndex + ex;
|
||||
// 计算子项的右边距
|
||||
int right = itemAllSpacing - left;
|
||||
outRect.left = left;
|
||||
outRect.right = right;
|
||||
outRect.bottom = h;
|
||||
}
|
||||
}
|
||||
|
||||
// 将 dp 值转换为像素值的方法
|
||||
public static float dpToPx(float dpValue) {
|
||||
// 获取当前设备的屏幕密度(dpi)
|
||||
float density = MainApplication.getContext().getResources().getDisplayMetrics().density;
|
||||
// 通过公式 density * dp + 0.5f 将 dp 转换为像素,并返回结果
|
||||
return density * dpValue + 0.5f;
|
||||
}
|
||||
}
|
||||
49
app/src/main/java/com/sound/prankparty/Utils/JsonParser.java
Normal file
@ -0,0 +1,49 @@
|
||||
package com.sound.prankparty.Utils;
|
||||
|
||||
import com.sound.prankparty.JSON.Category;
|
||||
import com.sound.prankparty.JSON.SoundItem;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class JsonParser {
|
||||
|
||||
public static List<Category> parseJson(String jsonString) {
|
||||
List<Category> categories = new ArrayList<>();
|
||||
|
||||
try {
|
||||
//字符串转换为数组
|
||||
JSONArray jsonArray = new JSONArray(jsonString);
|
||||
//遍历数组里的每一个元素
|
||||
for (int i = 0; i < jsonArray.length(); i++) {
|
||||
//获取String字段的值
|
||||
JSONObject categoryObject = jsonArray.getJSONObject(i);
|
||||
String categoryId = categoryObject.getString("categoryId");
|
||||
String categoryName = categoryObject.getString("categoryName");
|
||||
String categoryUrl = categoryObject.getString("categoryUrl");
|
||||
|
||||
JSONArray listArray = categoryObject.getJSONArray("list");
|
||||
List<SoundItem> soundItemList = new ArrayList<>();
|
||||
|
||||
for (int j = 0; j < listArray.length(); j++) {
|
||||
JSONObject soundObject = listArray.getJSONObject(j);
|
||||
String mp3Url = soundObject.getString("mp3Url");
|
||||
String preUrl = soundObject.getString("preUrl");
|
||||
String title = soundObject.getString("title");
|
||||
//创建ImageItem对象并添加到imageList中
|
||||
soundItemList.add(new SoundItem(mp3Url, preUrl,title));
|
||||
}
|
||||
//创建Category对象并添加到categories列表中
|
||||
categories.add(new Category(categoryId,categoryName,categoryUrl, soundItemList));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return categories;
|
||||
}
|
||||
|
||||
}
|
||||
29
app/src/main/java/com/sound/prankparty/Utils/LoadJSON.java
Normal file
@ -0,0 +1,29 @@
|
||||
package com.sound.prankparty.Utils;
|
||||
|
||||
import com.sound.prankparty.Application.MainApplication;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
public class LoadJSON {
|
||||
|
||||
public static String loadJSONFromAsset(String fileName) {
|
||||
StringBuilder jsonString = new StringBuilder();
|
||||
try {
|
||||
//读取filename文件,转换为字符流
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(MainApplication.getContext().getAssets().open(fileName)));
|
||||
String line;
|
||||
//逐行读取文件内容,直到文件末尾
|
||||
while ((line = reader.readLine()) != null) {
|
||||
jsonString.append(line);
|
||||
}
|
||||
//关闭读取器,释放资源
|
||||
reader.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//对象转换为字符串并返回
|
||||
return jsonString.toString();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package com.sound.prankparty.Utils;
|
||||
|
||||
import android.graphics.Canvas;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.recyclerview.widget.ItemTouchHelper;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
public class MyItemTouchHelperCallback extends ItemTouchHelper.SimpleCallback {
|
||||
|
||||
private float maxDistance; // 最大滑动距离
|
||||
private boolean isMaxSwiped = false; // 是否达到最大距离
|
||||
private RecyclerView.ViewHolder swipedViewHolder; // 被滑动的ViewHolder
|
||||
|
||||
public MyItemTouchHelperCallback() {
|
||||
super(0, ItemTouchHelper.LEFT); // 只允许左滑
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
|
||||
return false; // 不处理移动事件
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
|
||||
// 当滑动项被完全滑出时,可以在这里处理
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder,
|
||||
float dX, float dY, int actionState, boolean isCurrentlyActive) {
|
||||
// 限制最大滑动距离
|
||||
maxDistance = recyclerView.getWidth() * 0.5f; // 最大滑动为RecyclerView宽度的50%
|
||||
if (dX < -maxDistance) {
|
||||
dX = -maxDistance;
|
||||
isMaxSwiped = true;
|
||||
swipedViewHolder = viewHolder;
|
||||
} else {
|
||||
isMaxSwiped = false;
|
||||
}
|
||||
super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getSwipeThreshold(RecyclerView.ViewHolder viewHolder) {
|
||||
// 阻止自动滑出,始终返回1.0f
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
// 复原滑动项的方法
|
||||
public void restoreSwipedItem() {
|
||||
if (swipedViewHolder != null) {
|
||||
View itemView = swipedViewHolder.itemView;
|
||||
itemView.animate().translationX(0).setDuration(200).start();
|
||||
swipedViewHolder = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
30
app/src/main/res/drawable-v24/ic_launcher_foreground.xml
Normal file
@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
19
app/src/main/res/drawable/add_background.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="327dp"
|
||||
android:height="50dp"
|
||||
android:viewportWidth="327"
|
||||
android:viewportHeight="50"
|
||||
>
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M16 0H311C319.837 0 327 7.16344 327 16V34C327 42.8366 319.837 50 311 50H16C7.16344 50 0 42.8366 0 34V16C0 7.16344 7.16344 0 16 0Z"
|
||||
/>
|
||||
<path
|
||||
android:pathData="M0 0V50H327V0"
|
||||
android:fillColor="#505BC8"
|
||||
/>
|
||||
</group>
|
||||
</vector>
|
||||
18
app/src/main/res/drawable/add_sound.xml
Normal file
10
app/src/main/res/drawable/black_back.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="32dp"
|
||||
android:height="32dp"
|
||||
android:viewportWidth="32"
|
||||
android:viewportHeight="32">
|
||||
<path
|
||||
android:pathData="M6.44,15.19C6.159,15.471 6.001,15.852 6.001,16.25C6.001,16.647 6.159,17.028 6.44,17.31L12.94,23.81C13.224,24.075 13.601,24.219 13.989,24.212C14.378,24.205 14.749,24.048 15.023,23.773C15.298,23.498 15.456,23.127 15.462,22.739C15.469,22.35 15.325,21.974 15.06,21.69L9.62,16.25L15.06,10.81C15.325,10.525 15.469,10.149 15.462,9.761C15.456,9.372 15.298,9.001 15.023,8.726C14.749,8.452 14.378,8.294 13.989,8.287C13.601,8.28 13.224,8.425 12.94,8.69L6.44,15.19ZM22.94,8.69L16.44,15.19C16.159,15.471 16.001,15.852 16.001,16.25C16.001,16.647 16.159,17.028 16.44,17.31L22.94,23.81C23.077,23.957 23.243,24.075 23.427,24.157C23.611,24.239 23.81,24.283 24.011,24.287C24.212,24.29 24.413,24.253 24.599,24.178C24.786,24.103 24.956,23.99 25.098,23.848C25.241,23.705 25.353,23.536 25.428,23.349C25.504,23.162 25.541,22.962 25.537,22.761C25.534,22.559 25.49,22.361 25.408,22.177C25.326,21.993 25.208,21.827 25.06,21.69L19.62,16.25L25.06,10.81C25.325,10.525 25.469,10.149 25.462,9.761C25.456,9.372 25.298,9.001 25.023,8.726C24.749,8.452 24.378,8.294 23.989,8.287C23.601,8.28 23.225,8.425 22.94,8.69Z"
|
||||
android:fillColor="#181B3A"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
||||
12
app/src/main/res/drawable/cancel.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="21dp"
|
||||
android:height="20dp"
|
||||
android:viewportWidth="21"
|
||||
android:viewportHeight="20">
|
||||
<path
|
||||
android:pathData="M15.215,14.714L10.501,10M10.501,10L5.787,5.286M10.501,10L15.215,5.286M10.501,10L5.787,14.714"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#CECECE"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/empty_radio.xml
Normal file
9
app/src/main/res/drawable/favorite.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="26dp"
|
||||
android:height="26dp"
|
||||
android:viewportWidth="26"
|
||||
android:viewportHeight="26">
|
||||
<path
|
||||
android:pathData="M13,23.129L11.429,21.699C5.85,16.64 2.167,13.303 2.167,9.208C2.167,5.872 4.788,3.25 8.125,3.25C10.01,3.25 11.819,4.128 13,5.514C14.181,4.128 15.99,3.25 17.875,3.25C21.212,3.25 23.833,5.872 23.833,9.208C23.833,13.303 20.15,16.64 14.571,21.71L13,23.129Z"
|
||||
android:fillColor="#DF272A"/>
|
||||
</vector>
|
||||
74
app/src/main/res/drawable/ic_launcher_background.xml
Normal file
@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
android:height="108dp"
|
||||
android:width="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
</vector>
|
||||
@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
android:height="108dp"
|
||||
android:width="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
</vector>
|
||||
27
app/src/main/res/drawable/loop.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M8.5,8H6.5C4.015,8 2,10.015 2,12.5C2,14.985 4.015,17 6.5,17C7.738,17 8.859,16.5 9.673,15.691C10.493,14.876 12,12.5 12,12.5C12,12.5 13.503,10.134 14.316,9.32C15.13,8.505 16.256,8 17.5,8C19.985,8 22,10.015 22,12.5C22,14.985 19.985,17 17.5,17H15.5"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#616161"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M17.5,15L15.5,17L17.5,19"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#616161"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M6.5,6L8.5,8L6.5,10"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#616161"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
||||
18
app/src/main/res/drawable/main_favorite_select.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="103dp"
|
||||
android:height="40dp"
|
||||
android:viewportWidth="103"
|
||||
android:viewportHeight="40">
|
||||
<path
|
||||
android:pathData="M20,0L83,0A20,20 0,0 1,103 20L103,20A20,20 0,0 1,83 40L20,40A20,20 0,0 1,0 20L0,20A20,20 0,0 1,20 0z"
|
||||
android:fillColor="#181B3A"/>
|
||||
<path
|
||||
android:pathData="M20,4L20,4A16,16 0,0 1,36 20L36,20A16,16 0,0 1,20 36L20,36A16,16 0,0 1,4 20L4,20A16,16 0,0 1,20 4z"
|
||||
android:fillColor="#ffffff"/>
|
||||
<path
|
||||
android:pathData="M14.19,24.85H27.73C28.28,24.85 28.73,24.4 28.73,23.85V11.27C28.73,10.2 27.86,9.33 26.79,9.33H14.18C13.01,9.33 11.27,10.11 11.27,12.24V25.82C11.27,27.95 13.01,28.73 14.18,28.73H27.76C28.29,28.73 28.73,28.29 28.73,27.76C28.73,27.22 28.29,26.79 27.76,26.79H14.19C13.75,26.77 13.21,26.6 13.21,25.82C13.21,25.72 13.22,25.63 13.24,25.55C13.34,24.99 13.8,24.86 14.19,24.85ZM16.75,14.8C17.15,14.4 17.7,14.18 18.26,14.18C18.83,14.18 19.38,14.4 19.78,14.8C19.9,14.92 20.09,14.92 20.21,14.8C20.62,14.4 21.16,14.18 21.73,14.18C22.3,14.18 22.84,14.4 23.24,14.8C23.45,15 23.6,15.23 23.71,15.48C23.82,15.74 23.88,16.01 23.88,16.29C23.88,16.57 23.82,16.84 23.71,17.1C23.6,17.36 23.45,17.59 23.24,17.78L20.7,20.28C20.31,20.66 19.69,20.66 19.3,20.28L16.75,17.78C16.55,17.59 16.39,17.36 16.28,17.1C16.17,16.84 16.12,16.57 16.12,16.29C16.12,16.01 16.17,15.74 16.28,15.48C16.39,15.23 16.55,15 16.75,14.8Z"
|
||||
android:fillColor="#181B3A"/>
|
||||
<path
|
||||
android:pathData="M44.96,24.5V15.77H50.37V16.91H46.28V19.57H49.98V20.69H46.28V24.5H44.96ZM53.77,24.64C53.35,24.64 52.98,24.57 52.64,24.41C52.31,24.26 52.04,24.03 51.85,23.74C51.65,23.44 51.56,23.08 51.56,22.65C51.56,22.28 51.63,21.98 51.77,21.74C51.91,21.5 52.1,21.31 52.35,21.17C52.59,21.03 52.86,20.93 53.16,20.86C53.45,20.79 53.76,20.73 54.07,20.69C54.46,20.65 54.78,20.61 55.02,20.58C55.27,20.55 55.44,20.5 55.55,20.43C55.67,20.37 55.72,20.26 55.72,20.1V20.07C55.72,19.7 55.62,19.41 55.41,19.21C55.2,19 54.89,18.9 54.48,18.9C54.05,18.9 53.71,19 53.46,19.19C53.22,19.37 53.05,19.58 52.96,19.81L51.76,19.54C51.9,19.14 52.11,18.82 52.38,18.58C52.66,18.33 52.97,18.15 53.33,18.04C53.69,17.93 54.06,17.87 54.46,17.87C54.72,17.87 55,17.9 55.29,17.96C55.59,18.02 55.86,18.13 56.12,18.3C56.38,18.46 56.59,18.69 56.75,18.99C56.92,19.29 57,19.68 57,20.15V24.5H55.76V23.61H55.7C55.62,23.77 55.5,23.93 55.33,24.09C55.17,24.25 54.96,24.38 54.7,24.49C54.44,24.59 54.13,24.64 53.77,24.64ZM54.05,23.62C54.4,23.62 54.7,23.55 54.95,23.41C55.2,23.27 55.39,23.09 55.52,22.87C55.66,22.64 55.73,22.4 55.73,22.14V21.3C55.68,21.34 55.59,21.38 55.46,21.42C55.33,21.46 55.19,21.49 55.02,21.52C54.86,21.55 54.7,21.57 54.54,21.59C54.38,21.61 54.25,21.63 54.15,21.64C53.9,21.68 53.68,21.73 53.47,21.8C53.27,21.88 53.11,21.98 52.99,22.12C52.87,22.26 52.81,22.44 52.81,22.67C52.81,22.98 52.92,23.22 53.16,23.38C53.39,23.54 53.69,23.62 54.05,23.62ZM64.06,17.95L61.69,24.5H60.32L57.95,17.95H59.31L60.97,22.99H61.04L62.69,17.95H64.06ZM67.79,24.63C67.18,24.63 66.64,24.49 66.19,24.21C65.73,23.93 65.37,23.54 65.12,23.03C64.87,22.52 64.74,21.93 64.74,21.26C64.74,20.58 64.87,19.98 65.12,19.48C65.37,18.97 65.73,18.57 66.19,18.29C66.64,18.01 67.18,17.87 67.79,17.87C68.41,17.87 68.94,18.01 69.4,18.29C69.86,18.57 70.21,18.97 70.47,19.48C70.72,19.98 70.84,20.58 70.84,21.26C70.84,21.93 70.72,22.52 70.47,23.03C70.21,23.54 69.86,23.93 69.4,24.21C68.94,24.49 68.41,24.63 67.79,24.63ZM67.8,23.56C68.2,23.56 68.52,23.46 68.79,23.25C69.05,23.04 69.24,22.76 69.37,22.41C69.49,22.06 69.56,21.67 69.56,21.25C69.56,20.84 69.49,20.45 69.37,20.1C69.24,19.75 69.05,19.47 68.79,19.25C68.52,19.04 68.2,18.93 67.8,18.93C67.4,18.93 67.06,19.04 66.8,19.25C66.54,19.47 66.34,19.75 66.22,20.1C66.09,20.45 66.03,20.84 66.03,21.25C66.03,21.67 66.09,22.06 66.22,22.41C66.34,22.76 66.54,23.04 66.8,23.25C67.06,23.46 67.4,23.56 67.8,23.56ZM72.27,24.5V17.95H73.5V18.99H73.57C73.69,18.64 73.9,18.37 74.2,18.16C74.5,17.96 74.84,17.86 75.23,17.86C75.31,17.86 75.4,17.86 75.51,17.87C75.62,17.87 75.71,17.88 75.77,17.89V19.11C75.72,19.09 75.63,19.08 75.5,19.06C75.37,19.04 75.24,19.03 75.1,19.03C74.8,19.03 74.54,19.09 74.3,19.22C74.07,19.35 73.88,19.52 73.75,19.74C73.61,19.97 73.54,20.22 73.54,20.5V24.5H72.27ZM76.87,24.5V17.95H78.15V24.5H76.87ZM77.52,16.94C77.29,16.94 77.1,16.87 76.94,16.72C76.79,16.57 76.71,16.39 76.71,16.19C76.71,15.98 76.79,15.8 76.94,15.65C77.1,15.5 77.29,15.42 77.52,15.42C77.74,15.42 77.93,15.5 78.08,15.65C78.24,15.8 78.32,15.98 78.32,16.19C78.32,16.39 78.24,16.57 78.08,16.72C77.93,16.87 77.74,16.94 77.52,16.94ZM82.92,17.95V18.98H79.34V17.95H82.92ZM80.3,16.39H81.57V22.58C81.57,22.83 81.61,23.01 81.68,23.14C81.76,23.26 81.85,23.34 81.97,23.39C82.09,23.43 82.22,23.45 82.36,23.45C82.46,23.45 82.55,23.44 82.63,23.43C82.7,23.42 82.76,23.4 82.81,23.4L83.04,24.45C82.96,24.48 82.86,24.51 82.72,24.53C82.58,24.57 82.41,24.58 82.21,24.59C81.87,24.59 81.56,24.53 81.27,24.41C80.98,24.28 80.75,24.09 80.57,23.83C80.39,23.57 80.3,23.24 80.3,22.84V16.39ZM87.08,24.63C86.43,24.63 85.88,24.49 85.41,24.22C84.95,23.94 84.59,23.55 84.34,23.05C84.09,22.54 83.96,21.95 83.96,21.27C83.96,20.6 84.09,20.01 84.34,19.5C84.59,18.99 84.94,18.59 85.39,18.3C85.85,18.01 86.38,17.87 86.99,17.87C87.36,17.87 87.71,17.93 88.06,18.05C88.41,18.17 88.72,18.37 88.99,18.63C89.27,18.89 89.49,19.23 89.65,19.65C89.8,20.06 89.88,20.57 89.88,21.16V21.61H84.68V20.66H88.64C88.64,20.32 88.57,20.02 88.43,19.77C88.29,19.5 88.1,19.3 87.86,19.15C87.61,19 87.32,18.92 87,18.92C86.64,18.92 86.32,19.01 86.06,19.19C85.79,19.36 85.59,19.59 85.44,19.87C85.3,20.15 85.23,20.45 85.23,20.78V21.52C85.23,21.96 85.31,22.33 85.46,22.64C85.62,22.94 85.83,23.18 86.11,23.34C86.39,23.5 86.72,23.58 87.09,23.58C87.33,23.58 87.55,23.55 87.75,23.48C87.95,23.41 88.12,23.3 88.26,23.16C88.41,23.02 88.52,22.85 88.6,22.65L89.8,22.86C89.71,23.22 89.53,23.53 89.28,23.8C89.04,24.06 88.73,24.27 88.35,24.41C87.98,24.56 87.55,24.63 87.08,24.63Z"
|
||||
android:fillColor="#ffffff"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/main_favorite_unselect.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="30dp"
|
||||
android:height="30dp"
|
||||
android:viewportWidth="30"
|
||||
android:viewportHeight="30">
|
||||
<path
|
||||
android:pathData="M7.742,21.062H24.909C25.461,21.062 25.909,20.614 25.909,20.062V4.092C25.909,2.755 24.822,1.668 23.485,1.668H7.727C6.265,1.668 4.091,2.636 4.091,5.304V22.274C4.091,24.942 6.265,25.91 7.727,25.91H24.909C25.461,25.91 25.909,25.463 25.909,24.91V24.486C25.909,23.934 25.461,23.486 24.909,23.486H7.742C7.182,23.472 6.515,23.251 6.515,22.274C6.515,22.152 6.526,22.042 6.544,21.943C6.68,21.245 7.252,21.074 7.742,21.062ZM10.937,8.507C11.441,8.009 12.122,7.729 12.831,7.729C13.54,7.729 14.22,8.009 14.725,8.507C14.875,8.654 15.116,8.654 15.267,8.507C15.771,8.009 16.452,7.729 17.161,7.729C17.87,7.729 18.551,8.009 19.056,8.507C19.306,8.748 19.505,9.036 19.641,9.356C19.777,9.676 19.847,10.019 19.847,10.367C19.847,10.714 19.777,11.058 19.641,11.377C19.505,11.697 19.306,11.986 19.056,12.227L15.698,15.525C15.309,15.907 14.686,15.907 14.297,15.525L10.938,12.227C10.688,11.986 10.488,11.697 10.352,11.378C10.216,11.058 10.145,10.714 10.145,10.367C10.145,10.02 10.215,9.676 10.351,9.356C10.487,9.036 10.686,8.748 10.937,8.507Z"
|
||||
android:fillColor="#CECECE"/>
|
||||
</vector>
|
||||
29
app/src/main/res/drawable/main_radio_select.xml
Normal file
@ -0,0 +1,29 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="93dp"
|
||||
android:height="40dp"
|
||||
android:viewportWidth="93"
|
||||
android:viewportHeight="40">
|
||||
<path
|
||||
android:pathData="M20,0L73,0A20,20 0,0 1,93 20L93,20A20,20 0,0 1,73 40L20,40A20,20 0,0 1,0 20L0,20A20,20 0,0 1,20 0z"
|
||||
android:fillColor="#181B3A"/>
|
||||
<path
|
||||
android:pathData="M20,4L20,4A16,16 0,0 1,36 20L36,20A16,16 0,0 1,20 36L20,36A16,16 0,0 1,4 20L4,20A16,16 0,0 1,20 4z"
|
||||
android:fillColor="#ffffff"/>
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M8.364,8.363h23.273v23.273h-23.273z"/>
|
||||
<path
|
||||
android:pathData="M12,12.514C10.527,12.514 9.333,13.708 9.333,15.18V25.847C9.333,27.32 10.527,28.514 12,28.514H28C29.473,28.514 30.667,27.32 30.667,25.847V15.18C30.667,13.708 29.473,12.514 28,12.514H12ZM24.363,23.105C25.809,23.105 26.982,21.932 26.982,20.486C26.982,19.041 25.809,17.868 24.363,17.868C22.917,17.868 21.745,19.041 21.745,20.486C21.745,21.932 22.917,23.105 24.363,23.105ZM24.363,24.85C26.773,24.85 28.727,22.896 28.727,20.486C28.727,18.076 26.773,16.123 24.363,16.123C21.953,16.123 20,18.076 20,20.486C20,22.896 21.953,24.85 24.363,24.85ZM11.37,17.093C11.37,16.611 11.76,16.22 12.242,16.22H18.06C18.542,16.22 18.933,16.611 18.933,17.093C18.933,17.574 18.542,17.965 18.06,17.965H12.242C11.76,17.965 11.37,17.574 11.37,17.093ZM12.242,20.099C11.76,20.099 11.37,20.489 11.37,20.971C11.37,21.453 11.76,21.844 12.242,21.844H18.06C18.542,21.844 18.933,21.453 18.933,20.971C18.933,20.489 18.542,20.099 18.06,20.099H12.242ZM11.37,24.85C11.37,24.368 11.76,23.977 12.242,23.977H18.06C18.542,23.977 18.933,24.368 18.933,24.85C18.933,25.332 18.542,25.723 18.06,25.723H12.242C11.76,25.723 11.37,25.332 11.37,24.85Z"
|
||||
android:fillColor="#181B3A"
|
||||
android:fillType="evenOdd"/>
|
||||
<path
|
||||
android:pathData="M27.758,14.182L19.641,9.579"
|
||||
android:strokeWidth="1.93939"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#181B3A"
|
||||
android:strokeLineCap="round"/>
|
||||
</group>
|
||||
<path
|
||||
android:pathData="M44.959,24.5V15.773H48.07C48.746,15.773 49.307,15.889 49.753,16.122C50.202,16.355 50.537,16.678 50.758,17.09C50.98,17.499 51.091,17.972 51.091,18.508C51.091,19.043 50.979,19.513 50.754,19.919C50.533,20.322 50.197,20.636 49.749,20.861C49.303,21.085 48.742,21.197 48.065,21.197H45.709V20.064H47.946C48.372,20.064 48.719,20.003 48.986,19.881C49.256,19.758 49.453,19.581 49.578,19.348C49.703,19.115 49.766,18.835 49.766,18.508C49.766,18.179 49.702,17.893 49.574,17.652C49.449,17.41 49.251,17.226 48.981,17.098C48.715,16.967 48.364,16.902 47.929,16.902H46.276V24.5H44.959ZM49.267,20.563L51.423,24.5H49.923L47.81,20.563H49.267ZM54.496,24.645C54.081,24.645 53.706,24.568 53.371,24.415C53.035,24.258 52.77,24.033 52.574,23.737C52.381,23.442 52.284,23.08 52.284,22.651C52.284,22.281 52.355,21.977 52.497,21.739C52.639,21.5 52.831,21.311 53.072,21.172C53.314,21.033 53.584,20.928 53.882,20.857C54.18,20.785 54.484,20.732 54.794,20.695C55.186,20.649 55.504,20.612 55.749,20.584C55.993,20.553 56.171,20.503 56.281,20.435C56.392,20.367 56.447,20.256 56.447,20.102V20.072C56.447,19.7 56.342,19.412 56.132,19.207C55.925,19.003 55.615,18.901 55.203,18.901C54.774,18.901 54.436,18.996 54.189,19.186C53.945,19.374 53.776,19.582 53.682,19.813L52.484,19.54C52.626,19.142 52.834,18.821 53.106,18.577C53.382,18.33 53.699,18.151 54.057,18.04C54.415,17.926 54.791,17.869 55.186,17.869C55.447,17.869 55.724,17.901 56.017,17.963C56.313,18.023 56.588,18.133 56.844,18.295C57.102,18.457 57.314,18.689 57.479,18.99C57.644,19.288 57.726,19.676 57.726,20.153V24.5H56.481V23.605H56.43C56.348,23.77 56.224,23.932 56.06,24.091C55.895,24.25 55.683,24.382 55.425,24.487C55.166,24.592 54.856,24.645 54.496,24.645ZM54.773,23.622C55.125,23.622 55.426,23.553 55.676,23.413C55.929,23.274 56.121,23.092 56.251,22.868C56.385,22.641 56.452,22.398 56.452,22.139V21.295C56.406,21.341 56.318,21.383 56.188,21.423C56.06,21.46 55.913,21.493 55.749,21.521C55.584,21.547 55.423,21.571 55.267,21.594C55.111,21.614 54.98,21.631 54.875,21.645C54.628,21.676 54.402,21.729 54.197,21.803C53.996,21.876 53.834,21.983 53.712,22.122C53.592,22.258 53.533,22.44 53.533,22.668C53.533,22.983 53.649,23.222 53.882,23.383C54.115,23.543 54.412,23.622 54.773,23.622ZM61.873,24.628C61.345,24.628 60.873,24.493 60.458,24.223C60.047,23.95 59.723,23.563 59.487,23.06C59.254,22.554 59.137,21.947 59.137,21.24C59.137,20.533 59.255,19.928 59.491,19.425C59.73,18.922 60.056,18.537 60.471,18.27C60.886,18.003 61.356,17.869 61.882,17.869C62.288,17.869 62.615,17.938 62.862,18.074C63.112,18.207 63.305,18.364 63.441,18.543C63.581,18.722 63.689,18.879 63.765,19.016H63.842V15.773H65.116V24.5H63.872V23.482H63.765C63.689,23.621 63.578,23.78 63.433,23.959C63.291,24.138 63.095,24.294 62.845,24.428C62.595,24.561 62.271,24.628 61.873,24.628ZM62.154,23.541C62.521,23.541 62.831,23.445 63.083,23.251C63.339,23.055 63.532,22.784 63.663,22.438C63.797,22.091 63.863,21.688 63.863,21.227C63.863,20.773 63.798,20.375 63.667,20.034C63.537,19.693 63.345,19.428 63.092,19.237C62.839,19.047 62.527,18.952 62.154,18.952C61.771,18.952 61.451,19.051 61.196,19.25C60.94,19.449 60.747,19.72 60.616,20.064C60.488,20.408 60.424,20.795 60.424,21.227C60.424,21.665 60.49,22.058 60.62,22.408C60.751,22.757 60.944,23.034 61.2,23.239C61.458,23.44 61.777,23.541 62.154,23.541ZM66.935,24.5V17.955H68.209V24.5H66.935ZM67.578,16.945C67.356,16.945 67.166,16.871 67.007,16.723C66.851,16.572 66.773,16.393 66.773,16.186C66.773,15.976 66.851,15.797 67.007,15.649C67.166,15.499 67.356,15.423 67.578,15.423C67.8,15.423 67.989,15.499 68.145,15.649C68.304,15.797 68.383,15.976 68.383,16.186C68.383,16.393 68.304,16.572 68.145,16.723C67.989,16.871 67.8,16.945 67.578,16.945ZM72.68,24.632C72.066,24.632 71.531,24.492 71.074,24.21C70.616,23.929 70.261,23.535 70.008,23.03C69.755,22.524 69.629,21.933 69.629,21.257C69.629,20.578 69.755,19.984 70.008,19.476C70.261,18.967 70.616,18.572 71.074,18.291C71.531,18.01 72.066,17.869 72.68,17.869C73.294,17.869 73.829,18.01 74.287,18.291C74.744,18.572 75.099,18.967 75.352,19.476C75.605,19.984 75.731,20.578 75.731,21.257C75.731,21.933 75.605,22.524 75.352,23.03C75.099,23.535 74.744,23.929 74.287,24.21C73.829,24.492 73.294,24.632 72.68,24.632ZM72.684,23.563C73.082,23.563 73.412,23.457 73.673,23.247C73.934,23.037 74.128,22.757 74.253,22.408C74.38,22.058 74.444,21.673 74.444,21.253C74.444,20.835 74.38,20.452 74.253,20.102C74.128,19.75 73.934,19.467 73.673,19.254C73.412,19.041 73.082,18.935 72.684,18.935C72.284,18.935 71.951,19.041 71.687,19.254C71.426,19.467 71.231,19.75 71.103,20.102C70.978,20.452 70.916,20.835 70.916,21.253C70.916,21.673 70.978,22.058 71.103,22.408C71.231,22.757 71.426,23.037 71.687,23.247C71.951,23.457 72.284,23.563 72.684,23.563Z"
|
||||
android:fillColor="#ffffff"/>
|
||||
</vector>
|
||||
38
app/src/main/res/drawable/main_radio_unselect.xml
Normal file
@ -0,0 +1,38 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="28dp"
|
||||
android:height="26dp"
|
||||
android:viewportWidth="28"
|
||||
android:viewportHeight="26">
|
||||
<path
|
||||
android:pathData="M4,5.641L24,5.641A3.333,3.333 0,0 1,27.334 8.974L27.334,22.307A3.333,3.333 0,0 1,24 25.641L4,25.641A3.333,3.333 0,0 1,0.667 22.307L0.667,8.974A3.333,3.333 0,0 1,4 5.641z"
|
||||
android:fillColor="#CECECE"/>
|
||||
<path
|
||||
android:pathData="M19.455,15.607m-4.364,0a4.364,4.364 0,1 1,8.727 0a4.364,4.364 0,1 1,-8.727 0"
|
||||
android:strokeWidth="2.18182"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ffffff"/>
|
||||
<path
|
||||
android:pathData="M4.304,11.363H11.576"
|
||||
android:strokeWidth="2.18182"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ffffff"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M4.304,16.213H11.576"
|
||||
android:strokeWidth="2.18182"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ffffff"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M4.304,21.06H11.576"
|
||||
android:strokeWidth="2.18182"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ffffff"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M23.697,7.729L13.551,1.975"
|
||||
android:strokeWidth="2.42424"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#CECECE"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
||||
18
app/src/main/res/drawable/main_sound_select.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="93dp"
|
||||
android:height="40dp"
|
||||
android:viewportWidth="93"
|
||||
android:viewportHeight="40">
|
||||
<path
|
||||
android:pathData="M20,0L73,0A20,20 0,0 1,93 20L93,20A20,20 0,0 1,73 40L20,40A20,20 0,0 1,0 20L0,20A20,20 0,0 1,20 0z"
|
||||
android:fillColor="#181B3A"/>
|
||||
<path
|
||||
android:pathData="M20,4L20,4A16,16 0,0 1,36 20L36,20A16,16 0,0 1,20 36L20,36A16,16 0,0 1,4 20L4,20A16,16 0,0 1,20 4z"
|
||||
android:fillColor="#ffffff"/>
|
||||
<path
|
||||
android:pathData="M9.753,16.634C9.753,16.267 9.884,15.956 10.145,15.701C10.406,15.447 10.721,15.32 11.088,15.32H12.424V21.276H11.088C10.721,21.276 10.406,21.148 10.145,20.894C9.884,20.64 9.753,20.329 9.753,19.962V16.634ZM24.589,11.166C25.197,10.587 25.748,10.269 26.242,10.212C26.737,10.156 27.175,10.286 27.556,10.604C27.938,10.922 28.263,11.388 28.531,12.003C28.8,12.618 29.019,13.303 29.188,14.059C29.358,14.815 29.485,15.606 29.57,16.433C29.655,17.259 29.697,18.047 29.697,18.796C29.697,19.545 29.644,20.294 29.538,21.042C29.432,21.791 29.277,22.494 29.072,23.151C28.867,23.808 28.627,24.384 28.351,24.879C28.076,25.373 27.768,25.741 27.429,25.981C27.09,26.221 26.726,26.306 26.338,26.235C25.949,26.164 25.543,25.889 25.119,25.409C24.709,24.928 24.155,24.529 23.455,24.211C22.756,23.893 21.993,23.625 21.166,23.406C20.34,23.187 19.503,23.01 18.655,22.876C17.807,22.742 17.03,22.622 16.323,22.515C15.617,22.41 15.027,22.307 14.554,22.208C14.08,22.109 13.815,21.989 13.759,21.848V15.214C13.815,15.016 14.038,14.854 14.426,14.726C14.815,14.599 15.309,14.479 15.91,14.366C16.51,14.253 17.189,14.13 17.945,13.995C18.701,13.861 19.471,13.677 20.255,13.444C21.039,13.211 21.806,12.914 22.555,12.554C23.303,12.194 23.982,11.731 24.589,11.166ZM16.959,24.158C17.03,24.328 17.115,24.511 17.213,24.709C17.298,24.893 17.411,25.105 17.552,25.345C17.694,25.585 17.863,25.847 18.061,26.129C18.301,26.468 18.545,26.825 18.792,27.199C19.04,27.574 19.227,27.913 19.354,28.217C19.481,28.521 19.52,28.771 19.471,28.969C19.421,29.167 19.22,29.266 18.867,29.266H17.659C17.376,29.266 17.115,29.213 16.874,29.107C16.634,29.001 16.404,28.838 16.185,28.619C15.967,28.4 15.74,28.122 15.507,27.782C15.274,27.443 15.023,27.041 14.755,26.574C14.43,26.037 14.204,25.567 14.077,25.165C13.95,24.762 13.865,24.427 13.822,24.158C13.766,23.847 13.766,23.579 13.822,23.353C13.935,23.367 14.07,23.395 14.225,23.438C14.352,23.466 14.508,23.501 14.691,23.543C14.875,23.586 15.087,23.628 15.327,23.671C15.567,23.727 15.783,23.78 15.974,23.83C16.164,23.879 16.337,23.932 16.493,23.989C16.662,24.045 16.818,24.102 16.959,24.158Z"
|
||||
android:fillColor="#181B3A"/>
|
||||
<path
|
||||
android:pathData="M49.719,18.065C49.673,17.662 49.486,17.349 49.156,17.128C48.827,16.903 48.412,16.791 47.912,16.791C47.554,16.791 47.244,16.848 46.983,16.962C46.722,17.072 46.519,17.226 46.374,17.422C46.231,17.615 46.16,17.835 46.16,18.082C46.16,18.29 46.209,18.469 46.305,18.619C46.405,18.77 46.534,18.896 46.693,18.999C46.855,19.098 47.028,19.182 47.213,19.25C47.398,19.315 47.575,19.369 47.746,19.412L48.598,19.633C48.876,19.702 49.162,19.794 49.454,19.91C49.747,20.027 50.019,20.18 50.269,20.371C50.519,20.561 50.72,20.797 50.874,21.078C51.03,21.359 51.108,21.696 51.108,22.088C51.108,22.582 50.98,23.021 50.724,23.405C50.472,23.788 50.104,24.091 49.621,24.313C49.141,24.534 48.56,24.645 47.878,24.645C47.224,24.645 46.659,24.541 46.182,24.334C45.704,24.126 45.331,23.832 45.061,23.452C44.791,23.068 44.642,22.614 44.614,22.088H45.935C45.96,22.403 46.063,22.666 46.242,22.876C46.423,23.084 46.655,23.239 46.936,23.341C47.22,23.44 47.531,23.49 47.869,23.49C48.242,23.49 48.572,23.432 48.862,23.315C49.155,23.196 49.385,23.031 49.553,22.821C49.72,22.608 49.804,22.359 49.804,22.075C49.804,21.817 49.73,21.605 49.582,21.44C49.438,21.276 49.24,21.139 48.99,21.031C48.743,20.923 48.463,20.828 48.151,20.746L47.119,20.465C46.421,20.274 45.867,19.994 45.457,19.625C45.051,19.256 44.848,18.767 44.848,18.159C44.848,17.656 44.984,17.217 45.257,16.842C45.53,16.467 45.899,16.176 46.365,15.969C46.831,15.759 47.356,15.653 47.942,15.653C48.533,15.653 49.054,15.757 49.506,15.965C49.96,16.172 50.318,16.457 50.579,16.821C50.841,17.182 50.977,17.597 50.989,18.065H49.719ZM55.336,24.632C54.723,24.632 54.187,24.492 53.73,24.21C53.272,23.929 52.917,23.535 52.664,23.03C52.412,22.524 52.285,21.933 52.285,21.257C52.285,20.578 52.412,19.984 52.664,19.476C52.917,18.967 53.272,18.572 53.73,18.291C54.187,18.01 54.723,17.869 55.336,17.869C55.95,17.869 56.485,18.01 56.943,18.291C57.4,18.572 57.755,18.967 58.008,19.476C58.261,19.984 58.387,20.578 58.387,21.257C58.387,21.933 58.261,22.524 58.008,23.03C57.755,23.535 57.4,23.929 56.943,24.21C56.485,24.492 55.95,24.632 55.336,24.632ZM55.341,23.563C55.738,23.563 56.068,23.457 56.329,23.247C56.591,23.037 56.784,22.757 56.909,22.408C57.037,22.058 57.1,21.673 57.1,21.253C57.1,20.835 57.037,20.452 56.909,20.102C56.784,19.75 56.591,19.467 56.329,19.254C56.068,19.041 55.738,18.935 55.341,18.935C54.94,18.935 54.608,19.041 54.343,19.254C54.082,19.467 53.887,19.75 53.76,20.102C53.635,20.452 53.572,20.835 53.572,21.253C53.572,21.673 53.635,22.058 53.76,22.408C53.887,22.757 54.082,23.037 54.343,23.247C54.608,23.457 54.94,23.563 55.341,23.563ZM63.956,21.785V17.955H65.234V24.5H63.981V23.367H63.913C63.763,23.716 63.521,24.007 63.189,24.24C62.859,24.47 62.449,24.585 61.957,24.585C61.537,24.585 61.165,24.493 60.841,24.308C60.52,24.121 60.267,23.844 60.082,23.477C59.901,23.111 59.81,22.658 59.81,22.118V17.955H61.084V21.965C61.084,22.41 61.207,22.766 61.454,23.03C61.702,23.294 62.023,23.426 62.418,23.426C62.656,23.426 62.894,23.367 63.129,23.247C63.368,23.128 63.565,22.947 63.722,22.706C63.881,22.465 63.959,22.158 63.956,21.785ZM68.22,20.614V24.5H66.946V17.955H68.169V19.02H68.25C68.401,18.673 68.637,18.395 68.958,18.185C69.282,17.974 69.689,17.869 70.181,17.869C70.627,17.869 71.017,17.963 71.353,18.151C71.688,18.335 71.948,18.611 72.132,18.977C72.317,19.344 72.409,19.797 72.409,20.337V24.5H71.135V20.49C71.135,20.016 71.012,19.645 70.765,19.378C70.517,19.108 70.178,18.973 69.746,18.973C69.451,18.973 69.188,19.037 68.958,19.165C68.73,19.293 68.55,19.48 68.416,19.727C68.286,19.972 68.22,20.267 68.22,20.614ZM76.568,24.628C76.04,24.628 75.568,24.493 75.154,24.223C74.742,23.95 74.418,23.563 74.182,23.06C73.949,22.554 73.833,21.947 73.833,21.24C73.833,20.533 73.951,19.928 74.186,19.425C74.425,18.922 74.752,18.537 75.166,18.27C75.581,18.003 76.051,17.869 76.577,17.869C76.983,17.869 77.31,17.938 77.557,18.074C77.807,18.207 78,18.364 78.137,18.543C78.276,18.722 78.384,18.879 78.461,19.016H78.537V15.773H79.811V24.5H78.567V23.482H78.461C78.384,23.621 78.273,23.78 78.128,23.959C77.986,24.138 77.79,24.294 77.54,24.428C77.29,24.561 76.966,24.628 76.568,24.628ZM76.85,23.541C77.216,23.541 77.526,23.445 77.779,23.251C78.034,23.055 78.228,22.784 78.358,22.438C78.492,22.091 78.559,21.688 78.559,21.227C78.559,20.773 78.493,20.375 78.363,20.034C78.232,19.693 78.04,19.428 77.787,19.237C77.534,19.047 77.222,18.952 76.85,18.952C76.466,18.952 76.147,19.051 75.891,19.25C75.635,19.449 75.442,19.72 75.311,20.064C75.184,20.408 75.12,20.795 75.12,21.227C75.12,21.665 75.185,22.058 75.316,22.408C75.446,22.757 75.64,23.034 75.895,23.239C76.154,23.44 76.472,23.541 76.85,23.541Z"
|
||||
android:fillColor="#ffffff"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/main_sound_unselect.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="30dp"
|
||||
android:height="30dp"
|
||||
android:viewportWidth="30"
|
||||
android:viewportHeight="30">
|
||||
<path
|
||||
android:pathData="M2.191,10.793C2.191,10.334 2.354,9.946 2.681,9.628C3.008,9.31 3.401,9.151 3.86,9.151H5.529V16.596H3.86C3.401,16.596 3.008,16.437 2.681,16.119C2.354,15.801 2.191,15.412 2.191,14.953V10.793ZM20.736,3.958C21.496,3.234 22.184,2.837 22.803,2.766C23.421,2.695 23.968,2.859 24.445,3.256C24.922,3.654 25.328,4.236 25.664,5.005C26,5.773 26.273,6.63 26.485,7.575C26.697,8.519 26.856,9.509 26.962,10.542C27.068,11.575 27.121,12.56 27.121,13.496C27.121,14.432 27.055,15.368 26.922,16.304C26.79,17.24 26.596,18.119 26.34,18.94C26.083,19.761 25.783,20.481 25.439,21.099C25.094,21.718 24.71,22.177 24.286,22.477C23.862,22.777 23.408,22.883 22.922,22.795C22.436,22.707 21.928,22.362 21.399,21.762C20.886,21.161 20.193,20.662 19.319,20.265C18.444,19.867 17.491,19.532 16.458,19.258C15.424,18.984 14.378,18.764 13.318,18.596C12.258,18.428 11.287,18.278 10.404,18.145C9.521,18.013 8.783,17.885 8.192,17.761C7.6,17.638 7.269,17.487 7.198,17.311V9.018C7.269,8.771 7.547,8.568 8.033,8.409C8.518,8.25 9.137,8.1 9.887,7.959C10.638,7.817 11.486,7.663 12.431,7.495C13.375,7.327 14.338,7.098 15.318,6.806C16.299,6.515 17.257,6.144 18.193,5.694C19.129,5.243 19.977,4.665 20.736,3.958ZM11.199,20.199C11.287,20.41 11.393,20.64 11.517,20.887C11.623,21.117 11.764,21.382 11.94,21.682C12.117,21.982 12.329,22.309 12.576,22.662C12.877,23.086 13.181,23.532 13.49,24C13.799,24.468 14.033,24.892 14.192,25.272C14.351,25.652 14.4,25.965 14.338,26.212C14.276,26.46 14.025,26.583 13.583,26.583H12.073C11.72,26.583 11.393,26.517 11.093,26.385C10.792,26.252 10.505,26.049 10.232,25.775C9.958,25.502 9.675,25.153 9.384,24.729C9.092,24.305 8.779,23.802 8.443,23.219C8.037,22.548 7.754,21.96 7.596,21.457C7.437,20.954 7.331,20.534 7.278,20.199C7.207,19.81 7.207,19.474 7.278,19.192C7.419,19.209 7.587,19.245 7.781,19.298C7.94,19.333 8.134,19.377 8.364,19.43C8.593,19.483 8.858,19.536 9.159,19.589C9.459,19.66 9.728,19.726 9.967,19.788C10.205,19.85 10.422,19.916 10.616,19.987C10.828,20.057 11.022,20.128 11.199,20.199Z"
|
||||
android:fillColor="#CECECE"/>
|
||||
</vector>
|
||||
18
app/src/main/res/drawable/max_sound.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M16.5,11.25H24V12.75H16.5V11.25ZM13.5,22.5C13.401,22.5 13.303,22.48 13.211,22.442C13.12,22.404 13.037,22.348 12.967,22.277L7.249,16.5H2.25C2.051,16.5 1.861,16.421 1.72,16.281C1.579,16.14 1.5,15.949 1.5,15.751V8.25C1.5,8.051 1.579,7.86 1.719,7.72C1.86,7.579 2.05,7.5 2.249,7.5H7.249L12.967,1.723C13.071,1.617 13.205,1.545 13.351,1.515C13.496,1.485 13.648,1.5 13.785,1.556C13.923,1.613 14.04,1.709 14.123,1.832C14.206,1.956 14.25,2.101 14.25,2.25V21.75C14.25,21.949 14.171,22.139 14.03,22.28C13.89,22.421 13.699,22.5 13.5,22.5Z"
|
||||
android:fillColor="#505BC8"/>
|
||||
<path
|
||||
android:pathData="M24,11.25H16.5V12.75H24V11.25Z"
|
||||
android:fillColor="#505BC8"/>
|
||||
<path
|
||||
android:pathData="M24,11.25H16.5V12.75H24V11.25Z"
|
||||
android:fillColor="#505BC8"/>
|
||||
<path
|
||||
android:pathData="M20.981,8l-0,8l-1.5,0l-0,-8z"
|
||||
android:fillColor="#505BC8"/>
|
||||
</vector>
|
||||
12
app/src/main/res/drawable/microphone.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="40dp"
|
||||
android:height="40dp"
|
||||
android:viewportWidth="40"
|
||||
android:viewportHeight="40">
|
||||
<path
|
||||
android:pathData="M20,2.084C18.741,2.084 17.495,2.332 16.332,2.814C15.17,3.295 14.113,4.001 13.223,4.892C12.333,5.782 11.628,6.838 11.146,8.001C10.665,9.164 10.417,10.41 10.417,11.669V18.334C10.417,20.875 11.427,23.313 13.224,25.11C15.021,26.907 17.458,27.917 20,27.917C22.541,27.917 24.979,26.907 26.776,25.11C28.573,23.313 29.583,20.875 29.583,18.334V11.669C29.583,10.41 29.335,9.164 28.854,8.001C28.372,6.838 27.667,5.782 26.777,4.892C25.887,4.001 24.83,3.295 23.668,2.814C22.505,2.332 21.259,2.084 20,2.084Z"
|
||||
android:fillColor="#181B3A"/>
|
||||
<path
|
||||
android:pathData="M8.657,18.684C8.654,18.257 8.482,17.849 8.178,17.549C7.874,17.249 7.464,17.082 7.037,17.084C6.611,17.082 6.2,17.249 5.897,17.549C5.593,17.849 5.421,18.257 5.417,18.684C5.417,26.109 11.087,32.222 18.38,33.019V34.709H15.14C14.928,34.708 14.718,34.748 14.522,34.828C14.325,34.908 14.147,35.026 13.996,35.175C13.845,35.324 13.725,35.501 13.643,35.697C13.561,35.892 13.519,36.102 13.517,36.314C13.517,37.199 14.243,37.914 15.14,37.914H24.862C25.289,37.916 25.699,37.749 26.003,37.449C26.307,37.149 26.479,36.741 26.483,36.314C26.482,36.102 26.439,35.893 26.357,35.697C26.275,35.502 26.155,35.325 26.005,35.176C25.854,35.027 25.676,34.909 25.48,34.829C25.284,34.749 25.074,34.708 24.862,34.709H21.62V33.019C28.913,32.222 34.583,26.109 34.583,18.684C34.579,18.257 34.407,17.849 34.103,17.549C33.799,17.249 33.389,17.082 32.963,17.084C32.536,17.082 32.125,17.249 31.822,17.549C31.518,17.849 31.346,18.257 31.343,18.684C31.343,24.879 26.265,29.902 20,29.902C13.735,29.902 8.657,24.879 8.657,18.684Z"
|
||||
android:fillColor="#181B3A"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/min_sound.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M23.25,9.308L22.193,8.251L19.5,10.943L16.808,8.251L15.75,9.308L18.443,12.001L15.75,14.693L16.808,15.751L19.5,13.058L22.193,15.751L23.25,14.693L20.558,12.001L23.25,9.308ZM13.5,22.501C13.401,22.5 13.303,22.48 13.211,22.442C13.12,22.403 13.037,22.347 12.968,22.276L7.253,16.501H2.25C2.051,16.501 1.861,16.422 1.72,16.281C1.579,16.141 1.5,15.95 1.5,15.751V8.251C1.5,8.052 1.579,7.861 1.72,7.721C1.861,7.58 2.051,7.501 2.25,7.501H7.253L12.968,1.726C13.108,1.586 13.298,1.508 13.496,1.508C13.695,1.508 13.885,1.586 14.025,1.726C14.167,1.864 14.247,2.053 14.25,2.251V21.751C14.25,21.95 14.171,22.141 14.031,22.281C13.89,22.422 13.699,22.501 13.5,22.501Z"
|
||||
android:fillColor="#505BC8"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/pause.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="59dp"
|
||||
android:height="58dp"
|
||||
android:viewportWidth="59"
|
||||
android:viewportHeight="58">
|
||||
<path
|
||||
android:pathData="M17.929,11.285C17.36,11.285 16.815,11.479 16.413,11.823C16.011,12.168 15.786,12.635 15.786,13.122V43.734C15.786,44.748 16.746,45.571 17.929,45.571H22.214C22.783,45.571 23.328,45.377 23.73,45.033C24.131,44.688 24.357,44.221 24.357,43.734V13.122C24.357,12.635 24.131,12.168 23.73,11.823C23.328,11.479 22.783,11.285 22.214,11.285H17.929ZM37.929,11.285C37.36,11.285 36.815,11.479 36.413,11.823C36.012,12.168 35.786,12.635 35.786,13.122V43.734C35.786,44.748 36.746,45.571 37.929,45.571H42.214C42.783,45.571 43.328,45.377 43.73,45.033C44.131,44.688 44.357,44.221 44.357,43.734V13.122C44.357,12.635 44.131,12.168 43.73,11.823C43.328,11.479 42.783,11.285 42.214,11.285H37.929Z"
|
||||
android:fillColor="#ffffff"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/playback.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="59dp"
|
||||
android:height="58dp"
|
||||
android:viewportWidth="59"
|
||||
android:viewportHeight="58">
|
||||
<path
|
||||
android:pathData="M16.214,13.757C16.215,12.797 16.473,11.856 16.962,11.03C17.451,10.204 18.153,9.525 18.994,9.063C19.835,8.601 20.785,8.374 21.744,8.405C22.704,8.436 23.637,8.724 24.446,9.239L48.396,24.478C49.157,24.962 49.783,25.63 50.216,26.42C50.65,27.21 50.877,28.097 50.877,28.998C50.877,29.899 50.65,30.786 50.216,31.576C49.783,32.366 49.157,33.034 48.396,33.518L24.446,48.761C23.636,49.276 22.703,49.564 21.743,49.595C20.784,49.625 19.834,49.398 18.993,48.936C18.151,48.474 17.449,47.794 16.961,46.968C16.472,46.141 16.214,45.199 16.214,44.239V13.757Z"
|
||||
android:fillColor="#ffffff"/>
|
||||
</vector>
|
||||
12
app/src/main/res/drawable/privacy.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="20dp"
|
||||
android:height="20dp"
|
||||
android:viewportWidth="20"
|
||||
android:viewportHeight="20">
|
||||
<path
|
||||
android:pathData="M9.463,1.508L3.463,4.144C3.226,4.248 3.025,4.419 2.883,4.636C2.742,4.852 2.667,5.106 2.667,5.364V9.497C2.667,12.028 3.799,14.289 5.793,15.848L9.231,18.274C9.456,18.433 9.725,18.518 10,18.518C10.275,18.518 10.544,18.433 10.769,18.274L14.181,15.867C16.201,14.289 17.333,12.027 17.333,9.497V5.365C17.333,5.106 17.258,4.853 17.116,4.636C16.975,4.419 16.773,4.248 16.537,4.144L10.536,1.507C10.367,1.433 10.185,1.395 10,1.395C9.815,1.395 9.632,1.433 9.463,1.507V1.508ZM4,5.365L10,2.728L16,5.365V9.497C16,11.612 15.061,13.488 13.385,14.797L10,17.184L6.588,14.778C4.939,13.487 4,11.611 4,9.496V5.365Z"
|
||||
android:fillColor="#444444"/>
|
||||
<path
|
||||
android:pathData="M13.333,7L14.276,7.943L9.943,12.276C9.818,12.401 9.648,12.471 9.472,12.471C9.295,12.471 9.125,12.401 9,12.276L6.333,9.609L7.276,8.667L9.472,10.862L13.333,7Z"
|
||||
android:fillColor="#FFD041"/>
|
||||
</vector>
|
||||
393
app/src/main/res/drawable/record_radio.xml
Normal file
5
app/src/main/res/drawable/round.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#4156C8" /> <!-- 设置圆形的填充颜色 -->
|
||||
<size android:width="60dp" android:height="60dp" /> <!-- 设置圆形的直径 -->
|
||||
<corners android:radius="30dp" /> <!-- 圆角半径设置为宽度或高度的一半,以形成圆形 -->
|
||||
</shape>
|
||||
9
app/src/main/res/drawable/round_create.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 背景部分 -->
|
||||
<item android:left="2dp" android:bottom="2dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#ABABAB" /> <!-- 背景颜色 -->
|
||||
<corners android:radius="16dp" /> <!-- 圆角半径 -->
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
8
app/src/main/res/drawable/round_edit_text.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<!-- rounded_edittext.xml -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#EEF1FF" /> <!-- 设置背景色 -->
|
||||
<corners android:radius="8dp" /> <!-- 设置圆角半径 -->
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/blue" />
|
||||
</shape>
|
||||
33
app/src/main/res/drawable/rounded_border_shadow.xml
Normal file
@ -0,0 +1,33 @@
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 阴影部分 -->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<!-- 阴影颜色,增加不透明度 -->
|
||||
<solid android:color="#181B3A" />
|
||||
<corners android:radius="16dp" />
|
||||
<padding
|
||||
android:left="4dp"
|
||||
android:bottom="4dp"
|
||||
android:right="0dp"
|
||||
android:top="0dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!-- 背景部分 -->
|
||||
<item android:left="2dp" android:bottom="2dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#FFFFFF" /> <!-- 背景颜色 -->
|
||||
<corners android:radius="16dp" /> <!-- 圆角半径 -->
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!-- 边框部分 -->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<stroke
|
||||
android:width="2dp"
|
||||
android:color="#000000" /> <!-- 边框颜色和宽度 -->
|
||||
<corners android:radius="16dp" /> <!-- 圆角半径 -->
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
9
app/src/main/res/drawable/rounded_corners.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#F6F6F6" />
|
||||
<corners
|
||||
android:topLeftRadius="40dp"
|
||||
android:topRightRadius="40dp"
|
||||
android:bottomLeftRadius="40dp"
|
||||
android:bottomRightRadius="40dp" />
|
||||
</shape>
|
||||
9
app/src/main/res/drawable/rounded_rectangle.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners
|
||||
android:bottomLeftRadius="40dp"
|
||||
android:bottomRightRadius="40dp"
|
||||
android:topLeftRadius="0dp"
|
||||
android:topRightRadius="0dp"/>
|
||||
<solid android:color="#181B3A" />
|
||||
</shape>
|
||||
32
app/src/main/res/drawable/seek_bar_color.xml
Normal file
@ -0,0 +1,32 @@
|
||||
<!-- progress_drawable.xml -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<!-- 未完成的背景部分 -->
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<corners android:radius="5dp" />
|
||||
<solid android:color="#D8D8D8" /> <!-- 未完成部分的颜色 -->
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!-- 完成的进度部分 -->
|
||||
<item android:id="@android:id/progress">
|
||||
<clip>
|
||||
<shape>
|
||||
<corners android:radius="5dp" />
|
||||
<solid android:color="#505BC8" /> <!-- 完成部分的颜色 -->
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
|
||||
<!-- 次级进度部分(如缓冲进度) -->
|
||||
<item android:id="@android:id/secondaryProgress">
|
||||
<clip>
|
||||
<shape>
|
||||
<corners android:radius="5dp" />
|
||||
<solid android:color="#A9A9A9" /> <!-- 次级进度的颜色 -->
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
||||
10
app/src/main/res/drawable/setting.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="32dp"
|
||||
android:height="32dp"
|
||||
android:viewportWidth="32"
|
||||
android:viewportHeight="32">
|
||||
<path
|
||||
android:pathData="M14.771,3C13.548,3 12.505,3.884 12.304,5.089L12.067,6.519C12.04,6.679 11.913,6.865 11.671,6.983C11.214,7.202 10.774,7.456 10.356,7.743C10.135,7.896 9.911,7.911 9.756,7.853L8.4,7.344C7.846,7.136 7.236,7.132 6.678,7.332C6.121,7.532 5.653,7.923 5.357,8.436L4.128,10.565C3.832,11.078 3.728,11.679 3.833,12.261C3.939,12.843 4.247,13.369 4.704,13.745L5.824,14.668C5.951,14.772 6.051,14.973 6.029,15.241C5.991,15.747 5.991,16.254 6.029,16.76C6.049,17.027 5.951,17.229 5.825,17.333L4.704,18.256C4.247,18.632 3.939,19.158 3.833,19.74C3.728,20.323 3.832,20.924 4.128,21.436L5.357,23.565C5.653,24.078 6.122,24.469 6.679,24.669C7.236,24.868 7.846,24.864 8.4,24.656L9.759,24.147C9.912,24.089 10.136,24.105 10.359,24.256C10.775,24.541 11.213,24.796 11.672,25.016C11.915,25.133 12.041,25.32 12.068,25.483L12.305,26.911C12.403,27.494 12.704,28.025 13.156,28.407C13.608,28.79 14.18,29 14.772,29H17.231C18.452,29 19.496,28.116 19.697,26.911L19.935,25.481C19.961,25.321 20.087,25.135 20.331,25.016C20.789,24.796 21.228,24.541 21.644,24.256C21.867,24.104 22.091,24.089 22.244,24.147L23.604,24.656C24.158,24.863 24.767,24.867 25.324,24.667C25.881,24.467 26.348,24.076 26.644,23.564L27.875,21.435C28.17,20.922 28.275,20.321 28.17,19.739C28.064,19.157 27.756,18.631 27.299,18.255L26.179,17.332C26.052,17.228 25.952,17.027 25.973,16.759C26.011,16.253 26.011,15.745 25.973,15.24C25.952,14.973 26.052,14.771 26.177,14.667L27.297,13.744C28.241,12.968 28.485,11.624 27.875,10.564L26.645,8.435C26.349,7.922 25.881,7.531 25.324,7.331C24.767,7.132 24.157,7.136 23.603,7.344L22.243,7.853C22.091,7.911 21.867,7.895 21.644,7.743C21.226,7.456 20.787,7.202 20.331,6.983C20.087,6.867 19.961,6.68 19.935,6.519L19.696,5.089C19.599,4.505 19.298,3.975 18.846,3.592C18.394,3.21 17.821,3 17.229,3H14.772H14.771ZM16,21C17.326,21 18.598,20.473 19.535,19.535C20.473,18.598 21,17.326 21,16C21,14.674 20.473,13.402 19.535,12.465C18.598,11.527 17.326,11 16,11C14.674,11 13.402,11.527 12.465,12.465C11.527,13.402 11,14.674 11,16C11,17.326 11.527,18.598 12.465,19.535C13.402,20.473 14.674,21 16,21Z"
|
||||
android:fillColor="#181B3A"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
||||
15
app/src/main/res/drawable/share.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="20dp"
|
||||
android:height="20dp"
|
||||
android:viewportWidth="20"
|
||||
android:viewportHeight="20">
|
||||
<path
|
||||
android:pathData="M12,2C11.204,2 10.441,2.316 9.879,2.879C9.316,3.441 9,4.204 9,5C9,5.796 9.316,6.559 9.879,7.121C10.441,7.684 11.204,8 12,8C12.796,8 13.559,7.684 14.121,7.121C14.684,6.559 15,5.796 15,5C15,4.204 14.684,3.441 14.121,2.879C13.559,2.316 12.796,2 12,2ZM12,3.333C12.219,3.333 12.436,3.376 12.638,3.46C12.84,3.544 13.024,3.667 13.179,3.821C13.333,3.976 13.456,4.16 13.54,4.362C13.624,4.564 13.667,4.781 13.667,5C13.667,5.219 13.624,5.436 13.54,5.638C13.456,5.84 13.333,6.024 13.179,6.179C13.024,6.333 12.84,6.456 12.638,6.54C12.436,6.624 12.219,6.667 12,6.667C11.558,6.667 11.134,6.491 10.821,6.179C10.509,5.866 10.333,5.442 10.333,5C10.333,4.558 10.509,4.134 10.821,3.821C11.134,3.509 11.558,3.333 12,3.333ZM16,12C15.204,12 14.441,12.316 13.879,12.879C13.316,13.441 13,14.204 13,15C13,15.796 13.316,16.559 13.879,17.121C14.441,17.684 15.204,18 16,18C16.796,18 17.559,17.684 18.121,17.121C18.684,16.559 19,15.796 19,15C19,14.204 18.684,13.441 18.121,12.879C17.559,12.316 16.796,12 16,12ZM16,13.333C16.442,13.333 16.866,13.509 17.178,13.821C17.491,14.134 17.667,14.558 17.667,15C17.667,15.442 17.491,15.866 17.178,16.178C16.866,16.491 16.442,16.667 16,16.667C15.558,16.667 15.134,16.491 14.821,16.178C14.509,15.866 14.333,15.442 14.333,15C14.333,14.558 14.509,14.134 14.821,13.821C15.134,13.509 15.558,13.333 16,13.333Z"
|
||||
android:fillColor="#444444"/>
|
||||
<path
|
||||
android:pathData="M9.881,6.176C10.007,6.059 10.174,5.995 10.346,5.998C10.518,6.001 10.682,6.071 10.804,6.192C10.926,6.313 10.996,6.477 11,6.649C11.005,6.821 10.942,6.988 10.826,7.115L10.786,7.156L6.452,11.156C6.326,11.273 6.16,11.336 5.988,11.333C5.816,11.33 5.651,11.261 5.529,11.14C5.407,11.018 5.337,10.854 5.333,10.682C5.329,10.511 5.391,10.344 5.507,10.217L5.548,10.176L9.881,6.176ZM6.353,13.171C6.394,13.007 6.495,12.866 6.636,12.774C6.777,12.682 6.947,12.647 7.113,12.675L7.162,12.685L13.828,14.352C13.996,14.393 14.142,14.498 14.234,14.645C14.326,14.791 14.358,14.968 14.322,15.137C14.286,15.306 14.186,15.455 14.043,15.552C13.899,15.649 13.724,15.686 13.554,15.656L13.505,15.646L6.838,13.979C6.753,13.958 6.673,13.92 6.603,13.868C6.533,13.816 6.473,13.751 6.428,13.675C6.383,13.6 6.353,13.517 6.341,13.431C6.328,13.344 6.332,13.256 6.353,13.171Z"
|
||||
android:fillColor="#444444"/>
|
||||
<path
|
||||
android:pathData="M4.667,9.666C3.871,9.666 3.108,9.982 2.545,10.545C1.983,11.107 1.666,11.87 1.666,12.666C1.666,13.462 1.983,14.225 2.545,14.787C3.108,15.35 3.871,15.666 4.667,15.666C5.462,15.666 6.225,15.35 6.788,14.787C7.35,14.225 7.667,13.462 7.667,12.666C7.667,11.87 7.35,11.107 6.788,10.545C6.225,9.982 5.462,9.666 4.667,9.666ZM4.667,10.999C5.109,10.999 5.532,11.175 5.845,11.488C6.158,11.8 6.333,12.224 6.333,12.666C6.333,13.108 6.158,13.532 5.845,13.844C5.532,14.157 5.109,14.333 4.667,14.333C4.224,14.333 3.801,14.157 3.488,13.844C3.175,13.532 3,13.108 3,12.666C3,12.224 3.175,11.8 3.488,11.488C3.801,11.175 4.224,10.999 4.667,10.999Z"
|
||||
android:fillColor="#FFD041"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/sound_title.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="126dp"
|
||||
android:height="20dp"
|
||||
android:viewportWidth="126"
|
||||
android:viewportHeight="20">
|
||||
<path
|
||||
android:pathData="M0.68,1H2.94C4.74,1 6.18,1.08 7.26,1.24C8.33,1.38 9.27,1.85 10.09,2.63C10.92,3.42 11.34,4.67 11.34,6.4C11.34,7.97 10.98,9.16 10.28,9.98C9.59,10.78 8.74,11.3 7.71,11.56C6.7,11.8 5.54,11.92 4.21,11.92V18.86L0.68,19.14V1ZM4.83,9.06C5.76,9.06 6.49,8.87 7.02,8.49C7.56,8.1 7.83,7.4 7.83,6.38C7.83,5.37 7.58,4.69 7.09,4.34C6.59,3.98 5.81,3.81 4.74,3.81H4.23V9.06H4.83ZM13.26,5.78L16.62,5.49V7.67C17.1,6.98 17.69,6.43 18.4,6.02C19.12,5.58 20.03,5.37 21.13,5.37V8.66C20.56,8.66 19.8,8.76 18.85,8.97C17.92,9.16 17.18,9.5 16.62,10V18.86L13.26,19.14V5.78ZM25.17,19.31C24.6,19.31 24.08,19.14 23.61,18.78C23.15,18.42 22.79,17.93 22.53,17.32C22.28,16.7 22.15,16 22.15,15.23C22.15,13.49 22.74,12.26 23.92,11.56C25.12,10.84 26.52,10.43 28.1,10.34C28.1,9.47 28.04,8.83 27.93,8.42C27.82,8 27.55,7.79 27.12,7.79C26.75,7.79 26.47,7.94 26.28,8.22C26.08,8.51 25.96,8.88 25.92,9.33L22.63,8.75C22.79,7.52 23.29,6.64 24.14,6.11C24.99,5.58 25.98,5.32 27.12,5.32C28.57,5.32 29.66,5.7 30.38,6.47C31.12,7.24 31.48,8.24 31.48,9.47V16.46C31.48,17.21 31.6,18.01 31.84,18.86L28.56,19.14L28.17,17.49C27.88,18 27.46,18.43 26.9,18.78C26.34,19.14 25.76,19.31 25.17,19.31ZM26.73,16.91C27,16.91 27.23,16.85 27.4,16.72C27.6,16.59 27.83,16.38 28.1,16.1V12.35C27.3,12.35 26.66,12.57 26.18,13C25.7,13.43 25.46,14.1 25.46,15.02C25.46,15.62 25.56,16.1 25.77,16.43C26,16.75 26.32,16.91 26.73,16.91ZM34.26,5.78L37.62,5.49V7.22C38.31,6.61 38.98,6.14 39.64,5.82C40.31,5.49 40.92,5.32 41.48,5.32C42.33,5.32 43.02,5.63 43.55,6.26C44.09,6.86 44.36,7.69 44.36,8.73V18.86L41,19.14V10C41,8.8 40.6,8.2 39.78,8.2C39.51,8.2 39.2,8.28 38.87,8.44C38.55,8.6 38.13,8.83 37.62,9.14V18.86L34.26,19.14V5.78ZM54.4,19.31L51.66,12.59L50.56,14.06V19H47.2V1.43L50.56,1V9.93L53.99,5.49H57.64L53.85,10.36L57.37,18.3L54.4,19.31ZM70.03,19.34C68.57,19.34 67.34,18.94 66.33,18.14C65.34,17.32 64.61,16.23 64.15,14.87L67.12,13.48L67.41,13.96C67.87,14.76 68.31,15.38 68.73,15.83C69.16,16.28 69.7,16.5 70.34,16.5C70.75,16.5 71.12,16.3 71.44,15.9C71.78,15.5 71.95,15.06 71.95,14.58C71.95,14.14 71.83,13.73 71.61,13.36C71.39,12.99 71.1,12.7 70.75,12.47L67.6,10.6C66.69,10.09 65.96,9.44 65.42,8.66C64.87,7.87 64.6,6.99 64.6,6.02C64.6,4.98 64.84,4.05 65.32,3.23C65.82,2.42 66.48,1.78 67.31,1.34C68.16,0.89 69.11,0.66 70.17,0.66C71.4,0.66 72.45,0.97 73.31,1.58C74.18,2.18 74.82,3.09 75.23,4.29L72.26,5.63C72.19,5.5 72.06,5.22 71.85,4.77C71.64,4.32 71.39,4 71.08,3.81C70.79,3.6 70.43,3.5 70,3.5C69.47,3.5 69.07,3.66 68.78,4C68.51,4.34 68.37,4.77 68.37,5.3C68.37,5.68 68.47,6.03 68.68,6.35C68.91,6.66 69.17,6.9 69.47,7.07L72.38,8.78C74.52,9.99 75.65,11.59 75.76,13.58C75.76,14.71 75.51,15.72 74.99,16.6C74.5,17.46 73.81,18.14 72.93,18.62C72.07,19.1 71.1,19.34 70.03,19.34ZM82.25,19.31C80.63,19.31 79.38,18.67 78.5,17.39C77.64,16.11 77.21,14.41 77.21,12.28C77.21,10.17 77.64,8.48 78.5,7.22C79.37,5.95 80.61,5.32 82.25,5.32C83.86,5.32 85.11,5.95 85.99,7.22C86.89,8.48 87.33,10.17 87.33,12.28C87.33,14.39 86.89,16.1 85.99,17.39C85.11,18.67 83.86,19.31 82.25,19.31ZM82.25,16.82C82.97,16.82 83.43,16.38 83.64,15.5C83.85,14.62 83.95,13.54 83.95,12.26C83.95,10.98 83.85,9.9 83.64,9.02C83.43,8.14 82.97,7.7 82.25,7.7C81.53,7.7 81.07,8.11 80.88,8.94C80.69,9.78 80.59,10.79 80.59,11.99C80.59,13.46 80.69,14.64 80.88,15.52C81.07,16.38 81.53,16.82 82.25,16.82ZM92.52,19.31C91.64,19.31 90.92,19.01 90.36,18.4C89.8,17.78 89.52,16.94 89.52,15.9V5.78L92.88,5.49V14.54C92.88,15.18 92.99,15.64 93.2,15.93C93.4,16.2 93.72,16.34 94.16,16.34C94.49,16.34 94.85,16.26 95.24,16.1C95.62,15.92 95.96,15.65 96.27,15.28V5.78L99.65,5.49V18.86L96.27,19.14V17.42C95.71,18.06 95.09,18.54 94.42,18.86C93.76,19.16 93.13,19.31 92.52,19.31ZM102.56,5.78L105.92,5.49V7.22C106.61,6.61 107.28,6.14 107.93,5.82C108.61,5.49 109.22,5.32 109.78,5.32C110.63,5.32 111.32,5.63 111.85,6.26C112.39,6.86 112.66,7.69 112.66,8.73V18.86L109.3,19.14V10C109.3,8.8 108.89,8.2 108.08,8.2C107.81,8.2 107.5,8.28 107.17,8.44C106.85,8.6 106.43,8.83 105.92,9.14V18.86L102.56,19.14V5.78ZM118.78,19.31C116.19,19.31 114.89,16.96 114.89,12.26C114.89,9.81 115.21,8.04 115.86,6.95C116.5,5.86 117.5,5.32 118.86,5.32C119.43,5.32 119.98,5.51 120.51,5.9C121.04,6.26 121.42,6.73 121.66,7.29V1.43L125.05,1V18.86L122.5,19.14L121.66,17.32C121.5,17.91 121.21,18.39 120.78,18.76C120.34,19.13 119.68,19.31 118.78,19.31ZM120.03,16.91C120.51,16.91 120.9,16.65 121.21,16.12C121.51,15.58 121.66,14.66 121.66,13.38V8.87C121.2,8.15 120.65,7.79 120.03,7.79C119.5,7.79 119.11,7.98 118.86,8.37C118.61,8.74 118.46,9.22 118.38,9.83C118.31,10.44 118.28,11.25 118.28,12.26C118.28,13.28 118.31,14.11 118.38,14.75C118.46,15.39 118.62,15.91 118.88,16.31C119.14,16.71 119.52,16.91 120.03,16.91Z"
|
||||
android:fillColor="#181B3A"/>
|
||||
</vector>
|
||||
27
app/src/main/res/drawable/true_loop.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M8.5,8H6.5C4.015,8 2,10.015 2,12.5C2,14.985 4.015,17 6.5,17C7.738,17 8.859,16.5 9.673,15.691C10.493,14.876 12,12.5 12,12.5C12,12.5 13.503,10.134 14.316,9.32C15.13,8.505 16.256,8 17.5,8C19.985,8 22,10.015 22,12.5C22,14.985 19.985,17 17.5,17H15.5"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ffffff"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M17.5,15L15.5,17L17.5,19"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ffffff"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M6.5,6L8.5,8L6.5,10"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ffffff"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/unfavorite.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="26dp"
|
||||
android:height="26dp"
|
||||
android:viewportWidth="26"
|
||||
android:viewportHeight="26">
|
||||
<path
|
||||
android:pathData="M13,23.129L11.429,21.699C5.85,16.64 2.167,13.303 2.167,9.208C2.167,5.872 4.788,3.25 8.125,3.25C10.01,3.25 11.819,4.128 13,5.514C14.181,4.128 15.99,3.25 17.875,3.25C21.212,3.25 23.833,5.872 23.833,9.208C23.833,13.303 20.15,16.64 14.571,21.71L13,23.129Z"
|
||||
android:fillColor="#ffffff"/>
|
||||
</vector>
|
||||
10
app/src/main/res/drawable/whit_back.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="32dp"
|
||||
android:height="32dp"
|
||||
android:viewportWidth="32"
|
||||
android:viewportHeight="32">
|
||||
<path
|
||||
android:pathData="M6.44,15.19C6.159,15.471 6.001,15.852 6.001,16.25C6.001,16.647 6.159,17.028 6.44,17.31L12.94,23.81C13.224,24.075 13.6,24.219 13.989,24.212C14.378,24.205 14.748,24.048 15.023,23.773C15.298,23.498 15.455,23.127 15.462,22.739C15.469,22.35 15.325,21.974 15.06,21.69L9.62,16.25L15.06,10.81C15.325,10.525 15.469,10.149 15.462,9.761C15.455,9.372 15.298,9.001 15.023,8.726C14.748,8.452 14.378,8.294 13.989,8.287C13.6,8.28 13.224,8.425 12.94,8.69L6.44,15.19ZM22.94,8.69L16.44,15.19C16.159,15.471 16.001,15.852 16.001,16.25C16.001,16.647 16.159,17.028 16.44,17.31L22.94,23.81C23.077,23.957 23.243,24.075 23.427,24.157C23.611,24.239 23.809,24.283 24.011,24.287C24.212,24.29 24.412,24.253 24.599,24.178C24.786,24.103 24.956,23.99 25.098,23.848C25.24,23.705 25.353,23.536 25.428,23.349C25.504,23.162 25.541,22.962 25.537,22.761C25.534,22.559 25.49,22.361 25.407,22.177C25.326,21.993 25.207,21.827 25.06,21.69L19.62,16.25L25.06,10.81C25.325,10.525 25.469,10.149 25.462,9.761C25.455,9.372 25.298,9.001 25.023,8.726C24.748,8.452 24.378,8.294 23.989,8.287C23.6,8.28 23.224,8.425 22.94,8.69Z"
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
||||
36
app/src/main/res/layout/activity_airhonr.xml
Normal file
@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout 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/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".FirstFragment.AirHornActivity">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/air_horn_back"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:src="@drawable/black_back" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/air_horn_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="32dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:src="@drawable/sound_title" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/air_horn_recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/air_horn_title" />
|
||||
|
||||
</RelativeLayout>
|
||||
30
app/src/main/res/layout/activity_main.xml
Normal file
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".Main.MainActivity">
|
||||
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/main_viewpager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/main_tablayout"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
||||
/>
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/main_tablayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="88dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:tabGravity="center"
|
||||
app:tabIndicatorHeight="0dp"
|
||||
app:tabRippleColor="@android:color/transparent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
62
app/src/main/res/layout/activity_new_record.xml
Normal file
@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout 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/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".SecondFragment.NewRecordActivity">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/new_record_back"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:src="@drawable/setting" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/new_record_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="32dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:src="@drawable/sound_title" />
|
||||
|
||||
<com.airbnb.lottie.LottieAnimationView
|
||||
android:id="@+id/animation_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_below="@+id/new_record_title"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="50dp"
|
||||
app:lottie_fileName="Animation.json"
|
||||
app:lottie_loop="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/new_record_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/animation_view"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="50dp"
|
||||
android:textSize="44sp"
|
||||
android:textColor="@color/blue"
|
||||
android:text="00:00:00" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/new_record_record"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/new_record_time"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="50dp"
|
||||
android:background="@drawable/round"
|
||||
android:src="@drawable/microphone" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
127
app/src/main/res/layout/activity_play_sound.xml
Normal file
@ -0,0 +1,127 @@
|
||||
<androidx.constraintlayout.widget.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">
|
||||
|
||||
|
||||
<!-- 水平居中的不可见线 -->
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/horizontal_guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.5" />
|
||||
|
||||
<!-- 圆角矩形背景 -->
|
||||
<View
|
||||
android:id="@+id/rounded_background"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/rounded_rectangle"
|
||||
app:layout_constraintBottom_toTopOf="@id/horizontal_guideline"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/whit_back"
|
||||
app:layout_constraintStart_toStartOf="@id/rounded_background"
|
||||
app:layout_constraintTop_toTopOf="@id/rounded_background" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/favorite"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/unfavorite"
|
||||
app:layout_constraintEnd_toEndOf="@id/rounded_background"
|
||||
app:layout_constraintTop_toTopOf="@id/rounded_background" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="240dp"
|
||||
android:layout_height="180dp"
|
||||
android:layout_marginTop="64dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/loop"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/rounded_background" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/loop"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:src="@drawable/loop"
|
||||
app:layout_constraintBottom_toTopOf="@id/text"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/image" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/rounded_background"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/loop" />
|
||||
|
||||
<!--矩形下面-->
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/progress"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxHeight="5dp"
|
||||
android:progress="0"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:progressDrawable="@drawable/seek_bar_color"
|
||||
app:layout_constraintEnd_toStartOf="@id/max_sound"
|
||||
app:layout_constraintStart_toEndOf="@+id/min_sound"
|
||||
app:layout_constraintBottom_toTopOf="@+id/playback"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rounded_background" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/min_sound"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:src="@drawable/min_sound"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/playback"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rounded_background" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/max_sound"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:src="@drawable/max_sound"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/playback"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rounded_background" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/playback"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="50dp"
|
||||
android:layout_marginBottom="100dp"
|
||||
android:background="@drawable/round"
|
||||
android:src="@drawable/playback"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
88
app/src/main/res/layout/activity_save_record.xml
Normal file
@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout 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/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
tools:context=".SecondFragment.SaveRecordActivity">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/save_record_back"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:src="@drawable/black_back" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/save_record_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="32dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:src="@drawable/sound_title" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/save_record_image"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_below="@+id/save_record_title"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="50dp"
|
||||
android:src="@mipmap/savesound" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/save_record_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/save_record_image"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="50dp"
|
||||
android:textSize="44sp"
|
||||
android:textColor="@color/blue"
|
||||
android:text="00:00:00" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/save_record_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/save_record_time"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:hint="@string/give_name"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:background="@drawable/round_edit_text"
|
||||
android:layout_marginTop="50dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/save_record_play"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/save_record_name"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="50dp"
|
||||
android:background="@drawable/round"
|
||||
android:src="@drawable/playback" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/save_record_save"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="46dp"
|
||||
android:backgroundTint="@color/blue"
|
||||
android:text="Save Sound"/>
|
||||
|
||||
</RelativeLayout>
|
||||
27
app/src/main/res/layout/activity_splash.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.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">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/splash_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@mipmap/start_up"
|
||||
android:scaleType="fitXY"/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:max="100"
|
||||
android:progress="0"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintVertical_bias="0.5" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
54
app/src/main/res/layout/bottom_sheet_dialog.xml
Normal file
@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true">
|
||||
|
||||
<!-- 第一个 ImageView 在最上面居中 -->
|
||||
<ImageView
|
||||
android:id="@+id/sound_title"
|
||||
android:src="@drawable/sound_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginTop="12dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/all_option"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/sound_title"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="24dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/option1"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="100dp"
|
||||
android:src="@mipmap/import_sound"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/option2"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="100dp"
|
||||
android:src="@mipmap/record_sound"
|
||||
android:layout_marginTop="16dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/cancel_button"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:src="@drawable/cancel"
|
||||
android:layout_below="@id/all_option"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/round"
|
||||
android:backgroundTint="#F2F2F2"
|
||||
android:padding="12dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="32dp"/>
|
||||
</RelativeLayout>
|
||||
45
app/src/main/res/layout/fragment_favorite.xml
Normal file
@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout 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"
|
||||
tools:context=".ThirdFragment.FavoriteFragment">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/fragment_favorite_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="32dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:src="@drawable/sound_title" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/favorite_recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/fragment_favorite_title"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/fragment_favorite_image"
|
||||
android:layout_width="243dp"
|
||||
android:layout_height="243dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/favorite_background"
|
||||
android:visibility="visible"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/fragment_favorite_tips"
|
||||
android:layout_width="244dp"
|
||||
android:layout_height="51dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_below="@+id/fragment_favorite_image"
|
||||
android:src="@mipmap/favorite_background_title"
|
||||
|
||||
android:visibility="visible"/>
|
||||
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
51
app/src/main/res/layout/fragment_radio.xml
Normal file
@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".SecondFragment.RadioFragment">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/fragment_sound_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:src="@drawable/sound_title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/fragment_radio_add"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:src="@drawable/add_sound"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/empty_radio_image"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:src="@drawable/empty_radio"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/fragment_radio_add" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/radio_recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toBottomOf="@+id/fragment_sound_title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/fragment_radio_add"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
35
app/src/main/res/layout/fragment_sound.xml
Normal file
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout 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"
|
||||
tools:context=".FirstFragment.SoundFragment">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/fragment_sound_setting"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:src="@drawable/setting" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/fragment_sound_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="32dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:src="@drawable/sound_title" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/sound_recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/fragment_sound_title" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
26
app/src/main/res/layout/item_favorite.xml
Normal file
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.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="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/item_imageview_favorite"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="110dp"
|
||||
android:background="@drawable/rounded_border_shadow"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_imageview_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="22dp"
|
||||
android:background="@color/tint"
|
||||
android:text="@string/app_name"
|
||||
android:gravity="center"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/item_imageview_favorite"
|
||||
app:layout_constraintEnd_toEndOf="@+id/item_imageview_favorite"
|
||||
app:layout_constraintStart_toStartOf="@id/item_imageview_favorite" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
123
app/src/main/res/layout/item_radio.xml
Normal file
@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.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="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:padding="12dp"
|
||||
android:background="@drawable/round_create">
|
||||
|
||||
<!-- 可滑动的内容区 -->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/item_con"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<!-- 图片 -->
|
||||
<ImageView
|
||||
android:id="@+id/item_imageview_radio"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="60dp"
|
||||
android:src="@mipmap/savesound"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<!-- 标题 -->
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:text="@string/snoring"
|
||||
app:layout_constraintStart_toEndOf="@+id/item_imageview_radio"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/duration" />
|
||||
|
||||
<!-- 日期 -->
|
||||
<TextView
|
||||
android:id="@+id/date"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="date"
|
||||
app:layout_constraintStart_toEndOf="@+id/item_imageview_radio"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title"
|
||||
app:layout_constraintEnd_toStartOf="@+id/duration" />
|
||||
|
||||
<!-- 时间 -->
|
||||
<TextView
|
||||
android:id="@+id/time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="time"
|
||||
app:layout_constraintStart_toEndOf="@+id/date"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/date" />
|
||||
|
||||
<!-- 时长 -->
|
||||
<TextView
|
||||
android:id="@+id/duration"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="File duration"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- 收藏图标 -->
|
||||
<ImageView
|
||||
android:id="@+id/favorite"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:src="@drawable/unfavorite"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/duration" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- 左滑显示的 LinearLayout -->
|
||||
<LinearLayout
|
||||
android:id="@+id/item_linear"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="end"
|
||||
app:layout_constraintStart_toEndOf="@+id/item_con"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<!-- 编辑按钮 -->
|
||||
<TextView
|
||||
android:id="@+id/jianyi_zhiding"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="编辑"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#222222"
|
||||
android:background="#eaeaea" />
|
||||
|
||||
<!-- 删除按钮 -->
|
||||
<TextView
|
||||
android:id="@+id/jianyi_delete"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="删除"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#FFFFFF"
|
||||
android:background="#D52619" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
33
app/src/main/res/layout/item_sound.xml
Normal file
@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.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="wrap_content"
|
||||
android:background="@drawable/rounded_border_shadow">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="0dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/item_imageview_sound"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="126dp" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_textview_sound"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="6dp"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
14
app/src/main/res/layout/main_tab_item_custom.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_custom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
111
app/src/main/res/layout/setting_dialog.xml
Normal file
@ -0,0 +1,111 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true">
|
||||
|
||||
<!-- 第一个 ImageView 在最上面居中 -->
|
||||
<ImageView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="12dp"
|
||||
android:src="@drawable/sound_title" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:src="@drawable/setting" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/privacy"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/title"
|
||||
android:layout_margin="8dp"
|
||||
android:background="@drawable/rounded_corners"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:paddingRight="8dp"
|
||||
android:text="Privacy and security" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@drawable/privacy" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/share"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/privacy"
|
||||
android:layout_margin="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="@drawable/rounded_corners"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:paddingRight="8dp"
|
||||
android:text="Share" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@drawable/share" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/version"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/share"
|
||||
android:layout_margin="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="@drawable/rounded_corners"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:paddingRight="8dp"
|
||||
android:text="Version Number" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="1.0.0"/>
|
||||
</LinearLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/version"
|
||||
android:layout_marginTop="10dp"
|
||||
android:max="100"
|
||||
android:progress="0" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
5
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_prank"/>
|
||||
</adaptive-icon>
|
||||
5
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_prank"/>
|
||||
</adaptive-icon>
|
||||
BIN
app/src/main/res/mipmap-hdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_launcher_prank.webp
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
app/src/main/res/mipmap-hdpi/start_up.png
Normal file
|
After Width: | Height: | Size: 256 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher_prank.webp
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 4.7 KiB |