Commit b0d61de4 authored by wanglei's avatar wanglei

init

parent 8bac2198
plugins {
alias(libs.plugins.androidApplication)
alias(libs.plugins.jetbrainsKotlinAndroid)
id("com.google.gms.google-services")
id("com.google.firebase.crashlytics")
}
android {
......@@ -61,4 +63,10 @@ dependencies {
implementation("com.google.ads.mediation:facebook:6.17.0.0")
implementation("com.google.ads.mediation:mintegral:16.7.21.0")
implementation("com.google.ads.mediation:pangle:5.9.0.4.0")
//firebase
implementation(platform("com.google.firebase:firebase-bom:32.3.1"))
implementation("com.google.firebase:firebase-messaging")
implementation("com.google.firebase:firebase-analytics-ktx")
implementation("com.google.firebase:firebase-crashlytics")
}
\ No newline at end of file
{
"project_info": {
"project_number": "953792647345",
"project_id": "pdf-test-d0ae7",
"storage_bucket": "pdf-test-d0ae7.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:953792647345:android:c5234e8bfc859f8b20d290",
"android_client_info": {
"package_name": "com.base.locationsharewhite"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyBT6B1oPmkojGX0TgBOI9bDkx5pdEFXWoo"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}
\ No newline at end of file
......@@ -102,6 +102,14 @@
android:launchMode="singleTop"
android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713" />
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id" />
</application>
</manifest>
\ No newline at end of file
......@@ -5,6 +5,7 @@ import android.content.Intent
import android.graphics.Color
import android.os.Build
import android.view.LayoutInflater
import androidx.activity.addCallback
import androidx.core.view.updatePadding
import com.base.locationsharewhite.R
import com.base.locationsharewhite.databinding.ActivityMainBinding
......@@ -15,6 +16,7 @@ import com.base.locationsharewhite.map.MapUtils.getLastKnowLatLng
import com.base.locationsharewhite.ui.howuse.HowUseActivity
import com.base.locationsharewhite.ui.locationmap.LocationMapActivity
import com.base.locationsharewhite.ui.set.SettingActivity
import com.base.locationsharewhite.ui.views.DialogView.showAppExitDialog
import com.base.locationsharewhite.utils.BarUtils
import com.base.locationsharewhite.utils.LogEx
import com.base.locationsharewhite.utils.PermissionUtils.checkLocationPermission
......@@ -61,6 +63,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnMapReadyCallback {
override fun initListener() {
super.initListener()
onBackPressedDispatcher.addCallback {
showAppExitDialog()
}
binding.llMapLocation.setOnClickListener {
startActivity(Intent(this, LocationMapActivity::class.java))
}
......
package com.base.locationsharewhite.ui.views
import android.app.Activity
import android.app.AlertDialog
import android.content.Context
import android.view.Gravity
......@@ -29,7 +30,7 @@ object DialogView {
}
fun Context.showAppExitDialog() {
fun Activity.showAppExitDialog() {
val dialog = AlertDialog.Builder(this).create()
val binding = DialogAppExitBinding.inflate(LayoutInflater.from(this))
dialog.setView(binding.root)
......@@ -38,10 +39,18 @@ object DialogView {
dialog.show()
val params = dialog.window?.attributes
params?.width = resources.getDimensionPixelOffset(R.dimen.dp_375)
params?.width = resources.getDimensionPixelOffset(R.dimen.dp_356)
params?.height = LinearLayout.LayoutParams.WRAP_CONTENT
params?.gravity = Gravity.CENTER
dialog.window?.attributes = params
dialog.window?.setBackgroundDrawableResource(android.R.color.transparent)
binding.tvCancel.setOnClickListener {
dialog.dismiss()
}
binding.tvQuit.setOnClickListener {
dialog.dismiss()
finish()
}
}
}
\ No newline at end of file
......@@ -52,13 +52,13 @@
android:textStyle="bold" />
<TextView
android:id="@+id/tv_rate"
android:id="@+id/tv_quit"
android:layout_width="134dp"
android:layout_height="48dp"
android:layout_marginStart="16dp"
android:background="@drawable/bg_f14b3f_10"
android:gravity="center"
android:text="@string/rate"
android:text="@string/quit"
android:textColor="@color/white"
android:textSize="20sp"
android:textStyle="bold" />
......
......@@ -9,4 +9,5 @@
<dimen name="dp_100">100dp</dimen>
<dimen name="dp_200">200dp</dimen>
<dimen name="dp_150">150dp</dimen>
<dimen name="dp_356">356dp</dimen>
</resources>
\ No newline at end of file
......@@ -46,4 +46,6 @@
<string name="cancel">CANCEL</string>
<string name="rate">RATE</string>
<string name="are_you_sure_you_want_to_exit_the_app">Are you sure you want to\nexit the app?</string>
<string name="quit">QUIT</string>
<string name="facebook_app_id">123456789101112</string>
</resources>
\ No newline at end of file
......@@ -2,4 +2,7 @@
plugins {
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.jetbrainsKotlinAndroid) apply false
id("com.google.gms.google-services") version "4.4.1" apply false
id("com.google.firebase.crashlytics") version "3.0.2" apply false
}
\ No newline at end of file
......@@ -16,7 +16,12 @@ dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven(uri("https://s01.oss.sonatype.org/content/groups/public"))
maven("https://s01.oss.sonatype.org/content/groups/public")
maven("https://jitpack.io")
maven("https://android-sdk.is.com")
maven("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea")
maven("https://artifact.bytedance.com/repository/pangle")
maven("https://dl-maven-android.mintegral.com/repository/se_sdk_for_android/")
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment