V1.0.0(1)
This commit is contained in:
commit
19265224ba
15
.gitignore
vendored
Normal file
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
1
app/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/build
|
||||
BIN
app/PrankTools.jks
Normal file
BIN
app/PrankTools.jks
Normal file
Binary file not shown.
70
app/build.gradle.kts
Normal file
70
app/build.gradle.kts
Normal file
@ -0,0 +1,70 @@
|
||||
import java.util.Date
|
||||
import java.text.SimpleDateFormat
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
id("io.objectbox")
|
||||
}
|
||||
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
|
||||
android {
|
||||
namespace = "com.prank.tool"
|
||||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
//com.prank.tool
|
||||
applicationId = "com.prank.tool"
|
||||
minSdk = 23
|
||||
targetSdk = 34
|
||||
versionCode = 1
|
||||
versionName = "1.0.0"
|
||||
setProperty("archivesBaseName", "Prank Tools_V" + versionName + "(${versionCode})_$timestamp")
|
||||
testInstrumentationRunner = "androidx.sounds.runner.AndroidJUnitRunner"
|
||||
vectorDrawables {
|
||||
useSupportLibrary = true
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = true
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = "17"
|
||||
}
|
||||
buildFeatures {
|
||||
compose = true
|
||||
viewBinding = true
|
||||
}
|
||||
composeOptions {
|
||||
kotlinCompilerExtensionVersion = "1.4.3"
|
||||
}
|
||||
packaging {
|
||||
resources {
|
||||
excludes += "/META-INF/{AL2.0,LGPL2.1}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
|
||||
|
||||
implementation("androidx.appcompat:appcompat:1.6.1")
|
||||
implementation("com.google.android.material:material:1.12.0")
|
||||
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
||||
implementation("androidx.legacy:legacy-support-v4:1.0.0")
|
||||
implementation("androidx.recyclerview:recyclerview:1.3.2")
|
||||
implementation ("com.github.bumptech.glide:glide:4.16.0")
|
||||
implementation ("com.airbnb.android:lottie:5.2.0")
|
||||
|
||||
|
||||
}
|
||||
6
app/keystore.properties
Normal file
6
app/keystore.properties
Normal file
@ -0,0 +1,6 @@
|
||||
app_name=Prank Tools
|
||||
package_name=com.prank.tool
|
||||
keystoreFile=app/PrankTools.jks
|
||||
key_alias=PrankToolskey0
|
||||
key_store_password=PrankTools
|
||||
key_password=PrankTools
|
||||
143
app/objectbox-models/default.json
Normal file
143
app/objectbox-models/default.json
Normal file
@ -0,0 +1,143 @@
|
||||
{
|
||||
"_note1": "KEEP THIS FILE! Check it into a version control system (VCS) like git.",
|
||||
"_note2": "ObjectBox manages crucial IDs for your object model. See docs for details.",
|
||||
"_note3": "If you have VCS merge conflicts, you must resolve them according to ObjectBox docs.",
|
||||
"entities": [
|
||||
{
|
||||
"id": "9:8739827070759887179",
|
||||
"lastPropertyId": "7:7559103671740386544",
|
||||
"name": "Info",
|
||||
"properties": [
|
||||
{
|
||||
"id": "1:6461488128394318327",
|
||||
"name": "id",
|
||||
"type": 6,
|
||||
"flags": 1
|
||||
},
|
||||
{
|
||||
"id": "2:1026277688866110674",
|
||||
"name": "name",
|
||||
"type": 9
|
||||
},
|
||||
{
|
||||
"id": "3:2521498030617118564",
|
||||
"name": "covert",
|
||||
"type": 9
|
||||
},
|
||||
{
|
||||
"id": "4:2583438008647218971",
|
||||
"name": "audioUrl",
|
||||
"type": 9
|
||||
},
|
||||
{
|
||||
"id": "5:731259648768476447",
|
||||
"name": "isLike",
|
||||
"type": 1
|
||||
},
|
||||
{
|
||||
"id": "6:5851268731306509989",
|
||||
"name": "isCustomization",
|
||||
"type": 1
|
||||
},
|
||||
{
|
||||
"id": "7:7559103671740386544",
|
||||
"name": "colorIndex",
|
||||
"type": 5
|
||||
}
|
||||
],
|
||||
"relations": []
|
||||
},
|
||||
{
|
||||
"id": "10:8085616393527895261",
|
||||
"lastPropertyId": "3:5188652570119820578",
|
||||
"name": "MyBean",
|
||||
"properties": [
|
||||
{
|
||||
"id": "1:146773896596794310",
|
||||
"name": "id",
|
||||
"type": 6,
|
||||
"flags": 1
|
||||
},
|
||||
{
|
||||
"id": "2:5478293265216175724",
|
||||
"name": "name",
|
||||
"type": 9
|
||||
},
|
||||
{
|
||||
"id": "3:5188652570119820578",
|
||||
"name": "covert",
|
||||
"type": 9
|
||||
}
|
||||
],
|
||||
"relations": [
|
||||
{
|
||||
"id": "7:3875887204039397939",
|
||||
"name": "infoList",
|
||||
"targetId": "9:8739827070759887179"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"lastEntityId": "10:8085616393527895261",
|
||||
"lastIndexId": "0:0",
|
||||
"lastRelationId": "7:3875887204039397939",
|
||||
"lastSequenceId": "0:0",
|
||||
"modelVersion": 5,
|
||||
"modelVersionParserMinimum": 5,
|
||||
"retiredEntityUids": [
|
||||
6644187494744704837,
|
||||
5451755925324613900,
|
||||
5341528467384834198,
|
||||
8669262289368091330,
|
||||
8810616757821398748,
|
||||
6372494608185382462,
|
||||
260548638537148495,
|
||||
6171058126503557976
|
||||
],
|
||||
"retiredIndexUids": [],
|
||||
"retiredPropertyUids": [
|
||||
3737650329028529369,
|
||||
4763378658873693443,
|
||||
125364974873863130,
|
||||
2528835553105827913,
|
||||
4125097520975656265,
|
||||
1927156637783361412,
|
||||
6438478261519714898,
|
||||
2535158628950494443,
|
||||
4963029281587776266,
|
||||
8017263761729239946,
|
||||
3918234626049153042,
|
||||
4840800811073356695,
|
||||
930394402218217369,
|
||||
1357489842440803099,
|
||||
783114452691941347,
|
||||
881748992619560888,
|
||||
95077662452914291,
|
||||
7000351314398811626,
|
||||
3982750000194227585,
|
||||
5235585844249440522,
|
||||
3371160825837869454,
|
||||
9088572167887595053,
|
||||
2294045821758826971,
|
||||
6190783800393335475,
|
||||
6856939928119969590,
|
||||
9041548896743223717,
|
||||
4243540562679615259,
|
||||
3106056562243875264,
|
||||
7411940719916723671,
|
||||
8627564250033438412,
|
||||
2362105308234412259,
|
||||
6967435104198349134,
|
||||
9068611668884650878,
|
||||
1871289416013564443
|
||||
],
|
||||
"retiredRelationUids": [
|
||||
4497042841980461487,
|
||||
5723529287069432111,
|
||||
8439944504818566677,
|
||||
6781268415547019296,
|
||||
2600628166471439351,
|
||||
6610744321567014290
|
||||
],
|
||||
"version": 1
|
||||
}
|
||||
51
app/proguard-rules.pro
vendored
Normal file
51
app/proguard-rules.pro
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
# 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
|
||||
-useuniqueclassmembernames
|
||||
-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
-keepclassmembers class * implements java.io.Serializable {
|
||||
|
||||
static final long serialVersionUID;
|
||||
|
||||
private static final java.io.ObjectStreamField[] serialPersistentFields;
|
||||
|
||||
private void writeObject(java.io.ObjectOutputStream);
|
||||
|
||||
private void readObject(java.io.ObjectInputStream);
|
||||
|
||||
java.lang.Object writeReplace();
|
||||
|
||||
java.lang.Object readResolve();
|
||||
|
||||
}
|
||||
|
||||
|
||||
# 保留Processor类,这些类用于在编译时生成ObjectBox需要的代码
|
||||
-keep @io.objectbox.annotation.processor.Processor class * {
|
||||
*;
|
||||
}
|
||||
|
||||
# 保留ObjectBox的关键方法和构造函数
|
||||
-keepclassmembers class * extends io.objectbox.Box {
|
||||
<init>(...);
|
||||
<methods>;
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.prank.funny.audio.sounds
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Instrumented sounds, which will execute on an Android device.
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ExampleInstrumentedTest {
|
||||
@Test
|
||||
fun useAppContext() {
|
||||
// Context of the app under sounds.
|
||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
||||
assertEquals("com.play.funny.audio.sounds", appContext.packageName)
|
||||
}
|
||||
}
|
||||
56
app/src/main/AndroidManifest.xml
Normal file
56
app/src/main/AndroidManifest.xml
Normal file
@ -0,0 +1,56 @@
|
||||
<?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.READ_EXTERNAL_STORAGE"
|
||||
android:maxSdkVersion="32" />
|
||||
<uses-permission
|
||||
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
||||
android:maxSdkVersion="32" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
|
||||
<application
|
||||
android:name=".MyApp"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/my_logo"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/my_logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.FunnyAudio"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".act.ActivityPlay"
|
||||
android:screenOrientation="portrait"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".act.ActivityInfo"
|
||||
android:screenOrientation="portrait"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".act.ActivityMain"
|
||||
android:screenOrientation="portrait"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".act.ActivitySave"
|
||||
android:screenOrientation="portrait"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".act.ActivityRecorder"
|
||||
android:screenOrientation="portrait"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".act.ActivityLauncher"
|
||||
android:screenOrientation="portrait"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
BIN
app/src/main/assets/font.ttf
Normal file
BIN
app/src/main/assets/font.ttf
Normal file
Binary file not shown.
3791
app/src/main/assets/prank.json
Normal file
3791
app/src/main/assets/prank.json
Normal file
File diff suppressed because it is too large
Load Diff
48
app/src/main/java/com/prank/tool/MyApp.java
Normal file
48
app/src/main/java/com/prank/tool/MyApp.java
Normal file
@ -0,0 +1,48 @@
|
||||
package com.prank.tool;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.res.AssetManager;
|
||||
import android.graphics.Typeface;
|
||||
|
||||
import com.prank.tool.jbean.Info;
|
||||
|
||||
import com.prank.tool.jbean.MyBean;
|
||||
import com.prank.tool.utils.DbManager;
|
||||
import com.prank.tool.utils.Tools;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
|
||||
public class MyApp extends Application {
|
||||
|
||||
public static MyApp app;
|
||||
public static Typeface defaultFont;
|
||||
public static List<MyBean> bean;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
app = this;
|
||||
AssetManager assets = getAssets();
|
||||
defaultFont = Typeface.createFromAsset(assets, "font.ttf");
|
||||
DbManager.init(this);
|
||||
if (bean != null)
|
||||
return;
|
||||
try {
|
||||
InputStream open = getAssets().open("prank.json");
|
||||
String string = Tools.getString(open);
|
||||
if (!string.isEmpty()) {
|
||||
bean = Tools.getBean(string);
|
||||
for (MyBean category:bean){
|
||||
for (Info info1 : category.getInfoList()) {
|
||||
info1.setLike(false);
|
||||
DbManager.getBoxBean().put(info1);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
61
app/src/main/java/com/prank/tool/act/ActivityInfo.java
Normal file
61
app/src/main/java/com/prank/tool/act/ActivityInfo.java
Normal file
@ -0,0 +1,61 @@
|
||||
package com.prank.tool.act;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
|
||||
import com.prank.tool.adapter.AdapterChild;
|
||||
import com.prank.tool.databinding.ActivityLayoutInfoBinding;
|
||||
import com.prank.tool.interf.OnSoundsListener;
|
||||
import com.prank.tool.jbean.Info;
|
||||
import com.prank.tool.jbean.MyBean;
|
||||
import com.prank.tool.utils.Space;
|
||||
import com.prank.tool.utils.Tools;
|
||||
|
||||
public class ActivityInfo extends AppCompatActivity implements View.OnClickListener, OnSoundsListener {
|
||||
|
||||
private ActivityLayoutInfoBinding activityListBinding;
|
||||
private MyBean data;
|
||||
private int colorIndex;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
Tools.setStatusBarTextColor(this,true);
|
||||
activityListBinding = ActivityLayoutInfoBinding.inflate(getLayoutInflater());
|
||||
setContentView(activityListBinding.getRoot());
|
||||
data = (MyBean) getIntent().getSerializableExtra(Tools.KEY_LIST_DATA);
|
||||
colorIndex = getIntent().getIntExtra(Tools.KEY_LIST_COLOR_POS,0);
|
||||
activityListBinding.categoryName.setText(data.getName());
|
||||
onList();
|
||||
activityListBinding.back.setOnClickListener(this);
|
||||
}
|
||||
|
||||
private void onList() {
|
||||
Space itemHelper = new Space(10, 10, 0);
|
||||
activityListBinding.listRecycler.addItemDecoration(itemHelper);
|
||||
activityListBinding.listRecycler.setLayoutManager(new GridLayoutManager(this, 3));
|
||||
AdapterChild adapterChild = new AdapterChild(this, data.getInfoList(),0,this);
|
||||
activityListBinding.listRecycler.setAdapter(adapterChild);
|
||||
adapterChild.setColorIndex(colorIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if(v.equals(activityListBinding.back)){
|
||||
finish();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickSoundsListener(Info data) {
|
||||
Intent intent = new Intent(this, ActivityPlay.class);
|
||||
intent.putExtra(Tools.KEY_PLAY_DATA, data);
|
||||
intent.putExtra(Tools.KEY_LIST_COLOR_POS, colorIndex);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
57
app/src/main/java/com/prank/tool/act/ActivityLauncher.java
Normal file
57
app/src/main/java/com/prank/tool/act/ActivityLauncher.java
Normal file
@ -0,0 +1,57 @@
|
||||
package com.prank.tool.act;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.prank.tool.databinding.ActivityLayoutWelcomeBinding;
|
||||
import com.prank.tool.utils.Tools;
|
||||
|
||||
public class ActivityLauncher extends AppCompatActivity {
|
||||
|
||||
private long time = 1000;
|
||||
private ActivityLayoutWelcomeBinding binding;
|
||||
private CountDownTimer countDownTimer;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ActivityLayoutWelcomeBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
Tools.setStatusBarTextColor(this, true);
|
||||
countDownTimer = new CountDownTimer(time, 200) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
int progressPercentage = (int) ((100 * millisUntilFinished) / time);
|
||||
int Percentage = 100 - progressPercentage;
|
||||
binding.loadingPb.setProgress(Percentage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
welcomeMain();
|
||||
}
|
||||
};
|
||||
|
||||
countDownTimer.start();
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void welcomeMain() {
|
||||
binding.loadingPb.setProgress(100);
|
||||
Intent intent = new Intent(this, ActivityMain.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (countDownTimer != null) {
|
||||
countDownTimer.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
216
app/src/main/java/com/prank/tool/act/ActivityMain.java
Normal file
216
app/src/main/java/com/prank/tool/act/ActivityMain.java
Normal file
@ -0,0 +1,216 @@
|
||||
package com.prank.tool.act;
|
||||
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.activity.result.ActivityResultCallback;
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.prank.tool.R;
|
||||
import com.prank.tool.databinding.ActivityLayoutMainBinding;
|
||||
import com.prank.tool.frag.FragmentLike;
|
||||
import com.prank.tool.frag.FragmentMain;
|
||||
import com.prank.tool.frag.FragmentRecorder;
|
||||
import com.prank.tool.utils.Tools;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ActivityMain extends AppCompatActivity implements View.OnClickListener {
|
||||
|
||||
private ActivityLayoutMainBinding activityMainBinding;
|
||||
|
||||
private List<Fragment> fragmentList = new ArrayList<>();
|
||||
private FragmentLike fragmentLike;
|
||||
private FragmentRecorder fragmentRecorder;
|
||||
private ActivityResultLauncher<String> audioPickerLauncher;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
activityMainBinding = ActivityLayoutMainBinding.inflate(getLayoutInflater());
|
||||
setContentView(activityMainBinding.getRoot());
|
||||
Tools.setStatusBarTextColor(this, true);
|
||||
initVp2();
|
||||
activityMainBinding.frameHome.setOnClickListener(this);
|
||||
activityMainBinding.frameAdd.setOnClickListener(this);
|
||||
activityMainBinding.frameCollect.setOnClickListener(this);
|
||||
|
||||
|
||||
audioPickerLauncher = registerForActivityResult(new ActivityResultContracts.GetContent(),
|
||||
new ActivityResultCallback<Uri>() {
|
||||
@Override
|
||||
public void onActivityResult(Uri uri) {
|
||||
// Handle the returned Uri
|
||||
|
||||
if (uri != null) {
|
||||
long duration = Tools.getAudioDuration(ActivityMain.this, uri);
|
||||
Intent intent = new Intent(ActivityMain.this, ActivitySave.class);
|
||||
intent.putExtra(ActivitySave.KEY_Path, uri.toString());
|
||||
intent.putExtra(ActivitySave.KEY_Time, duration);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// audioPickerLauncher = registerForActivityResult(
|
||||
// new ActivityResultContracts.StartActivityForResult(),
|
||||
// result -> {
|
||||
// if (result.getResultCode() == Activity.RESULT_OK && result.getData() != null) {
|
||||
// Intent data = result.getData();
|
||||
// Uri selectedAudioUri = data.getData();
|
||||
// if (selectedAudioUri != null) {
|
||||
// long duration = CommonUtils.getAudioDuration(MainActivity.this, selectedAudioUri);
|
||||
// Intent intent = new Intent(MainActivity.this, SaveActivity.class);
|
||||
// intent.putExtra(SaveActivity.KEY_Path, selectedAudioUri.toString());
|
||||
// intent.putExtra(SaveActivity.KEY_Time, duration);
|
||||
// startActivity(intent);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
}
|
||||
|
||||
private void initVp2() {
|
||||
fragmentLike = FragmentLike.newInstance();
|
||||
fragmentRecorder = FragmentRecorder.newInstance();
|
||||
fragmentList.add(FragmentMain.newInstance());
|
||||
fragmentList.add(fragmentRecorder);
|
||||
fragmentList.add(fragmentLike);
|
||||
activityMainBinding.vp2.setAdapter(new FragmentStateAdapter(this) {
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment createFragment(int position) {
|
||||
return fragmentList.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return fragmentList.size();
|
||||
}
|
||||
});
|
||||
|
||||
activityMainBinding.vp2.setOrientation(ViewPager2.ORIENTATION_HORIZONTAL);
|
||||
activityMainBinding.vp2.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
super.onPageSelected(position);
|
||||
setCurSelectTab(position);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
int currentItem = activityMainBinding.vp2.getCurrentItem();
|
||||
Log.d("----------", "---------currentItem=" + currentItem);
|
||||
if (currentItem == 1) {
|
||||
fragmentRecorder.refresh();
|
||||
} else if (currentItem == 2) {
|
||||
fragmentLike.refresh();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void setCurSelectTab(int position) {
|
||||
if (position == 0) {
|
||||
activityMainBinding.frameHome.setSelected(true);
|
||||
activityMainBinding.frameAdd.setSelected(false);
|
||||
activityMainBinding.frameCollect.setSelected(false);
|
||||
activityMainBinding.imHome.setSelected(true);
|
||||
activityMainBinding.imAdd.setSelected(false);
|
||||
activityMainBinding.imCollect.setSelected(false);
|
||||
// activityMainBinding.imImport.setVisibility(View.GONE);
|
||||
} else if (position == 1) {
|
||||
activityMainBinding.frameHome.setSelected(false);
|
||||
activityMainBinding.frameAdd.setSelected(true);
|
||||
activityMainBinding.frameCollect.setSelected(false);
|
||||
|
||||
activityMainBinding.imHome.setSelected(false);
|
||||
activityMainBinding.imAdd.setSelected(true);
|
||||
activityMainBinding.imCollect.setSelected(false);
|
||||
// activityMainBinding.imImport.setVisibility(View.VISIBLE);
|
||||
fragmentRecorder.refresh();
|
||||
} else {
|
||||
activityMainBinding.frameHome.setSelected(false);
|
||||
activityMainBinding.frameAdd.setSelected(false);
|
||||
activityMainBinding.frameCollect.setSelected(true);
|
||||
|
||||
activityMainBinding.imHome.setSelected(false);
|
||||
activityMainBinding.imAdd.setSelected(false);
|
||||
activityMainBinding.imCollect.setSelected(true);
|
||||
// activityMainBinding.imImport.setVisibility(View.GONE);
|
||||
fragmentLike.refresh();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v.equals(activityMainBinding.frameHome)) {
|
||||
activityMainBinding.vp2.setCurrentItem(0);
|
||||
} else if (v.equals(activityMainBinding.frameAdd)) {
|
||||
activityMainBinding.vp2.setCurrentItem(1);
|
||||
} else if (v.equals(activityMainBinding.frameCollect)) {
|
||||
activityMainBinding.vp2.setCurrentItem(2);
|
||||
}
|
||||
// else if (v.equals(activityMainBinding.imImport)) {
|
||||
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
// if (ContextCompat.checkSelfPermission(this, ConstValues.permission_read_audio[0])
|
||||
// != PackageManager.PERMISSION_GRANTED) {
|
||||
// ActivityCompat.requestPermissions(this, ConstValues.permission_read_audio,
|
||||
// ConstValues.REQUEST_READ_STORAGE_PERMISSION);
|
||||
// } else {
|
||||
// importAudio();
|
||||
// }
|
||||
// } else {
|
||||
// if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||
// != PackageManager.PERMISSION_GRANTED ||
|
||||
// ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE)
|
||||
// != PackageManager.PERMISSION_GRANTED) {
|
||||
//
|
||||
// ActivityCompat.requestPermissions(this, ConstValues.permission_store, ConstValues.REQUEST_READ_STORAGE_PERMISSION);
|
||||
// } else {
|
||||
// importAudio();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
if (requestCode == Tools.REQUEST_READ_STORAGE_PERMISSION) {
|
||||
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||
importAudio();
|
||||
} else {
|
||||
Toast.makeText(this, getString(R.string.permission_fail), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void importAudio() {
|
||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
intent.setType("audio/*");
|
||||
audioPickerLauncher.launch("audio/*");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
248
app/src/main/java/com/prank/tool/act/ActivityPlay.java
Normal file
248
app/src/main/java/com/prank/tool/act/ActivityPlay.java
Normal file
@ -0,0 +1,248 @@
|
||||
package com.prank.tool.act;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.media.AudioManager;
|
||||
import android.media.MediaPlayer;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.prank.tool.R;
|
||||
import com.prank.tool.adapter.AdapterChild;
|
||||
import com.prank.tool.databinding.ActivityLayoutPlayBinding;
|
||||
import com.prank.tool.interf.OnSoundsListener;
|
||||
import com.prank.tool.interf.OnTimerListener;
|
||||
import com.prank.tool.jbean.Info;
|
||||
import com.prank.tool.popu.PopTimer;
|
||||
import com.prank.tool.utils.DbManager;
|
||||
import com.prank.tool.utils.Space;
|
||||
import com.prank.tool.utils.Tools;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
public class ActivityPlay extends AppCompatActivity implements View.OnClickListener, OnTimerListener, OnSoundsListener {
|
||||
|
||||
private ActivityLayoutPlayBinding playBinding;
|
||||
|
||||
private Info info;
|
||||
private PopTimer popTimer;
|
||||
|
||||
private MediaPlayer mediaPlayer;
|
||||
private BroadcastReceiver volumeReceiver;
|
||||
private CountDownTimer countDownTimer;
|
||||
private int color;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
playBinding = ActivityLayoutPlayBinding.inflate(getLayoutInflater());
|
||||
setContentView(playBinding.getRoot());
|
||||
Tools.setStatusBarTextColor(this, true);
|
||||
info = (Info) getIntent().getSerializableExtra(Tools.KEY_PLAY_DATA);
|
||||
color = getIntent().getIntExtra(Tools.KEY_LIST_COLOR_POS,0);
|
||||
playBinding.constraintLayout.setBackground(ContextCompat.getDrawable(this, Tools.playBgs[color]));
|
||||
initAudio();
|
||||
String covert = info.getCovert();
|
||||
if (covert != null && !covert.isEmpty()) {
|
||||
Glide.with(this).load(covert)
|
||||
.placeholder(R.drawable.default_import_audio)
|
||||
.into(playBinding.image);
|
||||
} else {
|
||||
Glide.with(this).load(R.drawable.default_import_audio)
|
||||
.into(playBinding.image);
|
||||
}
|
||||
playBinding.name.setText(info.getName());
|
||||
playBinding.back.setOnClickListener(this);
|
||||
playBinding.linearPlay.setOnClickListener(this);
|
||||
playBinding.imLike.setOnClickListener(this);
|
||||
playBinding.imLoop.setOnClickListener(this);
|
||||
playBinding.imTimer.setOnClickListener(this);
|
||||
|
||||
Tools.setVolume(this, playBinding.seekbar);
|
||||
|
||||
initLike();
|
||||
loadMore();
|
||||
volumeReceiver();
|
||||
|
||||
}
|
||||
|
||||
private void stopCountDown() {
|
||||
Log.d("------", "------stopCountDown");
|
||||
if (countDownTimer != null) {
|
||||
countDownTimer.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
private void startCountDown(long time) {
|
||||
stopCountDown();
|
||||
countDownTimer = new CountDownTimer(time, 1000) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
popTimer.setOffSelected();
|
||||
if (!mediaPlayer.isPlaying()) {
|
||||
playBinding.btnPlay.setSelected(true);
|
||||
mediaPlayer.start();
|
||||
}
|
||||
}
|
||||
};
|
||||
countDownTimer.start();
|
||||
}
|
||||
|
||||
private void volumeReceiver() {
|
||||
volumeReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (intent.getAction().equals("android.media.VOLUME_CHANGED_ACTION")) {
|
||||
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
|
||||
int currentVolume = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
|
||||
if (playBinding.seekbar.getProgress() != currentVolume) {
|
||||
playBinding.seekbar.setProgress(currentVolume);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
IntentFilter filter = new IntentFilter("android.media.VOLUME_CHANGED_ACTION");
|
||||
registerReceiver(volumeReceiver, filter);
|
||||
}
|
||||
|
||||
private void initLike() {
|
||||
boolean b = DbManager.checkLike(info);
|
||||
playBinding.imLike.setSelected(b);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void loadMore() {
|
||||
List<Info> more = DbManager.getMore();
|
||||
Space itemHelper = new Space(0, 0, (int) Tools.dpToPx(3));
|
||||
AdapterChild adapterChild = new AdapterChild(this, more, 1, this);
|
||||
playBinding.moreRecycler.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
|
||||
playBinding.moreRecycler.setAdapter(adapterChild);
|
||||
playBinding.moreRecycler.addItemDecoration(itemHelper);
|
||||
adapterChild.setColorIndex(color);
|
||||
}
|
||||
|
||||
private void initAudio() {
|
||||
showPlayBtn(false);
|
||||
mediaPlayer = new MediaPlayer();
|
||||
try {
|
||||
mediaPlayer.reset();
|
||||
mediaPlayer.setDataSource(info.getAudioUrl());
|
||||
mediaPlayer.prepareAsync();
|
||||
mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
|
||||
@Override
|
||||
public void onPrepared(MediaPlayer mp) {
|
||||
showPlayBtn(true);
|
||||
}
|
||||
});
|
||||
|
||||
mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
|
||||
@Override
|
||||
public void onCompletion(MediaPlayer mp) {
|
||||
playBinding.btnPlay.setSelected(false);
|
||||
}
|
||||
});
|
||||
} catch (IOException ioException) {
|
||||
showPlayBtn(true);
|
||||
Toast.makeText(this, "----------prepare fail", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
private void showPlayBtn(boolean showBtn) {
|
||||
if (showBtn) {
|
||||
playBinding.linearPlay.setVisibility(View.VISIBLE);
|
||||
playBinding.playLoading.setVisibility(View.GONE);
|
||||
} else {
|
||||
playBinding.linearPlay.setVisibility(View.GONE);
|
||||
playBinding.playLoading.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v.equals(playBinding.back)) {
|
||||
finish();
|
||||
} else if (v.equals(playBinding.linearPlay)) {
|
||||
boolean selected = playBinding.btnPlay.isSelected();
|
||||
if (selected) {
|
||||
if (mediaPlayer.isPlaying()) {
|
||||
mediaPlayer.pause();
|
||||
}
|
||||
} else {
|
||||
if (!mediaPlayer.isPlaying()) {
|
||||
mediaPlayer.start();
|
||||
}
|
||||
}
|
||||
playBinding.btnPlay.setSelected(!selected);
|
||||
|
||||
} else if (v.equals(playBinding.imLike)) {
|
||||
playBinding.imLike.setSelected(!playBinding.imLike.isSelected());
|
||||
boolean selected = playBinding.imLike.isSelected();
|
||||
if (selected) {
|
||||
info.setColorIndex(color);
|
||||
DbManager.addLike(info);
|
||||
} else {
|
||||
DbManager.removeLike(info);
|
||||
}
|
||||
} else if (v.equals(playBinding.imLoop)) {
|
||||
playBinding.imLoop.setSelected(!playBinding.imLoop.isSelected());
|
||||
mediaPlayer.setLooping(playBinding.imLoop.isSelected());
|
||||
} else if (v.equals(playBinding.imTimer)) {
|
||||
if (popTimer == null) {
|
||||
popTimer = new PopTimer(ActivityPlay.this, this);
|
||||
}
|
||||
popTimer.showTop(playBinding.imTimer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mediaPlayer.isPlaying()) {
|
||||
mediaPlayer.stop();
|
||||
}
|
||||
mediaPlayer.release();
|
||||
mediaPlayer = null;
|
||||
stopCountDown();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickTimerListener(long time) {
|
||||
popTimer.hide();
|
||||
if (time == -1) {
|
||||
stopCountDown();
|
||||
} else {
|
||||
startCountDown(time);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickSoundsListener(Info data) {
|
||||
Intent intent = new Intent(this, ActivityPlay.class);
|
||||
intent.putExtra(Tools.KEY_PLAY_DATA, data);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
88
app/src/main/java/com/prank/tool/act/ActivityRecorder.java
Normal file
88
app/src/main/java/com/prank/tool/act/ActivityRecorder.java
Normal file
@ -0,0 +1,88 @@
|
||||
package com.prank.tool.act;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.SystemClock;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.prank.tool.R;
|
||||
import com.prank.tool.databinding.ActivityLayoutRecordBinding;
|
||||
import com.prank.tool.utils.RecorderManager;
|
||||
import com.prank.tool.utils.Tools;
|
||||
|
||||
public class ActivityRecorder extends AppCompatActivity {
|
||||
private ActivityLayoutRecordBinding binding;
|
||||
private long startTime;
|
||||
private long elapsedTime;
|
||||
private Handler handler = new Handler();
|
||||
private Runnable runnable;
|
||||
private boolean isCreate = false;
|
||||
|
||||
private RecorderManager recorderManager;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ActivityLayoutRecordBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
Tools.setStatusBarTextColor(this, true);
|
||||
recorderManager = new RecorderManager(this);
|
||||
|
||||
binding.audioTime.setText(R.string.time_init);
|
||||
|
||||
initEvent();
|
||||
}
|
||||
|
||||
private void initEvent() {
|
||||
binding.back.setOnClickListener(v -> finish());
|
||||
binding.imMic.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
binding.imMic.setSelected(!binding.imMic.isSelected());
|
||||
createSound();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void createSound() {
|
||||
if (!isCreate) {
|
||||
recorderManager.startRecording();
|
||||
isCreate = true;
|
||||
runnable = new Runnable() {
|
||||
@SuppressLint("DefaultLocale")
|
||||
@Override
|
||||
public void run() {
|
||||
long currentTime = SystemClock.elapsedRealtime();
|
||||
elapsedTime = currentTime - startTime;
|
||||
int milliseconds = (int) (elapsedTime % 1000) / 10;
|
||||
int seconds = (int) (elapsedTime / 1000) % 60;
|
||||
int minutes = (int) (elapsedTime / (1000 * 60)) % 60;
|
||||
binding.audioTime.setText(String.format("%02d : %02d : %02d", minutes, seconds, milliseconds));
|
||||
handler.postDelayed(this, 10);
|
||||
}
|
||||
};
|
||||
startTime = SystemClock.elapsedRealtime();
|
||||
handler.post(runnable);
|
||||
} else {
|
||||
recorderManager.stopRecording();
|
||||
|
||||
handler.removeCallbacks(runnable);
|
||||
Intent intent = new Intent(ActivityRecorder.this, ActivitySave.class);
|
||||
intent.putExtra(ActivitySave.KEY_Time, elapsedTime);
|
||||
intent.putExtra(ActivitySave.KEY_Path, recorderManager.getTempFileName());
|
||||
intent.putExtra(ActivitySave.KEY_import, 1);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
handler.removeCallbacks(runnable);
|
||||
}
|
||||
}
|
||||
217
app/src/main/java/com/prank/tool/act/ActivitySave.java
Normal file
217
app/src/main/java/com/prank/tool/act/ActivitySave.java
Normal file
@ -0,0 +1,217 @@
|
||||
package com.prank.tool.act;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.media.AudioAttributes;
|
||||
import android.media.MediaPlayer;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.SystemClock;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.prank.tool.R;
|
||||
import com.prank.tool.databinding.ActivityLayoutSaveBinding;
|
||||
import com.prank.tool.jbean.Info;
|
||||
import com.prank.tool.utils.DbManager;
|
||||
import com.prank.tool.utils.Tools;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
public class ActivitySave extends AppCompatActivity {
|
||||
private ActivityLayoutSaveBinding binding;
|
||||
private String path;
|
||||
|
||||
private MediaPlayer mediaPlayer;
|
||||
private Handler handler = new Handler();
|
||||
private Runnable timeUpdater;
|
||||
private long startTime;
|
||||
private long elapsedTime;
|
||||
private long audioDuration;
|
||||
|
||||
public static String KEY_Time = "KEY_time";
|
||||
public static String KEY_Path = "KEY_path";
|
||||
public static String KEY_import = "flag";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ActivityLayoutSaveBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
Tools.setStatusBarTextColor(this, true);
|
||||
binding.audioTime.setText(R.string.time_init);
|
||||
initData();
|
||||
initEvent();
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void togglePrank() throws IOException {
|
||||
if (binding.imPlayBtn.isSelected()) {
|
||||
initMediaPlayer();
|
||||
} else {
|
||||
stopPrank();
|
||||
}
|
||||
}
|
||||
|
||||
private void stopPrank() {
|
||||
handler.removeCallbacks(timeUpdater);
|
||||
if (mediaPlayer != null) {
|
||||
mediaPlayer.release();
|
||||
mediaPlayer = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void initMediaPlayer() {
|
||||
if (mediaPlayer == null) {
|
||||
mediaPlayer = new MediaPlayer();
|
||||
mediaPlayer.setAudioAttributes(
|
||||
new AudioAttributes.Builder()
|
||||
.setContentType(AudioAttributes.CONTENT_TYPE_MUSIC)
|
||||
.setUsage(AudioAttributes.USAGE_MEDIA)
|
||||
.build());
|
||||
try {
|
||||
mediaPlayer.setDataSource(path);
|
||||
} catch (Exception ex) {
|
||||
|
||||
}
|
||||
mediaPlayer.setOnPreparedListener(mp -> {
|
||||
mediaPlayer.start();
|
||||
startTimer();
|
||||
});
|
||||
mediaPlayer.setOnCompletionListener(mp -> {
|
||||
binding.imPlayBtn.setSelected(false);
|
||||
handler.removeCallbacks(timeUpdater);
|
||||
});
|
||||
mediaPlayer.prepareAsync();
|
||||
} else {
|
||||
mediaPlayer.start();
|
||||
startTimer();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void startTimer() {
|
||||
if (timeUpdater == null) {
|
||||
timeUpdater = new Runnable() {
|
||||
@SuppressLint("DefaultLocale")
|
||||
@Override
|
||||
public void run() {
|
||||
if (mediaPlayer != null && mediaPlayer.isPlaying()) {
|
||||
long currentTime = SystemClock.elapsedRealtime();
|
||||
elapsedTime = currentTime - startTime;
|
||||
int milliseconds = (int) (elapsedTime % 1000) / 10;
|
||||
int seconds = (int) (elapsedTime / 1000) % 60;
|
||||
int minutes = (int) (elapsedTime / (1000 * 60)) % 60;
|
||||
binding.audioTime.setText(String.format("%02d : %02d : %02d", minutes, seconds, milliseconds));
|
||||
handler.postDelayed(this, 10);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
startTime = SystemClock.elapsedRealtime();
|
||||
handler.post(timeUpdater);
|
||||
}
|
||||
|
||||
private void initEvent() {
|
||||
binding.back.setOnClickListener(v -> finish());
|
||||
binding.imPlayBtn.setOnClickListener(v -> {
|
||||
binding.imPlayBtn.setSelected(!binding.imPlayBtn.isSelected());
|
||||
try {
|
||||
togglePrank();
|
||||
} catch (IOException e) {
|
||||
Log.e("SaveActivity", "Error toggling prank", e);
|
||||
}
|
||||
});
|
||||
binding.save.setOnClickListener(v -> {
|
||||
String name = binding.saveEdit.getText().toString().trim();
|
||||
boolean b = DbManager.checkName(name);
|
||||
if (!TextUtils.isEmpty(name)) {
|
||||
if(!b){
|
||||
binding.saveEdit.setText("");
|
||||
Toast.makeText(ActivitySave.this, getString(R.string.name_hint), Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
saveData(name);
|
||||
Toast.makeText(ActivitySave.this, getString(R.string.save_tips), Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
} else {
|
||||
Toast.makeText(ActivitySave.this, getString(R.string.save_tip), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void saveData(String name) {
|
||||
File cacheDir = getCacheDir();
|
||||
File sourceFile = new File(path);
|
||||
File destinationFile = new File(cacheDir, name + ".mp3");
|
||||
|
||||
if (sourceFile.renameTo(destinationFile)) {
|
||||
Info mydata = new Info();
|
||||
mydata.setLike(false);
|
||||
mydata.setName(name);
|
||||
mydata.setCustomization(true);
|
||||
mydata.setAudioUrl(destinationFile.getAbsolutePath());
|
||||
DbManager.getBoxBean().put(mydata);
|
||||
} else {
|
||||
Log.e("SaveActivity", "Failed to rename file");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private String readFileFromUri(Context context, Uri uri) {
|
||||
ContentResolver contentResolver = context.getContentResolver();
|
||||
try (InputStream inputStream = contentResolver.openInputStream(uri);
|
||||
FileOutputStream outputStream = new FileOutputStream(new File(getCacheDir(), "temp_audio_file.mp3"))) {
|
||||
|
||||
if (inputStream == null) {
|
||||
Log.e("SaveActivity", "Input stream is null");
|
||||
return null;
|
||||
}
|
||||
byte[] buffer = new byte[1024];
|
||||
int bytesRead;
|
||||
while ((bytesRead = inputStream.read(buffer)) != -1) {
|
||||
outputStream.write(buffer, 0, bytesRead);
|
||||
}
|
||||
return new File(getCacheDir(), "temp_audio_file.mp3").getAbsolutePath();
|
||||
} catch (IOException e) {
|
||||
Log.e("SaveActivity", "Error reading file from URI", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
Intent intent = getIntent();
|
||||
audioDuration = intent.getLongExtra(KEY_Time, 0);
|
||||
int importFlag = intent.getIntExtra(KEY_import, 0);
|
||||
|
||||
if (importFlag == 1) {
|
||||
path = intent.getStringExtra(KEY_Path);
|
||||
Log.e("zzj", "save path is" + path);
|
||||
} else {
|
||||
String uriPath = intent.getStringExtra(KEY_Path);
|
||||
Uri uri = Uri.parse(uriPath);
|
||||
path = readFileFromUri(this, uri);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
stopPrank();
|
||||
}
|
||||
}
|
||||
98
app/src/main/java/com/prank/tool/adapter/AdapterChild.java
Normal file
98
app/src/main/java/com/prank/tool/adapter/AdapterChild.java
Normal file
@ -0,0 +1,98 @@
|
||||
package com.prank.tool.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.prank.tool.R;
|
||||
import com.prank.tool.databinding.ItemInfoBinding;
|
||||
import com.prank.tool.interf.OnSoundsListener;
|
||||
import com.prank.tool.jbean.Info;
|
||||
import com.prank.tool.utils.Tools;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class AdapterChild extends RecyclerView.Adapter<AdapterChild.ViewHolder> {
|
||||
|
||||
private final List<Info> mValues;
|
||||
|
||||
private Context mCon;
|
||||
private int type;
|
||||
private OnSoundsListener mListener;
|
||||
private int colorIndex;
|
||||
|
||||
public void setColorIndex(int colorIndex) {
|
||||
this.colorIndex = colorIndex;
|
||||
}
|
||||
|
||||
public AdapterChild(Context context, List<Info> items, int mType, OnSoundsListener listener) {
|
||||
mValues = items;
|
||||
this.mCon = context;
|
||||
type = mType;
|
||||
mListener = listener;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
|
||||
return new ViewHolder(ItemInfoBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(final ViewHolder holder, int position) {
|
||||
|
||||
holder.vb.relative.setBackground(ContextCompat.getDrawable(mCon, Tools.childBgs[colorIndex]));
|
||||
Info info = mValues.get(position);
|
||||
String covert = info.getCovert();
|
||||
Glide.with(mCon).load(covert).into(holder.vb.image);
|
||||
holder.vb.name.setText(info.getName());
|
||||
holder.vb.getRoot().setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mListener.onClickSoundsListener(info);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mValues.size();
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private ItemInfoBinding vb;
|
||||
|
||||
public ViewHolder(ItemInfoBinding binding) {
|
||||
super(binding.getRoot());
|
||||
vb = binding;
|
||||
ViewGroup.LayoutParams layoutParams = vb.relative.getLayoutParams();
|
||||
if(type == 0){
|
||||
layoutParams.width = RelativeLayout.LayoutParams.MATCH_PARENT;
|
||||
// vb.relative.setBackground(ContextCompat.getDrawable(mCon, R.drawable.rect_main_gradient));
|
||||
vb.name.setMaxLines(2);
|
||||
}else {
|
||||
layoutParams.width = (int) Tools.dpToPx(130);
|
||||
vb.relative.setBackground(ContextCompat.getDrawable(mCon, R.drawable.rect_more));
|
||||
vb.name.setMaxLines(1);
|
||||
}
|
||||
vb.relative.setLayoutParams(layoutParams);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
75
app/src/main/java/com/prank/tool/adapter/AdapterHome.java
Normal file
75
app/src/main/java/com/prank/tool/adapter/AdapterHome.java
Normal file
@ -0,0 +1,75 @@
|
||||
package com.prank.tool.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.prank.tool.jbean.MyBean;
|
||||
import com.prank.tool.databinding.ItemHomeBinding;
|
||||
import com.prank.tool.utils.Tools;
|
||||
import com.prank.tool.act.ActivityInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class AdapterHome extends RecyclerView.Adapter<AdapterHome.ViewHolder> {
|
||||
|
||||
private final List<MyBean> mValues;
|
||||
|
||||
private Context mCon;
|
||||
|
||||
|
||||
public AdapterHome(Context context, List<MyBean> items) {
|
||||
mValues = items;
|
||||
this.mCon = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
|
||||
return new ViewHolder(ItemHomeBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(final ViewHolder holder, int position) {
|
||||
int i = position % 6;
|
||||
holder.vb.relative.setBackground(ContextCompat.getDrawable(mCon, Tools.bgs[i]));
|
||||
MyBean myBean = mValues.get(position);
|
||||
String covert = myBean.getCovert();
|
||||
Glide.with(mCon).load(covert).into(holder.vb.image);
|
||||
holder.vb.name.setText(myBean.getName());
|
||||
holder.vb.relative.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(mCon, ActivityInfo.class);
|
||||
intent.putExtra(Tools.KEY_LIST_DATA, myBean);
|
||||
intent.putExtra(Tools.KEY_LIST_COLOR_POS, i);
|
||||
mCon.startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mValues.size();
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private ItemHomeBinding vb;
|
||||
|
||||
public ViewHolder(ItemHomeBinding binding) {
|
||||
super(binding.getRoot());
|
||||
vb = binding;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
118
app/src/main/java/com/prank/tool/adapter/AdapterLike.java
Normal file
118
app/src/main/java/com/prank/tool/adapter/AdapterLike.java
Normal file
@ -0,0 +1,118 @@
|
||||
package com.prank.tool.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.prank.tool.R;
|
||||
import com.prank.tool.act.ActivityPlay;
|
||||
import com.prank.tool.databinding.ItemLikeBinding;
|
||||
import com.prank.tool.jbean.Info;
|
||||
import com.prank.tool.utils.DbManager;
|
||||
import com.prank.tool.utils.Tools;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class AdapterLike extends RecyclerView.Adapter<AdapterLike.ViewHolder> {
|
||||
|
||||
private List<Info> mValues;
|
||||
private Context mCOn;
|
||||
private boolean showDelete = false;
|
||||
|
||||
|
||||
|
||||
public AdapterLike(Context context, List<Info> items, boolean showDelete) {
|
||||
mValues = items;
|
||||
mCOn = context;
|
||||
this.showDelete = showDelete;
|
||||
|
||||
}
|
||||
|
||||
public void updateData(List<Info> items) {
|
||||
mValues = items;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
|
||||
return new ViewHolder(ItemLikeBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false));
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(final ViewHolder holder, int position) {
|
||||
Info info = mValues.get(position);
|
||||
holder.vb.ttvName.setText(info.getName());
|
||||
int colorIndex = info.getColorIndex();
|
||||
holder.vb.layout.setBackground(ContextCompat.getDrawable(mCOn, Tools.childBgs[colorIndex]));
|
||||
if (info.isCustomization()) {
|
||||
Glide.with(mCOn).load(R.drawable.default_import_audio).into(holder.vb.image);
|
||||
} else {
|
||||
Glide.with(mCOn).load(info.getCovert()).into(holder.vb.image);
|
||||
}
|
||||
|
||||
if (showDelete) {
|
||||
holder.vb.imDelete.setVisibility(View.VISIBLE);
|
||||
holder.vb.imDelete.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
DbManager.getBoxBean().remove(info);
|
||||
int bindingAdapterPosition = holder.getBindingAdapterPosition();
|
||||
String audioUrl = info.getAudioUrl();
|
||||
int pos = holder.getBindingAdapterPosition();
|
||||
mValues.remove(pos);
|
||||
notifyItemRemoved(pos);
|
||||
File file = new File(audioUrl);
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
holder.vb.imDelete.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
||||
holder.vb.layout.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(mCOn, ActivityPlay.class);
|
||||
intent.putExtra(Tools.KEY_PLAY_DATA, info);
|
||||
intent.putExtra(Tools.KEY_LIST_COLOR_POS, colorIndex);
|
||||
mCOn.startActivity(intent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mValues.size();
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
public ItemLikeBinding vb;
|
||||
|
||||
public ViewHolder(ItemLikeBinding binding) {
|
||||
super(binding.getRoot());
|
||||
vb = binding;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
80
app/src/main/java/com/prank/tool/frag/FragmentLike.java
Normal file
80
app/src/main/java/com/prank/tool/frag/FragmentLike.java
Normal file
@ -0,0 +1,80 @@
|
||||
package com.prank.tool.frag;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.prank.tool.adapter.AdapterLike;
|
||||
import com.prank.tool.databinding.FragmentLikeBinding;
|
||||
import com.prank.tool.jbean.Info;
|
||||
import com.prank.tool.utils.DbManager;
|
||||
import com.prank.tool.utils.Space;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class FragmentLike extends Fragment {
|
||||
|
||||
private AdapterLike adapter;
|
||||
|
||||
public FragmentLike() {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static FragmentLike newInstance() {
|
||||
FragmentLike fragment = new FragmentLike();
|
||||
Bundle args = new Bundle();
|
||||
// args.putInt(ARG_COLUMN_COUNT, columnCount);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
private FragmentLikeBinding collectBinding;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
collectBinding = FragmentLikeBinding.inflate(getLayoutInflater());
|
||||
RecyclerView recyclerView = collectBinding.list;
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(requireContext(), 2));
|
||||
List<Info> all = DbManager.getAllLike();
|
||||
if(all.size()==0){
|
||||
collectBinding.layoutEmpty.setVisibility(View.VISIBLE);
|
||||
collectBinding.list.setVisibility(View.GONE);
|
||||
}else {
|
||||
collectBinding.layoutEmpty.setVisibility(View.GONE);
|
||||
collectBinding.list.setVisibility(View.VISIBLE);
|
||||
}
|
||||
adapter = new AdapterLike(requireContext(), all,false);
|
||||
Space itemHelper = new Space(10, 10, 5);
|
||||
recyclerView.addItemDecoration(itemHelper);
|
||||
recyclerView.setAdapter(adapter);
|
||||
|
||||
return collectBinding.getRoot();
|
||||
}
|
||||
|
||||
public void refresh() {
|
||||
if (adapter != null) {
|
||||
List<Info> all = DbManager.getAllLike();
|
||||
if(all.size()==0){
|
||||
collectBinding.layoutEmpty.setVisibility(View.VISIBLE);
|
||||
collectBinding.list.setVisibility(View.GONE);
|
||||
}else {
|
||||
collectBinding.layoutEmpty.setVisibility(View.GONE);
|
||||
collectBinding.list.setVisibility(View.VISIBLE);
|
||||
}
|
||||
adapter.updateData(all);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
124
app/src/main/java/com/prank/tool/frag/FragmentMain.java
Normal file
124
app/src/main/java/com/prank/tool/frag/FragmentMain.java
Normal file
@ -0,0 +1,124 @@
|
||||
package com.prank.tool.frag;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
|
||||
import com.prank.tool.MyApp;
|
||||
import com.prank.tool.jbean.Info;
|
||||
import com.prank.tool.jbean.MyBean;
|
||||
import com.prank.tool.databinding.FragmentHomeBinding;
|
||||
import com.prank.tool.utils.Space;
|
||||
import com.prank.tool.adapter.AdapterHome;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class FragmentMain extends Fragment {
|
||||
|
||||
|
||||
private FragmentHomeBinding binding;
|
||||
|
||||
private List<Info> list;
|
||||
private boolean first = true;
|
||||
|
||||
public FragmentMain() {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static FragmentMain newInstance() {
|
||||
FragmentMain fragment = new FragmentMain();
|
||||
Bundle args = new Bundle();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
binding = FragmentHomeBinding.inflate(inflater);
|
||||
|
||||
Space itemHelper = new Space(15, 25, 10);
|
||||
binding.recyclerView.addItemDecoration(itemHelper);
|
||||
binding.recyclerView.setLayoutManager(new GridLayoutManager(requireContext(), 2));
|
||||
binding.recyclerView.setAdapter(new AdapterHome(requireContext(), MyApp.bean));
|
||||
initAudioData();
|
||||
// binding.linearPlay.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// if (mediaPlayer != null && mediaPlayer.isPlaying()) {
|
||||
// mediaPlayer.pause();
|
||||
// binding.btnPlay.setSelected(false);
|
||||
// return;
|
||||
// }
|
||||
// if (first) {
|
||||
// binding.btnPlay.setSelected(true);
|
||||
// first = false;
|
||||
// mediaPlayer.start();
|
||||
// } else {
|
||||
// playAudio(true);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// }
|
||||
// });
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
private void initAudioData() {
|
||||
list = new ArrayList<>();
|
||||
for (MyBean category : MyApp.bean) {
|
||||
list.addAll(category.getInfoList());
|
||||
}
|
||||
initAudio();
|
||||
}
|
||||
|
||||
private void initAudio() {
|
||||
// mediaPlayer = new MediaPlayer();
|
||||
// mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
|
||||
// @Override
|
||||
// public void onCompletion(MediaPlayer mp) {
|
||||
// binding.btnPlay.setSelected(false);
|
||||
// }
|
||||
// });
|
||||
// playAudio(false);
|
||||
}
|
||||
|
||||
|
||||
// private void playAudio(boolean play) {
|
||||
// Collections.shuffle(list);
|
||||
// childData = list.get(0);
|
||||
// Glide.with(this)
|
||||
// .load(childData.getCovert())
|
||||
// .into(binding.audioIm);
|
||||
// try {
|
||||
// mediaPlayer.reset();
|
||||
// mediaPlayer.setDataSource(childData.getAudioUrl());
|
||||
// mediaPlayer.prepareAsync();
|
||||
// mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
|
||||
// @Override
|
||||
// public void onPrepared(MediaPlayer mp) {
|
||||
// if (play) {
|
||||
// binding.btnPlay.setSelected(true);
|
||||
// mediaPlayer.start();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// } catch (IOException ioException) {
|
||||
//
|
||||
//
|
||||
// }
|
||||
// }
|
||||
}
|
||||
212
app/src/main/java/com/prank/tool/frag/FragmentRecorder.java
Normal file
212
app/src/main/java/com/prank/tool/frag/FragmentRecorder.java
Normal file
@ -0,0 +1,212 @@
|
||||
package com.prank.tool.frag;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.activity.result.ActivityResultCallback;
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
|
||||
import com.prank.tool.act.ActivityRecorder;
|
||||
import com.prank.tool.act.ActivitySave;
|
||||
import com.prank.tool.adapter.AdapterLike;
|
||||
import com.prank.tool.databinding.FragmentRecorderBinding;
|
||||
import com.prank.tool.interf.OnImportListener;
|
||||
import com.prank.tool.jbean.Info;
|
||||
import com.prank.tool.popu.PopRecorder;
|
||||
import com.prank.tool.utils.DbManager;
|
||||
import com.prank.tool.utils.Space;
|
||||
import com.prank.tool.utils.Tools;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class FragmentRecorder extends Fragment implements View.OnClickListener , OnImportListener {
|
||||
|
||||
private FragmentRecorderBinding binding;
|
||||
private AdapterLike adapter;
|
||||
private ActivityResultLauncher<String> requestRecordAudioLauncher;
|
||||
private ActivityResultLauncher<String> audioPickerLauncher;
|
||||
private ActivityResultLauncher<String[]> requestStorePermissionsLauncher;
|
||||
private PopRecorder popRecorder;
|
||||
public FragmentRecorder() {
|
||||
|
||||
}
|
||||
|
||||
public static FragmentRecorder newInstance() {
|
||||
FragmentRecorder fragment = new FragmentRecorder();
|
||||
Bundle args = new Bundle();
|
||||
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
requestRecordAudioLauncher = registerForActivityResult(
|
||||
new ActivityResultContracts.RequestPermission(),
|
||||
isGranted -> {
|
||||
if (isGranted) {
|
||||
intentRecordAudio();
|
||||
} else {
|
||||
Toast.makeText(requireContext(), "Recording permission denied", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
requestStorePermissionsLauncher = registerForActivityResult(
|
||||
new ActivityResultContracts.RequestMultiplePermissions(),
|
||||
new ActivityResultCallback<Map<String, Boolean>>() {
|
||||
@Override
|
||||
public void onActivityResult(Map<String, Boolean> result) {
|
||||
Boolean isGranted = true;
|
||||
for (Map.Entry<String, Boolean> entry : result.entrySet()) {
|
||||
String permission = entry.getKey();
|
||||
isGranted = entry.getValue();
|
||||
if(!entry.getValue()){
|
||||
isGranted = false;
|
||||
}
|
||||
|
||||
}
|
||||
if (isGranted) {
|
||||
importAudio();
|
||||
}else {
|
||||
Toast.makeText(requireContext(), " 权限被拒绝", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
audioPickerLauncher = registerForActivityResult(new ActivityResultContracts.GetContent(),
|
||||
new ActivityResultCallback<Uri>() {
|
||||
@Override
|
||||
public void onActivityResult(Uri uri) {
|
||||
// Handle the returned Uri
|
||||
|
||||
if (uri != null) {
|
||||
long duration = Tools.getAudioDuration(requireContext(), uri);
|
||||
Intent intent = new Intent(requireContext(), ActivitySave.class);
|
||||
intent.putExtra(ActivitySave.KEY_Path, uri.toString());
|
||||
intent.putExtra(ActivitySave.KEY_Time, duration);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
binding = FragmentRecorderBinding.inflate(getLayoutInflater());
|
||||
|
||||
binding.menu.setOnClickListener(this);
|
||||
Space itemHelper = new Space(10, 10, 5);
|
||||
binding.recyclerImport.addItemDecoration(itemHelper);
|
||||
binding.recyclerImport.setLayoutManager(new GridLayoutManager(requireContext(), 2));
|
||||
List<Info> all = DbManager.getAllCustomization();
|
||||
updateUi(all);
|
||||
adapter = new AdapterLike(requireContext(), all,true);
|
||||
binding.recyclerImport.setAdapter(adapter);
|
||||
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
|
||||
public void refresh() {
|
||||
if (adapter != null) {
|
||||
List<Info> all = DbManager.getAllCustomization();
|
||||
updateUi(all);
|
||||
adapter.updateData(all);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void updateUi(List<Info> all) {
|
||||
if (all.size() == 0) {
|
||||
binding.noImportHint.setVisibility(View.VISIBLE);
|
||||
binding.recyclerImport.setVisibility(View.GONE);
|
||||
} else {
|
||||
binding.noImportHint.setVisibility(View.GONE);
|
||||
binding.recyclerImport.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
private void checkAndRequestAudioPermission() {
|
||||
if (ContextCompat.checkSelfPermission(requireContext(), Tools.permission_record_audio)
|
||||
!= PackageManager.PERMISSION_GRANTED) {
|
||||
requestRecordAudioLauncher.launch(Tools.permission_record_audio);
|
||||
} else {
|
||||
intentRecordAudio();
|
||||
}
|
||||
}
|
||||
|
||||
private void intentRecordAudio() {
|
||||
Intent intent = new Intent(requireContext(), ActivityRecorder.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if(v.equals(binding.menu)){
|
||||
if (popRecorder == null) {
|
||||
popRecorder = new PopRecorder(requireActivity(), this);
|
||||
}
|
||||
popRecorder.showBottom(binding.menu);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void importAudio() {
|
||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
intent.setType("audio/*");
|
||||
audioPickerLauncher.launch("audio/*");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onClickTimerListener(int type) {
|
||||
switch (type){
|
||||
case 0:
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
if (ContextCompat.checkSelfPermission(requireContext(), Tools.permission_read_audio[0])
|
||||
!= PackageManager.PERMISSION_GRANTED) {
|
||||
requestStorePermissionsLauncher.launch(Tools.permission_read_audio);
|
||||
// ActivityCompat.requestPermissions(requireActivity(), ConstValues.permission_read_audio,
|
||||
// ConstValues.REQUEST_READ_STORAGE_PERMISSION);
|
||||
} else {
|
||||
importAudio();
|
||||
}
|
||||
} else {
|
||||
if (ContextCompat.checkSelfPermission(requireContext(), Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||
!= PackageManager.PERMISSION_GRANTED ||
|
||||
ContextCompat.checkSelfPermission(requireContext(), Manifest.permission.READ_EXTERNAL_STORAGE)
|
||||
!= PackageManager.PERMISSION_GRANTED) {
|
||||
requestStorePermissionsLauncher.launch(Tools.permission_store);
|
||||
// ActivityCompat.requestPermissions(requireActivity(), ConstValues.permission_store, ConstValues.REQUEST_READ_STORAGE_PERMISSION);
|
||||
} else {
|
||||
importAudio();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
checkAndRequestAudioPermission();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
package com.prank.tool.interf;
|
||||
|
||||
public interface OnImportListener {
|
||||
|
||||
void onClickTimerListener(int type);
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
package com.prank.tool.interf;
|
||||
|
||||
import com.prank.tool.jbean.Info;
|
||||
|
||||
public interface OnSoundsListener {
|
||||
|
||||
void onClickSoundsListener(Info data);
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
package com.prank.tool.interf;
|
||||
|
||||
public interface OnTimerListener {
|
||||
|
||||
void onClickTimerListener(long time);
|
||||
}
|
||||
78
app/src/main/java/com/prank/tool/jbean/Info.java
Normal file
78
app/src/main/java/com/prank/tool/jbean/Info.java
Normal file
@ -0,0 +1,78 @@
|
||||
package com.prank.tool.jbean;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.objectbox.annotation.Entity;
|
||||
import io.objectbox.annotation.Id;
|
||||
|
||||
@Entity
|
||||
public class Info implements Serializable {
|
||||
@Id
|
||||
private long id;
|
||||
|
||||
private String name;
|
||||
private String covert;
|
||||
|
||||
private String audioUrl;
|
||||
private boolean isLike;
|
||||
|
||||
private boolean isCustomization;
|
||||
private int colorIndex;
|
||||
|
||||
public int getColorIndex() {
|
||||
return colorIndex;
|
||||
}
|
||||
|
||||
public void setColorIndex(int colorIndex) {
|
||||
this.colorIndex = colorIndex;
|
||||
}
|
||||
|
||||
public boolean isCustomization() {
|
||||
return isCustomization;
|
||||
}
|
||||
|
||||
public void setCustomization(boolean customization) {
|
||||
isCustomization = customization;
|
||||
}
|
||||
|
||||
public boolean isLike() {
|
||||
return isLike;
|
||||
}
|
||||
|
||||
public void setLike(boolean like) {
|
||||
isLike = like;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCovert() {
|
||||
return covert;
|
||||
}
|
||||
|
||||
public void setCovert(String covert) {
|
||||
this.covert = covert;
|
||||
}
|
||||
|
||||
public String getAudioUrl() {
|
||||
return audioUrl;
|
||||
}
|
||||
|
||||
public void setAudioUrl(String audioUrl) {
|
||||
this.audioUrl = audioUrl;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
50
app/src/main/java/com/prank/tool/jbean/MyBean.java
Normal file
50
app/src/main/java/com/prank/tool/jbean/MyBean.java
Normal file
@ -0,0 +1,50 @@
|
||||
package com.prank.tool.jbean;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import io.objectbox.annotation.Entity;
|
||||
import io.objectbox.annotation.Id;
|
||||
|
||||
|
||||
@Entity
|
||||
public class MyBean implements Serializable {
|
||||
@Id
|
||||
private long id;
|
||||
private String name;
|
||||
private String covert;
|
||||
|
||||
private List<Info> infoList;
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCovert() {
|
||||
return covert;
|
||||
}
|
||||
|
||||
public void setCovert(String covert) {
|
||||
this.covert = covert;
|
||||
}
|
||||
|
||||
public List<Info> getInfoList() {
|
||||
return infoList;
|
||||
}
|
||||
|
||||
public void setInfoList(List<Info> infoList) {
|
||||
this.infoList = infoList;
|
||||
}
|
||||
}
|
||||
69
app/src/main/java/com/prank/tool/popu/PopRecorder.java
Normal file
69
app/src/main/java/com/prank/tool/popu/PopRecorder.java
Normal file
@ -0,0 +1,69 @@
|
||||
package com.prank.tool.popu;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.PopupWindow;
|
||||
|
||||
import com.prank.tool.databinding.PopupRecordBinding;
|
||||
import com.prank.tool.interf.OnImportListener;
|
||||
|
||||
|
||||
public class PopRecorder implements View.OnClickListener {
|
||||
private PopupRecordBinding binding;
|
||||
private PopupWindow popupWindow;
|
||||
private OnImportListener mListener;
|
||||
|
||||
public PopRecorder(Activity context, OnImportListener listener) {
|
||||
mListener = listener;
|
||||
binding = PopupRecordBinding.inflate(context.getLayoutInflater());
|
||||
popupWindow = new PopupWindow(binding.getRoot(), ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
popupWindow.setBackgroundDrawable(new BitmapDrawable());
|
||||
popupWindow.setOutsideTouchable(true);
|
||||
popupWindow.setFocusable(true);
|
||||
binding.imImport.setOnClickListener(this);
|
||||
binding.recordBtn.setOnClickListener(this);
|
||||
|
||||
}
|
||||
|
||||
public void showBottom(View view) {
|
||||
|
||||
int[] location = new int[2];
|
||||
view.getLocationOnScreen(location);
|
||||
|
||||
int x = location[0];
|
||||
int y = location[1];
|
||||
|
||||
|
||||
int popupHeight = popupWindow.getHeight();
|
||||
int height = view.getHeight();
|
||||
int width = view.getWidth();
|
||||
Log.d("-------------", "--------x=" + x + "---y=" + y + "----popupHeight=" + popupHeight);
|
||||
// popupWindow.showAtLocation(view, Gravity.NO_GRAVITY, x-30, y - popupHeight+height);
|
||||
popupWindow.showAsDropDown(view, -80,
|
||||
0,
|
||||
Gravity.NO_GRAVITY);
|
||||
}
|
||||
|
||||
|
||||
public void hide() {
|
||||
popupWindow.dismiss();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
if (v.equals(binding.imImport)) {
|
||||
mListener.onClickTimerListener(0);
|
||||
hide();
|
||||
} else if (v.equals(binding.recordBtn)) {
|
||||
mListener.onClickTimerListener(1);
|
||||
hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
104
app/src/main/java/com/prank/tool/popu/PopTimer.java
Normal file
104
app/src/main/java/com/prank/tool/popu/PopTimer.java
Normal file
@ -0,0 +1,104 @@
|
||||
package com.prank.tool.popu;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.PopupWindow;
|
||||
|
||||
import com.prank.tool.databinding.PopupTimerBinding;
|
||||
import com.prank.tool.interf.OnTimerListener;
|
||||
import com.prank.tool.utils.FontTextView;
|
||||
|
||||
public class PopTimer implements View.OnClickListener {
|
||||
private PopupTimerBinding binding;
|
||||
private PopupWindow popupWindow;
|
||||
private OnTimerListener mListener;
|
||||
|
||||
public PopTimer(Activity context, OnTimerListener listener) {
|
||||
mListener = listener;
|
||||
binding = PopupTimerBinding.inflate(context.getLayoutInflater());
|
||||
popupWindow = new PopupWindow(binding.getRoot(), ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
popupWindow.setBackgroundDrawable(new BitmapDrawable());
|
||||
popupWindow.setOutsideTouchable(true);
|
||||
popupWindow.setFocusable(true);
|
||||
binding.tvOff.setSelected(true);
|
||||
binding.tvOff.setOnClickListener(this);
|
||||
binding.tv15s.setOnClickListener(this);
|
||||
binding.tv30s.setOnClickListener(this);
|
||||
binding.tv1m.setOnClickListener(this);
|
||||
binding.tv5m.setOnClickListener(this);
|
||||
}
|
||||
|
||||
public void showTop(View view) {
|
||||
|
||||
int[] location = new int[2];
|
||||
view.getLocationOnScreen(location);
|
||||
|
||||
int x = location[0];
|
||||
int y = location[1];
|
||||
|
||||
|
||||
int popupHeight = popupWindow.getHeight();
|
||||
int height = view.getHeight();
|
||||
int width = view.getWidth();
|
||||
Log.d("-------------", "--------x=" + x + "---y=" + y + "----popupHeight=" + popupHeight);
|
||||
// popupWindow.showAtLocation(view, Gravity.NO_GRAVITY, x-30, y - popupHeight+height);
|
||||
popupWindow.showAsDropDown(view, -50,
|
||||
0,
|
||||
Gravity.NO_GRAVITY);
|
||||
}
|
||||
|
||||
private void setSelected(FontTextView tv) {
|
||||
int childCount = binding.layoutTime.getChildCount();
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
View child = binding.layoutTime.getChildAt(i);
|
||||
if (child instanceof FontTextView) {
|
||||
FontTextView tvTimer = (FontTextView) child;
|
||||
if (tvTimer.equals(tv)) {
|
||||
tvTimer.setSelected(true);
|
||||
} else {
|
||||
tvTimer.setSelected(false);
|
||||
}
|
||||
System.out.println("TextView: " + tvTimer.getText());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public void hide() {
|
||||
popupWindow.dismiss();
|
||||
|
||||
}
|
||||
public void setOffSelected() {
|
||||
setSelected(binding.tvOff);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v instanceof FontTextView) {
|
||||
FontTextView v1 = (FontTextView) v;
|
||||
String string = v1.getText().toString();
|
||||
switch (string){
|
||||
case "off":
|
||||
mListener.onClickTimerListener(-1);
|
||||
break;
|
||||
case "15 sec":
|
||||
mListener.onClickTimerListener(15*1000L);
|
||||
break;
|
||||
case "30 sec":
|
||||
mListener.onClickTimerListener(30*1000L);
|
||||
break;
|
||||
case "1 min":
|
||||
mListener.onClickTimerListener(60*1000L);
|
||||
break;
|
||||
case "5 min":
|
||||
mListener.onClickTimerListener(5*60*1000L);
|
||||
break;
|
||||
}
|
||||
setSelected(v1);
|
||||
}
|
||||
}
|
||||
}
|
||||
88
app/src/main/java/com/prank/tool/utils/DbManager.java
Normal file
88
app/src/main/java/com/prank/tool/utils/DbManager.java
Normal file
@ -0,0 +1,88 @@
|
||||
package com.prank.tool.utils;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.prank.tool.jbean.Info;
|
||||
import com.prank.tool.jbean.Info_;
|
||||
import com.prank.tool.jbean.MyObjectBox;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import io.objectbox.Box;
|
||||
import io.objectbox.BoxStore;
|
||||
import io.objectbox.query.Query;
|
||||
|
||||
public class DbManager {
|
||||
|
||||
private static BoxStore store;
|
||||
|
||||
public static void init(Context context) {
|
||||
store = MyObjectBox.builder()
|
||||
.androidContext(context)
|
||||
.build();
|
||||
}
|
||||
|
||||
public static Box<Info> getBoxBean() {
|
||||
return store.boxFor(Info.class);
|
||||
}
|
||||
|
||||
|
||||
public static List<Info> getAllLike() {
|
||||
Query<Info> query = DbManager.getBoxBean().query(Info_.isLike.equal(true)).build();
|
||||
List<Info> data = query.find();
|
||||
query.close();
|
||||
return data;
|
||||
}
|
||||
|
||||
public static List<Info> getAllCustomization() {
|
||||
Query<Info> query = DbManager.getBoxBean().query(Info_.isCustomization.equal(true)).build();
|
||||
List<Info> data = query.find();
|
||||
query.close();
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
public static List<Info> getMore() {
|
||||
Query<Info> query = DbManager.getBoxBean().query(Info_.isCustomization.equal(false)).build();
|
||||
List<Info> data = query.find();
|
||||
query.close();
|
||||
Collections.shuffle(data);
|
||||
return data.subList(0, 11);
|
||||
}
|
||||
public static boolean checkLike(Info info) {
|
||||
Query<Info> query = DbManager.getBoxBean().query(Info_.name.equal(info.getName())).build();
|
||||
Info data = query.findFirst();
|
||||
query.close();
|
||||
if (data != null) {
|
||||
return data.isLike();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static boolean checkName(String name) {
|
||||
Query<Info> query = DbManager.getBoxBean().query(Info_.name.equal(name)).build();
|
||||
Info data = query.findFirst();
|
||||
query.close();
|
||||
if (data != null) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void addLike(Info info) {
|
||||
info.setLike(true);
|
||||
DbManager.getBoxBean().put(info);
|
||||
}
|
||||
|
||||
public static void removeLike(Info info) {
|
||||
info.setLike(false);
|
||||
DbManager.getBoxBean().put(info);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
35
app/src/main/java/com/prank/tool/utils/FontTextView.java
Normal file
35
app/src/main/java/com/prank/tool/utils/FontTextView.java
Normal file
@ -0,0 +1,35 @@
|
||||
package com.prank.tool.utils;
|
||||
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.prank.tool.R;
|
||||
|
||||
|
||||
public class FontTextView extends androidx.appcompat.widget.AppCompatTextView {
|
||||
|
||||
|
||||
public FontTextView(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
initAttrs(context,attrs);
|
||||
}
|
||||
|
||||
|
||||
private void initAttrs(Context context, AttributeSet attrs){
|
||||
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.MyTV);
|
||||
boolean aBoolean = typedArray.getBoolean(R.styleable.MyTV_apply_font,false);
|
||||
if(aBoolean){
|
||||
Tools.initFont(this);
|
||||
}
|
||||
|
||||
typedArray.recycle();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
58
app/src/main/java/com/prank/tool/utils/RecorderManager.java
Normal file
58
app/src/main/java/com/prank/tool/utils/RecorderManager.java
Normal file
@ -0,0 +1,58 @@
|
||||
package com.prank.tool.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.media.MediaRecorder;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class RecorderManager {
|
||||
private MediaRecorder mediaRecorder;
|
||||
private String tempFileName;
|
||||
private String fileName;
|
||||
private boolean isRecording = false;
|
||||
|
||||
public RecorderManager(Context context) {
|
||||
|
||||
File dir = context.getCacheDir();
|
||||
File file = new File(dir, "temp_audio.mp3");
|
||||
tempFileName = file.getAbsolutePath();
|
||||
}
|
||||
|
||||
|
||||
public void startRecording() {
|
||||
if (isRecording) return;
|
||||
|
||||
mediaRecorder = new MediaRecorder();
|
||||
mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
|
||||
mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
|
||||
mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
|
||||
mediaRecorder.setOutputFile(tempFileName);
|
||||
|
||||
try {
|
||||
mediaRecorder.prepare();
|
||||
mediaRecorder.start();
|
||||
isRecording = true;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void stopRecording() {
|
||||
if (!isRecording) return;
|
||||
|
||||
try {
|
||||
mediaRecorder.stop();
|
||||
} catch (IllegalStateException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
mediaRecorder.release();
|
||||
mediaRecorder = null;
|
||||
isRecording = false;
|
||||
}
|
||||
}
|
||||
|
||||
public String getTempFileName() {
|
||||
return tempFileName;
|
||||
}
|
||||
}
|
||||
76
app/src/main/java/com/prank/tool/utils/Space.java
Normal file
76
app/src/main/java/com/prank/tool/utils/Space.java
Normal file
@ -0,0 +1,76 @@
|
||||
package com.prank.tool.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.prank.tool.MyApp;
|
||||
|
||||
|
||||
public class Space extends RecyclerView.ItemDecoration {
|
||||
|
||||
private int v, h, ex;
|
||||
|
||||
public Space(int v, int h, int ex) {
|
||||
this.v = Math.round(dpToPx(v));
|
||||
this.h = Math.round(dpToPx(h));
|
||||
this.ex = Math.round(dpToPx(ex));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
|
||||
super.getItemOffsets(outRect, view, parent, state);
|
||||
int spanCount = 1;
|
||||
int spanSize = 1;
|
||||
int spanIndex = 0;
|
||||
|
||||
int childAdapterPosition = parent.getChildAdapterPosition(view);
|
||||
RecyclerView.LayoutManager layoutManager = parent.getLayoutManager();
|
||||
if (layoutManager instanceof StaggeredGridLayoutManager) {
|
||||
StaggeredGridLayoutManager staggeredGridLayoutManager = (StaggeredGridLayoutManager) layoutManager;
|
||||
StaggeredGridLayoutManager.LayoutParams layoutParams = (StaggeredGridLayoutManager.LayoutParams) view.getLayoutParams();
|
||||
spanCount = staggeredGridLayoutManager.getSpanCount();
|
||||
if (layoutParams.isFullSpan()) {
|
||||
spanSize = spanCount;
|
||||
}
|
||||
spanIndex = layoutParams.getSpanIndex();
|
||||
} 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();
|
||||
} else if (layoutManager instanceof LinearLayoutManager) {
|
||||
outRect.left = v;
|
||||
outRect.right = v;
|
||||
outRect.bottom = h;
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static float dpToPx(float dpValue) {
|
||||
float density = MyApp.app.getResources().getDisplayMetrics().density;
|
||||
return density * dpValue + 0.5f;
|
||||
}
|
||||
}
|
||||
175
app/src/main/java/com/prank/tool/utils/Tools.java
Normal file
175
app/src/main/java/com/prank/tool/utils/Tools.java
Normal file
@ -0,0 +1,175 @@
|
||||
package com.prank.tool.utils;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.media.AudioManager;
|
||||
import android.media.MediaMetadataRetriever;
|
||||
import android.net.Uri;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.prank.tool.MyApp;
|
||||
import com.prank.tool.R;
|
||||
import com.prank.tool.jbean.Info;
|
||||
import com.prank.tool.jbean.MyBean;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.StringWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Tools {
|
||||
|
||||
public static int[] bgs = new int[]{R.drawable.home_bg1,R.drawable.home_bg2,R.drawable.home_bg3,R.drawable.home_bg4,
|
||||
R.drawable.home_bg5,R.drawable.home_bg6};
|
||||
|
||||
public static int[] childBgs = new int[]{R.drawable.child_bg1,R.drawable.child_bg2,R.drawable.child_bg3,R.drawable.child_bg4,
|
||||
R.drawable.child_bg5,R.drawable.child_bg6};
|
||||
|
||||
public static int[] playBgs = new int[]{R.drawable.bg_play1,R.drawable.bg_play2,R.drawable.bg_play3,R.drawable.bg_play4,
|
||||
R.drawable.bg_play5,R.drawable.bg_play6};
|
||||
public static final String KEY_LIST_COLOR_POS = "list_page_color_pos";
|
||||
public static final String KEY_LIST_DATA = "list_page_data";
|
||||
public static final String KEY_PLAY_DATA = "play_page_data";
|
||||
public static final String KEY_PLAY_COLOR_POS = "play_page_color_pos";
|
||||
|
||||
public static final int REQUEST_READ_STORAGE_PERMISSION = 5;
|
||||
public static final int REQUEST_PICK_AUDIO = -3;
|
||||
|
||||
public static String[] permission_read_audio = {Manifest.permission.READ_MEDIA_AUDIO};
|
||||
|
||||
public static String permission_record_audio = Manifest.permission.RECORD_AUDIO;
|
||||
public static String[] permission_store = {Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE};
|
||||
|
||||
|
||||
public static void initFont(TextView tv) {
|
||||
tv.setTypeface(MyApp.defaultFont);
|
||||
}
|
||||
public static void setStatusBarTextColor(Activity activity, boolean dark) {
|
||||
Window window = activity.getWindow();
|
||||
View decor = window.getDecorView();
|
||||
if (dark) {
|
||||
decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
| View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
|
||||
} else {
|
||||
decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||
}
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
||||
}
|
||||
|
||||
public static String getString(InputStream input) {
|
||||
try {
|
||||
char[] charArray = new char[input.available()];
|
||||
int count = 0;
|
||||
StringWriter stringWriter = new StringWriter();
|
||||
InputStreamReader inputStreamReader = new InputStreamReader(input);
|
||||
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
|
||||
while ((count = bufferedReader.read(charArray)) != -1) {
|
||||
stringWriter.write(charArray, 0, count);
|
||||
}
|
||||
return stringWriter.toString();
|
||||
} catch (IOException exception) {
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void setVolume(Context context, SeekBar seekBar) {
|
||||
AudioManager audioManager = (AudioManager)context.getSystemService(AppCompatActivity.AUDIO_SERVICE);
|
||||
int maxVolume = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
|
||||
seekBar.setMax(maxVolume);
|
||||
seekBar.setProgress(audioManager.getStreamVolume(AudioManager.STREAM_MUSIC));
|
||||
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||
audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, progress, 0);
|
||||
// Log.d("----------","--------maxVolume="+maxVolume+"-------progress="+progress);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
public static List<MyBean> getBean(String str) {
|
||||
|
||||
try {
|
||||
List<MyBean> data = new ArrayList<MyBean>();
|
||||
JSONArray jsonArray = new JSONArray(str);
|
||||
|
||||
for (int i = 0; i < jsonArray.length(); i++) {
|
||||
JSONObject it = jsonArray.getJSONObject(i);
|
||||
JSONArray listArray = it.getJSONArray("list");
|
||||
List<Info> list = new ArrayList<>();
|
||||
for (int k = 0; k < listArray.length(); k++) {
|
||||
JSONObject listBean = listArray.getJSONObject(k);
|
||||
Info info = new Info();
|
||||
info.setAudioUrl(listBean.getString("mp3Url"));
|
||||
info.setCovert(listBean.getString("preUrl"));
|
||||
info.setName(listBean.getString("title"));
|
||||
list.add(info);
|
||||
}
|
||||
|
||||
MyBean newBean = new MyBean();
|
||||
newBean.setCovert(it.getString("categoryUrl"));
|
||||
newBean.setInfoList(list);
|
||||
newBean.setName(it.getString("categoryName"));
|
||||
data.add(newBean);
|
||||
|
||||
}
|
||||
|
||||
return data;
|
||||
} catch (JSONException jo) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static long getAudioDuration(Context context, Uri uri) {
|
||||
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
|
||||
long duration = 0;
|
||||
|
||||
try {
|
||||
ContentResolver contentResolver = context.getContentResolver();
|
||||
retriever.setDataSource(context, uri);
|
||||
String time = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION);
|
||||
duration = Long.parseLong(time);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
retriever.release();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
return duration;
|
||||
}
|
||||
public static float dpToPx(float dpValue) {
|
||||
float density = MyApp.app.getResources().getDisplayMetrics().density;
|
||||
return density * dpValue + 0.5f;
|
||||
}
|
||||
|
||||
}
|
||||
5
app/src/main/res/color/color_timer.xml
Normal file
5
app/src/main/res/color/color_timer.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="@color/color_CECECE" android:state_selected="false"/>
|
||||
<item android:color="@color/color_F4A135" android:state_selected="true"/>
|
||||
</selector>
|
||||
30
app/src/main/res/drawable-v24/ic_launcher_foreground.xml
Normal file
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>
|
||||
9
app/src/main/res/drawable/back_black.xml
Normal file
9
app/src/main/res/drawable/back_black.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="64dp"
|
||||
android:height="64dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:pathData="M395.2,513.6l323.1,-312.4c19.1,-18.4 19.1,-48.3 0,-66.7 -19.1,-18.4 -49.9,-18.4 -69,0L291.8,480.3c-19.1,18.4 -19.1,48.3 0,66.7l357.6,345.7c9.5,9.2 22,13.8 34.5,13.8 12.5,0 25,-4.6 34.5,-13.8 19.1,-18.4 19.1,-48.2 0,-66.7L395.2,513.6z"
|
||||
android:fillColor="@color/black"/>
|
||||
</vector>
|
||||
10
app/src/main/res/drawable/bg_play1.xml
Normal file
10
app/src/main/res/drawable/bg_play1.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="210"
|
||||
android:startColor="@color/color_F4A135"
|
||||
android:centerColor="@color/color_F4A135"
|
||||
android:endColor="@color/white"/>
|
||||
|
||||
</shape>
|
||||
10
app/src/main/res/drawable/bg_play2.xml
Normal file
10
app/src/main/res/drawable/bg_play2.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="210"
|
||||
android:startColor="@color/color_88ABDA"
|
||||
android:centerColor="@color/color_88ABDA"
|
||||
android:endColor="@color/white"/>
|
||||
|
||||
</shape>
|
||||
10
app/src/main/res/drawable/bg_play3.xml
Normal file
10
app/src/main/res/drawable/bg_play3.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="210"
|
||||
android:startColor="@color/color_9774F1"
|
||||
android:centerColor="@color/color_9774F1"
|
||||
android:endColor="@color/white"/>
|
||||
|
||||
</shape>
|
||||
10
app/src/main/res/drawable/bg_play4.xml
Normal file
10
app/src/main/res/drawable/bg_play4.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="210"
|
||||
android:startColor="@color/color_FA666B"
|
||||
android:centerColor="@color/color_FA666B"
|
||||
android:endColor="@color/white"/>
|
||||
|
||||
</shape>
|
||||
10
app/src/main/res/drawable/bg_play5.xml
Normal file
10
app/src/main/res/drawable/bg_play5.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="210"
|
||||
android:startColor="@color/color_F8EE7C"
|
||||
android:centerColor="@color/color_F8EE7C"
|
||||
android:endColor="@color/white"/>
|
||||
|
||||
</shape>
|
||||
10
app/src/main/res/drawable/bg_play6.xml
Normal file
10
app/src/main/res/drawable/bg_play6.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="210"
|
||||
android:startColor="@color/color_BBDA73"
|
||||
android:centerColor="@color/color_BBDA73"
|
||||
android:endColor="@color/white"/>
|
||||
|
||||
</shape>
|
||||
7
app/src/main/res/drawable/child_bg1.xml
Normal file
7
app/src/main/res/drawable/child_bg1.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="16dp"/>
|
||||
<solid android:color="@color/color_F4A135"/>
|
||||
|
||||
</shape>
|
||||
7
app/src/main/res/drawable/child_bg2.xml
Normal file
7
app/src/main/res/drawable/child_bg2.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="16dp"/>
|
||||
<solid android:color="@color/color_88ABDA"/>
|
||||
|
||||
</shape>
|
||||
7
app/src/main/res/drawable/child_bg3.xml
Normal file
7
app/src/main/res/drawable/child_bg3.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="16dp"/>
|
||||
<solid android:color="@color/color_9774F1"/>
|
||||
|
||||
</shape>
|
||||
7
app/src/main/res/drawable/child_bg4.xml
Normal file
7
app/src/main/res/drawable/child_bg4.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="16dp"/>
|
||||
<solid android:color="@color/color_FA666B"/>
|
||||
|
||||
</shape>
|
||||
7
app/src/main/res/drawable/child_bg5.xml
Normal file
7
app/src/main/res/drawable/child_bg5.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="16dp"/>
|
||||
<solid android:color="@color/color_F8EE7C"/>
|
||||
|
||||
</shape>
|
||||
7
app/src/main/res/drawable/child_bg6.xml
Normal file
7
app/src/main/res/drawable/child_bg6.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="16dp"/>
|
||||
<solid android:color="@color/color_BBDA73"/>
|
||||
|
||||
</shape>
|
||||
24
app/src/main/res/drawable/default_import_audio.xml
Normal file
24
app/src/main/res/drawable/default_import_audio.xml
Normal file
@ -0,0 +1,24 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="256dp"
|
||||
android:height="256dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:pathData="M904,960H120c-30.9,0 -56,-25.1 -56,-56V120c0,-30.9 25.1,-56 56,-56h784c30.9,0 56,25.1 56,56v784c0,30.9 -25.1,56 -56,56z"
|
||||
android:fillColor="@color/color_88ABDA"/>
|
||||
<path
|
||||
android:pathData="M512,512m-336,0a336,336 0,1 0,672 0,336 336,0 1,0 -672,0Z"
|
||||
android:fillColor="@color/color_2B2929"/>
|
||||
<path
|
||||
android:pathData="M512,512m-112,0a112,112 0,1 0,224 0,112 112,0 1,0 -224,0Z"
|
||||
android:fillColor="@color/white"/>
|
||||
<path
|
||||
android:pathData="M512,512m-42,0a42,42 0,1 0,84 0,42 42,0 1,0 -84,0Z"
|
||||
android:fillColor="@color/color_F4A135"/>
|
||||
<path
|
||||
android:pathData="M842.7,239c-34.7,0 -63,-28.3 -63,-63s28.3,-63 63,-63 63,28.3 63,63 -28.3,63 -63,63zM842.7,155c-11.6,0 -21,9.4 -21,21s9.4,21 21,21 21,-9.4 21,-21 -9.4,-21 -21,-21z"
|
||||
android:fillColor="@color/color_F4A135"/>
|
||||
<path
|
||||
android:pathData="M715.1,597.2c-6.7,0 -13.3,-3.2 -17.3,-9.1 -6.6,-9.6 -4.1,-22.6 5.4,-29.2l52.8,-36.2 67.6,-309.2c2.5,-11.3 13.7,-18.5 25,-16 11.3,2.5 18.5,13.7 16,25L795.3,539.8a21,21 0,0 1,-8.6 12.8l-59.7,40.9a20.9,20.9 0,0 1,-11.9 3.7z"
|
||||
android:fillColor="@color/color_F4A135"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/home_bg1.xml
Normal file
9
app/src/main/res/drawable/home_bg1.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="158dp"
|
||||
android:height="130dp"
|
||||
android:viewportWidth="158"
|
||||
android:viewportHeight="130">
|
||||
<path
|
||||
android:pathData="M108.25,18.57C108.25,8.31 99.94,0 89.69,0H20C8.95,0 0,8.95 0,20V110C0,121.05 8.95,130 20,130H138C149.05,130 158,121.05 158,110V62.7C158,51.65 149.05,42.7 138,42.7H132.39C119.06,42.7 108.25,31.9 108.25,18.57Z"
|
||||
android:fillColor="@color/color_F4A135"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/home_bg2.xml
Normal file
9
app/src/main/res/drawable/home_bg2.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="158dp"
|
||||
android:height="130dp"
|
||||
android:viewportWidth="158"
|
||||
android:viewportHeight="130">
|
||||
<path
|
||||
android:pathData="M108.25,18.57C108.25,8.31 99.94,0 89.69,0H20C8.95,0 0,8.95 0,20V110C0,121.05 8.95,130 20,130H138C149.05,130 158,121.05 158,110V62.7C158,51.65 149.05,42.7 138,42.7H132.39C119.06,42.7 108.25,31.9 108.25,18.57Z"
|
||||
android:fillColor="@color/color_88ABDA"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/home_bg3.xml
Normal file
9
app/src/main/res/drawable/home_bg3.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="158dp"
|
||||
android:height="130dp"
|
||||
android:viewportWidth="158"
|
||||
android:viewportHeight="130">
|
||||
<path
|
||||
android:pathData="M108.25,18.57C108.25,8.31 99.94,0 89.69,0H20C8.95,0 0,8.95 0,20V110C0,121.05 8.95,130 20,130H138C149.05,130 158,121.05 158,110V62.7C158,51.65 149.05,42.7 138,42.7H132.39C119.06,42.7 108.25,31.9 108.25,18.57Z"
|
||||
android:fillColor="@color/color_9774F1"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/home_bg4.xml
Normal file
9
app/src/main/res/drawable/home_bg4.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="158dp"
|
||||
android:height="130dp"
|
||||
android:viewportWidth="158"
|
||||
android:viewportHeight="130">
|
||||
<path
|
||||
android:pathData="M108.25,18.57C108.25,8.31 99.94,0 89.69,0H20C8.95,0 0,8.95 0,20V110C0,121.05 8.95,130 20,130H138C149.05,130 158,121.05 158,110V62.7C158,51.65 149.05,42.7 138,42.7H132.39C119.06,42.7 108.25,31.9 108.25,18.57Z"
|
||||
android:fillColor="@color/color_FA666B"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/home_bg5.xml
Normal file
9
app/src/main/res/drawable/home_bg5.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="158dp"
|
||||
android:height="130dp"
|
||||
android:viewportWidth="158"
|
||||
android:viewportHeight="130">
|
||||
<path
|
||||
android:pathData="M108.25,18.57C108.25,8.31 99.94,0 89.69,0H20C8.95,0 0,8.95 0,20V110C0,121.05 8.95,130 20,130H138C149.05,130 158,121.05 158,110V62.7C158,51.65 149.05,42.7 138,42.7H132.39C119.06,42.7 108.25,31.9 108.25,18.57Z"
|
||||
android:fillColor="@color/color_F8EE7C"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/home_bg6.xml
Normal file
9
app/src/main/res/drawable/home_bg6.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="158dp"
|
||||
android:height="130dp"
|
||||
android:viewportWidth="158"
|
||||
android:viewportHeight="130">
|
||||
<path
|
||||
android:pathData="M108.25,18.57C108.25,8.31 99.94,0 89.69,0H20C8.95,0 0,8.95 0,20V110C0,121.05 8.95,130 20,130H138C149.05,130 158,121.05 158,110V62.7C158,51.65 149.05,42.7 138,42.7H132.39C119.06,42.7 108.25,31.9 108.25,18.57Z"
|
||||
android:fillColor="@color/color_BBDA73"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/ic_volum.xml
Normal file
9
app/src/main/res/drawable/ic_volum.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="21dp"
|
||||
android:height="18dp"
|
||||
android:viewportWidth="21"
|
||||
android:viewportHeight="18">
|
||||
<path
|
||||
android:pathData="M1.5,3.996H3.27C3.742,3.997 4.199,3.83 4.56,3.526L8.25,0.396C8.493,0.19 8.789,0.058 9.105,0.015C9.42,-0.028 9.741,0.02 10.03,0.154C10.319,0.287 10.564,0.5 10.736,0.768C10.908,1.036 10.999,1.348 11,1.666V16.326C10.999,16.645 10.908,16.956 10.736,17.224C10.564,17.492 10.319,17.705 10.03,17.838C9.741,17.972 9.42,18.02 9.105,17.977C8.789,17.934 8.493,17.802 8.25,17.596L4.56,14.466C4.199,14.162 3.742,13.996 3.27,13.996H1.5C1.102,13.996 0.721,13.838 0.439,13.557C0.158,13.276 0,12.894 0,12.496V5.496C0,5.098 0.158,4.717 0.439,4.436C0.721,4.154 1.102,3.996 1.5,3.996ZM14.77,13.766C15.397,13.14 15.895,12.397 16.234,11.578C16.573,10.76 16.748,9.882 16.748,8.996C16.748,8.11 16.573,7.233 16.234,6.414C15.895,5.596 15.397,4.852 14.77,4.226C14.629,4.086 14.439,4.007 14.24,4.007C14.041,4.007 13.851,4.086 13.71,4.226C13.569,4.367 13.491,4.557 13.491,4.756C13.491,4.955 13.569,5.146 13.71,5.286C14.198,5.773 14.585,6.351 14.849,6.988C15.113,7.625 15.25,8.307 15.25,8.996C15.25,9.685 15.113,10.368 14.849,11.005C14.585,11.641 14.198,12.219 13.71,12.706C13.569,12.847 13.491,13.038 13.491,13.236C13.491,13.435 13.569,13.626 13.71,13.766C13.778,13.838 13.861,13.894 13.952,13.932C14.043,13.97 14.141,13.988 14.24,13.986C14.339,13.987 14.436,13.967 14.527,13.93C14.618,13.892 14.701,13.836 14.77,13.766ZM17.07,16.816C16.971,16.817 16.874,16.798 16.782,16.76C16.691,16.723 16.609,16.667 16.54,16.596C16.469,16.527 16.413,16.445 16.375,16.354C16.336,16.263 16.316,16.165 16.316,16.066C16.316,15.967 16.336,15.87 16.375,15.779C16.413,15.688 16.469,15.605 16.54,15.536C18.274,13.802 19.249,11.449 19.249,8.996C19.249,6.543 18.274,4.191 16.54,2.456C16.469,2.387 16.413,2.305 16.375,2.214C16.336,2.123 16.316,2.025 16.316,1.926C16.316,1.827 16.336,1.73 16.375,1.639C16.413,1.548 16.469,1.465 16.54,1.396C16.681,1.256 16.871,1.177 17.07,1.177C17.269,1.177 17.459,1.256 17.6,1.396C18.599,2.394 19.392,3.578 19.932,4.882C20.473,6.187 20.751,7.584 20.751,8.996C20.751,10.408 20.473,11.806 19.932,13.11C19.392,14.414 18.599,15.599 17.6,16.596C17.531,16.666 17.448,16.722 17.357,16.76C17.266,16.797 17.169,16.817 17.07,16.816Z"
|
||||
android:fillColor="@color/white"/>
|
||||
</vector>
|
||||
57
app/src/main/res/drawable/im_empty_like.xml
Normal file
57
app/src/main/res/drawable/im_empty_like.xml
Normal file
@ -0,0 +1,57 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="256dp"
|
||||
android:height="256dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:pathData="M64,826.6c0,70.6 203.2,128 454.2,128s454.1,-57.2 454.1,-128 -203.1,-128 -454.1,-128S64,756.1 64,826.6zM64,826.6"
|
||||
android:fillColor="#DEDEDE"/>
|
||||
<path
|
||||
android:pathData="M795.6,740.3L600,912l-7,-332.3 208,-123.4zM795.6,740.3"
|
||||
android:fillColor="@color/color_FFF799"/>
|
||||
<path
|
||||
android:pathData="M593.8,908.6L228.8,802L228.8,678.6l307.7,90.6c20.2,-142 37,-197.4 49.4,-167.5s15,132.3 8,306.9zM588.5,574.4l-97.9,-21.3 -6.3,-69.5L484.2,365.4l306.9,85.6h10.5zM588.5,574.4"
|
||||
android:fillColor="@color/color_FFF799"/>
|
||||
<path
|
||||
android:pathData="M490.6,557.6l-254.9,-70.6 254.9,-123.4zM490.6,557.6"
|
||||
android:fillColor="@color/color_FFF799"/>
|
||||
<path
|
||||
android:pathData="M878.6,618.5l-74.8,-152.5v132.3zM878.6,618.5"
|
||||
android:fillColor="@color/color_FFF799"/>
|
||||
<path
|
||||
android:pathData="M489.8,562.1a4.3,4.3 0,0 1,-4.5 -4.5L485.3,372.6a4.5,4.5 0,1 1,9 0L494.2,557.6a4.4,4.4 0,0 1,-4.5 4.5zM489.8,562.1"
|
||||
android:fillColor="#AAAAAA"/>
|
||||
<path
|
||||
android:pathData="M588.5,584.9h-0.8L229.6,493.3c-1.8,-0.8 -3.4,-1.8 -3.4,-3.4a4.7,4.7 0,0 1,2.6 -4.4l260.2,-124.5a1.8,1.8 0,0 1,2.6 0l311.4,86.4a4.3,4.3 0,0 1,1.6 8L591.1,584c-0.8,0 -1.8,1 -2.6,1zM243.8,487.3l344,88 202.5,-122.4 -299.8,-83.8zM243.8,487.3"
|
||||
android:fillColor="#AAAAAA"/>
|
||||
<path
|
||||
android:pathData="M600,918.3h-1.8a3.5,3.5 0,0 1,-2.6 -3.4L584,580.7c0,-1.8 0.8,-3.4 1.8,-3.4l213.4,-128.6a4.5,4.5 0,0 1,4.5 0,4.4 4.4,0 0,1 2.6,3.4v290.1a5.3,5.3 0,0 1,-1.8 3.4l-201.9,172.8zM593,582.3L603.4,904l193.2,-164.8v-280zM593,582.3"
|
||||
android:fillColor="#AAAAAA"/>
|
||||
<path
|
||||
android:pathData="M600,918.3h-0.8l-369.3,-107.7a5.4,5.4 0,0 1,-3.4 -4.5L226.5,677.6a4.3,4.3 0,0 1,4.5 -4.5,4.2 4.2,0 0,1 4.4,4.5v126l360.7,105.8v-0.8a4.5,4.5 0,1 1,9 0v6.3a3.8,3.8 0,0 1,-1.8 3.4zM600,918.3"
|
||||
android:fillColor="#AAAAAA"/>
|
||||
<path
|
||||
android:pathData="M530.2,768.4L161.6,655.5l68.8,-166.7 358.1,91.6zM530.2,768.4"
|
||||
android:fillColor="@color/color_FFF799"/>
|
||||
<path
|
||||
android:pathData="M530.2,772.9h-0.8L160,660c-0.8,0 -1.8,-0.8 -2.6,-2.6a2.8,2.8 0,0 1,0 -3.4l68.8,-166.6a4.1,4.1 0,0 1,5.2 -2.6L589.5,576a4.2,4.2 0,0 1,2.6 1.8,2.8 2.8,0 0,1 0,3.4l-58.3,189c0,1.6 -1.8,2.6 -3.6,2.6zM166.9,652.9L528,763.1l56,-179.8 -351,-89zM876.7,627.4h-0.8l-74.8,-21.3a5.4,5.4 0,0 1,-3.4 -4.5L797.7,451c0,-1.8 1.8,-3.4 3.4,-4.5a4.6,4.6 0,0 1,5.3 2.6l74.8,155.9v17.6a3.6,3.6 0,0 1,-1.8 3.4,2.6 2.6,0 0,1 -2.6,1.4zM806.1,598.3l65.9,19.4L872,608.8l-66.2,-137.6z"
|
||||
android:fillColor="#AAAAAA"/>
|
||||
<path
|
||||
android:pathData="M880,86.6c-6.3,-8.9 -49.4,0.8 -68.7,30 -5.3,8.9 -11.6,36.2 -7.1,29.9 11.5,-16.8 32.6,-7.1 48.6,-20.2 13.1,-11.3 32.6,-32.6 27.3,-40zM880,86.6"
|
||||
android:fillColor="@color/color_FFF799"/>
|
||||
<path
|
||||
android:pathData="M804.3,149.4h-1.8c-4.5,-2.6 4.5,-28.1 7.1,-33.6a85.4,85.4 0,0 1,59.8 -34.4,12.9 12.9,0 0,1 11.5,4.5c8,11.5 -26.5,42.2 -27.3,42.2a42.2,42.2 0,0 1,-25.5 9c-8.9,1.8 -17.5,2.6 -22.8,10.5a1.2,1.2 0,0 1,-1 1.8zM870.5,84.9a76.6,76.6 0,0 0,-56.5 32,104 104,0 0,0 -8,24 35,35 0,0 1,22.8 -8.9,44.3 44.3,0 0,0 22.9,-8c15,-13.1 29.9,-32 26.5,-36.2 -0.8,-1.5 -3.7,-2.6 -8,-2.6zM870.5,84.9"
|
||||
android:fillColor="#AAAAAA"/>
|
||||
<path
|
||||
android:pathData="M826.4,127.4l-3.4,-2.6c16,-20.2 34.4,-36.2 73.2,-46.7 3.4,-0.8 5.3,-1.8 6.3,-1.8s1.8,-0.8 7.1,-0.8l0.8,4.5a26.4,26.4 0,0 1,-6.3 0.8,65.7 65.7,0 0,0 -6.3,1.8c-38.1,9.4 -56,24 -71.4,44.9zM826.4,127.4M856,149.4c30.6,49.2 31.4,107.1 2.1,139a112.6,112.6 0,0 1,-37 24c4.3,-22.8 -1.3,-51 -11.8,-65.3a20.9,20.9 0,0 0,-14.3 -9.5,29 29,0 0,0 -24,10.6 44.9,44.9 0,0 0,-16 36.2,42.4 42.4,0 0,0 21.8,32l0.6,0.6a53.4,53.4 0,0 0,39.4 1.8c-13.8,52.3 -76.9,79 -84.3,81.7l1.8,4.4a182.5,182.5 0,0 0,59.8 -38.6,86.4 86.4,0 0,0 26.5,-48.8 101.4,101.4 0,0 0,41 -26.2c30.5,-33 30.5,-92.8 -1.3,-144.6zM817.8,314.6a50.3,50.3 0,0 1,-38 -0.6l-1,-1.7c-15.4,-9.7 -18.8,-20.8 -18.8,-28.2a43.7,43.7 0,0 1,14.5 -33,28.6 28.6,0 0,1 20.6,-9.4 18.5,18.5 0,0 1,11.9 8,88.6 88.6,0 0,1 11.4,64z"
|
||||
android:fillColor="#AAAAAA"/>
|
||||
<path
|
||||
android:pathData="M137.4,831.1c-0.8,9 -37.8,19.4 -64,7.1 -9,-3.4 -24,-20.2 -18.6,-17.6 16,6.3 27.3,-8 44.9,-6.3 14.4,2.6 38.1,9.8 38.1,16.8zM137.4,831.1"
|
||||
android:fillColor="@color/color_FFF799"/>
|
||||
<path
|
||||
android:pathData="M100.3,846.1a78.2,78.2 0,0 1,-28.3 -5.2c-6.3,-2.6 -22.9,-16 -20.2,-20.2 0,0 0.8,-2.6 4.5,-0.8a28.2,28.2 0,0 0,22.1 -1.8,38.8 38.8,0 0,1 22.8,-3.4c8,0.8 40,8 40,18.6 0,2.6 -1.8,5.3 -6.3,7.1a130.1,130.1 0,0 1,-34.4 5.8zM58.1,824a60.9,60.9 0,0 0,15 12.3,69.4 69.4,0 0,0 57.2,-1.8c2.6,-1.8 3.4,-2.6 3.4,-3.4 0,-4.5 -18.6,-11.5 -36.2,-14.2a52.9,52.9 0,0 0,-20.2 3.4,28.5 28.5,0 0,1 -19.1,3.7zM58.1,824"
|
||||
android:fillColor="#AAAAAA"/>
|
||||
<path
|
||||
android:pathData="M150.7,832.7a123.2,123.2 0,0 0,-43.3 -1.8,78.2 78.2,0 0,1 -32.6,-1.8l1.8,-4.5a73.5,73.5 0,0 0,31 1.8,127.1 127.1,0 0,1 44.1,1.8zM150.7,832.7"
|
||||
android:fillColor="#AAAAAA"/>
|
||||
</vector>
|
||||
12
app/src/main/res/drawable/imdelete.xml
Normal file
12
app/src/main/res/drawable/imdelete.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="256dp"
|
||||
android:height="256dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:pathData="M1009.2,513.5C1009.2,236 788.5,15.4 511,15.4 233.5,15.4 13.3,236 13.3,513.5c0,277.5 220.7,498.2 498.2,498.2 277,0 497.7,-220.7 497.7,-498.2zM1009.2,513.5"
|
||||
android:fillColor="@color/color_FA666B"/>
|
||||
<path
|
||||
android:pathData="M719.9,627.7l-114.2,-114.2L719.9,399.4c29.2,-29.2 29.2,-58.9 0,-88.1l-6.7,-6.7c-29.2,-29.2 -58.9,-29.2 -88.1,0L511,418.8 397.3,304.6c-29.2,-29.2 -58.9,-29.2 -88.1,0L302.1,311.3c-29.2,29.2 -29.2,58.9 0,88.1l114.2,114.2L302.1,627.7c-29.2,29.2 -29.2,58.9 0,88.1l6.7,6.7c29.2,29.2 58.9,29.2 88.1,0l114.2,-114.2 114.2,114.2c29.2,29.2 58.9,29.2 88.1,0l6.7,-6.7c29.2,-29.7 29.2,-58.9 0,-88.1z"
|
||||
android:fillColor="#FFFFFF"/>
|
||||
</vector>
|
||||
15
app/src/main/res/drawable/immenu.xml
Normal file
15
app/src/main/res/drawable/immenu.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="256dp"
|
||||
android:height="256dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:pathData="M388.4,529.7H147.2c-27.1,0 -49.2,-22.1 -49.2,-49.2V239.3c0,-27.1 22.1,-49.2 49.2,-49.2h241.2c27.1,0 49.2,22.1 49.2,49.2v241.2c0,27.1 -22,49.2 -49.2,49.2zM147.2,236c-1.8,0 -3.3,1.5 -3.3,3.3v241.2c0,1.8 1.5,3.3 3.3,3.3h241.2c1.8,0 3.3,-1.5 3.3,-3.3V239.3c0,-1.8 -1.5,-3.3 -3.3,-3.3H147.2zM388.4,912.9H147.2c-27.1,0 -49.2,-22.1 -49.2,-49.2V622.5c0,-27.1 22.1,-49.2 49.2,-49.2h241.2c27.1,0 49.2,22.1 49.2,49.2v241.2c0,27.2 -22,49.2 -49.2,49.2zM147.2,619.3c-1.8,0 -3.3,1.5 -3.3,3.3v241.2c0,1.8 1.5,3.3 3.3,3.3h241.2c1.8,0 3.3,-1.5 3.3,-3.3V622.5c0,-1.8 -1.5,-3.3 -3.3,-3.3l-241.2,0.1zM780.2,912.9H539c-27.1,0 -49.2,-22.1 -49.2,-49.2V622.5c0,-27.1 22.1,-49.2 49.2,-49.2h241.2c27.1,0 49.2,22.1 49.2,49.2v241.2c0,27.2 -22.1,49.2 -49.2,49.2zM539,619.3c-1.8,0 -3.3,1.5 -3.3,3.3v241.2c0,1.8 1.5,3.3 3.3,3.3h241.2c1.8,0 3.3,-1.5 3.3,-3.3V622.5c0,-1.8 -1.5,-3.3 -3.3,-3.3l-241.2,0.1z"
|
||||
android:fillColor="@color/color_F4A135"/>
|
||||
<path
|
||||
android:pathData="M691.8,498.2l-170,-169.9c-10.2,-10.2 -10.2,-26.8 0,-37l169.9,-169.9c10.2,-10.2 26.8,-10.2 37,0l169.9,169.9c10.2,10.2 10.2,26.8 0,37L728.7,498.2c-10.1,10.2 -26.8,10.2 -36.9,0z"
|
||||
android:fillColor="@color/color_F4A135"/>
|
||||
<path
|
||||
android:pathData="M710.3,529.6c-12.8,0 -25.5,-4.9 -35.3,-14.6L505.1,345.1c-19.4,-19.4 -19.4,-51.1 0,-70.5l169.9,-170c19.4,-19.4 51.1,-19.4 70.5,0l169.9,169.9c19.4,19.4 19.4,51.1 0,70.5L745.5,515c-9.7,9.7 -22.5,14.6 -35.2,14.6zM710.3,137.5c-0.6,0 -1.3,0.2 -1.7,0.7l-170,169.9c-0.9,0.9 -0.9,2.5 0,3.4l169.9,169.9c0.6,0.6 1.2,0.7 1.7,0.7s1.1,-0.1 1.7,-0.7l169.9,-169.9c0.9,-0.9 0.9,-2.5 0,-3.4L712,138.2c-0.5,-0.5 -1.1,-0.7 -1.7,-0.7z"
|
||||
android:fillColor="@color/color_F4A135"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/loop0.xml
Normal file
9
app/src/main/res/drawable/loop0.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="64dp"
|
||||
android:height="64dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:fillColor="@color/color_cccccc"
|
||||
android:pathData="M199.7,583.7c15.4,-5.1 25.6,-20.5 20.5,-35.8 -5.1,-15.4 -5.1,-35.8 -5.1,-51.2 0,-102.4 87,-189.4 189.4,-189.4L665.6,307.2v51.2c0,15.4 10.2,20.5 25.6,15.4l117.8,-71.7c15.4,-10.2 15.4,-20.5 0,-30.7l-117.8,-76.8c-15.4,-15.4 -25.6,-10.2 -25.6,5.1v51.2L404.5,250.9c-66.6,0 -128,25.6 -174.1,71.7 -46.1,46.1 -71.7,107.5 -71.7,174.1 0,20.5 5.1,46.1 10.2,66.6 5.1,10.2 15.4,20.5 25.6,20.5h5.1zM199.7,583.7M844.8,409.6c-5.1,-10.2 -15.4,-20.5 -25.6,-20.5h-5.1c-15.4,5.1 -25.6,20.5 -20.5,35.8 5.1,15.4 5.1,35.8 5.1,51.2 0,107.5 -87,194.6 -194.6,194.6h-256v-51.2c0,-15.4 -10.2,-20.5 -25.6,-15.4L204.8,681c-15.4,10.2 -15.4,20.5 0,30.7l117.8,76.8c15.4,10.2 25.6,5.1 25.6,-15.4v-51.2h261.1c66.6,0 128,-25.6 174.1,-71.7 46.1,-46.1 71.7,-107.5 71.7,-174.1 0,-20.5 -5.1,-46.1 -10.2,-66.6zM844.8,409.6"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/loop1.xml
Normal file
9
app/src/main/res/drawable/loop1.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="64dp"
|
||||
android:height="64dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:fillColor="@color/color_F4A135"
|
||||
android:pathData="M199.7,583.7c15.4,-5.1 25.6,-20.5 20.5,-35.8 -5.1,-15.4 -5.1,-35.8 -5.1,-51.2 0,-102.4 87,-189.4 189.4,-189.4L665.6,307.2v51.2c0,15.4 10.2,20.5 25.6,15.4l117.8,-71.7c15.4,-10.2 15.4,-20.5 0,-30.7l-117.8,-76.8c-15.4,-15.4 -25.6,-10.2 -25.6,5.1v51.2L404.5,250.9c-66.6,0 -128,25.6 -174.1,71.7 -46.1,46.1 -71.7,107.5 -71.7,174.1 0,20.5 5.1,46.1 10.2,66.6 5.1,10.2 15.4,20.5 25.6,20.5h5.1zM199.7,583.7M844.8,409.6c-5.1,-10.2 -15.4,-20.5 -25.6,-20.5h-5.1c-15.4,5.1 -25.6,20.5 -20.5,35.8 5.1,15.4 5.1,35.8 5.1,51.2 0,107.5 -87,194.6 -194.6,194.6h-256v-51.2c0,-15.4 -10.2,-20.5 -25.6,-15.4L204.8,681c-15.4,10.2 -15.4,20.5 0,30.7l117.8,76.8c15.4,10.2 25.6,5.1 25.6,-15.4v-51.2h261.1c66.6,0 128,-25.6 174.1,-71.7 46.1,-46.1 71.7,-107.5 71.7,-174.1 0,-20.5 -5.1,-46.1 -10.2,-66.6zM844.8,409.6"/>
|
||||
</vector>
|
||||
7
app/src/main/res/drawable/name_view_shape.xml
Normal file
7
app/src/main/res/drawable/name_view_shape.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/view" />
|
||||
<corners android:bottomLeftRadius="12dp" android:bottomRightRadius="12dp"/>
|
||||
|
||||
</shape>
|
||||
7
app/src/main/res/drawable/oval_99ffffff.xml
Normal file
7
app/src/main/res/drawable/oval_99ffffff.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="@color/color_99FFFFFF" />
|
||||
|
||||
|
||||
</shape>
|
||||
16
app/src/main/res/drawable/pause.xml
Normal file
16
app/src/main/res/drawable/pause.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="64dp"
|
||||
android:height="64dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:pathData="M512,42.7c258.8,0 469.3,210.5 469.3,469.3s-210.5,469.3 -469.3,469.3 -469.3,-210.5 -469.3,-469.3 210.5,-469.3 469.3,-469.3z"
|
||||
android:fillColor="@color/white"/>
|
||||
<path
|
||||
android:pathData="M384,312.9c31.3,0 56.9,25.6 56.9,56.9v284.4c0,31.3 -25.6,56.9 -56.9,56.9s-56.9,-25.6 -56.9,-56.9v-284.4c0,-31.3 25.6,-56.9 56.9,-56.9z"
|
||||
android:strokeAlpha="0.6"
|
||||
android:fillColor="@color/black" />
|
||||
<path
|
||||
android:pathData="M640,312.9c31.3,0 56.9,25.6 56.9,56.9v284.4c0,31.3 -25.6,56.9 -56.9,56.9s-56.9,-25.6 -56.9,-56.9v-284.4c0,-31.3 25.6,-56.9 56.9,-56.9z"
|
||||
android:fillColor="@color/black"/>
|
||||
</vector>
|
||||
20
app/src/main/res/drawable/pb_welcome.xml
Normal file
20
app/src/main/res/drawable/pb_welcome.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<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="@color/color_CECECE" /> <!-- 背景颜色 -->
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:id="@android:id/progress">
|
||||
<clip>
|
||||
<shape>
|
||||
<corners android:radius="20dp" />
|
||||
<gradient
|
||||
android:startColor="@color/color_FFF799"
|
||||
android:endColor="@color/color_F4A135"
|
||||
android:angle="0" />
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
</layer-list>
|
||||
12
app/src/main/res/drawable/play.xml
Normal file
12
app/src/main/res/drawable/play.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="64dp"
|
||||
android:height="64dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:pathData="M512.5,512m-418.9,0a418.9,418.9 0,1 0,837.7 0,418.9 418.9,0 1,0 -837.7,0Z"
|
||||
android:fillColor="@color/white"/>
|
||||
<path
|
||||
android:pathData="M683.6,470l-231.4,-133.6c-32.3,-18.6 -72.7,4.7 -72.7,42v267.2c0,37.3 40.4,60.6 72.7,42l231.4,-133.6c32.3,-18.7 32.3,-65.3 0,-84z"
|
||||
android:fillColor="@color/black"/>
|
||||
</vector>
|
||||
15
app/src/main/res/drawable/play_like0.xml
Normal file
15
app/src/main/res/drawable/play_like0.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="64dp"
|
||||
android:height="64dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:pathData="M510.4,298.9C394.7,30.2 65.6,92.9 63.4,404.8c-1.3,180.3 434.6,455.2 447.7,499.8 11.9,-46.3 448,-322.6 446.7,-501.7 -2.2,-312.7 -337,-362.1 -447.4,-104z"
|
||||
android:fillColor="@color/color_cccccc"/>
|
||||
<path
|
||||
android:pathData="M425.2,824.7c39.9,47.1 82.4,67.9 86,80 11.9,-46.3 448,-322.6 446.7,-501.7 -0.7,-101 -36.1,-174.5 -87.4,-219C762.9,90.4 275.6,538.5 425.2,824.7z"
|
||||
android:fillColor="@color/color_cccccc"/>
|
||||
<path
|
||||
android:pathData="M511.1,904.6c8.6,-47 448,-322.6 446.7,-501.7 -0.3,-50.5 -9.4,-94.1 -24.7,-130.7S355.8,729.6 511.1,904.6z"
|
||||
android:fillColor="@color/color_cccccc"/>
|
||||
</vector>
|
||||
15
app/src/main/res/drawable/play_like1.xml
Normal file
15
app/src/main/res/drawable/play_like1.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="64dp"
|
||||
android:height="64dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:pathData="M510.4,298.9C394.7,30.2 65.6,92.9 63.4,404.8c-1.3,180.3 434.6,455.2 447.7,499.8 11.9,-46.3 448,-322.6 446.7,-501.7 -2.2,-312.7 -337,-362.1 -447.4,-104z"
|
||||
android:fillColor="@color/color_D6242A"/>
|
||||
<path
|
||||
android:pathData="M425.2,824.7c39.9,47.1 82.4,67.9 86,80 11.9,-46.3 448,-322.6 446.7,-501.7 -0.7,-101 -36.1,-174.5 -87.4,-219C762.9,90.4 275.6,538.5 425.2,824.7z"
|
||||
android:fillColor="@color/color_D6242A"/>
|
||||
<path
|
||||
android:pathData="M511.1,904.6c8.6,-47 448,-322.6 446.7,-501.7 -0.3,-50.5 -9.4,-94.1 -24.7,-130.7S355.8,729.6 511.1,904.6z"
|
||||
android:fillColor="@color/color_D6242A"/>
|
||||
</vector>
|
||||
21
app/src/main/res/drawable/record0.xml
Normal file
21
app/src/main/res/drawable/record0.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="45dp"
|
||||
android:height="45dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:pathData="M513.1,504.6m-450.8,0a450.8,450.8 0,1 0,901.6 0,450.8 450.8,0 1,0 -901.6,0Z"
|
||||
android:fillColor="@color/color_F4A135"/>
|
||||
<path
|
||||
android:pathData="M513.1,182c-178.2,0 -322.7,144.4 -322.7,322.7 0,178.2 144.4,322.7 322.7,322.7 178.2,0 322.7,-144.4 322.7,-322.7 0,-178.2 -144.4,-322.7 -322.7,-322.7zM419.1,397.9c0,-51.9 42,-94 94,-94 51.9,0 94,42 94,94v96.3c0,51.9 -42,94 -94,94 -51.9,0 -94,-42 -94,-94v-96.3zM684.5,492.5c0,86.5 -63.3,158.4 -145.7,171.2v46.7c0,14.1 -11.5,25.6 -25.6,25.6s-25.6,-11.5 -25.6,-25.6v-46.5C404.5,651.7 340.4,579.5 340.4,492.5v-12.8c0,-14.1 11.5,-25.6 25.6,-25.6s25.6,11.5 25.6,25.6v12.8c0,67.3 54.2,122 120.8,122 66.7,0 120.8,-54.7 120.8,-122v-12.8c0,-14.1 11.5,-25.6 25.6,-25.6s25.6,11.5 25.6,25.6v12.8z"
|
||||
android:fillColor="@color/white"/>
|
||||
<path
|
||||
android:pathData="M799.6,356.4c-53.7,-103.6 -161.8,-174.4 -286.6,-174.4 -178.2,0 -322.7,144.4 -322.7,322.7 0,117.1 62.4,219.6 155.8,276.2 1.1,0 2.3,0.1 3.4,0.1 240.1,0 436.4,-187.8 450,-424.4zM419.1,397.9c0,-51.9 42,-94 94,-94 51.9,0 94,42 94,94v96.3c0,51.9 -42,94 -94,94 -51.9,0 -94,-42 -94,-94v-96.3zM538.8,663.7v46.7c0,14.1 -11.5,25.6 -25.6,25.6s-25.6,-11.5 -25.6,-25.6v-46.5C404.5,651.7 340.4,579.5 340.4,492.5v-12.8c0,-14.1 11.5,-25.6 25.6,-25.6s25.6,11.5 25.6,25.6v12.8c0,67.3 54.2,122 120.8,122 66.7,0 120.8,-54.7 120.8,-122v-12.8c0,-14.1 11.5,-25.6 25.6,-25.6s25.6,11.5 25.6,25.6v12.8c0.1,86.5 -63.2,158.4 -145.6,171.2z"
|
||||
android:fillColor="@color/white"/>
|
||||
<path
|
||||
android:pathData="M190.4,504.6c0,40.9 7.7,79.9 21.5,115.9 4.8,0.2 9.5,0.3 14.3,0.3 51.9,0 101.8,-8.8 148.2,-24.9a172.9,172.9 0,0 1,-34.1 -103.3v-12.8c0,-14.1 11.5,-25.6 25.6,-25.6s25.6,11.5 25.6,25.6v12.8c0,31.9 12.2,61 32.2,82.8 8.4,-4.1 16.6,-8.4 24.7,-13.1 -18.1,-17.1 -29.4,-41.3 -29.4,-68.1v-96.3c0,-51.9 42,-94 94,-94 51.9,0 94,42 94,94v13.6a448.5,448.5 0,0 0,66.8 -186.6,321 321,0 0,0 -160.7,-42.9c-178.1,0 -322.6,144.5 -322.6,322.7z"
|
||||
android:fillColor="@color/white"/>
|
||||
<path
|
||||
android:pathData="M194.5,453.8c152.2,-27.8 277.7,-132 335.3,-271.5 -5.5,-0.3 -11.1,-0.4 -16.6,-0.4 -160.9,0 -294.2,117.8 -318.6,271.9z"
|
||||
android:fillColor="@color/white"/>
|
||||
</vector>
|
||||
21
app/src/main/res/drawable/record1.xml
Normal file
21
app/src/main/res/drawable/record1.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="25dp"
|
||||
android:height="25dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:pathData="M513.1,504.6m-450.8,0a450.8,450.8 0,1 0,901.6 0,450.8 450.8,0 1,0 -901.6,0Z"
|
||||
android:fillColor="@color/color_CECECE"/>
|
||||
<path
|
||||
android:pathData="M513.1,182c-178.2,0 -322.7,144.4 -322.7,322.7 0,178.2 144.4,322.7 322.7,322.7 178.2,0 322.7,-144.4 322.7,-322.7 0,-178.2 -144.4,-322.7 -322.7,-322.7zM419.1,397.9c0,-51.9 42,-94 94,-94 51.9,0 94,42 94,94v96.3c0,51.9 -42,94 -94,94 -51.9,0 -94,-42 -94,-94v-96.3zM684.5,492.5c0,86.5 -63.3,158.4 -145.7,171.2v46.7c0,14.1 -11.5,25.6 -25.6,25.6s-25.6,-11.5 -25.6,-25.6v-46.5C404.5,651.7 340.4,579.5 340.4,492.5v-12.8c0,-14.1 11.5,-25.6 25.6,-25.6s25.6,11.5 25.6,25.6v12.8c0,67.3 54.2,122 120.8,122 66.7,0 120.8,-54.7 120.8,-122v-12.8c0,-14.1 11.5,-25.6 25.6,-25.6s25.6,11.5 25.6,25.6v12.8z"
|
||||
android:fillColor="@color/white"/>
|
||||
<path
|
||||
android:pathData="M799.6,356.4c-53.7,-103.6 -161.8,-174.4 -286.6,-174.4 -178.2,0 -322.7,144.4 -322.7,322.7 0,117.1 62.4,219.6 155.8,276.2 1.1,0 2.3,0.1 3.4,0.1 240.1,0 436.4,-187.8 450,-424.4zM419.1,397.9c0,-51.9 42,-94 94,-94 51.9,0 94,42 94,94v96.3c0,51.9 -42,94 -94,94 -51.9,0 -94,-42 -94,-94v-96.3zM538.8,663.7v46.7c0,14.1 -11.5,25.6 -25.6,25.6s-25.6,-11.5 -25.6,-25.6v-46.5C404.5,651.7 340.4,579.5 340.4,492.5v-12.8c0,-14.1 11.5,-25.6 25.6,-25.6s25.6,11.5 25.6,25.6v12.8c0,67.3 54.2,122 120.8,122 66.7,0 120.8,-54.7 120.8,-122v-12.8c0,-14.1 11.5,-25.6 25.6,-25.6s25.6,11.5 25.6,25.6v12.8c0.1,86.5 -63.2,158.4 -145.6,171.2z"
|
||||
android:fillColor="@color/white"/>
|
||||
<path
|
||||
android:pathData="M190.4,504.6c0,40.9 7.7,79.9 21.5,115.9 4.8,0.2 9.5,0.3 14.3,0.3 51.9,0 101.8,-8.8 148.2,-24.9a172.9,172.9 0,0 1,-34.1 -103.3v-12.8c0,-14.1 11.5,-25.6 25.6,-25.6s25.6,11.5 25.6,25.6v12.8c0,31.9 12.2,61 32.2,82.8 8.4,-4.1 16.6,-8.4 24.7,-13.1 -18.1,-17.1 -29.4,-41.3 -29.4,-68.1v-96.3c0,-51.9 42,-94 94,-94 51.9,0 94,42 94,94v13.6a448.5,448.5 0,0 0,66.8 -186.6,321 321,0 0,0 -160.7,-42.9c-178.1,0 -322.6,144.5 -322.6,322.7z"
|
||||
android:fillColor="@color/white"/>
|
||||
<path
|
||||
android:pathData="M194.5,453.8c152.2,-27.8 277.7,-132 335.3,-271.5 -5.5,-0.3 -11.1,-0.4 -16.6,-0.4 -160.9,0 -294.2,117.8 -318.6,271.9z"
|
||||
android:fillColor="@color/white"/>
|
||||
</vector>
|
||||
11
app/src/main/res/drawable/rect_main_solid.xml
Normal file
11
app/src/main/res/drawable/rect_main_solid.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="10dp" />
|
||||
<gradient
|
||||
android:angle="135"
|
||||
android:centerColor="@color/color_FFA964"
|
||||
android:endColor="@color/color_FFA964"
|
||||
android:startColor="@color/color_FFA964" />
|
||||
|
||||
</shape>
|
||||
7
app/src/main/res/drawable/rect_more.xml
Normal file
7
app/src/main/res/drawable/rect_more.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="16dp" />
|
||||
<solid android:color="@color/white" />
|
||||
|
||||
</shape>
|
||||
8
app/src/main/res/drawable/rect_popup_timer.xml
Normal file
8
app/src/main/res/drawable/rect_popup_timer.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="10dp" />
|
||||
<solid android:color="@color/white" />
|
||||
|
||||
|
||||
</shape>
|
||||
6
app/src/main/res/drawable/selector_collection.xml
Normal file
6
app/src/main/res/drawable/selector_collection.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/tab_like0" android:state_selected="false" />
|
||||
<item android:drawable="@drawable/tab_like1" android:state_selected="true" />
|
||||
|
||||
</selector>
|
||||
6
app/src/main/res/drawable/selector_home.xml
Normal file
6
app/src/main/res/drawable/selector_home.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="false" android:drawable="@drawable/tab_home0"/>
|
||||
<item android:state_selected="true" android:drawable="@drawable/tab_home1"/>
|
||||
|
||||
</selector>
|
||||
6
app/src/main/res/drawable/selector_looper.xml
Normal file
6
app/src/main/res/drawable/selector_looper.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/loop0" android:state_selected="false" />
|
||||
<item android:drawable="@drawable/loop1" android:state_selected="true" />
|
||||
|
||||
</selector>
|
||||
7
app/src/main/res/drawable/selector_mic.xml
Normal file
7
app/src/main/res/drawable/selector_mic.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="false" android:drawable="@drawable/record0"/>
|
||||
<item android:state_selected="true" android:drawable="@drawable/record1"/>
|
||||
|
||||
|
||||
</selector>
|
||||
6
app/src/main/res/drawable/selector_play_activity.xml
Normal file
6
app/src/main/res/drawable/selector_play_activity.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/play" android:state_selected="false" />
|
||||
<item android:drawable="@drawable/pause" android:state_selected="true" />
|
||||
|
||||
</selector>
|
||||
6
app/src/main/res/drawable/selector_play_collection.xml
Normal file
6
app/src/main/res/drawable/selector_play_collection.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/play_like0" android:state_selected="false" />
|
||||
<item android:drawable="@drawable/play_like1" android:state_selected="true" />
|
||||
|
||||
</selector>
|
||||
6
app/src/main/res/drawable/selector_record.xml
Normal file
6
app/src/main/res/drawable/selector_record.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/tab_recorder0" android:state_selected="false" />
|
||||
<item android:drawable="@drawable/tab_recorder1" android:state_selected="true" />
|
||||
|
||||
</selector>
|
||||
9
app/src/main/res/drawable/stoke_rect.xml
Normal file
9
app/src/main/res/drawable/stoke_rect.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="8dp" />
|
||||
<stroke
|
||||
android:width="4dp"
|
||||
android:color="@color/white" />
|
||||
|
||||
</shape>
|
||||
9
app/src/main/res/drawable/tab_home0.xml
Normal file
9
app/src/main/res/drawable/tab_home0.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="256dp"
|
||||
android:height="256dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:pathData="M997.3,456.4l-419,-428.5c-36.4,-37.3 -96.1,-37.3 -132.5,0l-419,428.5c-57,58.3 -16.6,158 64,158h62.9v307.2c0,56.6 45.8,102.4 102.4,102.4h153.6V768c0,-28.3 22.9,-51.2 51.2,-51.2h102.4c28.3,0 51.2,22.9 51.2,51.2v256H768c56.6,0 102.4,-45.8 102.4,-102.4V614.4h62.9c80.6,0 121,-99.7 64,-158z"
|
||||
android:fillColor="@color/color_CECECE"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/tab_home1.xml
Normal file
9
app/src/main/res/drawable/tab_home1.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="256dp"
|
||||
android:height="256dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:pathData="M997.3,456.4l-419,-428.5c-36.4,-37.3 -96.1,-37.3 -132.5,0l-419,428.5c-57,58.3 -16.6,158 64,158h62.9v307.2c0,56.6 45.8,102.4 102.4,102.4h153.6V768c0,-28.3 22.9,-51.2 51.2,-51.2h102.4c28.3,0 51.2,22.9 51.2,51.2v256H768c56.6,0 102.4,-45.8 102.4,-102.4V614.4h62.9c80.6,0 121,-99.7 64,-158z"
|
||||
android:fillColor="@color/color_88ABDA"/>
|
||||
</vector>
|
||||
15
app/src/main/res/drawable/tab_like0.xml
Normal file
15
app/src/main/res/drawable/tab_like0.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="64dp"
|
||||
android:height="64dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:pathData="M510.4,298.9C394.7,30.2 65.6,92.9 63.4,404.8c-1.3,180.3 434.6,455.2 447.7,499.8 11.9,-46.3 448,-322.6 446.7,-501.7 -2.2,-312.7 -337,-362.1 -447.4,-104z"
|
||||
android:fillColor="@color/main_gray1"/>
|
||||
<path
|
||||
android:pathData="M425.2,824.7c39.9,47.1 82.4,67.9 86,80 11.9,-46.3 448,-322.6 446.7,-501.7 -0.7,-101 -36.1,-174.5 -87.4,-219C762.9,90.4 275.6,538.5 425.2,824.7z"
|
||||
android:fillColor="@color/main_gray1"/>
|
||||
<path
|
||||
android:pathData="M511.1,904.6c8.6,-47 448,-322.6 446.7,-501.7 -0.3,-50.5 -9.4,-94.1 -24.7,-130.7S355.8,729.6 511.1,904.6z"
|
||||
android:fillColor="@color/main_gray1"/>
|
||||
</vector>
|
||||
15
app/src/main/res/drawable/tab_like1.xml
Normal file
15
app/src/main/res/drawable/tab_like1.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="64dp"
|
||||
android:height="64dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:pathData="M510.4,298.9C394.7,30.2 65.6,92.9 63.4,404.8c-1.3,180.3 434.6,455.2 447.7,499.8 11.9,-46.3 448,-322.6 446.7,-501.7 -2.2,-312.7 -337,-362.1 -447.4,-104z"
|
||||
android:fillColor="@color/color_88ABDA"/>
|
||||
<path
|
||||
android:pathData="M425.2,824.7c39.9,47.1 82.4,67.9 86,80 11.9,-46.3 448,-322.6 446.7,-501.7 -0.7,-101 -36.1,-174.5 -87.4,-219C762.9,90.4 275.6,538.5 425.2,824.7z"
|
||||
android:fillColor="@color/color_88ABDA"/>
|
||||
<path
|
||||
android:pathData="M511.1,904.6c8.6,-47 448,-322.6 446.7,-501.7 -0.3,-50.5 -9.4,-94.1 -24.7,-130.7S355.8,729.6 511.1,904.6z"
|
||||
android:fillColor="@color/color_88ABDA"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/tab_recorder0.xml
Normal file
9
app/src/main/res/drawable/tab_recorder0.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="256dp"
|
||||
android:height="256dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:pathData="M512,683.5c130.6,0 235.5,-102.4 235.5,-233L747.5,256c0,-130.6 -105,-233 -235.5,-233s-235.5,102.4 -235.5,233v194.6c0,130.6 102.4,233 235.5,233zM880.6,401.9c0,-23 -20.5,-43.5 -46.1,-43.5s-43.5,20.5 -43.5,43.5c0,5.1 0,10.2 2.6,12.8v33.3c0,151 -125.4,276.5 -281.6,276.5 -153.6,0 -281.6,-125.4 -281.6,-276.5L230.4,409.6c0,-2.6 2.6,-5.1 2.6,-10.2 0,-23 -20.5,-43.5 -43.5,-43.5 -25.6,0 -43.5,20.5 -43.5,43.5v64c0,186.9 140.8,335.4 320,361v87h-122.9c-25.6,0 -46.1,20.5 -46.1,46.1s20.5,43.5 46.1,43.5h332.8c28.2,0 43.5,-17.9 43.5,-43.5 0,-23 -17.9,-46.1 -43.5,-46.1h-122.9v-87c184.3,-20.5 327.7,-174.1 327.7,-361v-61.4zM880.6,401.9"
|
||||
android:fillColor="@color/color_CECECE"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/tab_recorder1.xml
Normal file
9
app/src/main/res/drawable/tab_recorder1.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="256dp"
|
||||
android:height="256dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:pathData="M512,683.5c130.6,0 235.5,-102.4 235.5,-233L747.5,256c0,-130.6 -105,-233 -235.5,-233s-235.5,102.4 -235.5,233v194.6c0,130.6 102.4,233 235.5,233zM880.6,401.9c0,-23 -20.5,-43.5 -46.1,-43.5s-43.5,20.5 -43.5,43.5c0,5.1 0,10.2 2.6,12.8v33.3c0,151 -125.4,276.5 -281.6,276.5 -153.6,0 -281.6,-125.4 -281.6,-276.5L230.4,409.6c0,-2.6 2.6,-5.1 2.6,-10.2 0,-23 -20.5,-43.5 -43.5,-43.5 -25.6,0 -43.5,20.5 -43.5,43.5v64c0,186.9 140.8,335.4 320,361v87h-122.9c-25.6,0 -46.1,20.5 -46.1,46.1s20.5,43.5 46.1,43.5h332.8c28.2,0 43.5,-17.9 43.5,-43.5 0,-23 -17.9,-46.1 -43.5,-46.1h-122.9v-87c184.3,-20.5 327.7,-174.1 327.7,-361v-61.4zM880.6,401.9"
|
||||
android:fillColor="@color/color_88ABDA"/>
|
||||
</vector>
|
||||
12
app/src/main/res/drawable/timer1.xml
Normal file
12
app/src/main/res/drawable/timer1.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="64dp"
|
||||
android:height="64dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:fillColor="@color/color_F4A135"
|
||||
android:pathData="M512,64C264.6,64 64,264.6 64,512s200.6,448 448,448 448,-200.6 448,-448S759.4,64 512,64zM512,884c-205.4,0 -372,-166.6 -372,-372s166.6,-372 372,-372 372,166.6 372,372 -166.6,372 -372,372z"/>
|
||||
<path
|
||||
android:fillColor="@color/color_F4A135"
|
||||
android:pathData="M686.7,638.6L544.1,535.5V288c0,-4.4 -3.6,-8 -8,-8H488c-4.4,0 -8,3.6 -8,8v275.4c0,2.6 1.2,5 3.3,6.5l165.4,120.6c3.6,2.6 8.6,1.8 11.2,-1.7l28.6,-39c2.6,-3.7 1.8,-8.7 -1.8,-11.2z"/>
|
||||
</vector>
|
||||
17
app/src/main/res/drawable/volum_seekbar.xml
Normal file
17
app/src/main/res/drawable/volum_seekbar.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@android:id/background">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/color_cccccc" />
|
||||
<corners android:radius="10dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<solid android:color="@color/color_F4A135" />
|
||||
<corners android:radius="10dp" />
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
</layer-list>
|
||||
8
app/src/main/res/drawable/volum_thumb.xml
Normal file
8
app/src/main/res/drawable/volum_thumb.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="@color/color_F4A135" />
|
||||
<size
|
||||
android:width="12dp"
|
||||
android:height="12dp" />
|
||||
</shape>
|
||||
48
app/src/main/res/layout/activity_layout_info.xml
Normal file
48
app/src/main/res/layout/activity_layout_info.xml
Normal file
@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
|
||||
android:paddingTop="34dp"
|
||||
tools:context="com.prank.tool.act.ActivityInfo">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/title_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="12dp"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.prank.tool.utils.FontTextView
|
||||
android:id="@+id/category_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
app:apply_font="true" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/back_black" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/list_recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
71
app/src/main/res/layout/activity_layout_main.xml
Normal file
71
app/src/main/res/layout/activity_layout_main.xml
Normal file
@ -0,0 +1,71 @@
|
||||
<?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"
|
||||
android:paddingTop="40dp"
|
||||
tools:context="com.prank.tool.act.ActivityMain">
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/vp2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/linear_tab"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="1.0"
|
||||
tools:layout_editor_absoluteX="16dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linear_tab"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:background="@color/transparent"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/frame_home"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imHome"
|
||||
android:layout_width="23dp"
|
||||
android:layout_height="23dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/selector_home" />
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/frame_add"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imAdd"
|
||||
android:layout_width="23dp"
|
||||
android:layout_height="23dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/selector_record" />
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/frame_collect"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imCollect"
|
||||
android:layout_width="23dp"
|
||||
android:layout_height="23dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/selector_collection" />
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
202
app/src/main/res/layout/activity_layout_play.xml
Normal file
202
app/src/main/res/layout/activity_layout_play.xml
Normal file
@ -0,0 +1,202 @@
|
||||
<?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/constraint_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="com.prank.tool.act.ActivityPlay">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/title_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="34dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="12dp"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.prank.tool.utils.FontTextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
app:apply_font="true" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/back_black" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/layout_img"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="25dp"
|
||||
android:padding="10dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="160dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/play_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/layout_img">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/play_loading"
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="34dp"
|
||||
android:layout_gravity="center"
|
||||
android:indeterminateTint="@color/white" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linear_play"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="38dp"
|
||||
android:background="@drawable/stoke_rect"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:visibility="visible">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_play"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:src="@drawable/selector_play_activity" />
|
||||
|
||||
<com.prank.tool.utils.FontTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:text="@string/play_audio"
|
||||
android:textColor="@color/white"
|
||||
app:apply_font="true" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_timer"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginStart="66dp"
|
||||
android:layout_marginTop="60dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_toStartOf="@id/play_parent"
|
||||
android:background="@drawable/oval_99ffffff"
|
||||
android:padding="4dp"
|
||||
android:src="@drawable/timer1"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/play_parent" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_loop"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:background="@drawable/oval_99ffffff"
|
||||
android:padding="2dp"
|
||||
android:src="@drawable/selector_looper"
|
||||
app:layout_constraintLeft_toRightOf="@id/im_timer"
|
||||
app:layout_constraintTop_toTopOf="@id/im_timer" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_like"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:background="@drawable/oval_99ffffff"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/selector_play_collection"
|
||||
app:layout_constraintLeft_toRightOf="@id/im_loop"
|
||||
app:layout_constraintTop_toTopOf="@id/im_timer" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_volume"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/im_timer">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@drawable/ic_volum" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/seekbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toEndOf="@id/im"
|
||||
android:maxHeight="5dp"
|
||||
android:progress="10"
|
||||
android:progressDrawable="@drawable/volum_seekbar"
|
||||
android:thumb="@drawable/volum_thumb" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<com.prank.tool.utils.FontTextView
|
||||
android:id="@+id/more_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@string/more"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
app:apply_font="true"
|
||||
app:layout_constraintBottom_toTopOf="@id/more_recycler"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/more_recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="40dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
60
app/src/main/res/layout/activity_layout_record.xml
Normal file
60
app/src/main/res/layout/activity_layout_record.xml
Normal file
@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/title_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="34dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="12dp"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.prank.tool.utils.FontTextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="@string/recording_audio"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
app:apply_font="true" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/back_black" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<com.prank.tool.utils.FontTextView
|
||||
android:id="@+id/audio_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="134dp"
|
||||
android:text="00:00:00"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="28sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_mic"
|
||||
android:layout_width="125dp"
|
||||
android:layout_height="125dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="60dp"
|
||||
android:src="@drawable/selector_mic" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
128
app/src/main/res/layout/activity_layout_save.xml
Normal file
128
app/src/main/res/layout/activity_layout_save.xml
Normal file
@ -0,0 +1,128 @@
|
||||
<?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/activity_save"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/title_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="34dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="12dp"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.prank.tool.utils.FontTextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="@string/save_sound"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
app:apply_font="true" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/back_black" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/audio_im"
|
||||
android:layout_width="260dp"
|
||||
android:layout_height="220dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:src="@drawable/default_import_audio"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||
|
||||
</ImageView>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/im_play_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="38dp"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/audio_im"
|
||||
android:background="@drawable/rect_main_solid"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_play"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:src="@drawable/selector_play_activity" />
|
||||
|
||||
<com.prank.tool.utils.FontTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:textColor="@color/white"
|
||||
android:text="@string/play_audio"
|
||||
app:apply_font="true" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
<com.prank.tool.utils.FontTextView
|
||||
android:id="@+id/audio_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="14dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
android:text="00:00:00"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/im_play_btn" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/save_edit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="36dp"
|
||||
android:background="@drawable/stoke_rect"
|
||||
android:gravity="center"
|
||||
android:hint="@string/save_audio_name_hint"
|
||||
android:maxLength="10"
|
||||
android:padding="11dp"
|
||||
android:textColorHint="@color/color_CECECE"
|
||||
app:layout_constraintTop_toBottomOf="@id/audio_time" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/save"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="45dp"
|
||||
android:paddingStart="35dp"
|
||||
android:paddingEnd="35dp"
|
||||
android:background="@drawable/rect_main_solid"
|
||||
android:gravity="center"
|
||||
android:text="@string/save"
|
||||
android:layout_marginTop="50dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="19sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/save_edit" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
42
app/src/main/res/layout/activity_layout_welcome.xml
Normal file
42
app/src/main/res/layout/activity_layout_welcome.xml
Normal file
@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
tools:context="com.prank.tool.act.ActivityLauncher">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="230dp"
|
||||
android:src="@mipmap/my_logo" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="18dp"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="26sp" />
|
||||
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="220dp"
|
||||
android:layout_marginTop="58dp"
|
||||
android:layout_marginBottom="60dp"
|
||||
android:progress="90"
|
||||
android:id="@+id/loading_pb"
|
||||
android:progressDrawable="@drawable/pb_welcome"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_height="7dp"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
77
app/src/main/res/layout/fragment_home.xml
Normal file
77
app/src/main/res/layout/fragment_home.xml
Normal file
@ -0,0 +1,77 @@
|
||||
<?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:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.prank.tool.utils.FontTextView
|
||||
android:id="@+id/title_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:gravity="center"
|
||||
android:text="@string/tab1"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
app:apply_font="true" />
|
||||
|
||||
<!-- <FrameLayout-->
|
||||
<!-- android:id="@+id/covert_layout"-->
|
||||
<!-- android:layout_width="160dp"-->
|
||||
<!-- android:layout_height="160dp"-->
|
||||
<!-- android:layout_below="@id/title_layout"-->
|
||||
<!-- android:layout_centerHorizontal="true"-->
|
||||
<!-- android:layout_marginTop="10dp"-->
|
||||
<!-- android:background="@drawable/oval_main"-->
|
||||
<!-- android:elevation="3dp"-->
|
||||
<!-- android:padding="4dp">-->
|
||||
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/audio_im"-->
|
||||
<!-- android:layout_width="70dp"-->
|
||||
<!-- android:layout_height="70dp"-->
|
||||
<!-- android:layout_gravity="center"-->
|
||||
<!-- android:src="@mipmap/ic_launcher" />-->
|
||||
<!-- </FrameLayout>-->
|
||||
|
||||
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:id="@+id/linear_play"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="38dp"-->
|
||||
<!-- android:layout_below="@id/covert_layout"-->
|
||||
<!-- android:layout_centerHorizontal="true"-->
|
||||
<!-- android:layout_marginTop="15dp"-->
|
||||
<!-- android:layout_marginBottom="15dp"-->
|
||||
<!-- android:background="@drawable/stoke_rect"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:orientation="horizontal"-->
|
||||
<!-- android:paddingStart="10dp"-->
|
||||
<!-- android:paddingEnd="10dp">-->
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/btn_play"-->
|
||||
<!-- android:layout_width="22dp"-->
|
||||
<!-- android:layout_height="22dp"-->
|
||||
<!-- android:src="@drawable/selector_play" />-->
|
||||
|
||||
<!-- <com.prank.tool.manager.FontTv-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginStart="5dp"-->
|
||||
<!-- android:text="@string/play_audio"-->
|
||||
<!-- android:textColor="@color/white"-->
|
||||
<!-- app:apply_font="true" />-->
|
||||
<!-- </LinearLayout>-->
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/title_layout" />
|
||||
</RelativeLayout>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user