Compare commits
3 Commits
main
...
AR_Draw_Sk
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e91ee55e71 | ||
|
|
3885be00f5 | ||
|
|
2927af6a93 |
BIN
app/ARDraw.jks
Normal file
BIN
app/ARDraw.jks
Normal file
Binary file not shown.
BIN
app/ARDrawSketch.jks
Normal file
BIN
app/ARDrawSketch.jks
Normal file
Binary file not shown.
@ -4,15 +4,10 @@ import java.text.SimpleDateFormat
|
|||||||
plugins {
|
plugins {
|
||||||
id("com.android.application")
|
id("com.android.application")
|
||||||
id("org.jetbrains.kotlin.android")
|
id("org.jetbrains.kotlin.android")
|
||||||
id("com.google.gms.google-services")
|
|
||||||
id("com.google.firebase.crashlytics")
|
|
||||||
id("applovin-quality-service")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
applovin {
|
|
||||||
apiKey =
|
|
||||||
"0pn_nPmNSunNT9Oq6nyqrUVTGfbFsZUoU47_B5ydJsLCvMPzZ8VdNFvemW1bfJfLlQ4WEgrD_fu3M4ep7hS9Ng"
|
|
||||||
}
|
|
||||||
|
|
||||||
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
|
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
|
||||||
android {
|
android {
|
||||||
@ -20,15 +15,15 @@ android {
|
|||||||
compileSdk = 34
|
compileSdk = 34
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
//com.draw.painting.helper
|
//com.draw.ar.draw
|
||||||
applicationId = "com.draw.painting.helper"
|
applicationId = "com.draw.ar.draw"
|
||||||
minSdk = 23
|
minSdk = 23
|
||||||
targetSdk = 34
|
targetSdk = 34
|
||||||
versionCode = 2
|
versionCode = 1
|
||||||
versionName = "1.0.1"
|
versionName = "1.0.0"
|
||||||
setProperty(
|
setProperty(
|
||||||
"archivesBaseName",
|
"archivesBaseName",
|
||||||
"Painting Helper_V" + versionName + "(${versionCode})_$timestamp"
|
"AR Draw_V" + versionName + "(${versionCode})_$timestamp"
|
||||||
)
|
)
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
@ -78,14 +73,6 @@ dependencies {
|
|||||||
implementation("androidx.camera:camera-extensions:${camerax_version}")
|
implementation("androidx.camera:camera-extensions:${camerax_version}")
|
||||||
|
|
||||||
|
|
||||||
implementation("com.applovin:applovin-sdk:+")
|
|
||||||
implementation("com.applovin.mediation:vungle-adapter:+")
|
|
||||||
implementation("com.applovin.mediation:mintegral-adapter:+")
|
|
||||||
implementation("com.applovin.mediation:bytedance-adapter:+")
|
|
||||||
implementation("com.applovin.mediation:unityads-adapter:+")
|
|
||||||
implementation(platform("com.google.firebase:firebase-bom:33.1.1"))
|
|
||||||
implementation("com.google.firebase:firebase-crashlytics")
|
|
||||||
implementation("com.google.firebase:firebase-analytics")
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,29 +0,0 @@
|
|||||||
{
|
|
||||||
"project_info": {
|
|
||||||
"project_number": "21924510593",
|
|
||||||
"project_id": "painting-helper",
|
|
||||||
"storage_bucket": "painting-helper.appspot.com"
|
|
||||||
},
|
|
||||||
"client": [
|
|
||||||
{
|
|
||||||
"client_info": {
|
|
||||||
"mobilesdk_app_id": "1:21924510593:android:6d87dde89c34f4c8bc8680",
|
|
||||||
"android_client_info": {
|
|
||||||
"package_name": "com.draw.painting.helper"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"oauth_client": [],
|
|
||||||
"api_key": [
|
|
||||||
{
|
|
||||||
"current_key": "AIzaSyAjY1w9grBlztoWK_xncU7ImRySsoyKtms"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"services": {
|
|
||||||
"appinvite_service": {
|
|
||||||
"other_platform_oauth_client": []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"configuration_version": "1"
|
|
||||||
}
|
|
||||||
@ -13,7 +13,8 @@
|
|||||||
android:maxSdkVersion="32" />
|
android:maxSdkVersion="32" />
|
||||||
<uses-permission
|
<uses-permission
|
||||||
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
||||||
android:maxSdkVersion="32" />
|
android:maxSdkVersion="32"
|
||||||
|
tools:ignore="ScopedStorage" />
|
||||||
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
|
|||||||
@ -1,8 +0,0 @@
|
|||||||
package com.draw.painting.test;
|
|
||||||
|
|
||||||
import com.applovin.mediation.MaxAd;
|
|
||||||
|
|
||||||
public interface Adcallback {
|
|
||||||
void onShowFail(MaxAd ad);
|
|
||||||
void onAdHidden( );
|
|
||||||
}
|
|
||||||
@ -2,15 +2,6 @@ package com.draw.painting.test;
|
|||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
|
||||||
|
|
||||||
import com.applovin.sdk.AppLovinMediationProvider;
|
|
||||||
import com.applovin.sdk.AppLovinSdk;
|
|
||||||
import com.applovin.sdk.AppLovinSdkConfiguration;
|
|
||||||
import com.applovin.sdk.AppLovinSdkInitializationConfiguration;
|
|
||||||
|
|
||||||
|
|
||||||
public class PaintingApp extends Application {
|
public class PaintingApp extends Application {
|
||||||
@ -20,9 +11,9 @@ public class PaintingApp extends Application {
|
|||||||
public static PaintingApp app;
|
public static PaintingApp app;
|
||||||
public static String APP_KEY = "";
|
public static String APP_KEY = "";
|
||||||
private static Context context;
|
private static Context context;
|
||||||
public static final String AD_BROADCAST = "on_success_action";
|
// public static final String AD_BROADCAST = "on_success_action";
|
||||||
private static final String MAX_SDK = "27z51PI2aTeTbobe3ORmbnMCb97dZbW8zfHEBfRFzb2DlCRJaTQCNebHHVZ2aepZGpqkvO1J7noD4s8W2UwJew";
|
// private static final String MAX_SDK = "27z51PI2aTeTbobe3ORmbnMCb97dZbW8zfHEBfRFzb2DlCRJaTQCNebHHVZ2aepZGpqkvO1J7noD4s8W2UwJew";
|
||||||
public static Boolean initSDK = false;
|
// public static Boolean initSDK = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
@ -30,22 +21,22 @@ public class PaintingApp extends Application {
|
|||||||
app = this;
|
app = this;
|
||||||
context = getApplicationContext();
|
context = getApplicationContext();
|
||||||
|
|
||||||
initSDk();
|
// initSDk();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initSDk() {
|
private void initSDk() {
|
||||||
|
|
||||||
AppLovinSdkInitializationConfiguration initConfig = AppLovinSdkInitializationConfiguration.builder(MAX_SDK, this)
|
// AppLovinSdkInitializationConfiguration initConfig = AppLovinSdkInitializationConfiguration.builder(MAX_SDK, this)
|
||||||
.setMediationProvider(AppLovinMediationProvider.MAX)
|
// .setMediationProvider(AppLovinMediationProvider.MAX)
|
||||||
.build();
|
// .build();
|
||||||
AppLovinSdk.getInstance(this).initialize(initConfig, new AppLovinSdk.SdkInitializationListener() {
|
// AppLovinSdk.getInstance(this).initialize(initConfig, new AppLovinSdk.SdkInitializationListener() {
|
||||||
@Override
|
// @Override
|
||||||
public void onSdkInitialized(final AppLovinSdkConfiguration sdkConfig) {
|
// public void onSdkInitialized(final AppLovinSdkConfiguration sdkConfig) {
|
||||||
initSDK = true;
|
// initSDK = true;
|
||||||
LocalBroadcastManager.getInstance(context).sendBroadcast(new Intent(AD_BROADCAST));
|
// LocalBroadcastManager.getInstance(context).sendBroadcast(new Intent(AD_BROADCAST));
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -65,8 +65,6 @@ public class HomeAdapter extends RecyclerView.Adapter<HomeAdapter.HomeVH> {
|
|||||||
if (listener != null) {
|
if (listener != null) {
|
||||||
listener.onClickItem(true,dir);
|
listener.onClickItem(true,dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,102 +9,21 @@ import android.graphics.Bitmap;
|
|||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
import android.graphics.Point;
|
import android.graphics.Point;
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
import android.util.Log;
|
|
||||||
import android.util.Range;
|
import android.util.Range;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.camera.core.Camera;
|
import androidx.camera.core.Camera;
|
||||||
import androidx.core.app.ActivityCompat;
|
import androidx.core.app.ActivityCompat;
|
||||||
|
|
||||||
import com.applovin.mediation.MaxAd;
|
|
||||||
import com.applovin.mediation.MaxAdListener;
|
|
||||||
import com.applovin.mediation.MaxError;
|
|
||||||
import com.applovin.mediation.ads.MaxInterstitialAd;
|
|
||||||
import com.draw.painting.test.Adcallback;
|
|
||||||
import com.draw.painting.test.PaintingApp;
|
|
||||||
import com.draw.painting.test.ui.ALaucherActivity;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class Utils {
|
public class Utils {
|
||||||
|
|
||||||
private static ArrayList<MaxInterstitialAd> adArrayList;
|
|
||||||
private static final String one_AD = "fd0f2d1eca71b3a1";
|
|
||||||
private static final String two_Ad = "f129bbb52cd84647";
|
|
||||||
private static final String three_ad = "b42153354e619004";
|
|
||||||
|
|
||||||
|
|
||||||
public static void setCallBcak(MaxInterstitialAd ad, Adcallback adcallback) {
|
|
||||||
ad.setListener(new MaxAdListener() {
|
|
||||||
@Override
|
|
||||||
public void onAdLoaded(@NonNull MaxAd maxAd) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAdDisplayed(@NonNull MaxAd maxAd) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAdHidden(@NonNull MaxAd maxAd) {
|
|
||||||
adcallback.onAdHidden();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAdClicked(@NonNull MaxAd maxAd) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAdLoadFailed(@NonNull String s, @NonNull MaxError maxError) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAdDisplayFailed(@NonNull MaxAd maxAd, @NonNull MaxError maxError) {
|
|
||||||
adcallback.onShowFail(maxAd);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public static MaxInterstitialAd onCache(List<MaxInterstitialAd> list) {
|
|
||||||
Collections.shuffle(list);
|
|
||||||
for (MaxInterstitialAd ad : list) {
|
|
||||||
if (ad.isReady()) {
|
|
||||||
return ad;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<MaxInterstitialAd> getAllAd() {
|
|
||||||
if (adArrayList == null) {
|
|
||||||
adArrayList = new ArrayList<>();
|
|
||||||
adArrayList.add(createAd(one_AD, PaintingApp.app));
|
|
||||||
adArrayList.add(createAd(two_Ad, PaintingApp.app));
|
|
||||||
adArrayList.add(createAd(three_ad, PaintingApp.app));
|
|
||||||
}
|
|
||||||
for (MaxInterstitialAd ad : adArrayList) {
|
|
||||||
if (!ad.isReady()) {
|
|
||||||
ad.loadAd();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return adArrayList;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static MaxInterstitialAd createAd(String adUnitId, Context context) {
|
|
||||||
MaxInterstitialAd ad = new MaxInterstitialAd(adUnitId, context);
|
|
||||||
return ad;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static int getRange(Camera camera) {
|
public static int getRange(Camera camera) {
|
||||||
Range<Integer> exposureCompensationRange = camera.getCameraInfo().getExposureState().getExposureCompensationRange();
|
Range<Integer> exposureCompensationRange = camera.getCameraInfo().getExposureState().getExposureCompensationRange();
|
||||||
|
|||||||
@ -1,32 +1,21 @@
|
|||||||
package com.draw.painting.test.ui;
|
package com.draw.painting.test.ui;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
|
||||||
|
|
||||||
import android.content.BroadcastReceiver;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.CountDownTimer;
|
import android.os.CountDownTimer;
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import com.applovin.mediation.MaxAd;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import com.applovin.mediation.ads.MaxInterstitialAd;
|
|
||||||
import com.draw.painting.test.Adcallback;
|
|
||||||
import com.draw.painting.test.PaintingApp;
|
|
||||||
import com.draw.painting.test.databinding.ActivityAlaucherBinding;
|
import com.draw.painting.test.databinding.ActivityAlaucherBinding;
|
||||||
import com.draw.painting.test.manager.Utils;
|
import com.draw.painting.test.manager.Utils;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class ALaucherActivity extends AppCompatActivity {
|
public class ALaucherActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private ActivityAlaucherBinding binding;
|
private ActivityAlaucherBinding binding;
|
||||||
private long time = 11000;
|
private long time = 2000;
|
||||||
private CountDownTimer countDownTimer;
|
private CountDownTimer countDownTimer;
|
||||||
private static List<MaxInterstitialAd> adsList;
|
|
||||||
public static boolean isAlreadyShow = false;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@ -39,69 +28,21 @@ public class ALaucherActivity extends AppCompatActivity {
|
|||||||
countDownTimer = new CountDownTimer(time, 200) {
|
countDownTimer = new CountDownTimer(time, 200) {
|
||||||
@Override
|
@Override
|
||||||
public void onTick(long millisUntilFinished) {
|
public void onTick(long millisUntilFinished) {
|
||||||
if (!isAlreadyShow) {
|
|
||||||
showAdOrStartView(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFinish() {
|
public void onFinish() {
|
||||||
if (!isAlreadyShow) {
|
enterMain();
|
||||||
showAdOrStartView(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
registerBroadcastReceiver();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void showAdOrStartView(boolean go) {
|
|
||||||
MaxInterstitialAd cachedAd = Utils.onCache(adsList);
|
|
||||||
if (cachedAd == null) {
|
|
||||||
isAlreadyShow = false;
|
|
||||||
if (go) {
|
|
||||||
enterMain();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
isAlreadyShow = true;
|
|
||||||
Utils.setCallBcak(cachedAd, new Adcallback() {
|
|
||||||
@Override
|
|
||||||
public void onShowFail(MaxAd ad) {
|
|
||||||
isAlreadyShow = false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAdHidden() {
|
|
||||||
isAlreadyShow = true;
|
|
||||||
enterMain();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
cachedAd.showAd();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void registerBroadcastReceiver() {
|
|
||||||
if (!PaintingApp.initSDK) {
|
|
||||||
BroadcastReceiver receiver = new BroadcastReceiver() {
|
|
||||||
@Override
|
|
||||||
public void onReceive(Context context, Intent intent) {
|
|
||||||
loadAndStartAd();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
LocalBroadcastManager.getInstance(this).registerReceiver(receiver, new IntentFilter(PaintingApp.AD_BROADCAST));
|
|
||||||
} else {
|
|
||||||
loadAndStartAd();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void loadAndStartAd() {
|
|
||||||
adsList = Utils.getAllAd();
|
|
||||||
countDownTimer.start();
|
countDownTimer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void enterMain() {
|
private void enterMain() {
|
||||||
Intent intent = new Intent(ALaucherActivity.this, HomeActivity.class);
|
Intent intent = new Intent(ALaucherActivity.this, HomeActivity.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
|||||||
@ -1,18 +1,5 @@
|
|||||||
package com.draw.painting.test.ui;
|
package com.draw.painting.test.ui;
|
||||||
|
|
||||||
import androidx.activity.result.ActivityResultLauncher;
|
|
||||||
import androidx.activity.result.contract.ActivityResultContracts;
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import androidx.camera.core.Camera;
|
|
||||||
import androidx.camera.core.CameraSelector;
|
|
||||||
import androidx.camera.core.ImageCapture;
|
|
||||||
import androidx.camera.core.Preview;
|
|
||||||
import androidx.camera.lifecycle.ProcessCameraProvider;
|
|
||||||
import androidx.camera.view.PreviewView;
|
|
||||||
import androidx.core.app.ActivityCompat;
|
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@ -32,13 +19,24 @@ import android.widget.ImageView;
|
|||||||
import android.widget.SeekBar;
|
import android.widget.SeekBar;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.applovin.mediation.MaxAd;
|
import androidx.activity.result.ActivityResultLauncher;
|
||||||
import com.applovin.mediation.ads.MaxInterstitialAd;
|
import androidx.activity.result.contract.ActivityResultContracts;
|
||||||
import com.draw.painting.test.Adcallback;
|
import androidx.annotation.NonNull;
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.camera.core.Camera;
|
||||||
|
import androidx.camera.core.CameraSelector;
|
||||||
|
import androidx.camera.core.ImageCapture;
|
||||||
|
import androidx.camera.core.Preview;
|
||||||
|
import androidx.camera.lifecycle.ProcessCameraProvider;
|
||||||
|
import androidx.camera.view.PreviewView;
|
||||||
|
import androidx.core.app.ActivityCompat;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
|
||||||
import com.draw.painting.test.PaintingApp;
|
import com.draw.painting.test.PaintingApp;
|
||||||
import com.draw.painting.test.R;
|
import com.draw.painting.test.R;
|
||||||
import com.draw.painting.test.manager.Utils;
|
import com.draw.painting.test.manager.Utils;
|
||||||
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -73,7 +71,7 @@ public class CameraActivity extends AppCompatActivity implements View.OnTouchLis
|
|||||||
private boolean hasPermission = false;
|
private boolean hasPermission = false;
|
||||||
private boolean isMain;
|
private boolean isMain;
|
||||||
private String ismain;
|
private String ismain;
|
||||||
private static List<MaxInterstitialAd> adsList;
|
|
||||||
private ActivityResultLauncher<Intent> intentActivityResultLauncher;
|
private ActivityResultLauncher<Intent> intentActivityResultLauncher;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -82,7 +80,7 @@ public class CameraActivity extends AppCompatActivity implements View.OnTouchLis
|
|||||||
setContentView(R.layout.activity_camera);
|
setContentView(R.layout.activity_camera);
|
||||||
Utils.setStatusBarTextColor(this, true);
|
Utils.setStatusBarTextColor(this, true);
|
||||||
|
|
||||||
adsList = Utils.getAllAd();
|
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
isMain = intent.getBooleanExtra(PaintingApp.Key_ISMAIN, false);
|
isMain = intent.getBooleanExtra(PaintingApp.Key_ISMAIN, false);
|
||||||
|
|
||||||
@ -115,23 +113,7 @@ public class CameraActivity extends AppCompatActivity implements View.OnTouchLis
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void showAd() {
|
private void showAd() {
|
||||||
MaxInterstitialAd cachedAd = Utils.onCache(adsList);
|
|
||||||
if (cachedAd == null) {
|
|
||||||
|
|
||||||
} else {
|
|
||||||
Utils.setCallBcak(cachedAd, new Adcallback() {
|
|
||||||
@Override
|
|
||||||
public void onShowFail(MaxAd ad) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAdHidden() {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
cachedAd.showAd(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onInitIm(float imW, float imH) {
|
private void onInitIm(float imW, float imH) {
|
||||||
@ -297,7 +279,6 @@ public class CameraActivity extends AppCompatActivity implements View.OnTouchLis
|
|||||||
int height = bitmap.getHeight();
|
int height = bitmap.getHeight();
|
||||||
onInitIm(width, height);
|
onInitIm(width, height);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -339,14 +320,5 @@ public class CameraActivity extends AppCompatActivity implements View.OnTouchLis
|
|||||||
Toast.makeText(this, getString(R.string.permission_fail), Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, getString(R.string.permission_fail), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBackPressed() {
|
|
||||||
super.onBackPressed();
|
|
||||||
if (isMain) {
|
|
||||||
showAd();
|
|
||||||
finish();
|
|
||||||
} else {
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,14 +1,12 @@
|
|||||||
package com.draw.painting.test.ui;
|
package com.draw.painting.test.ui;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import com.applovin.mediation.MaxAd;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import com.applovin.mediation.ads.MaxInterstitialAd;
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
import com.draw.painting.test.Adcallback;
|
|
||||||
|
|
||||||
import com.draw.painting.test.PaintingApp;
|
import com.draw.painting.test.PaintingApp;
|
||||||
import com.draw.painting.test.adapter.PreViewAdapter;
|
import com.draw.painting.test.adapter.PreViewAdapter;
|
||||||
import com.draw.painting.test.databinding.ActivityPreViewBinding;
|
import com.draw.painting.test.databinding.ActivityPreViewBinding;
|
||||||
@ -21,7 +19,7 @@ public class PreViewActivity extends AppCompatActivity {
|
|||||||
private ActivityPreViewBinding preViewBinding;
|
private ActivityPreViewBinding preViewBinding;
|
||||||
|
|
||||||
private String dirStr;
|
private String dirStr;
|
||||||
private static List<MaxInterstitialAd> adsList;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@ -32,7 +30,7 @@ public class PreViewActivity extends AppCompatActivity {
|
|||||||
dirStr = getIntent().getStringExtra(PaintingApp.Key_ViewDir);
|
dirStr = getIntent().getStringExtra(PaintingApp.Key_ViewDir);
|
||||||
preViewBinding.categoryName.setText(dirStr.substring(dirStr.lastIndexOf("_") + 1));
|
preViewBinding.categoryName.setText(dirStr.substring(dirStr.lastIndexOf("_") + 1));
|
||||||
|
|
||||||
adsList = Utils.getAllAd();
|
|
||||||
|
|
||||||
onInitList();
|
onInitList();
|
||||||
onInitClick();
|
onInitClick();
|
||||||
@ -51,34 +49,15 @@ public class PreViewActivity extends AppCompatActivity {
|
|||||||
preViewBinding.back.setOnClickListener(new View.OnClickListener() {
|
preViewBinding.back.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
showAd();
|
finish();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showAd() {
|
|
||||||
MaxInterstitialAd cachedAd = Utils.onCache(adsList);
|
|
||||||
if (cachedAd == null) {
|
|
||||||
finish();
|
|
||||||
} else {
|
|
||||||
Utils.setCallBcak(cachedAd, new Adcallback() {
|
|
||||||
@Override
|
|
||||||
public void onShowFail(MaxAd ad) {
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAdHidden() {
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
cachedAd.showAd(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
super.onBackPressed();
|
super.onBackPressed();
|
||||||
showAd();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -7,34 +7,40 @@
|
|||||||
android:background="@color/wel_color"
|
android:background="@color/wel_color"
|
||||||
tools:context=".ui.ALaucherActivity">
|
tools:context=".ui.ALaucherActivity">
|
||||||
|
|
||||||
<ImageView
|
<androidx.cardview.widget.CardView
|
||||||
android:layout_width="166dp"
|
|
||||||
android:layout_height="166dp"
|
|
||||||
android:layout_marginTop="186dp"
|
|
||||||
android:src="@mipmap/logo"
|
|
||||||
android:id="@+id/image"
|
android:id="@+id/image"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="186dp"
|
||||||
|
app:cardCornerRadius="10dp"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="126dp"
|
||||||
|
android:layout_height="126dp"
|
||||||
|
android:src="@mipmap/logo" />
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:textSize="40sp"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintTop_toBottomOf="@id/image"
|
android:layout_marginTop="20dp"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
|
||||||
android:layout_marginTop="30dp"
|
|
||||||
android:text="@string/app_name"
|
android:text="@string/app_name"
|
||||||
android:textColor="@color/wel_text_color"
|
android:textColor="@color/wel_text_color"
|
||||||
android:layout_height="wrap_content"/>
|
android:textSize="20sp"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/image" />
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
|
||||||
android:layout_marginBottom="60dp"
|
android:layout_marginBottom="60dp"
|
||||||
android:indeterminateTint="@color/wel_text_color"
|
android:indeterminateTint="@color/wel_text_color"
|
||||||
android:layout_height="wrap_content"/>
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@ -3,6 +3,7 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:paddingTop="33dp"
|
android:paddingTop="33dp"
|
||||||
|
android:background="@color/white"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 357 KiB After Width: | Height: | Size: 96 KiB |
@ -1,5 +1,5 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">Painting Helper</string>
|
<string name="app_name">AR Draw</string>
|
||||||
|
|
||||||
<string name="see_all">See All</string>
|
<string name="see_all">See All</string>
|
||||||
<string name="tab_draw">Trace&Draw</string>
|
<string name="tab_draw">Trace&Draw</string>
|
||||||
@ -10,5 +10,5 @@
|
|||||||
<string name="version">Version</string>
|
<string name="version">Version</string>
|
||||||
<string name="version_code">V%s</string>
|
<string name="version_code">V%s</string>
|
||||||
<string name="permission_fail">Please grant the relevant permissions and try again.</string>
|
<string name="permission_fail">Please grant the relevant permissions and try again.</string>
|
||||||
<string name="url_privacy">https://sites.google.com/view/httpprivates</string>
|
<string name="url_privacy">https://sites.google.com/view/privacy-policy-view-page</string>
|
||||||
</resources>
|
</resources>
|
||||||
@ -2,11 +2,4 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("com.android.application") version "8.1.0" apply false
|
id("com.android.application") version "8.1.0" apply false
|
||||||
id("org.jetbrains.kotlin.android") version "1.8.20" apply false
|
id("org.jetbrains.kotlin.android") version "1.8.20" 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
|
|
||||||
}
|
}
|
||||||
buildscript{
|
|
||||||
dependencies{
|
|
||||||
classpath("com.applovin.quality:AppLovinQualityServiceGradlePlugin:+")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
15
keystore.properties
Normal file
15
keystore.properties
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#app_name=AR Draw Sketch
|
||||||
|
#package_name=com.draw.ar.drawsketch
|
||||||
|
#keystoreFile=app/ARDrawSketch.jks
|
||||||
|
#key_alias=ARDrawSketchkey0
|
||||||
|
#key_store_password=ARDrawSketch
|
||||||
|
#key_password=ARDrawSketch
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
app_name=AR Draw
|
||||||
|
package_name=com.draw.ar.draw
|
||||||
|
keystoreFile=app/ARDraw.jks
|
||||||
|
key_alias=ARDrawkey0
|
||||||
|
key_store_password=ARDraw
|
||||||
|
key_password=ARDraw
|
||||||
@ -3,8 +3,6 @@ pluginManagement {
|
|||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
|
|
||||||
maven { url = uri("https://artifacts.applovin.com/android") }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencyResolutionManagement {
|
dependencyResolutionManagement {
|
||||||
@ -12,13 +10,9 @@ dependencyResolutionManagement {
|
|||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|
||||||
maven { url = uri("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea") }
|
|
||||||
maven { url = uri("https://artifact.bytedance.com/repository/pangle") }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rootProject.name = "Painting_Helper"
|
rootProject.name = "AR Draw Sketch"
|
||||||
include(":app")
|
include(":app")
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user