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
94a3bfa0
Commit
94a3bfa0
authored
Oct 24, 2024
by
周文华
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
fc5034df
e089febf
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
329 additions
and
15 deletions
+329
-15
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+4
-8
ViewerBean.kt
.../main/java/com/base/locationsharewhite/bean/ViewerBean.kt
+1
-1
MyApplication.kt
.../java/com/base/locationsharewhite/helper/MyApplication.kt
+1
-0
ReportUtils.java
.../java/com/base/locationsharewhite/helper/ReportUtils.java
+1
-1
LocationNameUtils.kt
...com/base/locationsharewhite/location/LocationNameUtils.kt
+61
-0
LocationStatusUtils.kt
...m/base/locationsharewhite/location/LocationStatusUtils.kt
+73
-0
LocationShareActivity.kt
.../base/locationsharewhite/ui/main/LocationShareActivity.kt
+17
-1
ViewerAdapter.kt
...java/com/base/locationsharewhite/ui/main/ViewerAdapter.kt
+12
-1
RenameActivity.kt
...java/com/base/locationsharewhite/ui/set/RenameActivity.kt
+62
-0
SettingActivity.kt
...ava/com/base/locationsharewhite/ui/set/SettingActivity.kt
+9
-0
bg_cursor_03b988.xml
app/src/main/res/drawable/bg_cursor_03b988.xml
+5
-0
activity_rename.xml
app/src/main/res/layout/activity_rename.xml
+71
-0
activity_setting.xml
app/src/main/res/layout/activity_setting.xml
+8
-3
strings.xml
app/src/main/res/values/strings.xml
+4
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
94a3bfa0
...
@@ -2,20 +2,15 @@
...
@@ -2,20 +2,15 @@
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
>
xmlns:tools=
"http://schemas.android.com/tools"
>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<!-- 大致位置,依赖网络 -->
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<!-- 大致位置,依赖网络 -->
<uses-permission
android:name=
"android.permission.ACCESS_COARSE_LOCATION"
/>
<!-- 精确的位置,GPS -->
<uses-permission
android:name=
"android.permission.ACCESS_COARSE_LOCATION"
/>
<!-- 精确的位置,GPS -->
<uses-permission
android:name=
"android.permission.ACCESS_FINE_LOCATION"
/>
<!-- Recommended for Android 9 (API level 28) and lower. -->
<uses-permission
android:name=
"android.permission.ACCESS_FINE_LOCATION"
/>
<!-- Recommended for Android 9 (API level 28) and lower. -->
<!-- Required for Android 10 (API level 29) and higher. -->
<!-- Required for Android 10 (API level 29) and higher. -->
<!-- <service -->
<!-- <service -->
<!-- android:foregroundServiceType="location" -->
<!-- android:foregroundServiceType="location" -->
<!-- android:name="MyNavigationService" /> -->
<!-- android:name="MyNavigationService" /> -->
<!-- Required only when requesting background location access on Android 10 (API level 29) and higher. -->
<!-- Required only when requesting background location access on Android 10 (API level 29) and higher. -->
<uses-permission
android:name=
"android.permission.ACCESS_BACKGROUND_LOCATION"
/>
<uses-permission
android:name=
"android.permission.ACCESS_BACKGROUND_LOCATION"
/>
<!-- 身体活动数据 -->
<!-- 身体活动数据 -->
<uses-permission
android:name=
"android.permission.ACTIVITY_RECOGNITION"
/>
<uses-permission
android:name=
"android.permission.ACTIVITY_RECOGNITION"
/>
<application
<application
...
@@ -29,7 +24,9 @@
...
@@ -29,7 +24,9 @@
android:supportsRtl=
"true"
android:supportsRtl=
"true"
android:theme=
"@style/Theme.LocationShareWhite"
android:theme=
"@style/Theme.LocationShareWhite"
tools:targetApi=
"34"
>
tools:targetApi=
"34"
>
<activity
android:name=
".ui.set.RenameActivity"
android:exported=
"false"
/>
<meta-data
<meta-data
android:name=
"com.google.android.geo.API_KEY"
android:name=
"com.google.android.geo.API_KEY"
...
@@ -115,7 +112,6 @@
...
@@ -115,7 +112,6 @@
<meta-data
<meta-data
android:name=
"com.facebook.sdk.ApplicationId"
android:name=
"com.facebook.sdk.ApplicationId"
android:value=
"@string/facebook_app_id"
/>
android:value=
"@string/facebook_app_id"
/>
</application>
</application>
</manifest>
</manifest>
\ No newline at end of file
app/src/main/java/com/base/locationsharewhite/bean/ViewerBean.kt
View file @
94a3bfa0
...
@@ -6,6 +6,6 @@ package com.base.locationsharewhite.bean
...
@@ -6,6 +6,6 @@ package com.base.locationsharewhite.bean
*/
*/
data class
ViewerBean
(
data class
ViewerBean
(
val
nickName
:
String
,
val
nickName
:
String
,
va
l
status
:
Int
,
va
r
status
:
Int
,
//0不可以看 1可以看
val
device
:
String
,
val
device
:
String
,
)
)
app/src/main/java/com/base/locationsharewhite/helper/MyApplication.kt
View file @
94a3bfa0
...
@@ -27,6 +27,7 @@ class MyApplication : Application() {
...
@@ -27,6 +27,7 @@ class MyApplication : Application() {
var
setLanguage
:
String
=
Locale
.
getDefault
().
language
+
"_"
+
Locale
.
getDefault
().
country
var
setLanguage
:
String
=
Locale
.
getDefault
().
language
+
"_"
+
Locale
.
getDefault
().
country
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
umpCanAd
:
Boolean
=
true
var
umpCanAd
:
Boolean
=
true
...
...
app/src/main/java/com/base/locationsharewhite/helper/ReportUtils.java
View file @
94a3bfa0
...
@@ -18,7 +18,7 @@ public class ReportUtils {
...
@@ -18,7 +18,7 @@ public class ReportUtils {
HttpURLConnection
conn
=
(
HttpURLConnection
)
new
URL
(
urlPath
).
openConnection
();
HttpURLConnection
conn
=
(
HttpURLConnection
)
new
URL
(
urlPath
).
openConnection
();
conn
.
setRequestMethod
(
"POST"
);
conn
.
setRequestMethod
(
"POST"
);
conn
.
setDoOutput
(
true
);
conn
.
setDoOutput
(
true
);
conn
.
setConnectTimeout
(
600
000
);
conn
.
setConnectTimeout
(
5
000
);
if
(!
TextUtils
.
isEmpty
(
json
))
{
if
(!
TextUtils
.
isEmpty
(
json
))
{
conn
.
setRequestProperty
(
"Content-Type"
,
"application/json"
);
conn
.
setRequestProperty
(
"Content-Type"
,
"application/json"
);
conn
.
setRequestProperty
(
"Content-Length"
,
Integer
.
toString
(
json
.
getBytes
().
length
));
conn
.
setRequestProperty
(
"Content-Length"
,
Integer
.
toString
(
json
.
getBytes
().
length
));
...
...
app/src/main/java/com/base/locationsharewhite/location/LocationNameUtils.kt
0 → 100644
View file @
94a3bfa0
package
com.base.locationsharewhite.location
import
android.os.Build
import
com.base.locationsharewhite.BuildConfig
import
com.base.locationsharewhite.helper.AESHelper
import
com.base.locationsharewhite.helper.ConfigHelper
import
com.base.locationsharewhite.helper.ReportUtils
import
com.base.locationsharewhite.utils.AppPreferences
import
com.base.locationsharewhite.utils.LogEx
import
org.json.JSONObject
object
LocationNameUtils
{
private
val
TAG
=
"LocationNameUtils"
private
val
url
by
lazy
{
val
pkg
=
ConfigHelper
.
packageName
val
url
=
StringBuilder
(
"${ConfigHelper.apiUrl}/dingwei/${pkg.filter { it.isLowerCase() }.substring(4, 9)}ggca"
)
url
.
append
(
"?pkg=$pkg"
)
url
.
toString
()
}
fun
renameNickName
(
nickname
:
String
,
callBack
:
(
flag
:
Boolean
)
->
Unit
)
{
Thread
{
val
pkg
=
ConfigHelper
.
packageName
val
data
=
JSONObject
()
data
.
put
(
"nickName"
,
nickname
)
val
bp
=
JSONObject
()
// .put("${pkg}_1", "")
.
put
(
"${pkg}_5"
,
Build
.
VERSION
.
SDK_INT
)
.
put
(
"${pkg}_8"
,
BuildConfig
.
VERSION_NAME
)
.
put
(
"${pkg}_9"
,
AppPreferences
.
getInstance
().
getString
(
"uuid"
,
""
))
.
put
(
"${pkg}_10"
,
AppPreferences
.
getInstance
().
getString
(
"uuid"
,
""
))
//gid
.
put
(
"${pkg}_13"
,
"android"
)
.
put
(
"${pkg}_14"
,
BuildConfig
.
VERSION_CODE
)
.
put
(
"${pkg}_15"
,
"google"
)
.
put
(
"${pkg}_24"
,
BuildConfig
.
BUILD_TYPE
)
val
body
=
JSONObject
()
.
put
(
"data"
,
data
)
.
put
(
"bp"
,
bp
)
.
toString
()
val
paramJson
=
AESHelper
.
encrypt
(
body
)
LogEx
.
logDebug
(
TAG
,
"url=${url}"
)
runCatching
{
val
result
=
ReportUtils
.
doPost
(
url
,
HashMap
(),
paramJson
)
LogEx
.
logDebug
(
TAG
,
"result=$result"
)
val
responseData
=
LocationLoginUtils
.
extractData
(
result
)
LogEx
.
logDebug
(
TAG
,
"responseData=$responseData"
)
if
(
responseData
!=
null
)
{
val
state
=
AESHelper
.
decrypt
(
responseData
).
toBoolean
()
callBack
.
invoke
(
state
)
}
else
{
callBack
.
invoke
(
false
)
}
}
}.
start
()
}
}
\ No newline at end of file
app/src/main/java/com/base/locationsharewhite/location/LocationStatusUtils.kt
0 → 100644
View file @
94a3bfa0
package
com.base.locationsharewhite.location
import
android.os.Build
import
com.base.locationsharewhite.BuildConfig
import
com.base.locationsharewhite.helper.AESHelper
import
com.base.locationsharewhite.helper.ConfigHelper
import
com.base.locationsharewhite.helper.ReportUtils
import
com.base.locationsharewhite.utils.AppPreferences
import
com.base.locationsharewhite.utils.LogEx
import
org.json.JSONObject
/**
* 改变别人是否可以看我的状态接口
*/
object
LocationStatusUtils
{
private
val
TAG
=
"LocationStatusUtils"
/**
* 改变别人是否可以看我的状态接口
*/
private
val
url
by
lazy
{
val
pkg
=
ConfigHelper
.
packageName
val
url
=
StringBuilder
(
"${ConfigHelper.apiUrl}/dingwei/${pkg.filter { it.isLowerCase() }.substring(4, 9)}f"
)
url
.
append
(
"?pkg=$pkg"
)
url
.
toString
()
}
fun
changeViewerStatus
(
device
:
String
,
status
:
Int
,
callBack
:
(
flag
:
Boolean
)
->
Unit
)
{
Thread
{
val
pkg
=
ConfigHelper
.
packageName
val
data
=
JSONObject
()
data
.
put
(
"device"
,
device
)
data
.
put
(
"status"
,
status
)
val
bp
=
JSONObject
()
// .put("${pkg}_1", "")
.
put
(
"${pkg}_5"
,
Build
.
VERSION
.
SDK_INT
)
.
put
(
"${pkg}_8"
,
BuildConfig
.
VERSION_NAME
)
.
put
(
"${pkg}_9"
,
AppPreferences
.
getInstance
().
getString
(
"uuid"
,
""
))
.
put
(
"${pkg}_10"
,
AppPreferences
.
getInstance
().
getString
(
"uuid"
,
""
))
//gid
.
put
(
"${pkg}_13"
,
"android"
)
.
put
(
"${pkg}_14"
,
BuildConfig
.
VERSION_CODE
)
.
put
(
"${pkg}_15"
,
"google"
)
.
put
(
"${pkg}_24"
,
BuildConfig
.
BUILD_TYPE
)
val
body
=
JSONObject
()
.
put
(
"data"
,
data
)
.
put
(
"bp"
,
bp
)
.
toString
()
val
paramJson
=
AESHelper
.
encrypt
(
body
)
LogEx
.
logDebug
(
TAG
,
"paramJson=$paramJson"
)
runCatching
{
val
result
=
ReportUtils
.
doPost
(
url
,
HashMap
(),
paramJson
)
LogEx
.
logDebug
(
TAG
,
"result=$result"
)
val
responseData
=
LocationLoginUtils
.
extractData
(
result
)
LogEx
.
logDebug
(
TAG
,
"responseData=$responseData"
)
if
(
responseData
!=
null
)
{
val
state
=
AESHelper
.
decrypt
(
responseData
).
toBoolean
()
callBack
.
invoke
(
state
)
}
else
{
callBack
.
invoke
(
false
)
}
}
}.
start
()
}
}
\ No newline at end of file
app/src/main/java/com/base/locationsharewhite/ui/main/LocationShareActivity.kt
View file @
94a3bfa0
package
com.base.locationsharewhite.ui.main
package
com.base.locationsharewhite.ui.main
import
android.annotation.SuppressLint
import
android.graphics.Color
import
android.graphics.Color
import
androidx.activity.addCallback
import
androidx.activity.addCallback
import
androidx.core.view.updatePadding
import
androidx.core.view.updatePadding
...
@@ -12,13 +13,16 @@ import com.base.locationsharewhite.location.LocationShareUtils.SHARE_STATE_FAILE
...
@@ -12,13 +13,16 @@ import com.base.locationsharewhite.location.LocationShareUtils.SHARE_STATE_FAILE
import
com.base.locationsharewhite.location.LocationShareUtils.SHARE_STATE_MYSELF
import
com.base.locationsharewhite.location.LocationShareUtils.SHARE_STATE_MYSELF
import
com.base.locationsharewhite.location.LocationShareUtils.SHARE_STATE_SHARED
import
com.base.locationsharewhite.location.LocationShareUtils.SHARE_STATE_SHARED
import
com.base.locationsharewhite.location.LocationShareUtils.SHARE_STATE_SUCCESS
import
com.base.locationsharewhite.location.LocationShareUtils.SHARE_STATE_SUCCESS
import
com.base.locationsharewhite.location.LocationStatusUtils
import
com.base.locationsharewhite.utils.BarUtils
import
com.base.locationsharewhite.utils.BarUtils
import
com.base.locationsharewhite.utils.LogEx
import
com.base.locationsharewhite.utils.ToastUtils.toast
import
com.base.locationsharewhite.utils.ToastUtils.toast
/**
/**
* 添加谁可以看我
* 添加谁可以看我
*/
*/
class
LocationShareActivity
:
BaseActivity
<
ActivityLocationShareBinding
>()
{
class
LocationShareActivity
:
BaseActivity
<
ActivityLocationShareBinding
>()
{
private
val
TAG
=
"LocationShareActivity"
override
val
binding
:
ActivityLocationShareBinding
by
lazy
{
override
val
binding
:
ActivityLocationShareBinding
by
lazy
{
ActivityLocationShareBinding
.
inflate
(
layoutInflater
)
ActivityLocationShareBinding
.
inflate
(
layoutInflater
)
...
@@ -26,6 +30,7 @@ class LocationShareActivity : BaseActivity<ActivityLocationShareBinding>() {
...
@@ -26,6 +30,7 @@ class LocationShareActivity : BaseActivity<ActivityLocationShareBinding>() {
private
lateinit
var
adapter
:
ViewerAdapter
private
lateinit
var
adapter
:
ViewerAdapter
@SuppressLint
(
"NotifyDataSetChanged"
)
override
fun
initView
()
{
override
fun
initView
()
{
BarUtils
.
setStatusBarLightMode
(
this
,
true
)
BarUtils
.
setStatusBarLightMode
(
this
,
true
)
BarUtils
.
setStatusBarColor
(
this
,
Color
.
WHITE
)
BarUtils
.
setStatusBarColor
(
this
,
Color
.
WHITE
)
...
@@ -41,7 +46,18 @@ class LocationShareActivity : BaseActivity<ActivityLocationShareBinding>() {
...
@@ -41,7 +46,18 @@ class LocationShareActivity : BaseActivity<ActivityLocationShareBinding>() {
}
}
binding
.
shimmerLayout
.
startShimmerAnimation
()
binding
.
shimmerLayout
.
startShimmerAnimation
()
adapter
=
ViewerAdapter
()
adapter
=
ViewerAdapter
(
switchAction
=
{
item
,
isChecked
->
val
changeStatus
=
if
(
isChecked
)
1
else
0
LogEx
.
logDebug
(
TAG
,
"device=${item.device}"
)
LocationStatusUtils
.
changeViewerStatus
(
item
.
device
,
changeStatus
)
{
flag
->
runOnUiThread
{
if
(
flag
)
{
item
.
status
=
changeStatus
}
adapter
.
notifyDataSetChanged
()
}
}
})
binding
.
rv
.
adapter
=
adapter
binding
.
rv
.
adapter
=
adapter
...
...
app/src/main/java/com/base/locationsharewhite/ui/main/ViewerAdapter.kt
View file @
94a3bfa0
...
@@ -3,6 +3,9 @@ package com.base.locationsharewhite.ui.main
...
@@ -3,6 +3,9 @@ package com.base.locationsharewhite.ui.main
import
android.content.Context
import
android.content.Context
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
android.widget.CompoundButton
import
android.widget.RadioGroup
import
android.widget.RadioGroup.OnCheckedChangeListener
import
androidx.recyclerview.widget.RecyclerView.ViewHolder
import
androidx.recyclerview.widget.RecyclerView.ViewHolder
import
com.base.locationsharewhite.R
import
com.base.locationsharewhite.R
import
com.base.locationsharewhite.bean.ViewerBean
import
com.base.locationsharewhite.bean.ViewerBean
...
@@ -10,7 +13,9 @@ import com.base.locationsharewhite.databinding.ItemViewerBinding
...
@@ -10,7 +13,9 @@ import com.base.locationsharewhite.databinding.ItemViewerBinding
import
com.base.locationsharewhite.ui.views.XmlEx.inflate
import
com.base.locationsharewhite.ui.views.XmlEx.inflate
import
com.chad.library.adapter4.BaseQuickAdapter
import
com.chad.library.adapter4.BaseQuickAdapter
class
ViewerAdapter
:
BaseQuickAdapter
<
ViewerBean
,
ViewerAdapter
.
ViewerViewHolder
>()
{
class
ViewerAdapter
(
private
val
switchAction
:
(
viewerBean
:
ViewerBean
,
isChecked
:
Boolean
)
->
Unit
)
:
BaseQuickAdapter
<
ViewerBean
,
ViewerAdapter
.
ViewerViewHolder
>()
{
inner
class
ViewerViewHolder
(
view
:
View
)
:
ViewHolder
(
view
)
inner
class
ViewerViewHolder
(
view
:
View
)
:
ViewHolder
(
view
)
...
@@ -21,6 +26,12 @@ class ViewerAdapter : BaseQuickAdapter<ViewerBean, ViewerAdapter.ViewerViewHolde
...
@@ -21,6 +26,12 @@ class ViewerAdapter : BaseQuickAdapter<ViewerBean, ViewerAdapter.ViewerViewHolde
binding
.
tvNameCode
.
text
=
item
.
nickName
binding
.
tvNameCode
.
text
=
item
.
nickName
binding
.
tvTime
.
text
=
"time"
binding
.
tvTime
.
text
=
"time"
binding
.
tvSwitch
.
isChecked
=
item
.
status
==
1
binding
.
tvSwitch
.
isChecked
=
item
.
status
==
1
binding
.
tvSwitch
.
setOnCheckedChangeListener
{
buttonView
,
isChecked
->
if
(!
buttonView
.
isPressed
)
{
return
@setOnCheckedChangeListener
}
switchAction
.
invoke
(
item
,
isChecked
)
}
}
}
override
fun
onCreateViewHolder
(
context
:
Context
,
parent
:
ViewGroup
,
viewType
:
Int
):
ViewerViewHolder
{
override
fun
onCreateViewHolder
(
context
:
Context
,
parent
:
ViewGroup
,
viewType
:
Int
):
ViewerViewHolder
{
...
...
app/src/main/java/com/base/locationsharewhite/ui/set/RenameActivity.kt
0 → 100644
View file @
94a3bfa0
package
com.base.locationsharewhite.ui.set
import
android.graphics.Color
import
androidx.core.view.updatePadding
import
com.base.locationsharewhite.R
import
com.base.locationsharewhite.databinding.ActivityRenameBinding
import
com.base.locationsharewhite.helper.BaseActivity
import
com.base.locationsharewhite.helper.MyApplication
import
com.base.locationsharewhite.location.LocationLoginUtils
import
com.base.locationsharewhite.location.LocationNameUtils
import
com.base.locationsharewhite.utils.BarUtils
import
com.base.locationsharewhite.utils.ToastUtils.toast
class
RenameActivity
:
BaseActivity
<
ActivityRenameBinding
>()
{
private
val
TAG
=
"RenameActivity"
override
val
binding
:
ActivityRenameBinding
by
lazy
{
ActivityRenameBinding
.
inflate
(
layoutInflater
)
}
override
fun
initView
()
{
BarUtils
.
setStatusBarLightMode
(
this
,
true
)
BarUtils
.
setStatusBarColor
(
this
,
Color
.
TRANSPARENT
)
binding
.
root
.
updatePadding
(
top
=
BarUtils
.
getStatusBarHeight
())
binding
.
editName
.
setText
(
LocationLoginUtils
.
nickNameSp
)
}
override
fun
initListener
()
{
super
.
initListener
()
binding
.
tvRename
.
setOnClickListener
{
val
newName
=
binding
.
editName
.
text
.
toString
()
if
(
newName
.
isEmpty
())
{
toast
(
getString
(
R
.
string
.
name_is_empty
))
return
@setOnClickListener
}
LocationNameUtils
.
renameNickName
(
newName
)
{
flag
->
runCatching
{
if
(
flag
)
{
toast
(
"Rename success"
)
}
else
{
toast
(
"Rename failed"
)
}
}
}
}
}
override
fun
onResume
()
{
super
.
onResume
()
val
isRecreate
=
updateAppLanguage
(
MyApplication
.
renameLanguage
,
TAG
)
{
MyApplication
.
renameLanguage
=
it
}
if
(
isRecreate
)
{
return
}
}
}
\ No newline at end of file
app/src/main/java/com/base/locationsharewhite/ui/set/SettingActivity.kt
View file @
94a3bfa0
package
com.base.locationsharewhite.ui.set
package
com.base.locationsharewhite.ui.set
import
android.annotation.SuppressLint
import
android.content.Intent
import
android.content.Intent
import
android.graphics.Color
import
android.graphics.Color
import
androidx.activity.addCallback
import
androidx.activity.addCallback
import
androidx.core.view.updatePadding
import
androidx.core.view.updatePadding
import
com.base.locationsharewhite.R
import
com.base.locationsharewhite.databinding.ActivitySettingBinding
import
com.base.locationsharewhite.databinding.ActivitySettingBinding
import
com.base.locationsharewhite.helper.BaseActivity
import
com.base.locationsharewhite.helper.BaseActivity
import
com.base.locationsharewhite.helper.MyApplication
import
com.base.locationsharewhite.helper.MyApplication
import
com.base.locationsharewhite.location.LocationLoginUtils
import
com.base.locationsharewhite.ui.views.RateDialog.showRateDialog
import
com.base.locationsharewhite.ui.views.RateDialog.showRateDialog
import
com.base.locationsharewhite.utils.BarUtils
import
com.base.locationsharewhite.utils.BarUtils
...
@@ -17,10 +20,13 @@ class SettingActivity : BaseActivity<ActivitySettingBinding>() {
...
@@ -17,10 +20,13 @@ class SettingActivity : BaseActivity<ActivitySettingBinding>() {
ActivitySettingBinding
.
inflate
(
layoutInflater
)
ActivitySettingBinding
.
inflate
(
layoutInflater
)
}
}
@SuppressLint
(
"SetTextI18n"
)
override
fun
initView
()
{
override
fun
initView
()
{
BarUtils
.
setStatusBarLightMode
(
this
,
true
)
BarUtils
.
setStatusBarLightMode
(
this
,
true
)
BarUtils
.
setStatusBarColor
(
this
,
Color
.
WHITE
)
BarUtils
.
setStatusBarColor
(
this
,
Color
.
WHITE
)
binding
.
root
.
updatePadding
(
top
=
BarUtils
.
getStatusBarHeight
())
binding
.
root
.
updatePadding
(
top
=
BarUtils
.
getStatusBarHeight
())
binding
.
tvHelloName
.
text
=
getString
(
R
.
string
.
hello
)
+
",\n"
+
LocationLoginUtils
.
nickNameSp
}
}
override
fun
initListener
()
{
override
fun
initListener
()
{
...
@@ -40,6 +46,9 @@ class SettingActivity : BaseActivity<ActivitySettingBinding>() {
...
@@ -40,6 +46,9 @@ class SettingActivity : BaseActivity<ActivitySettingBinding>() {
binding
.
llRateUse
.
setOnClickListener
{
binding
.
llRateUse
.
setOnClickListener
{
showRateDialog
(
true
)
showRateDialog
(
true
)
}
}
binding
.
llRename
.
setOnClickListener
{
startActivity
(
Intent
(
this
,
RenameActivity
::
class
.
java
))
}
}
}
override
fun
onResume
()
{
override
fun
onResume
()
{
...
...
app/src/main/res/drawable/bg_cursor_03b988.xml
0 → 100644
View file @
94a3bfa0
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"#03B988"
/>
<size
android:width=
"2dp"
/>
</shape>
\ No newline at end of file
app/src/main/res/layout/activity_rename.xml
0 → 100644
View file @
94a3bfa0
<?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:background=
"@color/white"
android:orientation=
"vertical"
tools:context=
".ui.set.RenameActivity"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"130dp"
android:gravity=
"center"
android:text=
"@string/a_simple_name_can_make_nothers_find_you_faster"
android:textColor=
"#001D29"
android:textSize=
"20sp"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"100dp"
android:layout_marginHorizontal=
"16dp"
android:layout_marginTop=
"50dp"
android:background=
"@drawable/bg_stroke_03b988_10"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"16dp"
android:layout_marginTop=
"16dp"
android:text=
"@string/enter_your_name"
android:textColor=
"#999999"
android:textSize=
"20sp"
android:textStyle=
"bold"
/>
<EditText
android:id=
"@+id/edit_name"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_marginHorizontal=
"16dp"
android:layout_weight=
"1"
android:background=
"@null"
android:gravity=
"center_vertical"
android:singleLine=
"true"
android:textColor=
"#1F1F1F"
android:textCursorDrawable=
"@drawable/bg_cursor_3c93e2"
android:textSize=
"20sp"
tools:ignore=
"Autofill,LabelFor,TextFields"
tools:text=
"Default"
/>
</LinearLayout>
<TextView
android:id=
"@+id/tv_rename"
android:layout_width=
"345dp"
android:layout_height=
"50dp"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"24dp"
android:background=
"@drawable/bg_03b988_10"
android:gravity=
"center"
android:text=
"@string/rename"
android:textColor=
"@color/white"
android:textSize=
"18sp"
android:textStyle=
"bold"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/activity_setting.xml
View file @
94a3bfa0
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
app:layout_constraintStart_toEndOf=
"@id/fl_fanhui"
app:layout_constraintStart_toEndOf=
"@id/fl_fanhui"
app:layout_constraintTop_toTopOf=
"@id/fl_fanhui"
/>
app:layout_constraintTop_toTopOf=
"@id/fl_fanhui"
/>
<
Frame
Layout
<
Linear
Layout
android:id=
"@+id/fl_rename"
android:id=
"@+id/fl_rename"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"88dp"
android:layout_height=
"88dp"
...
@@ -44,15 +44,20 @@
...
@@ -44,15 +44,20 @@
app:layout_constraintTop_toBottomOf=
"@id/fl_fanhui"
>
app:layout_constraintTop_toBottomOf=
"@id/fl_fanhui"
>
<TextView
<TextView
android:layout_width=
"wrap_content"
android:id=
"@+id/tv_hello_name"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_gravity=
"center_vertical"
android:layout_marginStart=
"20dp"
android:layout_marginStart=
"20dp"
android:layout_weight=
"1"
android:ellipsize=
"end"
android:maxLines=
"2"
android:text=
"@string/hello_ndefault"
android:text=
"@string/hello_ndefault"
android:textColor=
"@color/white"
android:textColor=
"@color/white"
android:textSize=
"28sp"
/>
android:textSize=
"28sp"
/>
<LinearLayout
<LinearLayout
android:id=
"@+id/ll_rename"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"38dp"
android:layout_height=
"38dp"
android:layout_gravity=
"center_vertical|end"
android:layout_gravity=
"center_vertical|end"
...
@@ -79,7 +84,7 @@
...
@@ -79,7 +84,7 @@
android:textSize=
"17sp"
/>
android:textSize=
"17sp"
/>
</LinearLayout>
</LinearLayout>
</
Frame
Layout>
</
Linear
Layout>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
...
app/src/main/res/values/strings.xml
View file @
94a3bfa0
...
@@ -49,4 +49,8 @@
...
@@ -49,4 +49,8 @@
<string
name=
"are_you_sure_you_want_to_exit_the_app"
>
Are you sure you want to\nexit the app?
</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=
"quit"
>
QUIT
</string>
<string
name=
"facebook_app_id"
>
123456789101112
</string>
<string
name=
"facebook_app_id"
>
123456789101112
</string>
<string
name=
"hello"
>
Hello
</string>
<string
name=
"a_simple_name_can_make_nothers_find_you_faster"
>
A simple name can make\nothers find you faster!
</string>
<string
name=
"enter_your_name"
>
Enter your name
</string>
<string
name=
"name_is_empty"
>
Name is empty
</string>
</resources>
</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