init
17
.gitignore
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
*.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
|
||||
.idea/
|
||||
app/release/
|
||||
35
BaseActivity.kt
Normal file
@ -0,0 +1,35 @@
|
||||
package com.kitobochi.softapp.timberlock.ui.activity
|
||||
|
||||
import android.graphics.Color
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
|
||||
abstract class BaseActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(getActivityView())
|
||||
initView()
|
||||
}
|
||||
|
||||
open fun initView() {
|
||||
initStatusBar()
|
||||
}
|
||||
|
||||
abstract fun getActivityView(): View
|
||||
|
||||
private fun initStatusBar() {
|
||||
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
// window.decorView.systemUiVisibility =
|
||||
// (View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_STABLE) or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
|
||||
// window.statusBarColor = Color.TRANSPARENT
|
||||
// }
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
window.decorView.systemUiVisibility =
|
||||
(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_STABLE)
|
||||
window.statusBarColor = Color.TRANSPARENT
|
||||
}
|
||||
}
|
||||
}
|
||||
1
app/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/build
|
||||
BIN
app/FunnySounds.jks
Normal file
BIN
app/FunnySoundstest.jks
Normal file
62
app/build.gradle.kts
Normal file
@ -0,0 +1,62 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
id("com.google.gms.google-services")
|
||||
id("com.google.firebase.crashlytics")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.example.funnysounds"
|
||||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.funny.sounds.hd"
|
||||
minSdk = 23
|
||||
targetSdk = 34
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = true
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
buildFeatures {
|
||||
viewBinding = true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation(libs.appcompat)
|
||||
implementation(libs.material)
|
||||
implementation(libs.activity)
|
||||
implementation(libs.constraintlayout)
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.ext.junit)
|
||||
androidTestImplementation(libs.espresso.core)
|
||||
implementation ("com.github.bumptech.glide:glide:4.16.0")
|
||||
implementation ("com.google.code.gson:gson:2.10.1")
|
||||
implementation("com.google.android.material:material:1.11.0")
|
||||
|
||||
implementation(platform("com.google.firebase:firebase-bom:32.3.1"))
|
||||
implementation("com.google.firebase:firebase-analytics-ktx")
|
||||
implementation("com.google.firebase:firebase-crashlytics-ktx")
|
||||
|
||||
//---------------------------------Mintegral SDK
|
||||
implementation ("com.mbridge.msdk.oversea:newinterstitial:16.7.71")
|
||||
implementation ("com.mbridge.msdk.oversea:mbbid:16.7.61")
|
||||
|
||||
|
||||
|
||||
}
|
||||
29
app/google-services.json
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "15060781613",
|
||||
"project_id": "funny-sounds-air-horn",
|
||||
"storage_bucket": "funny-sounds-air-horn.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:15060781613:android:cae5beb7e5d3e8946586a4",
|
||||
"android_client_info": {
|
||||
"package_name": "com.funny.sounds.hd"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyBl8gjqL1vaAbozfSIU8ittZHGIyeq1528"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
5
app/info
Normal file
@ -0,0 +1,5 @@
|
||||
包名:com.funny.sounds.hd
|
||||
应用名:Funny Sounds
|
||||
签名文件:FunnySounds.jks
|
||||
别名:key0
|
||||
密码:FunnySounds
|
||||
48
app/proguard-rules.pro
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
# 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
|
||||
-keep class com.omicronapplications.** { *; }
|
||||
-keep class net.sf.sevenzipjbinding.** { *; }
|
||||
-keep class com.google.gson.reflect.TypeToken { *; }
|
||||
-keep class * extends com.google.gson.reflect.TypeToken
|
||||
|
||||
-keep class com.example.funnysounds.data.MyData { *; }
|
||||
-keep class com.example.funnysounds.data.CategoryList { *; }
|
||||
-keepattributes Signature
|
||||
-keepattributes *Annotation*
|
||||
-keep class com.mbridge.** {*; }
|
||||
-keep interface com.mbridge.** {*; }
|
||||
-dontwarn com.mbridge.**
|
||||
-keepclassmembers class **.R$* { public static final int mbridge*; }
|
||||
|
||||
-keep public class com.mbridge.* extends androidx.** { *; }
|
||||
-keep public class androidx.viewpager.widget.PagerAdapter{*;}
|
||||
-keep interface androidx.annotation.IntDef{*;}
|
||||
-keep interface androidx.annotation.Nullable{*;}
|
||||
-keep interface androidx.annotation.CheckResult{*;}
|
||||
-keep interface androidx.annotation.NonNull{*;}
|
||||
-keep public class androidx.fragment.app.Fragment{*;}
|
||||
-keep public class androidx.core.content.FileProvider{*;}
|
||||
-keep public class androidx.core.app.NotificationCompat{*;}
|
||||
-keep public class androidx.appcompat.widget.AppCompatImageView {*;}
|
||||
-keep public class androidx.recyclerview.*{*;}
|
||||
-keep class com.mbridge.msdk.foundation.tools.FastKV{*;}
|
||||
-keep class com.mbridge.msdk.foundation.tools.FastKV$Builder{*;}
|
||||
@ -0,0 +1,26 @@
|
||||
package com.example.funnysounds;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("com.example.funnysounds", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
42
app/src/main/AndroidManifest.xml
Normal file
@ -0,0 +1,42 @@
|
||||
<?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.SET_WALLPAPER" />
|
||||
|
||||
<application
|
||||
android:name=".resolve.Sounds"
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/logo"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.FunnySounds"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".activity.DetailActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".activity.SpecifisoundsActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".activity.IntoActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activity.MainActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".activity.StartPageActivity"
|
||||
android:exported="false" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
BIN
app/src/main/assets/myfont.ttf
Normal file
3390
app/src/main/assets/prank.json
Normal file
@ -0,0 +1,7 @@
|
||||
package com.example.funnysounds.action;
|
||||
|
||||
import com.example.funnysounds.data.CategoryList;
|
||||
|
||||
public interface CategoryNameSoundsrListener {
|
||||
public void onItemClickAction(CategoryList categoryList);
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
package com.example.funnysounds.action;
|
||||
|
||||
import com.example.funnysounds.data.CategoryList;
|
||||
import com.example.funnysounds.data.MyData;
|
||||
|
||||
public interface MyDataSounderListener {
|
||||
public void onItemClickAction(MyData myData);
|
||||
}
|
||||
@ -0,0 +1,176 @@
|
||||
package com.example.funnysounds.activity;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.media.AudioManager;
|
||||
import android.media.MediaPlayer;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.DataSource;
|
||||
import com.bumptech.glide.load.engine.GlideException;
|
||||
import com.bumptech.glide.request.RequestListener;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
import com.example.funnysounds.R;
|
||||
import com.example.funnysounds.ad.ADBean;
|
||||
import com.example.funnysounds.ad.MBrManager;
|
||||
import com.example.funnysounds.ad.onAdStatusListener;
|
||||
import com.example.funnysounds.data.CategoryList;
|
||||
import com.example.funnysounds.data.MyData;
|
||||
import com.example.funnysounds.value.StaticValue;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
public class DetailActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
private String name;
|
||||
private String image;
|
||||
private MyData resource;
|
||||
private String media;
|
||||
private TextView textView;
|
||||
private ImageView imageView,imageView2;
|
||||
private MediaPlayer mediaPlayer;
|
||||
protected Button btn_play_pause;
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_detail);
|
||||
Log.d("----------y","-----onCreate="+Thread.currentThread().getName());
|
||||
textView = findViewById(R.id.data_name);
|
||||
imageView = findViewById(R.id.data_image);
|
||||
imageView2 = findViewById(R.id.imageview_back);
|
||||
btn_play_pause = findViewById(R.id.btn_play_pause);
|
||||
btn_play_pause.setBackgroundResource(R.mipmap.play);
|
||||
goGetData();
|
||||
initfindview();
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void initfindview() {
|
||||
|
||||
imageView2.setOnClickListener(this);
|
||||
btn_play_pause.setOnClickListener(this);
|
||||
}
|
||||
|
||||
private void goGetData() {
|
||||
Intent intent = getIntent();
|
||||
resource = (MyData) intent.getSerializableExtra(StaticValue.key_resourse);
|
||||
assert resource != null;
|
||||
textView.setText(resource.getTitle());
|
||||
mediaPlayer = MediaPlayer.create(DetailActivity.this, Uri.parse(resource.getMp3Url()));
|
||||
image = resource.getPreUrl();
|
||||
Glide.with(this).load(image).addListener(new RequestListener<Drawable>() {
|
||||
@Override
|
||||
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onResourceReady(@NonNull Drawable resource, @NonNull Object model, Target<Drawable> target, @NonNull DataSource dataSource, boolean isFirstResource) {
|
||||
return false;
|
||||
}
|
||||
}).into(imageView);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
btn_play_pause.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if(mediaPlayer != null){
|
||||
if(mediaPlayer.isPlaying()){
|
||||
((Button)v).setBackgroundResource(R.mipmap.play);
|
||||
mediaPlayer.pause();
|
||||
}else {
|
||||
((Button)v).setBackgroundResource(R.mipmap.stop);
|
||||
mediaPlayer.start();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
imageView2.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if(mediaPlayer != null){
|
||||
if (mediaPlayer.isPlaying()) {
|
||||
mediaPlayer.stop();
|
||||
}
|
||||
}
|
||||
|
||||
showad();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void showad() {
|
||||
ADBean cache = MBrManager.getCache();
|
||||
if(cache == null){
|
||||
finish();
|
||||
Log.d("-------fail","------showfail");
|
||||
}else{
|
||||
MBrManager.setCallBack(cache.getInterstitialHandler(), new onAdStatusListener() {
|
||||
@Override
|
||||
public void onLoaded() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFail() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShowFail() {
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose() {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
cache.getInterstitialHandler().showFromBid();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mediaPlayer != null) {
|
||||
mediaPlayer.stop();
|
||||
mediaPlayer.release();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,128 @@
|
||||
package com.example.funnysounds.activity;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.graphics.Typeface;
|
||||
import android.net.wifi.p2p.WifiP2pManager;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.util.Log;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
import com.example.funnysounds.R;
|
||||
import com.example.funnysounds.ad.ADBean;
|
||||
|
||||
import com.example.funnysounds.ad.MBrManager;
|
||||
import com.example.funnysounds.ad.onAdStatusListener;
|
||||
import com.example.funnysounds.ad.onInterHandlerListener;
|
||||
import com.example.funnysounds.resolve.Sounds;
|
||||
import com.mbridge.msdk.newinterstitial.out.MBBidNewInterstitialHandler;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import kotlin.Unit;
|
||||
|
||||
public class IntoActivity extends AppCompatActivity {
|
||||
private boolean needShow = true;
|
||||
public MBBidNewInterstitialHandler MBBidNewInterstitialHandler;
|
||||
protected CountDownTimer countDownTimer;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_into);
|
||||
countDownTimer = new CountDownTimer(11000,100) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
if (needShow) {
|
||||
startShowAd(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
if (needShow) {
|
||||
startShowAd(true);
|
||||
// startMainActivity();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
startAd();
|
||||
}
|
||||
private void startAd() {
|
||||
if (!Sounds.initOK) {
|
||||
IntentFilter intentFilter = new IntentFilter(Sounds.AD_INIT);
|
||||
LocalBroadcastManager.getInstance(this).registerReceiver(new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
loadMyAdAndStart();
|
||||
Log.d("------------", "------------1sucess");
|
||||
}
|
||||
},intentFilter);
|
||||
|
||||
} else {
|
||||
loadMyAdAndStart();
|
||||
Log.d("------------", "------------2sucess");
|
||||
}
|
||||
}
|
||||
public void startShowAd(boolean is){
|
||||
ADBean cache = MBrManager.getCache();
|
||||
if(cache == null){
|
||||
if(is){
|
||||
startMainActivity();
|
||||
}
|
||||
}else{
|
||||
needShow = false;
|
||||
MBrManager.setCallBack(cache.getInterstitialHandler(), new onAdStatusListener() {
|
||||
@Override
|
||||
public void onLoaded() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFail() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShowFail() {
|
||||
startMainActivity();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose() {
|
||||
startMainActivity();
|
||||
}
|
||||
});
|
||||
cache.getInterstitialHandler().showFromBid();
|
||||
}
|
||||
}
|
||||
|
||||
private void loadMyAdAndStart() {
|
||||
countDownTimer.start();
|
||||
|
||||
}
|
||||
private void startMainActivity() {
|
||||
Intent intent = new Intent(this, MainActivity.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
countDownTimer.cancel();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package com.example.funnysounds.activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import android.util.Log;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.funnysounds.R;
|
||||
import com.example.funnysounds.action.CategoryNameSoundsrListener;
|
||||
import com.example.funnysounds.data.CategoryList;
|
||||
import com.example.funnysounds.resolve.MySpace;
|
||||
import com.example.funnysounds.resolve.Sounds;
|
||||
import com.example.funnysounds.soundsadapter.CgNameAdapter;
|
||||
import com.example.funnysounds.value.StaticValue;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class MainActivity extends AppCompatActivity implements CategoryNameSoundsrListener{
|
||||
private TextView textview_sounds;
|
||||
private RecyclerView recyclerview_sounds;
|
||||
private String name;
|
||||
|
||||
@SuppressLint("MissingInflatedId")
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
textview_sounds = findViewById(R.id.textview_sounds);
|
||||
recyclerview_sounds = findViewById(R.id.recyclerview_sounds);
|
||||
textview_sounds.setTypeface(Typeface.createFromAsset(getAssets(),"myfont.ttf"));
|
||||
setRecyclerviewSounds();
|
||||
|
||||
}
|
||||
|
||||
private void setRecyclerviewSounds() {
|
||||
MySpace mySpace = new MySpace(10,10,15);
|
||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 2);
|
||||
recyclerview_sounds.setLayoutManager(gridLayoutManager);
|
||||
recyclerview_sounds.addItemDecoration(mySpace);
|
||||
CgNameAdapter cgNameAdapter = new CgNameAdapter(Sounds.getUserList(), this);
|
||||
cgNameAdapter.setCategoryNameSoundsListener(this);
|
||||
recyclerview_sounds.setAdapter(cgNameAdapter);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onItemClickAction(CategoryList categoryList) {
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,89 @@
|
||||
package com.example.funnysounds.activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.funnysounds.R;
|
||||
import com.example.funnysounds.action.MyDataSounderListener;
|
||||
import com.example.funnysounds.data.CategoryList;
|
||||
import com.example.funnysounds.data.MyData;
|
||||
import com.example.funnysounds.resolve.MySpace;
|
||||
import com.example.funnysounds.resolve.Sounds;
|
||||
import com.example.funnysounds.soundsadapter.CgNameAdapter;
|
||||
import com.example.funnysounds.soundsadapter.DataAdapter;
|
||||
import com.example.funnysounds.value.StaticValue;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class SpecifisoundsActivity extends AppCompatActivity implements MyDataSounderListener,View.OnClickListener {
|
||||
|
||||
private ImageView imageView;
|
||||
private CategoryList name;
|
||||
|
||||
private TextView cName;
|
||||
private RecyclerView recyclerview_specific;
|
||||
private int i;
|
||||
private List<CategoryList> categoryLists;
|
||||
|
||||
@SuppressLint("MissingInflatedId")
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_specifisounds);
|
||||
recyclerview_specific = findViewById(R.id.recyclerview_specific);
|
||||
imageView = findViewById(R.id.imageview_back);
|
||||
cName = findViewById(R.id.categoryname);
|
||||
imageView.setOnClickListener(this);
|
||||
getData();
|
||||
setSpecificRecycleView();
|
||||
|
||||
}
|
||||
public void getData(){
|
||||
Intent intent = getIntent();
|
||||
name = (CategoryList) intent.getSerializableExtra(StaticValue.key_category_name);
|
||||
assert name != null;
|
||||
cName.setText(name.getCategoryName());
|
||||
}
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
imageView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void setSpecificRecycleView(){
|
||||
MySpace mySpace = new MySpace(10,10,15);
|
||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(this,2);
|
||||
recyclerview_specific.setLayoutManager(gridLayoutManager);
|
||||
recyclerview_specific.addItemDecoration(mySpace);
|
||||
DataAdapter dataAdapter = new DataAdapter(name.getList(),this);
|
||||
dataAdapter.setMyDataSounderListener(this);
|
||||
recyclerview_specific.setAdapter(dataAdapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClickAction(MyData myData) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
27
app/src/main/java/com/example/funnysounds/ad/ADBean.java
Normal file
@ -0,0 +1,27 @@
|
||||
package com.example.funnysounds.ad;
|
||||
|
||||
import com.mbridge.msdk.newinterstitial.out.MBBidNewInterstitialHandler;
|
||||
|
||||
public class ADBean {
|
||||
|
||||
private MBBidNewInterstitialHandler interstitialHandler;
|
||||
private String token;
|
||||
|
||||
public void setInterstitialHandler(MBBidNewInterstitialHandler interstitialHandler) {
|
||||
this.interstitialHandler = interstitialHandler;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public MBBidNewInterstitialHandler getInterstitialHandler() {
|
||||
return interstitialHandler;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
package com.example.funnysounds.ad
|
||||
|
||||
interface AdMsgListener {
|
||||
fun msg(msg: String)
|
||||
}
|
||||
232
app/src/main/java/com/example/funnysounds/ad/MBrManager.java
Normal file
@ -0,0 +1,232 @@
|
||||
package com.example.funnysounds.ad;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.util.Log;
|
||||
|
||||
import com.example.funnysounds.resolve.Sounds;
|
||||
import com.mbridge.msdk.MBridgeConstans;
|
||||
import com.mbridge.msdk.mbbid.out.BidListennning;
|
||||
import com.mbridge.msdk.mbbid.out.BidManager;
|
||||
import com.mbridge.msdk.mbbid.out.BidResponsed;
|
||||
import com.mbridge.msdk.newinterstitial.out.MBBidNewInterstitialHandler;
|
||||
import com.mbridge.msdk.newinterstitial.out.NewInterstitialListener;
|
||||
import com.mbridge.msdk.out.MBridgeIds;
|
||||
import com.mbridge.msdk.out.RewardInfo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class MBrManager {
|
||||
|
||||
public static String TAG = "------------ltt";
|
||||
|
||||
public static String[] placeIDs = new String[]{"1613846", "1613849", "1613851"};
|
||||
|
||||
public static String[] unitIDs = new String[]{"3473086", "3473090", "3473092"};
|
||||
|
||||
public static List<ADBean> AdInstances = new ArrayList<>();
|
||||
|
||||
public static void getToken(String placeId, String unitId, onBidTokenListener listener) {
|
||||
BidManager manager = new BidManager(placeId, unitId);
|
||||
manager.setBidListener(new BidListennning() {
|
||||
@Override
|
||||
public void onFailed(String s) {
|
||||
listener.onBidToken("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccessed(BidResponsed bidResponsed) {
|
||||
String mBidToken = bidResponsed.getBidToken();
|
||||
listener.onBidToken(mBidToken);
|
||||
}
|
||||
});
|
||||
manager.bid();
|
||||
}
|
||||
|
||||
public static void loadAllAd() {
|
||||
if (AdInstances.size() > 0) {
|
||||
for (ADBean adBean : AdInstances) {
|
||||
if (!adBean.getInterstitialHandler().isBidReady()) {
|
||||
adBean.getInterstitialHandler().loadFromBid(adBean.getToken());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void init(onInterHandlerListener listener) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
String finalPlaceId = placeIDs[i];
|
||||
String unitId = unitIDs[i];
|
||||
getToken(finalPlaceId, unitId, new onBidTokenListener() {
|
||||
@Override
|
||||
public void onBidToken(String token) {
|
||||
MBBidNewInterstitialHandler mMBBidNewInterstitialHandler = new MBBidNewInterstitialHandler(Sounds.mAppContext, finalPlaceId, unitId);
|
||||
ADBean adBean = new ADBean();
|
||||
Log.d(TAG, "------------token=" + token);
|
||||
adBean.setToken(token);
|
||||
adBean.setInterstitialHandler(mMBBidNewInterstitialHandler);
|
||||
setCallBack(mMBBidNewInterstitialHandler, new onAdStatusListener() {
|
||||
@Override
|
||||
public void onLoaded() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFail() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShowFail() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose() {
|
||||
|
||||
}
|
||||
});
|
||||
mMBBidNewInterstitialHandler.loadFromBid(token);
|
||||
AdInstances.add(adBean);
|
||||
listener.onAddOK();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static ADBean getCache() {
|
||||
Collections.shuffle(AdInstances);
|
||||
for (ADBean adBean : AdInstances) {
|
||||
if (adBean.getInterstitialHandler().isBidReady()) {
|
||||
return adBean;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static void setCallBack(MBBidNewInterstitialHandler mbBidNewInterstitialHandler, onAdStatusListener listener) {
|
||||
mbBidNewInterstitialHandler.setInterstitialVideoListener(new NewInterstitialListener() {
|
||||
|
||||
@Override
|
||||
public void onLoadCampaignSuccess(MBridgeIds ids) {
|
||||
/**
|
||||
* 广告已填充
|
||||
* @param ids 封装的广告id对象
|
||||
*/
|
||||
Log.i(TAG, "onLoadCampaignSuccess: " + Thread.currentThread() + " " + ids.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResourceLoadSuccess(MBridgeIds ids) {
|
||||
/**
|
||||
* 广告资源加载成功,可以播放
|
||||
* @param ids 封装的广告id对象
|
||||
*/
|
||||
Log.i(TAG, "onResourceLoadSuccess: " + Thread.currentThread() + " " + ids.toString());
|
||||
listener.onLoaded();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResourceLoadFail(MBridgeIds ids, String errorMsg) {
|
||||
/**
|
||||
* 广告加载失败
|
||||
* @param errorMsg 加载错误原因
|
||||
*/
|
||||
listener.onLoadFail();
|
||||
Log.e(TAG, "onResourceLoadFail errorMsg: " + errorMsg + " " + ids.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShowFail(MBridgeIds ids, String errorMsg) {
|
||||
/**
|
||||
* 广告播放失败
|
||||
* @param errorMsg 错误原因
|
||||
*/
|
||||
listener.onShowFail();
|
||||
Log.e(TAG, "onShowFail: " + errorMsg + " " + ids.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAdShow(MBridgeIds ids) {
|
||||
/**
|
||||
* 广告成功展示
|
||||
*/
|
||||
Log.i(TAG, "onAdShow: " + ids.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAdClose(MBridgeIds ids, RewardInfo info) {
|
||||
/**
|
||||
* 广告关闭时调用
|
||||
* @param info.isCompleteView如果为true,则表示已完全观看了视频
|
||||
*/
|
||||
loadAllAd();
|
||||
listener.onClose();
|
||||
Log.i(TAG, "onAdClose: " + "isCompleteView:" + info.isCompleteView() + " " + ids.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAdClicked(MBridgeIds ids) {
|
||||
/**
|
||||
* 广告被点击
|
||||
* @param 封装的广告id对象
|
||||
*/
|
||||
Log.i(TAG, "onAdClicked: " + ids.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoComplete(MBridgeIds ids) {
|
||||
/**
|
||||
* 广告播放完成时调用
|
||||
* @param ids 封装的广告id对象
|
||||
*/
|
||||
Log.i(TAG, "onVideoComplete: " + ids.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAdCloseWithNIReward(MBridgeIds ids, RewardInfo info) {
|
||||
/**
|
||||
* 如果开发人员设置了IV奖励,则在广告关闭时调用.
|
||||
*
|
||||
* @param 封装的广告id对象
|
||||
* @param info.isCompleteView() 是否完全观看
|
||||
*/
|
||||
Log.i(TAG, "onAdCloseWithNIReward: " + ids.toString() + " " + info.toString());
|
||||
|
||||
Log.i(TAG, info.isCompleteView() ? "Video playback/playable is complete." : "Video playback/playable is not complete.");
|
||||
|
||||
int rewardAlertStatus = info.getRewardAlertStatus();
|
||||
|
||||
if (rewardAlertStatus == MBridgeConstans.IVREWARDALERT_STATUS_NOTSHOWN) {
|
||||
Log.e(TAG, "The dialog is not show.");
|
||||
}
|
||||
|
||||
if (rewardAlertStatus == MBridgeConstans.IVREWARDALERT_STATUS_CLICKCONTINUE) {
|
||||
Log.e(TAG, "The dialog's continue button clicked.");
|
||||
}
|
||||
|
||||
if (rewardAlertStatus == MBridgeConstans.IVREWARDALERT_STATUS_CLICKCANCEL) {
|
||||
Log.e(TAG, "The dialog's cancel button clicked.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEndcardShow(MBridgeIds ids) {
|
||||
/**
|
||||
* 展示广告落地页时调用
|
||||
* @param ids 封装的广告id对象
|
||||
*/
|
||||
Log.i(TAG, "onEndcardShow: " + ids.toString());
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
package com.example.funnysounds.ad;
|
||||
|
||||
public interface onAdStatusListener {
|
||||
|
||||
void onLoaded();
|
||||
void onLoadFail();
|
||||
void onShowFail();
|
||||
void onClose();
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
package com.example.funnysounds.ad;
|
||||
|
||||
public interface onBidTokenListener {
|
||||
|
||||
void onBidToken(String token);
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package com.example.funnysounds.ad;
|
||||
|
||||
public interface onInterHandlerListener {
|
||||
|
||||
void onAddOK();
|
||||
|
||||
|
||||
// void onLoaded();
|
||||
// void onLoadFail();
|
||||
// void onShowFail();
|
||||
//
|
||||
// void onClose();
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package com.example.funnysounds.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class CategoryList implements Serializable {
|
||||
private String categoryId;
|
||||
private String categoryName;
|
||||
private String categoryUrl;
|
||||
private List<MyData> list;
|
||||
|
||||
public void setCategoryId(String categoryId) {
|
||||
this.categoryId = categoryId;
|
||||
}
|
||||
|
||||
public void setCategoryName(String categoryName) {
|
||||
this.categoryName = categoryName;
|
||||
}
|
||||
|
||||
public void setCategoryUrl(String categoryUrl) {
|
||||
this.categoryUrl = categoryUrl;
|
||||
}
|
||||
|
||||
public void setList(List<MyData> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
public String getCategoryId() {
|
||||
return categoryId;
|
||||
}
|
||||
|
||||
public String getCategoryName() {
|
||||
return categoryName;
|
||||
}
|
||||
|
||||
public String getCategoryUrl() {
|
||||
return categoryUrl;
|
||||
}
|
||||
|
||||
public List<MyData> getList() {
|
||||
return list;
|
||||
}
|
||||
}
|
||||
35
app/src/main/java/com/example/funnysounds/data/MyData.java
Normal file
@ -0,0 +1,35 @@
|
||||
package com.example.funnysounds.data;
|
||||
|
||||
import android.net.Uri;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class MyData implements Serializable {
|
||||
private String title;
|
||||
private String mp3Url;
|
||||
private String preUrl;
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public void setMp3Url(String mp3Url) {
|
||||
this.mp3Url = mp3Url;
|
||||
}
|
||||
|
||||
public void setPreUrl(String preUrl) {
|
||||
this.preUrl = preUrl;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public String getMp3Url() {
|
||||
return mp3Url;
|
||||
}
|
||||
|
||||
public String getPreUrl() {
|
||||
return preUrl;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
package com.example.funnysounds.resolve;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.view.View;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
public class MySpace extends RecyclerView.ItemDecoration {
|
||||
private int ex_space = 0;
|
||||
private int h_space = 0;
|
||||
private int v_space = 0;
|
||||
|
||||
@Override
|
||||
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
|
||||
int position = parent.getChildAdapterPosition(view);
|
||||
int spanSize = 1;
|
||||
int spanIndex = 0;
|
||||
int spanCount = 1;
|
||||
RecyclerView.LayoutManager layoutManager = parent.getLayoutManager();
|
||||
if (layoutManager instanceof GridLayoutManager) {
|
||||
GridLayoutManager layoutManager1 = (GridLayoutManager) layoutManager;
|
||||
GridLayoutManager.LayoutParams layoutParams = (GridLayoutManager.LayoutParams) view.getLayoutParams();
|
||||
spanCount = layoutManager1.getSpanCount();
|
||||
spanSize = layoutManager1.getSpanSizeLookup().getSpanSize(position);
|
||||
spanIndex = layoutParams.getSpanIndex();
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (spanSize == spanCount) {
|
||||
outRect.left = v_space + ex_space;
|
||||
outRect.right = v_space + ex_space;
|
||||
outRect.bottom = h_space;
|
||||
} else {
|
||||
int itemAllSpacing = (v_space * (spanCount + 1) + ex_space * 2) / spanCount;
|
||||
int left = v_space * (spanIndex + 1) - itemAllSpacing * spanIndex + ex_space;
|
||||
int right = itemAllSpacing - left;
|
||||
outRect.left = left;
|
||||
outRect.right = right;
|
||||
outRect.bottom = h_space;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public MySpace(int ex_space,int h_space,int v_space) {
|
||||
this.ex_space = ex_space;
|
||||
this.h_space = h_space;
|
||||
this.v_space = v_space;
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package com.example.funnysounds.resolve;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.io.StringWriter;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class Readfile {
|
||||
public static String getCovertStr(InputStream stream) {
|
||||
String covertStr = "";
|
||||
try {
|
||||
StringWriter writer = new StringWriter();
|
||||
char[] buffer = new char[stream.available()];
|
||||
Reader reader = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8));
|
||||
int a = 0;
|
||||
while ((a = reader.read(buffer)) != -1) {
|
||||
writer.write(buffer, 0, a);
|
||||
}
|
||||
covertStr = writer.toString();
|
||||
} catch (IOException e) {
|
||||
return covertStr;
|
||||
}
|
||||
return covertStr;
|
||||
}
|
||||
|
||||
public static int dp2Px(int dp) {
|
||||
float scale = Sounds.mAppContext.getResources().getDisplayMetrics().density;
|
||||
return (int) (dp * scale + 0.5f);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
package com.example.funnysounds.resolve;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
import com.example.funnysounds.ad.MBrManager;
|
||||
import com.example.funnysounds.ad.onInterHandlerListener;
|
||||
import com.example.funnysounds.data.CategoryList;
|
||||
import com.example.funnysounds.value.StaticValue;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.mbridge.msdk.MBridgeSDK;
|
||||
import com.mbridge.msdk.out.MBridgeSDKFactory;
|
||||
import com.mbridge.msdk.out.SDKInitStatusListener;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class Sounds extends Application {
|
||||
public static final String AD_INIT = "on_SDK_action";
|
||||
public static Context mAppContext;
|
||||
public static boolean initOK = false;
|
||||
private static List<CategoryList> categoryList;
|
||||
private String MAX_INIT_ACTION = "ad_action";
|
||||
private String AppId = "299723";
|
||||
private String AppKey = "c70a4a739f660e03fef52c6222c38e1a";
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
mAppContext = this;
|
||||
init();
|
||||
try {
|
||||
InputStream open = getAssets().open("prank.json");
|
||||
String covertStr = Readfile.getCovertStr(open);
|
||||
if (!covertStr.isEmpty()) {
|
||||
Gson gson = new Gson();
|
||||
categoryList = gson.fromJson(covertStr, new TypeToken<List<CategoryList>>() {
|
||||
}.getType());
|
||||
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static List<CategoryList> getUserList() {
|
||||
if (categoryList != null) {
|
||||
return categoryList;
|
||||
}
|
||||
return categoryList;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
MBridgeSDK sdk = MBridgeSDKFactory.getMBridgeSDK();
|
||||
Map<String, String> map = sdk.getMBConfigurationMap(AppId, AppKey);
|
||||
sdk.init(map, this, new SDKInitStatusListener() {
|
||||
@Override
|
||||
public void onInitSuccess() {
|
||||
Log.e(MBrManager.TAG, "onInitSuccess");
|
||||
initOK = true;
|
||||
MBrManager.init( new onInterHandlerListener() {
|
||||
@Override
|
||||
public void onAddOK() {
|
||||
LocalBroadcastManager.getInstance(mAppContext).sendBroadcast(new Intent(AD_INIT));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInitFail(String errorMsg) {
|
||||
Log.e(MBrManager.TAG, errorMsg);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,130 @@
|
||||
package com.example.funnysounds.soundsadapter;
|
||||
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.DataSource;
|
||||
import com.bumptech.glide.load.engine.GlideException;
|
||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
||||
import com.bumptech.glide.request.RequestListener;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
import com.example.funnysounds.R;
|
||||
import com.example.funnysounds.action.CategoryNameSoundsrListener;
|
||||
import com.example.funnysounds.activity.SpecifisoundsActivity;
|
||||
import com.example.funnysounds.ad.ADBean;
|
||||
import com.example.funnysounds.ad.MBrManager;
|
||||
import com.example.funnysounds.ad.onAdStatusListener;
|
||||
import com.example.funnysounds.data.CategoryList;
|
||||
import com.example.funnysounds.value.StaticValue;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CgNameAdapter extends RecyclerView.Adapter<CgViewHolder> {
|
||||
private List<CategoryList> dataCategoryList;
|
||||
private Context myContext;
|
||||
private CategoryNameSoundsrListener cgNameSoundsrListener;
|
||||
|
||||
public void setCategoryNameSoundsListener(CategoryNameSoundsrListener categoryNameSoundsrListener)
|
||||
{
|
||||
this.cgNameSoundsrListener = categoryNameSoundsrListener;
|
||||
}
|
||||
|
||||
public CgNameAdapter(List<CategoryList> cglist,Context mycontext){
|
||||
dataCategoryList = cglist;
|
||||
myContext = mycontext;
|
||||
}
|
||||
@NonNull
|
||||
@Override
|
||||
public CgViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View itemview = LayoutInflater.from(myContext).inflate(R.layout.sounds_adapterlist,parent,false);
|
||||
return new CgViewHolder(itemview);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull CgViewHolder holder, int position) {
|
||||
CategoryList categorylist = dataCategoryList.get(position);
|
||||
holder.getTextView().setText(categorylist.getCategoryName());
|
||||
ImageView imageView = holder.getImageView();
|
||||
Glide.with(myContext)
|
||||
.load(categorylist.getCategoryUrl())
|
||||
.transform(new RoundedCorners(90))
|
||||
.listener(new RequestListener<Drawable>() {
|
||||
@Override
|
||||
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<Drawable> target, boolean isFirstResource) {
|
||||
Log.e(MBrManager.TAG, "onLoadFailed-----------------categorylist.getCategoryUrl()=---"+categorylist.getCategoryUrl()+"---------e="+e.getMessage());
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onResourceReady(@NonNull Drawable resource, @NonNull Object model, Target<Drawable> target, @NonNull DataSource dataSource, boolean isFirstResource) {
|
||||
return false;
|
||||
}
|
||||
})
|
||||
.into(imageView);
|
||||
|
||||
holder.getLayout_root().setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
showad(categorylist);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void showad(CategoryList cate) {
|
||||
ADBean cache = MBrManager.getCache();
|
||||
if(cache == null){
|
||||
startSpecifiActivity(cate);
|
||||
Log.d("-------fail","------showfail");
|
||||
}else{
|
||||
MBrManager.setCallBack(cache.getInterstitialHandler(), new onAdStatusListener() {
|
||||
@Override
|
||||
public void onLoaded() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFail() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShowFail() {
|
||||
startSpecifiActivity(cate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose() {
|
||||
startSpecifiActivity(cate);
|
||||
}
|
||||
});
|
||||
cache.getInterstitialHandler().showFromBid();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void startSpecifiActivity(CategoryList categoryList) {
|
||||
Intent intent = new Intent(myContext, SpecifisoundsActivity.class);
|
||||
intent.putExtra(StaticValue.key_category_name, categoryList);
|
||||
myContext.startActivity(intent);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return dataCategoryList.size();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.example.funnysounds.soundsadapter;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.funnysounds.R;
|
||||
|
||||
public class CgViewHolder extends RecyclerView.ViewHolder {
|
||||
private ImageView imageView;
|
||||
private TextView textView;
|
||||
private LinearLayout layout_root;
|
||||
public CgViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
imageView = itemView.findViewById(R.id.imageview_sounds);
|
||||
textView = itemView.findViewById(R.id.textview_categoryname);
|
||||
layout_root = itemView.findViewById(R.id.layout_root);
|
||||
}
|
||||
|
||||
public ImageView getImageView() {
|
||||
return imageView;
|
||||
}
|
||||
|
||||
public TextView getTextView() {
|
||||
return textView;
|
||||
}
|
||||
|
||||
public LinearLayout getLayout_root() {
|
||||
return layout_root;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,74 @@
|
||||
package com.example.funnysounds.soundsadapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.media.MediaPlayer;
|
||||
import android.net.Uri;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
||||
import com.example.funnysounds.R;
|
||||
import com.example.funnysounds.action.CategoryNameSoundsrListener;
|
||||
import com.example.funnysounds.action.MyDataSounderListener;
|
||||
import com.example.funnysounds.activity.DetailActivity;
|
||||
import com.example.funnysounds.data.MyData;
|
||||
import com.example.funnysounds.resolve.Readfile;
|
||||
import com.example.funnysounds.value.StaticValue;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class DataAdapter extends RecyclerView.Adapter<DataViewHolder>{
|
||||
private List<MyData> myDataList;
|
||||
private Context myContext;
|
||||
private MyDataSounderListener myDataSounderListener;
|
||||
public DataAdapter(List<MyData> myData,Context mycontext){
|
||||
myDataList = myData;
|
||||
myContext = mycontext;
|
||||
}
|
||||
public void setMyDataSounderListener(MyDataSounderListener dataSounderListener)
|
||||
{
|
||||
this.myDataSounderListener = dataSounderListener;
|
||||
}
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public DataViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View itemview = LayoutInflater.from(myContext).inflate(R.layout.specific_adapterlist,parent,false);
|
||||
return new DataViewHolder(itemview);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull DataViewHolder holder, int position) {
|
||||
MyData myData = myDataList.get(position);
|
||||
holder.getTextview_specific().setText(myData.getTitle());
|
||||
ImageView imageView = holder.getImageview_specific();
|
||||
//final MediaPlayer mediaPlayer = MediaPlayer.create(holder.itemView.getContext(), Uri.parse(myData.getMp3Url()));
|
||||
Glide.with(myContext)
|
||||
.load(myData.getPreUrl())
|
||||
.transform(new RoundedCorners(90))
|
||||
.into(imageView);
|
||||
holder.getLayout_specific().setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(myContext, DetailActivity.class);
|
||||
intent.putExtra(StaticValue.key_resourse,myData);
|
||||
myContext.startActivity(intent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return myDataList.size();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package com.example.funnysounds.soundsadapter;
|
||||
|
||||
import android.media.MediaPlayer;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.funnysounds.R;
|
||||
|
||||
public class DataViewHolder extends RecyclerView.ViewHolder {
|
||||
ImageView imageview_specific;
|
||||
TextView textview_specific;
|
||||
LinearLayout layout_specific;
|
||||
MediaPlayer mediaPlayer;
|
||||
|
||||
public DataViewHolder(@NonNull View itemview) {
|
||||
super(itemview);
|
||||
imageview_specific = itemview.findViewById(R.id.imageview_specific);
|
||||
textview_specific = itemview.findViewById(R.id.textview_dataname);
|
||||
layout_specific = itemview.findViewById(R.id.layout_specific);
|
||||
}
|
||||
|
||||
public ImageView getImageview_specific() {
|
||||
return imageview_specific;
|
||||
}
|
||||
|
||||
public TextView getTextview_specific() {
|
||||
return textview_specific;
|
||||
}
|
||||
|
||||
public LinearLayout getLayout_specific() {
|
||||
return layout_specific;
|
||||
}
|
||||
|
||||
public MediaPlayer getMediaPlayer() {
|
||||
return mediaPlayer;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
package com.example.funnysounds.value;
|
||||
|
||||
public class StaticValue {
|
||||
public static final String key_category_name = "key_category_name";
|
||||
public static final String key_data_name = "key_data_name";
|
||||
public static final String key_image = "key_image";
|
||||
public static final String key_resourse = "key_resourse";
|
||||
public static final String MAX_INIT_ACTION = "ad_action";
|
||||
public static final String YOUR_SDK_KEY = "gtOv1uuZoSrXBVgJLKgwRTRrMdPLV_x0C1uFOPrTCBTyJzWJNcFniU1uxQBHoOdWAA7o5CWPlaCrm5qKqe5iHx";
|
||||
}
|
||||
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>
|
||||
7
app/src/main/res/drawable/back_circle.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/sounds_main"/>
|
||||
|
||||
|
||||
</shape>
|
||||
7
app/src/main/res/drawable/detail_background.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="50dp"/>
|
||||
<solid android:color="#8ABABD"/>
|
||||
|
||||
</shape>
|
||||
170
app/src/main/res/drawable/ic_launcher_background.xml
Normal file
@ -0,0 +1,170 @@
|
||||
<?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>
|
||||
7
app/src/main/res/drawable/list_background.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="10dp"/>
|
||||
<solid android:color="@color/color_trans"/>
|
||||
|
||||
</shape>
|
||||
11
app/src/main/res/drawable/myselector.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:state_pressed="false"
|
||||
android:drawable="@mipmap/play"/>
|
||||
|
||||
<item
|
||||
android:state_pressed="true"
|
||||
android:drawable="@mipmap/stop"/>
|
||||
|
||||
</selector>
|
||||
9
app/src/main/res/drawable/svg_back.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="200dp"
|
||||
android:height="200dp"
|
||||
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>
|
||||
58
app/src/main/res/layout/activity_detail.xml
Normal file
@ -0,0 +1,58 @@
|
||||
<?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:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activity.DetailActivity">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal">
|
||||
<FrameLayout
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:background="@drawable/back_circle">
|
||||
<ImageView
|
||||
android:id="@+id/imageview_back"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/svg_back" />
|
||||
</FrameLayout>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="60dp"
|
||||
android:id="@+id/data_name"
|
||||
android:textStyle="italic"
|
||||
android:textSize="25sp"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/list_background"
|
||||
android:layout_gravity="center">
|
||||
<ImageView
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="30dp"
|
||||
android:background="#E8F1F3"
|
||||
android:id="@+id/data_image"/>
|
||||
<android.widget.Button
|
||||
android:id="@+id/btn_play_pause"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="end"
|
||||
android:background="@drawable/myselector"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
50
app/src/main/res/layout/activity_into.xml
Normal file
@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activity.IntoActivity">
|
||||
<ImageView
|
||||
android:id="@+id/logo"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:src="@mipmap/logo"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="230dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/logo"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="45dp"
|
||||
android:text="Funny"
|
||||
android:textColor="@color/sounds_text"
|
||||
android:textSize="40sp"
|
||||
android:textStyle="italic" />
|
||||
<TextView
|
||||
android:id="@+id/name2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/name"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="Sounds"
|
||||
android:textColor="@color/sounds_text"
|
||||
android:textSize="50sp"
|
||||
android:textStyle="italic" />
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/name2"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="30dp"
|
||||
android:indeterminateTint="@color/sounds_main" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
48
app/src/main/res/layout/activity_main.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:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="#EEF4F4"
|
||||
tools:context=".activity.MainActivity">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:orientation="horizontal"
|
||||
android:background="@color/sounds_main">
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:src="@mipmap/logo"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/textview_sounds"
|
||||
android:text="@string/app_name"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textSize="35sp"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:textColor="@color/sounds_text"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview_sounds"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
42
app/src/main/res/layout/activity_specifisounds.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:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="#EEF4F4"
|
||||
tools:context=".activity.SpecifisoundsActivity">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal">
|
||||
<FrameLayout
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:background="@drawable/back_circle">
|
||||
<ImageView
|
||||
android:id="@+id/imageview_back"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/svg_back" />
|
||||
</FrameLayout>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="60dp"
|
||||
android:id="@+id/categoryname"
|
||||
android:textStyle="italic"
|
||||
android:textSize="25sp"/>
|
||||
</LinearLayout>
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview_specific"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
49
app/src/main/res/layout/activity_start.xml
Normal file
@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout 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:background="@color/white"
|
||||
tools:context=".activity.StartPageActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
app:cardCornerRadius="12dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@mipmap/logo" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<TextView
|
||||
android:layout_width="260dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="32dp"
|
||||
android:layout_marginBottom="60dp"
|
||||
android:gravity="center"
|
||||
android:lineSpacingExtra="20dp"
|
||||
android:lineSpacingMultiplier="0.6"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/sounds_text"
|
||||
android:textSize="26sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginBottom="110dp"
|
||||
android:indeterminateTint="@color/sounds_main"
|
||||
android:visibility="visible" />
|
||||
|
||||
</FrameLayout>
|
||||
21
app/src/main/res/layout/sounds_adapterlist.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?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="wrap_content"
|
||||
android:id="@+id/layout_root"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/list_background">
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="150dp"
|
||||
android:id="@+id/imageview_sounds"
|
||||
android:scaleType="fitXY" />
|
||||
<TextView
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:textSize="15sp"
|
||||
android:id="@+id/textview_categoryname"/>
|
||||
|
||||
</LinearLayout>
|
||||
22
app/src/main/res/layout/specific_adapterlist.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<?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="wrap_content"
|
||||
android:id="@+id/layout_specific"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/list_background">
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="150dp"
|
||||
android:id="@+id/imageview_specific"
|
||||
android:scaleType="fitXY"/>
|
||||
<TextView
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:textSize="15sp"
|
||||
android:id="@+id/textview_dataname"/>
|
||||
|
||||
</LinearLayout>
|
||||
6
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
6
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
BIN
app/src/main/res/mipmap-hdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/mipmap-hdpi/logo.png
Normal file
|
After Width: | Height: | Size: 281 KiB |
BIN
app/src/main/res/mipmap-hdpi/play.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
app/src/main/res/mipmap-hdpi/stop.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 982 B |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
7
app/src/main/res/values-night/themes.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.FunnySounds" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<!-- Customize your dark theme here. -->
|
||||
<!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
|
||||
</style>
|
||||
</resources>
|
||||
8
app/src/main/res/values/colors.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="sounds_main">#72C8D5</color>
|
||||
<color name="sounds_text">#047685</color>
|
||||
<color name="color_trans">#DDE9EA</color>
|
||||
</resources>
|
||||
3
app/src/main/res/values/strings.xml
Normal file
@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_name">Funny Sounds</string>
|
||||
</resources>
|
||||
12
app/src/main/res/values/themes.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.FunnySounds" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<!-- Customize your light theme here. -->
|
||||
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
|
||||
</style>
|
||||
|
||||
<style name="Theme.FunnySounds" parent="Base.Theme.FunnySounds">
|
||||
<item name="android:statusBarColor">@color/sounds_main</item>
|
||||
<item name="colorOnSecondary">@color/white</item>
|
||||
</style>
|
||||
</resources>
|
||||
13
app/src/main/res/xml/backup_rules.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?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>
|
||||
19
app/src/main/res/xml/data_extraction_rules.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?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>
|
||||
@ -0,0 +1,17 @@
|
||||
package com.example.funnysounds;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||
8
build.gradle.kts
Normal file
@ -0,0 +1,8 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
plugins {
|
||||
alias(libs.plugins.android.application) apply false
|
||||
alias(libs.plugins.jetbrainsKotlinAndroid) apply false
|
||||
|
||||
id("com.google.gms.google-services") version "4.3.15" apply false
|
||||
id ("com.google.firebase.crashlytics") version "2.9.2" apply false
|
||||
}
|
||||
22
gradle.properties
Normal file
@ -0,0 +1,22 @@
|
||||
# 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. For more details, visit
|
||||
# https://developer.android.com/r/tools/gradle-multi-project-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
|
||||
# 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
|
||||
android.nonFinalResIds=false
|
||||
24
gradle/libs.versions.toml
Normal file
@ -0,0 +1,24 @@
|
||||
[versions]
|
||||
agp = "8.4.0"
|
||||
kotlin = "1.9.0"
|
||||
junit = "4.13.2"
|
||||
junitVersion = "1.1.5"
|
||||
espressoCore = "3.5.1"
|
||||
appcompat = "1.7.0"
|
||||
material = "1.12.0"
|
||||
activity = "1.9.0"
|
||||
constraintlayout = "2.1.4"
|
||||
|
||||
[libraries]
|
||||
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||||
ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
|
||||
espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
|
||||
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
|
||||
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
|
||||
activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
|
||||
constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
|
||||
|
||||
[plugins]
|
||||
android-application = { id = "com.android.application", version.ref = "agp" }
|
||||
jetbrainsKotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
|
||||
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
6
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
#Mon Jun 17 18:01:32 CST 2024
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
185
gradlew
vendored
Normal file
@ -0,0 +1,185 @@
|
||||
#!/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" "$@"
|
||||
89
gradlew.bat
vendored
Normal file
@ -0,0 +1,89 @@
|
||||
@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
|
||||
27
settings.gradle.kts
Normal file
@ -0,0 +1,27 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
google {
|
||||
content {
|
||||
includeGroupByRegex("com\\.android.*")
|
||||
includeGroupByRegex("com\\.google.*")
|
||||
includeGroupByRegex("androidx.*")
|
||||
}
|
||||
}
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
dependencyResolutionManagement {
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
maven ("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea")
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "Funny Sounds"
|
||||
include(":app")
|
||||
|
||||