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
bd2488f7
Commit
bd2488f7
authored
Oct 24, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
e089febf
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
177 additions
and
9 deletions
+177
-9
MyApplication.kt
.../java/com/base/locationsharewhite/helper/MyApplication.kt
+1
-0
LocationShareListUtils.kt
...ase/locationsharewhite/location/LocationShareListUtils.kt
+1
-0
LocationMapActivity.kt
.../locationsharewhite/ui/locationmap/LocationMapActivity.kt
+54
-7
ViewingAdapter.kt
.../base/locationsharewhite/ui/locationmap/ViewingAdapter.kt
+25
-0
LocationShareActivity.kt
.../base/locationsharewhite/ui/main/LocationShareActivity.kt
+5
-0
activity_location_map.xml
app/src/main/res/layout/activity_location_map.xml
+11
-2
item_viewing.xml
app/src/main/res/layout/item_viewing.xml
+80
-0
No files found.
app/src/main/java/com/base/locationsharewhite/helper/MyApplication.kt
View file @
bd2488f7
...
@@ -28,6 +28,7 @@ class MyApplication : Application() {
...
@@ -28,6 +28,7 @@ class MyApplication : Application() {
var
settingsLanguage
:
String
=
Locale
.
getDefault
().
language
+
"_"
+
Locale
.
getDefault
().
country
var
settingsLanguage
:
String
=
Locale
.
getDefault
().
language
+
"_"
+
Locale
.
getDefault
().
country
var
howUseLanguage
:
String
=
Locale
.
getDefault
().
language
+
"_"
+
Locale
.
getDefault
().
country
var
howUseLanguage
:
String
=
Locale
.
getDefault
().
language
+
"_"
+
Locale
.
getDefault
().
country
var
renameLanguage
:
String
=
Locale
.
getDefault
().
language
+
"_"
+
Locale
.
getDefault
().
country
var
renameLanguage
:
String
=
Locale
.
getDefault
().
language
+
"_"
+
Locale
.
getDefault
().
country
var
locationMapLanguage
:
String
=
Locale
.
getDefault
().
language
+
"_"
+
Locale
.
getDefault
().
country
var
umpCanAd
:
Boolean
=
true
var
umpCanAd
:
Boolean
=
true
...
...
app/src/main/java/com/base/locationsharewhite/location/LocationShareListUtils.kt
View file @
bd2488f7
...
@@ -91,6 +91,7 @@ object LocationShareListUtils {
...
@@ -91,6 +91,7 @@ object LocationShareListUtils {
val
viewingListJson
=
jsonObject
.
getJSONArray
(
"viewingList"
).
toString
()
val
viewingListJson
=
jsonObject
.
getJSONArray
(
"viewingList"
).
toString
()
LogEx
.
logDebug
(
TAG
,
"viewingListJson=$viewingListJson"
)
LogEx
.
logDebug
(
TAG
,
"viewingListJson=$viewingListJson"
)
val
viewingList
:
List
<
ViewingBean
>
=
gson
.
fromJson
(
viewingListJson
,
viewingListType
)
val
viewingList
:
List
<
ViewingBean
>
=
gson
.
fromJson
(
viewingListJson
,
viewingListType
)
LogEx
.
logDebug
(
TAG
,
"viewingList size=${viewingList.size}"
)
viewingListCallBack
?.
invoke
(
viewingList
)
viewingListCallBack
?.
invoke
(
viewingList
)
}
}
}
}
\ No newline at end of file
app/src/main/java/com/base/locationsharewhite/ui/locationmap/LocationMapActivity.kt
View file @
bd2488f7
...
@@ -12,9 +12,12 @@ import com.base.locationsharewhite.bean.ConstObject
...
@@ -12,9 +12,12 @@ import com.base.locationsharewhite.bean.ConstObject
import
com.base.locationsharewhite.bean.ViewingBean
import
com.base.locationsharewhite.bean.ViewingBean
import
com.base.locationsharewhite.databinding.ActivityLocationMapBinding
import
com.base.locationsharewhite.databinding.ActivityLocationMapBinding
import
com.base.locationsharewhite.helper.BaseActivity
import
com.base.locationsharewhite.helper.BaseActivity
import
com.base.locationsharewhite.helper.MyApplication
import
com.base.locationsharewhite.location.LocationShareListUtils
import
com.base.locationsharewhite.map.MapUtils.addLocationMarker
import
com.base.locationsharewhite.map.MapUtils.addLocationMarker
import
com.base.locationsharewhite.map.MapUtils.cameraMovePointsBounds
import
com.base.locationsharewhite.map.MapUtils.cameraMovePointsBounds
import
com.base.locationsharewhite.map.MapUtils.getLastKnowLatLng
import
com.base.locationsharewhite.map.MapUtils.getLastKnowLatLng
import
com.base.locationsharewhite.ui.main.ViewerAdapter
import
com.base.locationsharewhite.ui.views.DialogView.showMapTypeDialog
import
com.base.locationsharewhite.ui.views.DialogView.showMapTypeDialog
import
com.base.locationsharewhite.utils.BarUtils
import
com.base.locationsharewhite.utils.BarUtils
import
com.base.locationsharewhite.utils.BitmapUtils
import
com.base.locationsharewhite.utils.BitmapUtils
...
@@ -40,6 +43,7 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
...
@@ -40,6 +43,7 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
private
val
TAG
=
"LocationMapActivity"
private
val
TAG
=
"LocationMapActivity"
private
var
map
:
GoogleMap
?
=
null
private
var
map
:
GoogleMap
?
=
null
private
lateinit
var
locationPresenter
:
LocationPresenter
private
lateinit
var
locationPresenter
:
LocationPresenter
private
lateinit
var
adapter
:
ViewingAdapter
override
val
binding
:
ActivityLocationMapBinding
by
lazy
{
override
val
binding
:
ActivityLocationMapBinding
by
lazy
{
ActivityLocationMapBinding
.
inflate
(
layoutInflater
)
ActivityLocationMapBinding
.
inflate
(
layoutInflater
)
...
@@ -48,7 +52,6 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
...
@@ -48,7 +52,6 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
private
var
myMarker
:
Marker
?
=
null
private
var
myMarker
:
Marker
?
=
null
private
var
friendMarker
:
Marker
?
=
null
private
var
friendMarker
:
Marker
?
=
null
var
friendsList
=
arrayListOf
<
ViewingBean
>()
override
fun
initView
()
{
override
fun
initView
()
{
BarUtils
.
setStatusBarLightMode
(
this
,
true
)
BarUtils
.
setStatusBarLightMode
(
this
,
true
)
...
@@ -56,7 +59,27 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
...
@@ -56,7 +59,27 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
// binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
// binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
locationPresenter
=
LocationPresenter
(
this
,
lifecycleScope
)
locationPresenter
=
LocationPresenter
(
this
,
lifecycleScope
)
if
(
isLanguageRecreate
(
MyApplication
.
locationMapLanguage
))
{
return
}
val
mapFragment
=
supportFragmentManager
.
findFragmentById
(
R
.
id
.
map
)
as
SupportMapFragment
?
mapFragment
?.
getMapAsync
(
this
)
showFriendGuideOrNoFriend
()
initAdapter
()
initViewingData
()
}
private
fun
initAdapter
()
{
adapter
=
ViewingAdapter
()
binding
.
rvViewing
.
adapter
=
adapter
}
private
fun
showFriendGuideOrNoFriend
()
{
if
(
ConstObject
.
noShowFriendsShareGuide
)
{
if
(
ConstObject
.
noShowFriendsShareGuide
)
{
binding
.
llFriendsGuide
.
visibility
=
View
.
GONE
binding
.
llFriendsGuide
.
visibility
=
View
.
GONE
binding
.
llNoFriend
.
visibility
=
View
.
VISIBLE
binding
.
llNoFriend
.
visibility
=
View
.
VISIBLE
...
@@ -64,15 +87,30 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
...
@@ -64,15 +87,30 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
binding
.
llFriendsGuide
.
visibility
=
View
.
VISIBLE
binding
.
llFriendsGuide
.
visibility
=
View
.
VISIBLE
binding
.
llNoFriend
.
visibility
=
View
.
GONE
binding
.
llNoFriend
.
visibility
=
View
.
GONE
}
}
}
val
mapFragment
=
private
fun
initViewingData
()
{
supportFragmentManager
.
findFragmentById
(
R
.
id
.
map
)
as
SupportMapFragment
?
LocationShareListUtils
.
getShareList
(
mapFragment
?.
getMapAsync
(
this
)
viewingListCallBack
=
{
runOnUiThread
{
if
(
it
.
isEmpty
())
{
showFriendGuideOrNoFriend
()
}
else
{
binding
.
llFriendsGuide
.
visibility
=
View
.
GONE
binding
.
llNoFriend
.
visibility
=
View
.
GONE
binding
.
rvViewing
.
visibility
=
View
.
VISIBLE
adapter
.
submitList
(
it
)
}
}
}
)
}
}
override
fun
initListener
()
{
override
fun
initListener
()
{
super
.
initListener
()
super
.
initListener
()
if
(
isLanguageRecreate
(
MyApplication
.
locationMapLanguage
))
{
return
}
onBackPressedDispatcher
.
addCallback
{
onBackPressedDispatcher
.
addCallback
{
finishToMain
()
finishToMain
()
}
}
...
@@ -84,14 +122,14 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
...
@@ -84,14 +122,14 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
}
}
binding
.
tvGotIt
.
setOnClickListener
{
binding
.
tvGotIt
.
setOnClickListener
{
binding
.
llFriendsGuide
.
visibility
=
View
.
GONE
binding
.
llFriendsGuide
.
visibility
=
View
.
GONE
if
(
friendsList
.
isEmpty
())
{
if
(
adapter
.
items
.
isEmpty
())
{
binding
.
llNoFriend
.
visibility
=
View
.
VISIBLE
binding
.
llNoFriend
.
visibility
=
View
.
VISIBLE
}
}
}
}
binding
.
tvNoShowAgain
.
setOnClickListener
{
binding
.
tvNoShowAgain
.
setOnClickListener
{
ConstObject
.
noShowFriendsShareGuide
=
true
ConstObject
.
noShowFriendsShareGuide
=
true
binding
.
llFriendsGuide
.
visibility
=
View
.
GONE
binding
.
llFriendsGuide
.
visibility
=
View
.
GONE
if
(
friendsList
.
isEmpty
())
{
if
(
adapter
.
items
.
isEmpty
())
{
binding
.
llNoFriend
.
visibility
=
View
.
VISIBLE
binding
.
llNoFriend
.
visibility
=
View
.
VISIBLE
}
}
}
}
...
@@ -113,6 +151,7 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
...
@@ -113,6 +151,7 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
stopRefreshAnimation
()
stopRefreshAnimation
()
}
}
}
}
binding
.
bottomSheet
.
setOnClickListener
{
}
}
}
...
@@ -268,6 +307,14 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
...
@@ -268,6 +307,14 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
override
fun
onResume
()
{
override
fun
onResume
()
{
super
.
onResume
()
super
.
onResume
()
val
isRecreate
=
updateAppLanguage
(
MyApplication
.
locationMapLanguage
)
{
MyApplication
.
locationMapLanguage
=
it
}
if
(
isRecreate
)
{
return
}
if
(
checkLocationPermission
())
{
if
(
checkLocationPermission
())
{
locationPresenter
.
startUploadMyLocation
()
locationPresenter
.
startUploadMyLocation
()
}
}
...
...
app/src/main/java/com/base/locationsharewhite/ui/locationmap/ViewingAdapter.kt
0 → 100644
View file @
bd2488f7
package
com.base.locationsharewhite.ui.locationmap
import
android.content.Context
import
android.view.View
import
android.view.ViewGroup
import
androidx.recyclerview.widget.RecyclerView.ViewHolder
import
com.base.locationsharewhite.R
import
com.base.locationsharewhite.bean.ViewingBean
import
com.base.locationsharewhite.databinding.ItemViewingBinding
import
com.base.locationsharewhite.ui.views.XmlEx.inflate
import
com.chad.library.adapter4.BaseQuickAdapter
class
ViewingAdapter
:
BaseQuickAdapter
<
ViewingBean
,
ViewingAdapter
.
ViewingViewHolder
>()
{
inner
class
ViewingViewHolder
(
view
:
View
)
:
ViewHolder
(
view
)
override
fun
onBindViewHolder
(
holder
:
ViewingViewHolder
,
position
:
Int
,
item
:
ViewingBean
?)
{
item
?:
return
val
binding
=
ItemViewingBinding
.
bind
(
holder
.
itemView
)
binding
.
tvNameLetters
.
text
=
item
.
nickname
.
substring
(
0
,
1
)
binding
.
tvNameCode
.
text
=
item
.
nickname
}
override
fun
onCreateViewHolder
(
context
:
Context
,
parent
:
ViewGroup
,
viewType
:
Int
):
ViewingViewHolder
{
return
ViewingViewHolder
(
R
.
layout
.
item_viewing
.
inflate
(
parent
))
}
}
\ No newline at end of file
app/src/main/java/com/base/locationsharewhite/ui/main/LocationShareActivity.kt
View file @
bd2488f7
...
@@ -75,6 +75,10 @@ class LocationShareActivity : BaseActivity<ActivityLocationShareBinding>() {
...
@@ -75,6 +75,10 @@ class LocationShareActivity : BaseActivity<ActivityLocationShareBinding>() {
}
}
binding
.
tvShare
.
setOnClickListener
{
binding
.
tvShare
.
setOnClickListener
{
val
code
=
binding
.
editCode
.
text
.
toString
()
val
code
=
binding
.
editCode
.
text
.
toString
()
if
(
code
.
isEmpty
())
{
toast
(
"code is empty"
)
return
@setOnClickListener
}
if
(
code
.
length
>=
8
)
{
if
(
code
.
length
>=
8
)
{
LocationShareUtils
.
shareMyLocationByInvitationCode
(
code
)
{
status
->
LocationShareUtils
.
shareMyLocationByInvitationCode
(
code
)
{
status
->
runOnUiThread
{
runOnUiThread
{
...
@@ -85,6 +89,7 @@ class LocationShareActivity : BaseActivity<ActivityLocationShareBinding>() {
...
@@ -85,6 +89,7 @@ class LocationShareActivity : BaseActivity<ActivityLocationShareBinding>() {
SHARE_STATE_SUCCESS
->
{
SHARE_STATE_SUCCESS
->
{
toast
(
"Code verification success"
)
toast
(
"Code verification success"
)
initShareData
()
}
}
SHARE_STATE_SHARED
->
{
SHARE_STATE_SHARED
->
{
...
...
app/src/main/res/layout/activity_location_map.xml
View file @
bd2488f7
...
@@ -50,6 +50,7 @@
...
@@ -50,6 +50,7 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/iv_change_map_type"
app:layout_constraintTop_toBottomOf=
"@id/iv_change_map_type"
tools:ignore=
"ContentDescription"
/>
tools:ignore=
"ContentDescription"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<FrameLayout
<FrameLayout
...
@@ -63,7 +64,8 @@
...
@@ -63,7 +64,8 @@
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
tools:ignore=
"UselessParent"
>
<androidx.constraintlayout.widget.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
@@ -113,7 +115,8 @@
...
@@ -113,7 +115,8 @@
android:id=
"@+id/ll_friends_guide"
android:id=
"@+id/ll_friends_guide"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
android:visibility=
"gone"
>
<ImageView
<ImageView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
...
@@ -184,6 +187,12 @@
...
@@ -184,6 +187,12 @@
android:textSize=
"16sp"
/>
android:textSize=
"16sp"
/>
</LinearLayout>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_viewing"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:visibility=
"gone"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
/>
</FrameLayout>
</FrameLayout>
</LinearLayout>
</LinearLayout>
...
...
app/src/main/res/layout/item_viewing.xml
0 → 100644
View file @
bd2488f7
<?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:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<FrameLayout
android:layout_width=
"54dp"
android:layout_height=
"54dp"
android:layout_marginVertical=
"8dp"
android:layout_marginStart=
"16dp"
android:gravity=
"center"
tools:ignore=
"UselessParent"
>
<de.hdodenhof.circleimageview.CircleImageView
android:id=
"@+id/iv_avatar"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:src=
"@mipmap/logo"
android:visibility=
"gone"
app:civ_border_color=
"#33000000"
app:civ_border_width=
"1dp"
tools:ignore=
"ContentDescription"
/>
<TextView
android:id=
"@+id/tv_name_letters"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@drawable/bg_circle_ff8271"
android:gravity=
"center"
android:textColor=
"@color/white"
android:textSize=
"20sp"
android:textStyle=
"bold"
tools:text=
"V"
/>
</FrameLayout>
<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/tv_name_code"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:ellipsize=
"end"
android:includeFontPadding=
"false"
android:singleLine=
"true"
android:textColor=
"#001725"
android:textSize=
"16sp"
android:textStyle=
"bold"
tools:text=
"V0OC3RJK"
/>
<TextView
android:id=
"@+id/tv_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"8dp"
android:textColor=
"#81888D"
android:textSize=
"14sp"
tools:text=
"20:27"
/>
</LinearLayout>
<ImageView
android:id=
"@+id/iv_more"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginEnd=
"16dp"
android:src=
"@mipmap/gengduo_viwer"
tools:ignore=
"ContentDescription"
/>
</LinearLayout>
\ 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