Commit 0cbacef9 authored by bixing's avatar bixing

Initial commit

parents
*.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
# Default ignored files
/shelf/
/workspace.xml
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="17" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="17" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinJpsPluginSettings">
<option name="version" value="1.7.20" />
</component>
</project>
\ No newline at end of file
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
\ No newline at end of file
/build
\ No newline at end of file
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
android {
namespace 'com.ads.cal.decibel'
compileSdk 33
defaultConfig {
applicationId "com.ads.cal.decibel"
minSdk 24
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
}
buildTypes {
release {
debuggable false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'app-proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.3.2'
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
signingConfigs {
toolsTest {
storeFile file("../toolsTest.jks")
storePassword '123456'
keyAlias 'key0'
keyPassword '123456'
}
}
flavorDimensions "versionName"
productFlavors {
tools {
applicationId "com.ads.cal.decibel"
versionName "1.0"
signingConfig signingConfigs.toolsTest
manifestPlaceholders = [google_ad_app_id: "ca-app-pub-3940256099942544~3347511713"]
}
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.8.0'
implementation platform('org.jetbrains.kotlin:kotlin-bom:1.8.0')
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
implementation 'androidx.activity:activity-compose:1.5.1'
implementation platform('androidx.compose:compose-bom:2022.10.00')
implementation 'androidx.compose.ui:ui'
implementation 'androidx.compose.ui:ui-graphics'
implementation 'androidx.compose.ui:ui-tooling-preview'
implementation 'androidx.compose.material3:material3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation platform('androidx.compose:compose-bom:2022.10.00')
androidTestImplementation 'androidx.compose.ui:ui-test-junit4'
debugImplementation 'androidx.compose.ui:ui-tooling'
debugImplementation 'androidx.compose.ui:ui-test-manifest'
implementation 'com.google.android.gms:play-services-ads:22.5.0'
}
\ No newline at end of file
# 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
-dontpreverify
-flattenpackagehierarchy
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose
-useuniqueclassmembernames
-ignorewarnings
#基础模板开始
# 保护注解
-keepattributes *Annotation*
-keepattributes *JavascriptInterface*
# Retrofit does reflection on generic parameters. InnerClasses is required to use Signature and
# EnclosingMethod is required to use InnerClasses.
#泛型 内部类 反射
-keepattributes Signature,InnerClasses,EnclosingMethod
#显示代码行数
-keepattributes Exceptions,SourceFile,LineNumberTable
-keep public class *$JavaScriptInterface
-keepattributes *$JavaScriptInterface
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}
-keepclassmembers class * extends android.webkit.WebViewClient {
*;
}
# Understand the @Keep support annotation.
-keep class android.support.annotation.Keep
-keep @android.support.annotation.Keep class * {*;}
-keepclasseswithmembers class * {
@android.support.annotation.Keep <methods>;
}
-keepclasseswithmembers class * {
@android.support.annotation.Keep <fields>;
}
-keepclasseswithmembers class * {
@android.support.annotation.Keep <init>(...);
}
#【不进行混淆保持原样】
-keep public class * extends android.view.View
-keep public class * extends android.app.Fragment
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
#commom
-keep public class com.google.vending.licensing.ILicensingService
-keep public class com.android.vending.licensing.ILicensingService
-keep public class * extends android.support.**
-keep class com.google.** { *; }
-keep class android.webkit.**{*;}
-keep class org.apache.** { *; }
-keep public class android.** { *; }
-keepclassmembers public class android.** { *; }
# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
-keepclasseswithmembernames class * {
native <methods>;
}
# keep setters in Views so that animations can still work.
# see http://proguard.sourceforge.net/manual/examples.html#beans
-keepclassmembers public class * extends android.view.View {
void set*(***);
*** get*();
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
}
# We want to keep methods in Activity that could be used in the XML attribute onClick
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {*;}
-keepclassmembers class * implements android.os.Parcelable {*;}
-keep class * implements java.io.Serializable {*;}
-keepclassmembers class * implements java.io.Serializable {*;}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keepclassmembers class **.R$* {
public static <fields>;
}
#基础模板结束
#utilcode
-keep class com.blankj.utilcode.** { *; }
-keepclassmembers class com.blankj.utilcode.** { *; }
-keepclassmembers class * {
@com.blankj.utilcode.util.BusUtils$Bus <methods>;
}
-dontwarn com.blankj.utilcode.**
-dontwarn javax.annotation.**
-dontwarn javax.inject.**
# OkHttp3
-dontwarn okhttp3.**
-dontwarn okio.**
-dontwarn javax.annotation.**
# A resource is loaded with a relative path so the package of this class must be preserved.
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
#okhttp
-dontwarn okhttp3.**
-keep class okhttp3.*{*;}
#okio
-dontwarn okio.**
-keep class okio.*{*;}
# Retrofit
-dontwarn retrofit2.**
-keep class retrofit2.** { *; }
-keepattributes Signature-keepattributes
# Gson
-keep class com.google.gson.stream.** { *; }
-keepattributes EnclosingMethod
-keep class org.xz_sale.entity.**{*;}
# agentWeb
-keep class com.just.agentweb.** {
*;
}
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
!static !transient <fields>;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}
##Glide
-keep class com.bumptech.glide.** {*;}
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
**[] $VALUES;
public *;
}
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
**[] $VALUES;
public *;
}
-keep public class * extends com.bumptech.glide.module.AppGlideModule
-keep class com.bumptech.glide.GeneratedAppGlideModuleImpl { *; }
#alibaba arouter start
-keep public class com.alibaba.android.arouter.routes.**{*;}
-keep public class com.alibaba.android.arouter.facade.**{*;}
-keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;}
# 如果使用了 byType 的方式获取 Service,需添加下面规则,保护接口
-keep interface * implements com.alibaba.android.arouter.facade.template.IProvider
# 如果使用了 单类注入,即不定义接口实现 IProvider,需添加下面规则,保护实现
-keep class * implements com.alibaba.android.arouter.facade.template.IProvider
#alibaba arouter end
#kotlinx start
-keep class kotlinx.** { *; }
-keep class kotlin.** { *; }
-keepclassmembers class **$WhenMappings {
<fields>;
}
-keepclassmembers class kotlin.Metadata {
public <methods>;
}
-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
static void checkParameterIsNotNull(java.lang.Object, java.lang.String);
}
#kotlinx end
#9.22版本新增加混淆
-keep class android.support.v7.widget.RecyclerView {*;}
-keepnames class android.support.v7.widget.RecyclerView$* {
public <fields>;
public <methods>;
}
#android
-keep class android.** {*;}
-keep class androidx.** {*;}
-keep class android.support.** {*;}
-keep class android.content.** {*;}
-keep class android.app.** {*;}
-keep class android.os.** {*;}
-keep class android.net.** {*;}
-keep class android.provider.** {*;}
#com.github
-keep class com.github.** {*;}
#com.google
-keep class com.google.** {*;}
#org.
-keep class org.**{ *; }
package com.ads.cal.decibel
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 test, 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 test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.ads.cal.decibel", appContext.packageName)
}
}
\ No newline at end of file
<?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.RECORD_AUDIO" />
<application
android:name="com.ads.cal.decibel.ui.A"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.Decibel"
tools:targetApi="31">
<activity
android:name="com.ads.cal.decibel.ui.WActivity"
android:exported="true"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@style/Theme.Decibel">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.ads.cal.decibel.ui.MActivity"
android:exported="true"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@style/Theme.Decibel">
</activity>
<activity
android:name="com.ads.cal.decibel.ui.DetailActivity"
android:exported="true"
android:screenOrientation="portrait" />
<activity
android:name="com.ads.cal.decibel.ui.BActivity"
android:exported="true"
android:screenOrientation="portrait" />
<activity
android:name="com.ads.cal.decibel.ui.PActivity"
android:exported="true"
android:screenOrientation="portrait" />
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="${google_ad_app_id}" />
</application>
</manifest>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Privacy Policy - Decibel App</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
}
h1 {
color: #333;
}
p {
margin-bottom: 15px;
}
.highlight {
color: #007BFF;
font-weight: bold;
}
</style>
</head>
<body>
<h1>Privacy Policy - Decibel App</h1>
<p>Welcome to our Decibel App. This application uses the microphone permission to measure sound decibels accurately. We value your privacy and have implemented measures to protect your personal information.</p>
<h2>Purpose of Microphone Permission</h2>
<p>To provide accurate measurements of sound decibels, our app requires access to your device's microphone. The use of the microphone permission is limited to the functionality of sound decibel detection and will not be used for any other purpose.</p>
<h2>How We Use Microphone Permission</h2>
<p>The microphone permission is only activated when you use the decibel detection feature. It is used to capture ambient sound data, perform analysis, and provide corresponding decibel measurement results. We do not save, store, or share the recorded audio data. Audio data is processed in real-time locally on your device and is not recorded or transmitted to external servers.</p>
<h2>Data Security</h2>
<p>We have implemented measures to ensure the security of your audio data:</p>
<ul>
<li><strong>Local Processing:</strong> Audio data is processed in real-time locally on your device and is not transmitted to any external servers.</li>
<li><strong>Encryption:</strong> All communications related to audio data use secure encryption protocols to ensure the security of data transmission.</li>
</ul>
<h2>Consent Authorization</h2>
<p>Upon the first launch of the app, we will request microphone permission. Please ensure that you grant this permission to enable the proper functioning of the decibel detection feature. You can revoke the authorization for microphone permission at any time through your device's settings.</p>
<h2>Data Sharing</h2>
<p>We commit not to share your audio data with any third parties, and it will not be used for advertising purposes. Your privacy is our top priority.</p>
<h2>Privacy Policy Updates</h2>
<p>We may periodically update our privacy policy to reflect changes in the application or regulations. You will receive timely notifications within the app and have the choice to accept or decline updates.</p>
<p>If you have any concerns or questions regarding privacy or security, feel free to contact us. We are dedicated to providing you with a secure and reliable service.</p>
<p class="highlight">Thank you for choosing our Decibel App. We are committed to offering you a safe and trustworthy service.</p>
<p style="margin-top: 30px;">Date: November 14, 2023</p>
</body>
</html>
package com.ads.cal.decibel.ui;
import android.app.Application;
import android.content.Context;
public class A extends Application {
public static Context context;
@Override
public void onCreate() {
super.onCreate();
context = this;
}
}
package com.ads.cal.decibel.ui;
import android.app.Activity;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.ads.cal.decibel.R;
public class BActivity extends Activity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try {
getWindow().setStatusBarColor(Color.parseColor("#000000")); // 设置颜色
} catch (Exception e) {
e.printStackTrace();
}
setContentView(R.layout.b_activity);
findViewById(R.id.title_layout).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
TextView t = findViewById(R.id.v_n);
GradientDrawable shape2 = new GradientDrawable();
shape2.setShape(GradientDrawable.RECTANGLE);
shape2.setCornerRadius(180f);
shape2.setColor(Color.parseColor("#648B909B"));
t.setBackground(shape2);
try {
PackageInfo packageInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
t.setText(String.valueOf(packageInfo.versionName));
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
}
}
package com.ads.cal.decibel.ui;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.View;
import android.view.WindowManager;
import androidx.annotation.NonNull;
public class CRView extends View {
private Paint paint;
private int currentRadius, currentRadius2;
private int ringSpacing = 120; // 同心圆之间的间隔
private int ringSpacing2 = 120; // 同心圆之间的间隔
private boolean isAnimating = false;
private Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case 1:
if (currentRadius <= screenWidth / 2 - 20) {
ringSpacing += 10;
currentRadius = ringSpacing;
handler.sendEmptyMessageDelayed(1, 35); // 控制扩散速度,可根据需求调整+.
if (currentRadius == screenWidth / 2 - 100) {
handler.sendEmptyMessage(2);
}
} else {
isAnimating = false;
currentRadius = 0;
ringSpacing = screenWidth / 4;
}
break;
case 2:
if (currentRadius2 <= screenWidth / 2 - 20) {
ringSpacing2 += 10;
currentRadius2 = ringSpacing2;
handler.sendEmptyMessageDelayed(2, 35); // 控制扩散速度,可根据需求调整
if (currentRadius2 == screenWidth / 2 - 100) {
handler.sendEmptyMessage(1);
}
} else {
isAnimating = false;
currentRadius2 = 0;
ringSpacing2 = screenWidth / 4;
}
break;
}
invalidate();
}
};
public CRView(Context context) {
super(context);
initView();
}
public CRView(Context context, AttributeSet attrs) {
super(context, attrs);
initView();
}
private int screenWidth;
private void initView() {
DisplayMetrics displayMetrics = new DisplayMetrics();
WindowManager windowManager = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);
windowManager.getDefaultDisplay().getMetrics(displayMetrics);
screenWidth = displayMetrics.widthPixels;
ringSpacing = screenWidth / 4;
ringSpacing2 = ringSpacing;
paint = new Paint();
paint.setColor(Color.argb(25, 255, 255, 255)); // 初始为10%透明度的白色
paint.setAntiAlias(true);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
int centerX = getWidth() / 2;
int centerY = getHeight() / 2;
canvas.drawCircle(centerX, centerY, currentRadius, paint);
canvas.drawCircle(centerX, centerY, currentRadius2, paint);
}
public void startRippleAnimation() {
if (!isAnimating) {
isAnimating = true;
handler.sendEmptyMessage(1);
}
}
public void stopRippleAnimation() {
isAnimating = false;
currentRadius2 = 0;
currentRadius = 0;
handler.removeCallbacksAndMessages(null);
invalidate();
}
}
\ No newline at end of file
package com.ads.cal.decibel.ui;
import android.graphics.Color;
import android.util.Log;
public class ColorUtils {
int startColor = 0xFFDB1E11; // 起始颜色
int endColor = 0xFF3DB801; // 终止颜色
private final int numSteps = 120; // 生成的中间颜色数
private final String[] intermediateColors = new String[numSteps];
public String getColor(int i) {
return intermediateColors[i];
}
private ColorUtils() {
i();
}
private static final class ColorUtilsHolder {
static final ColorUtils colorUtils = new ColorUtils();
}
public static ColorUtils getInstance() {
return ColorUtilsHolder.colorUtils;
}
private void i() {
for (int i = 0; i < numSteps; i++) {
float ratio = (float) i / (numSteps - 1);
int interpolatedColor = interpolateColor(startColor, endColor, ratio);
intermediateColors[i] = String.format("#%06X", 0xFFFFFF & interpolatedColor);
Log.d("AAAAAA", intermediateColors[i]);
}
}
private int interpolateColor(int color1, int color2, float ratio) {
int r1 = Color.red(color1);
int g1 = Color.green(color1);
int b1 = Color.blue(color1);
int r2 = Color.red(color2);
int g2 = Color.green(color2);
int b2 = Color.blue(color2);
int interpolatedR = (int) (r1 + (r2 - r1) * ratio);
int interpolatedG = (int) (g1 + (g2 - g1) * ratio);
int interpolatedB = (int) (b1 + (b2 - b1) * ratio);
return Color.rgb(interpolatedR, interpolatedG, interpolatedB);
}
}
package com.ads.cal.decibel.ui;
public class DataBean {
public String title;
public String detail;
}
package com.ads.cal.decibel.ui;
import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.ads.cal.decibel.R;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
public class DetailActivity extends Activity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.d_activity);
initView();
try {
getWindow().setStatusBarColor(Color.parseColor("#000000")); // 设置颜色
} catch (Exception e) {
e.printStackTrace();
}
}
private void initView() {
LinearLayout l = findViewById(R.id.title_layout);
l.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
ListView listView = findViewById(R.id.list);
DataAdapter dataAdapter = new DataAdapter(initData(), this);
listView.setAdapter(dataAdapter);
}
private ArrayList<DataBean> initData() {
ArrayList<DataBean> arrayList = new ArrayList<>();
for (int i = 0; i < 6; i++) {
DataBean dataBean = new DataBean();
switch (i) {
case 0:
dataBean.title = "0-20dB";
dataBean.detail = "Extremely quiet, almost unnoticeable";
break;
case 1:
dataBean.title = "20-40dB";
dataBean.detail = "Quiet, talk softly";
break;
case 2:
dataBean.title = "40-60dB";
dataBean.detail = "Normal, ordinary indoor talking";
break;
case 3:
dataBean.title = "60-70dB";
dataBean.detail = "Noisy, loud talking";
break;
case 4:
dataBean.title = "70-90dB";
dataBean.detail = "Very noisy, damaging nerve cells";
break;
case 5:
dataBean.title = "90-120dB";
dataBean.detail = "Extremely noisy, injuried hearing";
break;
}
arrayList.add(dataBean);
}
return arrayList;
}
private static class DataAdapter extends BaseAdapter {
private final String[] colors = {"#3BB800", "#A9A803", "#DD9104", "#DD5A01", "#DD4100", "#DB1D11"};
private final String[] colorBgs = {"#103bb800", "#10A9A803", "#10DD9104", "#10DD5A01", "#10DD4100", "#10DB1D11"};
private final ArrayList<DataBean> arrayList;
private final WeakReference<Context> weakReference;
public DataAdapter(ArrayList<DataBean> arrayList, Context context) {
this.arrayList = arrayList;
weakReference = new WeakReference<>(context);
}
@Override
public int getCount() {
return arrayList.size();
}
@Override
public Object getItem(int position) {
return arrayList.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder;
if (convertView == null) {
convertView = LayoutInflater.from(weakReference.get()).inflate(R.layout.detaile_item, null, false);
viewHolder = new ViewHolder();
viewHolder.position = convertView.findViewById(R.id.p);
viewHolder.title = convertView.findViewById(R.id.t);
viewHolder.desc = convertView.findViewById(R.id.d);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
int colorBg = Color.parseColor(colorBgs[position % colors.length]);
GradientDrawable shape2 = new GradientDrawable();
shape2.setShape(GradientDrawable.RECTANGLE);
shape2.setCornerRadius(10f);
shape2.setColor(colorBg);
convertView.setBackground(shape2);
// 设置圆形背景颜色
int color = Color.parseColor(colors[position % colors.length]);
GradientDrawable shape = new GradientDrawable();
shape.setShape(GradientDrawable.OVAL);
shape.setColor(color);
viewHolder.position.setBackground(shape);
viewHolder.position.setText(String.valueOf(position + 1));
viewHolder.title.setText(arrayList.get(position).title);
viewHolder.desc.setText(arrayList.get(position).detail);
return convertView;
}
class ViewHolder {
private TextView position, title, desc;
}
}
}
package com.ads.cal.decibel.ui;
import android.Manifest;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.media.AudioFormat;
import android.media.AudioRecord;
import android.media.MediaRecorder;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.app.ActivityCompat;
import com.ads.cal.decibel.R;
import java.util.Random;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class MActivity extends Activity {
private FrameLayout content;
private TextView textView;
private CRView crView;
private TextView max, min;
private static final int MESSAGE_WHAT_VALUE_1 = 1;
private static final int PERMISSION_R_CODE = 2;
private static final int A_E_FORMAT = AudioFormat.ENCODING_PCM_16BIT;
private static final int A_C_CONFIG = AudioFormat.CHANNEL_IN_MONO;
private static final int A_S_RATE = 44200;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.a_m);
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
ImageView imageView = findViewById(R.id.iv);
RelativeLayout.LayoutParams params1 = (RelativeLayout.LayoutParams) imageView.getLayoutParams();
params1.width = displayMetrics.widthPixels / 2;
params1.height = displayMetrics.widthPixels / 2;
ImageView vd = findViewById(R.id.vd);
RelativeLayout.LayoutParams params2 = (RelativeLayout.LayoutParams) vd.getLayoutParams();
params2.width = displayMetrics.widthPixels / 2 + pxTodp(16);
params2.height = displayMetrics.widthPixels / 2 + pxTodp(16);
crView = findViewById(R.id.v);
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) crView.getLayoutParams();
params.width = displayMetrics.widthPixels;
params.height = displayMetrics.widthPixels;
crView.startRippleAnimation();
LinearLayout layout = findViewById(R.id.ll);
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) layout.getLayoutParams();
layoutParams.topMargin = displayMetrics.widthPixels + pxTodp(68);
findViewById(R.id.setting).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
findViewById(R.id.de).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MActivity.this, DetailActivity.class);
startActivity(intent);
}
});
findViewById(R.id.setting).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showSettingPop(v);
}
});
textView = findViewById(R.id.textView);
content = findViewById(R.id.cc);
int color = Color.parseColor(ColorUtils.getInstance().getColor(119));
content.setBackgroundColor(color);
textView.setTextColor(color);
max = findViewById(R.id.max);
min = findViewById(R.id.min);
}
private AudioRecord audioRecord;
private boolean isRecording = false;
private void collectSound() {
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.RECORD_AUDIO}, PERMISSION_R_CODE);
return;
}
int bufferSize = AudioRecord.getMinBufferSize(A_S_RATE, A_C_CONFIG, A_E_FORMAT);
if (bufferSize == AudioRecord.ERROR_BAD_VALUE) {
return;
}
audioRecord = new AudioRecord.Builder()
.setBufferSizeInBytes(bufferSize)
.setAudioSource(MediaRecorder.AudioSource.MIC)
.setAudioFormat(new AudioFormat.Builder()
.setChannelMask(A_C_CONFIG)
.setSampleRate(A_S_RATE)
.setEncoding(A_E_FORMAT)
.build())
.build();
audioRecord.startRecording();
isRecording = true;
executorService.submit(new Runnable() {
@Override
public void run() {
short[] buffer = new short[bufferSize];
int sampleCount = 0;
double soundIntensitySum = 0;
while (isRecording) {
audioRecord.read(buffer, 0, bufferSize);
double maxAmplitude = 0;
for (short s : buffer) {
double amplitude = Math.abs((double) s / Short.MAX_VALUE);
maxAmplitude = Math.max(maxAmplitude, amplitude);
}
soundIntensitySum += maxAmplitude;
sampleCount++;
// 每秒更新一次分贝值
if (sampleCount == A_S_RATE / (bufferSize * 3)) {
double threshold = 1.0e-10; // 阈值,避免除以0
// 计算平均声音强度的平方
double averageSoundIntensitySquared = Math.max(soundIntensitySum / sampleCount, threshold);
// 声音强度的参考值,使用20μPa
double referencePressure = 20.0e-6; // 20微帕斯卡
// 计算分贝值
double decibel = 20 * Math.log10(averageSoundIntensitySquared / referencePressure);
// 发送分贝值到主线程更新UI
handler.sendEmptyMessage((int) decibel);
// 重置计数器和声音强度总和
sampleCount = 0;
soundIntensitySum = 0;
}
}
audioRecord.stop();
audioRecord.release();
}
});
}
private int pxTodp(int dpValue) {
float density = getResources().getDisplayMetrics().density;
return (int) (dpValue * density);
}
@Override
protected void onStop() {
super.onStop();
isRecording = false;
}
@Override
protected void onResume() {
super.onResume();
collectSound();
isRecording = true;
}
@Override
protected void onDestroy() {
super.onDestroy();
crView.stopRippleAnimation();
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (requestCode == PERMISSION_R_CODE && grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
collectSound();
}
}
private int maxValue, minValue = 120;
@SuppressLint("HandlerLeak")
private final Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
int value = (int) msg.what;
if (value < 0) {
return;
}
int color;
if (value >= 120) {
color = Color.parseColor(ColorUtils.getInstance().getColor(0));
} else {
color = Color.parseColor(ColorUtils.getInstance().getColor(120 - value));
}
try {
getWindow().setStatusBarColor(color); // 设置颜色
} catch (Exception e) {
e.printStackTrace();
}
content.setBackgroundColor(color);
textView.setTextColor(color);
if (value < minValue) {
minValue = value;
}
if (value > maxValue) {
maxValue = value;
}
min.setText(String.valueOf(minValue));
max.setText(String.valueOf(maxValue));
textView.setText(String.valueOf(value));
}
};
private void showSettingPop(View setting) {
PopupWindow popupWindow = new PopupWindow();
View view = LayoutInflater.from(this).inflate(R.layout.p, null, false);
popupWindow.setContentView(view);
// 测量 contentView 的宽度
view.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
// 获取 contentView 的测量宽度
int popupWidth = view.getMeasuredWidth();
popupWindow.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT);
popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
popupWindow.setOutsideTouchable(false);
popupWindow.setFocusable(true);
popupWindow.setWindowLayoutMode(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
popupWindow.setClippingEnabled(false);
// 获取按钮的位置,按钮的宽度和高度
int[] locationOnScreen = new int[2];
setting.getLocationOnScreen(locationOnScreen);
float dpValue = 5; // 你要转换的dp值
float density = getResources().getDisplayMetrics().density; // 获取屏幕的密度
int pxValue = (int) (dpValue * density + 0.5f); // 四舍五入取整数值
popupWindow.showAsDropDown(setting, popupWidth - (locationOnScreen[0]) + (int)(setting.getWidth() * 2.4), pxValue);
view.findViewById(R.id.pp).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MActivity.this, PActivity.class);
startActivity(intent);
popupWindow.dismiss();
}
});
view.findViewById(R.id.au).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MActivity.this, BActivity.class);
startActivity(intent);
popupWindow.dismiss();
}
});
}
private static final ExecutorService executorService = Executors.newFixedThreadPool(5);
}
package com.ads.cal.decibel.ui;
import android.app.Activity;
import android.util.Log;
import androidx.annotation.NonNull;
import com.google.android.gms.ads.AdError;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.FullScreenContentCallback;
import com.google.android.gms.ads.LoadAdError;
import com.google.android.gms.ads.appopen.AppOpenAd;
import java.util.Date;
public class OpenManager {
private static final String LOG_TAG = "OpenManager";
// private static final String AD_UNIT_ID = "ca-app-pub-3940256099942544/3419835294";
/**
* Constructor.
*/
public OpenManager() {
}
private static final class OHolder {
static final OpenManager o = new OpenManager();
}
public static OpenManager getInstance() {
return OHolder.o;
}
/**
* Keep track of the time an app open ad is loaded to ensure you don't show an expired ad.
*/
private long loadTime = 0;
private AppOpenAd appOpenAd = null;
private boolean isLoadingAd = false;
private boolean isShowingAd = false;
private OnAdLoadCompleteCallBack onAdLoadCompleteCallBack;
private OnAdShowCompleteCallBack onAdShowCompleteCallBack;
public boolean isShowingAd() {
return isShowingAd;
}
/**
* Load an ad.
*
*/
public void loadAd() {
// Do not load ad if there is an unused ad or one is already loading.
if (isLoadingAd || isAdAvailable()) {
return;
}
isLoadingAd = true;
AdRequest request = new AdRequest.Builder().build();
AppOpenAd.load(
A.context,
"",
request,
new AppOpenAd.AppOpenAdLoadCallback() {
/**
* Called when an app open ad has loaded.
*
* @param ad the loaded app open ad.
*/
@Override
public void onAdLoaded(AppOpenAd ad) {
appOpenAd = ad;
isLoadingAd = false;
loadTime = (new Date()).getTime();
if (null != onAdLoadCompleteCallBack) {
onAdLoadCompleteCallBack.onLoadAdComplete();
onAdLoadCompleteCallBack = null;
}
Log.e(LOG_TAG, "onAdLoaded.");
}
/**
* Called when an app open ad has failed to load.
*
* @param loadAdError the error.
*/
@Override
public void onAdFailedToLoad(LoadAdError loadAdError) {
isLoadingAd = false;
if (null != onAdLoadCompleteCallBack) {
onAdLoadCompleteCallBack.onLoadAdFailed(loadAdError.getMessage());
onAdLoadCompleteCallBack = null;
}
Log.e(LOG_TAG, "onAdFailedToLoad: " + loadAdError.getMessage());
}
});
}
/**
* Check if ad was loaded more than n hours ago.
*/
private boolean wasLoadTimeLessThanNHoursAgo(long numHours) {
long dateDifference = (new Date()).getTime() - loadTime;
long numMilliSecondsPerHour = 3600000;
return (dateDifference < (numMilliSecondsPerHour * numHours));
}
/**
* Check if ad exists and can be shown.
*/
public boolean isAdAvailable() {
// Ad references in the app open beta will time out after four hours, but this time limit
// may change in future beta versions. For details, see:
// https://support.google.com/admob/answer/9341964?hl=en
return appOpenAd != null && wasLoadTimeLessThanNHoursAgo(4);
}
/**
* Show the ad if one isn't already showing.
*
* @param activity the activity that shows the app open ad
*/
public boolean showAdIfAvailable(
@NonNull Activity activity) {
// If the app open ad is already showing, do not show the ad again.
if (isShowingAd) {
Log.e(LOG_TAG, "The app open ad is already showing.");
return false;
}
// If the app open ad is not available yet, invoke the callback then load the ad.
if (!isAdAvailable()) {
Log.e(LOG_TAG, "The app open ad is not ready yet.");
loadAd();
return false;
}
Log.e(LOG_TAG, "Will show ad.");
appOpenAd.setFullScreenContentCallback(
new FullScreenContentCallback() {
/** Called when full screen content is dismissed. */
@Override
public void onAdDismissedFullScreenContent() {
// Set the reference to null so isAdAvailable() returns false.
appOpenAd = null;
isShowingAd = false;
Log.e(LOG_TAG, "onAdDismissedFullScreenContent.");
if (null != onAdShowCompleteCallBack) {
onAdShowCompleteCallBack.onShowAdComplete();
onAdShowCompleteCallBack = null;
}
loadAd();
}
/** Called when fullscreen content failed to show. */
@Override
public void onAdFailedToShowFullScreenContent(@NonNull AdError adError) {
appOpenAd = null;
isShowingAd = false;
Log.e(LOG_TAG, "onAdFailedToShowFullScreenContent: " + adError.getMessage());
if (null != onAdShowCompleteCallBack) {
onAdShowCompleteCallBack.onShowAdFailed(adError.getMessage());
onAdShowCompleteCallBack = null;
}
loadAd();
}
/** Called when fullscreen content is shown. */
@Override
public void onAdShowedFullScreenContent() {
Log.e(LOG_TAG, "onAdShowedFullScreenContent.");
}
@Override
public void onAdImpression() {
super.onAdImpression();
Log.e(LOG_TAG, "onAdImpression.");
}
@Override
public void onAdClicked() {
super.onAdClicked();
}
});
isShowingAd = true;
appOpenAd.show(activity);
return true;
}
public interface OnAdShowCompleteCallBack {
void onShowAdComplete();
void onShowAdFailed(String errorMsg);
}
public interface OnAdLoadCompleteCallBack {
void onLoadAdComplete();
void onLoadAdFailed(String errorMsg);
}
public void setOnLoadAdCompleteCallBack(OnAdLoadCompleteCallBack onAdLoadCompleteCallBack) {
this.onAdLoadCompleteCallBack = onAdLoadCompleteCallBack;
}
public void setOnShowAdCompleteCallBack(OnAdShowCompleteCallBack onAdShowCompleteCallBack) {
this.onAdShowCompleteCallBack = onAdShowCompleteCallBack;
}
}
package com.ads.cal.decibel.ui;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.annotation.Nullable;
import com.ads.cal.decibel.R;
public class PActivity extends Activity {
@SuppressLint("SetJavaScriptEnabled")
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.p_activity);
WebView webView = findViewById(R.id.w);
webView.setWebViewClient(new WebViewClient());
webView.setWebChromeClient(new WebChromeClient());
WebSettings settings = webView.getSettings();
settings.setJavaScriptEnabled(true);
webView.loadUrl("file:///android_asset/p.html");
}
}
package com.ads.cal.decibel.ui;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.widget.ProgressBar;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.ads.cal.decibel.R;
import java.lang.ref.WeakReference;
public class WActivity extends Activity {
private static class Hl extends Handler {
private final WeakReference<Activity> weakReference;
private int i = 0;
public Hl(Activity activity) {
super();
weakReference = new WeakReference<>(activity);
}
@Override
public void handleMessage(@NonNull Message msg) {
super.handleMessage(msg);
Activity activity = weakReference.get();
sendEmptyMessageDelayed(1, 10);
if (activity instanceof WActivity) {
((WActivity) activity).setProgressBarProgress(i++);
}
}
}
private ProgressBar progressBar;
private Hl hl;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.w_activity);
progressBar = findViewById(R.id.p);
hl = new Hl(this);
hl.sendEmptyMessage(1);
}
public void setProgressBarProgress(int i) {
if (i > 100) {
if (hl != null) {
hl.removeCallbacksAndMessages(null);
}
Intent intent = new Intent(this, MActivity.class);
startActivity(intent);
finish();
return;
}
progressBar.setProgress(i);
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<corners android:radius="180dp"/>
<solid android:color="@color/black"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke android:width="1dp" android:color="#66000000"/>
<solid android:color="#4DFFFFFF" />
<corners android:radius="180dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape
android:shape="oval">
<solid android:color="#30FFFFFF" /> <!-- 10% 的透明度的白色 -->
</shape>
</item>
<item android:left="20dp" android:top="20dp" android:right="20dp" android:bottom="20dp">
<shape
android:shape="oval">
<solid android:color="@android:color/transparent" />
</shape>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#1F2022"/>
<corners android:radius="5dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<corners android:radius="180dp"/>
<solid android:color="@color/white"/>
</shape>
\ No newline at end of file
<?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="#E8E9EB" /> <!-- 背景颜色 -->
<corners android:radius="8dp" /> <!-- 圆角 -->
</shape>
</item>
<item android:id="@android:id/progress">
<clip>
<shape android:shape="rectangle">
<solid android:color="#545362" /> <!-- 进度条颜色 -->
<corners android:radius="8dp" /> <!-- 圆角 -->
</shape>
</clip>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/cc"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="53dp">
<ImageView
android:id="@+id/logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="14dp"
android:src="@mipmap/logo" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="4dp"
android:layout_toEndOf="@+id/logo"
android:text="@string/app_name"
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/setting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginEnd="10dp"
android:padding="10dp"
android:src="@mipmap/icon_setting" />
</RelativeLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="14dp"
android:layout_marginTop="69dp"
android:src="@mipmap/color_value" />
<LinearLayout
android:id="@+id/ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="@+id/max"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:text="@string/app_value"
android:layout_gravity="bottom"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:gravity="center"
android:text="@string/app_max_value"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
<ImageView
android:layout_width="1dp"
android:layout_height="30dp"
android:layout_marginTop="7dp"
android:layout_marginBottom="7dp"
android:background="@color/black" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="@+id/min"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:text="@string/app_value"
android:layout_gravity="bottom"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:gravity="center"
android:text="@string/app_min_value"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp">
<com.ads.cal.decibel.ui.CRView
android:id="@+id/v"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
<ImageView
android:id="@+id/vd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@drawable/i_img_bg" />
<ImageView
android:id="@+id/iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@drawable/value_bg"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="80sp"
android:text="1"
android:gravity="center"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:drawableEnd="@mipmap/db"
android:drawablePadding="4dp"
android:text="Current decibels"
android:gravity="center"
android:textColor="#545362"
android:textSize="13sp" />
</LinearLayout>
</RelativeLayout>
<TextView
android:id="@+id/de"
android:layout_width="132dp"
android:layout_height="36dp"
android:layout_marginBottom="30dp"
android:gravity="center"
android:textColor="#000000"
android:textSize="13sp"
android:background="@drawable/detail"
android:text="Decibel level table"
android:layout_gravity="bottom|center_horizontal"/>
</FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/title_layout"
android:layout_width="match_parent"
android:layout_height="53dp"
android:background="#1F2022"
android:orientation="horizontal"
android:paddingStart="14dp"
android:paddingEnd="14dp">
<ImageView
android:id="@+id/back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="8dp"
android:src="@mipmap/icon_back" />
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="About Us"
android:textColor="#FFFFFF"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:src="@mipmap/ic_launcher"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:gravity="center"
android:layout_marginTop="14dp"
android:textSize="18sp"
android:textColor="#62656A"/>
<TextView
android:id="@+id/v_n"
android:layout_width="48dp"
android:layout_height="22dp"
android:gravity="center"
android:layout_marginTop="14dp"
android:textSize="14sp"
android:textColor="#8B909B"/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/title_layout"
android:layout_width="match_parent"
android:layout_height="53dp"
android:background="#1F2022"
android:orientation="horizontal"
android:paddingStart="14dp"
android:paddingEnd="14dp">
<ImageView
android:id="@+id/back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="8dp"
android:src="@mipmap/icon_back" />
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="@string/level"
android:textColor="#FFFFFF"
android:textSize="18sp" />
</LinearLayout>
<ListView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="@null"
android:dividerHeight="8dp"
android:paddingStart="14dp"
android:paddingTop="14dp"
android:paddingEnd="14dp" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_marginBottom="8dp"
android:orientation="horizontal"
android:gravity="center_vertical"
android:padding="15dp">
<TextView
android:id="@+id/p"
android:layout_width="40dp"
android:layout_height="40dp"
android:textColor="#FFFFFF"
android:gravity="center"
android:layout_marginEnd="10dp"
android:textStyle="bold"
android:textSize="20sp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/t"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="#1F2022"
android:textSize="16sp"
android:layout_marginBottom="4dp"/>
<TextView
android:id="@+id/d"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#62656A"
android:textSize="13sp"/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="130dp"
android:gravity="start|center_vertical"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/vector"
android:layout_marginEnd="17dp"
android:layout_gravity="end"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="80dp"
android:background="@drawable/p_setting_bg"
android:orientation="vertical"
android:paddingStart="14dp"
android:paddingEnd="14dp">
<TextView
android:id="@+id/au"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:gravity="center"
android:text="About Us"
android:textColor="@color/white"
android:textSize="14sp" />
<ImageView
android:layout_width="100dp"
android:layout_height="0.33dp"
android:background="@color/white" />
<TextView
android:id="@+id/pp"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:gravity="center"
android:text="Privacy Policy"
android:textColor="@color/white"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<WebView
android:id="@+id/w"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginTop="160dp"
android:src="@mipmap/ic_launcher" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:gravity="center"
android:text="@string/app_name"
android:textColor="#545362"
android:textSize="18sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
android:orientation="vertical">
<ProgressBar
android:id="@+id/p"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="6dp"
android:layout_marginStart="80dp"
android:layout_marginEnd="80dp"
android:layout_marginBottom="80dp"
android:max="100"
android:progressDrawable="@drawable/w_p" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
</resources>
\ No newline at end of file
<resources>
<string name="app_name">Decibel Tester</string>
<string name="app_value">dB</string>
<string name="app_max_value">Maximum decibel</string>
<string name="app_min_value">Minimum decibel</string>
<string name="level">Decibel level table</string>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Decibel" parent="android:Theme.Material.Light.NoActionBar" />
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?><!--
Sample backup rules file; uncomment and customize as necessary.
See https://developer.android.com/guide/topics/data/autobackup
for details.
Note: This file is ignored for devices older that API 31
See https://developer.android.com/about/versions/12/backup-restore
-->
<full-backup-content>
<!--
<include domain="sharedpref" path="."/>
<exclude domain="sharedpref" path="device.xml"/>
-->
</full-backup-content>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?><!--
Sample data extraction rules file; uncomment and customize as necessary.
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
for details.
-->
<data-extraction-rules>
<cloud-backup>
<!-- TODO: Use <include> and <exclude> to control what is backed up.
<include .../>
<exclude .../>
-->
</cloud-backup>
<!--
<device-transfer>
<include .../>
<exclude .../>
</device-transfer>
-->
</data-extraction-rules>
\ No newline at end of file
package com.ads.cal.decibel
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}
\ No newline at end of file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '8.0.2' apply false
id 'com.android.library' version '8.0.2' apply false
id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
}
\ No newline at end of file
File added
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
\ No newline at end of file
#Fri Nov 10 14:47:14 CST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "Decibel"
include ':app'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment