Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
L
location share white
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanglei
location share white
Commits
8bac2198
Commit
8bac2198
authored
Oct 18, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
f3f02b96
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
292 additions
and
7 deletions
+292
-7
build.gradle.kts
app/build.gradle.kts
+8
-0
MapUtils.kt
...src/main/java/com/base/locationsharewhite/map/MapUtils.kt
+5
-0
LocationMapActivity.kt
.../locationsharewhite/ui/locationmap/LocationMapActivity.kt
+26
-2
DialogView.kt
...n/java/com/base/locationsharewhite/ui/views/DialogView.kt
+18
-0
bg_03b988_22.xml
app/src/main/res/drawable/bg_03b988_22.xml
+5
-0
bg_03b988_tl15_br15.xml
app/src/main/res/drawable/bg_03b988_tl15_br15.xml
+9
-0
bg_cafaee_15.xml
app/src/main/res/drawable/bg_cafaee_15.xml
+6
-0
dialog_app_exit.xml
app/src/main/res/layout/dialog_app_exit.xml
+96
-0
dialog_map_type.xml
app/src/main/res/layout/dialog_map_type.xml
+10
-5
layout_admob_app_exit.xml
app/src/main/res/layout/layout_admob_app_exit.xml
+108
-0
guanbi_app_exit.png
app/src/main/res/mipmap-xxhdpi/guanbi_app_exit.png
+0
-0
strings.xml
app/src/main/res/values/strings.xml
+1
-0
No files found.
app/build.gradle.kts
View file @
8bac2198
...
...
@@ -53,4 +53,12 @@ dependencies {
//google地图
implementation
(
libs
.
play
.
services
.
maps
)
//广告
implementation
(
"com.google.android.gms:play-services-ads:23.1.0"
)
implementation
(
"com.google.ads.mediation:applovin:12.4.3.0"
)
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"
)
}
\ No newline at end of file
app/src/main/java/com/base/locationsharewhite/map/MapUtils.kt
View file @
8bac2198
...
...
@@ -2,6 +2,7 @@ package com.base.locationsharewhite.map
import
android.annotation.SuppressLint
import
android.content.Context
import
android.graphics.Color
import
android.location.Criteria
import
android.location.Location
import
android.location.LocationManager
...
...
@@ -12,6 +13,7 @@ import com.google.android.gms.maps.GoogleMap
import
com.google.android.gms.maps.model.LatLng
import
com.google.android.gms.maps.model.LatLngBounds
import
com.google.android.gms.maps.model.MarkerOptions
import
com.google.android.gms.maps.model.PolylineOptions
import
kotlin.math.abs
...
...
@@ -60,4 +62,7 @@ object MapUtils {
}
}
\ No newline at end of file
app/src/main/java/com/base/locationsharewhite/ui/locationmap/LocationMapActivity.kt
View file @
8bac2198
...
...
@@ -15,6 +15,7 @@ import com.google.android.gms.maps.GoogleMap
import
com.google.android.gms.maps.OnMapReadyCallback
import
com.google.android.gms.maps.SupportMapFragment
import
com.google.android.gms.maps.model.LatLng
import
com.google.android.gms.maps.model.PolylineOptions
class
LocationMapActivity
:
BaseActivity
<
ActivityLocationMapBinding
>(),
OnMapReadyCallback
{
...
...
@@ -52,10 +53,10 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
val
sydney
=
LatLng
(-
33.87365
,
151.20689
)
showMeAndFriendLocation
(
sydney
)
//
showMeAndFriendLocation(sydney)
val
chunxilu
=
LatLng
(
30.655782251943407
,
104.07701072527895
)
//
showMeAndFriendLocation(chunxilu)
showMeAndFriendLocation
(
chunxilu
)
}
...
...
@@ -72,6 +73,29 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
val
padding
=
resources
.
getDimensionPixelOffset
(
R
.
dimen
.
dp_150
)
map
?.
cameraMovePointsBounds
(
myPair
,
friendLatLng
,
padding
)
val
list
=
arrayListOf
<
LatLng
>()
list
.
addAll
(
friendTestLine
)
list
.
add
(
friendLatLng
)
addFriendPolyline
(
list
)
}
val
friendTestLine
=
listOf
(
LatLng
(
30.65988197028939
,
104.07775588286886
),
//總府皇冠假日酒店
LatLng
(
30.658174607262318
,
104.06581096754789
),
//天府广场
LatLng
(
30.6531557462031
,
104.06660595172475
),
//航天科技大廈
LatLng
(
30.64867742925485
,
104.06548317653692
),
//錦江賓館
LatLng
(
30.654908885860806
,
104.08053620625755
),
//ifs
)
fun
addFriendPolyline
(
list
:
List
<
LatLng
>)
{
map
?.
addPolyline
(
PolylineOptions
().
apply
{
list
.
forEach
{
add
(
it
)
}
width
(
5
.
toFloat
())
color
(
Color
.
BLUE
)
geodesic
(
true
)
clickable
(
true
)
})
}
}
\ No newline at end of file
app/src/main/java/com/base/locationsharewhite/ui/views/DialogView.kt
View file @
8bac2198
...
...
@@ -6,7 +6,9 @@ import android.view.Gravity
import
android.view.LayoutInflater
import
android.widget.LinearLayout
import
com.base.locationsharewhite.R
import
com.base.locationsharewhite.databinding.DialogAppExitBinding
import
com.base.locationsharewhite.databinding.DialogMapTypeBinding
import
com.base.locationsharewhite.ui.views.DialogView.showMapTypeDialog
object
DialogView
{
...
...
@@ -26,4 +28,20 @@ object DialogView {
dialog
.
window
?.
setBackgroundDrawableResource
(
android
.
R
.
color
.
transparent
)
}
fun
Context
.
showAppExitDialog
()
{
val
dialog
=
AlertDialog
.
Builder
(
this
).
create
()
val
binding
=
DialogAppExitBinding
.
inflate
(
LayoutInflater
.
from
(
this
))
dialog
.
setView
(
binding
.
root
)
dialog
.
setCanceledOnTouchOutside
(
true
)
dialog
.
show
()
val
params
=
dialog
.
window
?.
attributes
params
?.
width
=
resources
.
getDimensionPixelOffset
(
R
.
dimen
.
dp_375
)
params
?.
height
=
LinearLayout
.
LayoutParams
.
WRAP_CONTENT
params
?.
gravity
=
Gravity
.
CENTER
dialog
.
window
?.
attributes
=
params
dialog
.
window
?.
setBackgroundDrawableResource
(
android
.
R
.
color
.
transparent
)
}
}
\ No newline at end of file
app/src/main/res/drawable/bg_03b988_22.xml
0 → 100644
View file @
8bac2198
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"22dp"
/>
<solid
android:color=
"#03B988"
/>
</shape>
\ No newline at end of file
app/src/main/res/drawable/bg_03b988_tl15_br15.xml
0 → 100644
View file @
8bac2198
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"#03B988"
/>
<corners
android:bottomRightRadius=
"15dp"
android:topLeftRadius=
"15dp"
/>
</shape>
\ No newline at end of file
app/src/main/res/drawable/bg_cafaee_15.xml
0 → 100644
View file @
8bac2198
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"15dp"
/>
<solid
android:color=
"#CAFAEE"
/>
</shape>
\ No newline at end of file
app/src/main/res/layout/dialog_app_exit.xml
0 → 100644
View file @
8bac2198
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"356dp"
android:layout_height=
"wrap_content"
android:background=
"@android:color/transparent"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"56dp"
android:background=
"@drawable/bg_ffffff_15"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
>
<TextView
android:id=
"@+id/tv"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"65dp"
android:layout_marginTop=
"58dp"
android:gravity=
"center"
android:text=
"@string/are_you_sure_you_want_to_exit_the_app"
android:textColor=
"#001725"
android:textSize=
"20sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<LinearLayout
android:id=
"@+id/ll"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"32dp"
android:layout_marginBottom=
"24dp"
android:orientation=
"horizontal"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tv"
>
<TextView
android:id=
"@+id/tv_cancel"
android:layout_width=
"134dp"
android:layout_height=
"48dp"
android:background=
"@drawable/bg_454545_10"
android:gravity=
"center"
android:text=
"@string/cancel"
android:textColor=
"@color/white"
android:textSize=
"20sp"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/tv_rate"
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:textColor=
"@color/white"
android:textSize=
"20sp"
android:textStyle=
"bold"
/>
</LinearLayout>
<FrameLayout
android:layout_marginTop=
"16dp"
android:id=
"@+id/fl_ad"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/ll"
>
<include
layout=
"@layout/layout_admob_app_exit"
android:layout_width=
"match_parent"
android:layout_height=
"250dp"
/>
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<ImageView
android:id=
"@+id/iv_close"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@mipmap/guanbi_app_exit"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:ignore=
"ContentDescription"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/dialog_map_type.xml
View file @
8bac2198
...
...
@@ -4,13 +4,15 @@
android:layout_width=
"375dp"
android:layout_height=
"wrap_content"
android:background=
"@drawable/bg_ffffff_15"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
tools:ignore=
"DisableBaselineAlignment"
>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
tools:ignore=
"UseCompoundDrawables"
>
<ImageView
android:layout_width=
"wrap_content"
...
...
@@ -18,7 +20,8 @@
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"26dp"
android:padding=
"1dp"
android:src=
"@mipmap/staellitemap"
/>
android:src=
"@mipmap/staellitemap"
tools:ignore=
"ContentDescription"
/>
<TextView
android:layout_width=
"wrap_content"
...
...
@@ -33,7 +36,8 @@
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
tools:ignore=
"UseCompoundDrawables"
>
<ImageView
android:layout_width=
"wrap_content"
...
...
@@ -42,7 +46,8 @@
android:layout_marginTop=
"26dp"
android:padding=
"1dp"
android:src=
"@mipmap/streetmap"
tools:background=
"@drawable/bg_stroke_03b988_15"
/>
tools:background=
"@drawable/bg_stroke_03b988_15"
tools:ignore=
"ContentDescription"
/>
<TextView
android:layout_width=
"wrap_content"
...
...
app/src/main/res/layout/layout_admob_app_exit.xml
0 → 100644
View file @
8bac2198
<com.google.android.gms.ads.nativead.NativeAdView
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=
"345dp"
android:layout_height=
"250dp"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_gravity=
"center"
android:background=
"@drawable/bg_cafaee_15"
android:baselineAligned=
"false"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/bg_03b988_tl15_br15"
android:paddingHorizontal=
"6dp"
android:paddingVertical=
"4dp"
android:text=
"AD"
android:textColor=
"@color/white"
android:textSize=
"13sp"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:ignore=
"HardcodedText"
/>
<LinearLayout
android:id=
"@+id/ll"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"32dp"
android:orientation=
"horizontal"
app:layout_constraintTop_toTopOf=
"parent"
>
<ImageView
android:id=
"@+id/ad_app_icon"
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:layout_gravity=
"center_vertical"
android:layout_marginStart=
"8dp"
tools:ignore=
"ContentDescription"
/>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginHorizontal=
"8dp"
android:layout_weight=
"1"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/ad_headline"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:ellipsize=
"end"
android:maxLines=
"2"
android:textColor=
"#001D29"
android:textSize=
"16sp"
android:textStyle=
"bold"
tools:text=
"All You Can Wish For"
/>
<TextView
android:id=
"@+id/ad_body"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"2dp"
android:ellipsize=
"end"
android:maxLines=
"2"
android:textColor=
"@color/black"
android:textSize=
"13sp"
tools:text=
"wuyunbooster.com"
/>
</LinearLayout>
</LinearLayout>
<com.google.android.gms.ads.nativead.MediaView
android:id=
"@+id/ad_media"
android:layout_width=
"match_parent"
android:layout_height=
"95dp"
android:layout_gravity=
"center_vertical"
android:layout_marginHorizontal=
"16dp"
android:layout_marginTop=
"8dp"
app:layout_constraintTop_toBottomOf=
"@id/ll"
/>
<androidx.appcompat.widget.AppCompatButton
android:id=
"@+id/ad_call_to_action"
android:layout_width=
"match_parent"
android:layout_height=
"45dp"
android:layout_gravity=
"center_vertical"
android:layout_marginHorizontal=
"16dp"
android:layout_marginBottom=
"2dp"
android:background=
"@drawable/bg_03b988_22"
android:gravity=
"center"
android:textAllCaps=
"false"
android:textColor=
"@color/white"
android:textSize=
"15sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/ad_media"
tools:text=
"Install"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.gms.ads.nativead.NativeAdView>
\ No newline at end of file
app/src/main/res/mipmap-xxhdpi/guanbi_app_exit.png
0 → 100644
View file @
8bac2198
10.8 KB
app/src/main/res/values/strings.xml
View file @
8bac2198
...
...
@@ -45,4 +45,5 @@
<string
name=
"thank_you_for_your_nsupport"
>
Thank you for your\nsupport!
</string>
<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>
</resources>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment