Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_street
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_street
Commits
101d6b03
Commit
101d6b03
authored
Jul 20, 2021
by
mengcuiguang2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加工具类防止连点击,无线网络,添加oaid,联调支付宝等
parent
c5e73b85
Changes
24
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
588 additions
and
27 deletions
+588
-27
AppApplication.kt
app/src/main/java/com/mints/street/AppApplication.kt
+0
-1
CsjGroMoreManager.kt
app/src/main/java/com/mints/street/ad/CsjGroMoreManager.kt
+1
-1
TTGroMoreAdManagerHolder.java
...in/java/com/mints/street/ad/TTGroMoreAdManagerHolder.java
+0
-2
MainApi.kt
app/src/main/java/com/mints/street/api/MainApi.kt
+8
-0
LoginViewModel.kt
app/src/main/java/com/mints/street/login/LoginViewModel.kt
+3
-4
MainActivity.kt
app/src/main/java/com/mints/street/main/MainActivity.kt
+3
-5
HomeFragment.kt
app/src/main/java/com/mints/street/main/home/HomeFragment.kt
+7
-0
HomeViewModel.kt
...src/main/java/com/mints/street/main/home/HomeViewModel.kt
+37
-0
AboutusActivity.kt
...src/main/java/com/mints/street/main/my/AboutusActivity.kt
+12
-0
MyFragment.kt
app/src/main/java/com/mints/street/main/my/MyFragment.kt
+13
-2
MyViewModel.kt
app/src/main/java/com/mints/street/main/my/MyViewModel.kt
+2
-3
PermissionsActivity.kt
...main/java/com/mints/street/main/my/PermissionsActivity.kt
+16
-0
UserManager.kt
app/src/main/java/com/mints/street/manager/UserManager.kt
+2
-2
MiitHelper.java
...c/main/java/com/mints/street/manager/oaid/MiitHelper.java
+82
-0
OaidManager.kt
...rc/main/java/com/mints/street/manager/oaid/OaidManager.kt
+24
-0
ApiModel.kt
app/src/main/java/com/mints/street/model/ApiModel.kt
+8
-0
SplashActivity.kt
app/src/main/java/com/mints/street/splash/SplashActivity.kt
+4
-4
NetUtils.java
app/src/main/java/com/mints/street/utils/NetUtils.java
+212
-0
AntiShake.java
.../java/com/mints/street/utils/nodoubleclick/AntiShake.java
+22
-0
LimitQueue.java
...java/com/mints/street/utils/nodoubleclick/LimitQueue.java
+64
-0
NoDoubleClickListener.java
...nts/street/utils/nodoubleclick/NoDoubleClickListener.java
+32
-0
OneClick.java
...n/java/com/mints/street/utils/nodoubleclick/OneClick.java
+33
-0
activity_aboutus.xml
app/src/main/res/layout/activity_aboutus.xml
+2
-2
view_data_page2.xml
app/src/main/res/layout/view_data_page2.xml
+1
-1
No files found.
app/src/main/java/com/mints/street/AppApplication.kt
View file @
101d6b03
...
@@ -9,7 +9,6 @@ import com.baidu.mapapi.SDKInitializer
...
@@ -9,7 +9,6 @@ import com.baidu.mapapi.SDKInitializer
import
com.cuieney.rxpay_annotation.WX
import
com.cuieney.rxpay_annotation.WX
import
com.fry.base.base.BaseApp
import
com.fry.base.base.BaseApp
import
com.mints.street.main.vr.PanoramicActivity
import
com.mints.street.main.vr.PanoramicActivity
import
com.mints.street.manager.CsjGroMoreManager
import
com.mints.street.manager.UmengManager
import
com.mints.street.manager.UmengManager
import
com.orhanobut.logger.AndroidLogAdapter
import
com.orhanobut.logger.AndroidLogAdapter
import
com.orhanobut.logger.FormatStrategy
import
com.orhanobut.logger.FormatStrategy
...
...
app/src/main/java/com/mints/street/
manager
/CsjGroMoreManager.kt
→
app/src/main/java/com/mints/street/
ad
/CsjGroMoreManager.kt
View file @
101d6b03
package
com.mints.street.
manager
package
com.mints.street.
ad
import
com.mints.street.AppApplication
import
com.mints.street.AppApplication
import
com.mints.street.ad.TTGroMoreAdManagerHolder
import
com.mints.street.ad.TTGroMoreAdManagerHolder
...
...
app/src/main/java/com/mints/street/ad/TTGroMoreAdManagerHolder.java
View file @
101d6b03
package
com
.
mints
.
street
.
ad
;
package
com
.
mints
.
street
.
ad
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.Context
;
import
android.provider.Settings
;
import
android.provider.Settings
;
...
@@ -10,7 +9,6 @@ import com.bytedance.msdk.api.TTMediationAdSdk;
...
@@ -10,7 +9,6 @@ import com.bytedance.msdk.api.TTMediationAdSdk;
import
com.bytedance.msdk.api.UserInfoForSegment
;
import
com.bytedance.msdk.api.UserInfoForSegment
;
import
com.mints.street.common.Constant
;
import
com.mints.street.common.Constant
;
import
com.mints.street.BuildConfig
;
import
com.mints.street.BuildConfig
;
import
com.mints.street.manager.CsjGroMoreManager
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
...
...
app/src/main/java/com/mints/street/api/MainApi.kt
View file @
101d6b03
...
@@ -17,6 +17,14 @@ interface MainApi {
...
@@ -17,6 +17,14 @@ interface MainApi {
}
}
}
}
/**
* 打开激活
*
* @return
*/
@POST
(
"na/saveTerminalInfo"
)
fun
comSaveTerminalInfo
(
@Body
vo
:
Map
<
String
,
Any
>):
Observable
<
Response
<
BaseResponse
<
Any
>>>
/**
/**
* 获取验证码
* 获取验证码
*
*
...
...
app/src/main/java/com/mints/street/login/LoginViewModel.kt
View file @
101d6b03
...
@@ -6,6 +6,7 @@ import com.mints.street.bean.BaseResponse
...
@@ -6,6 +6,7 @@ import com.mints.street.bean.BaseResponse
import
com.mints.street.bean.UserBean
import
com.mints.street.bean.UserBean
import
com.mints.street.common.DeviceInfo
import
com.mints.street.common.DeviceInfo
import
com.mints.street.manager.UserManager
import
com.mints.street.manager.UserManager
import
com.mints.street.manager.oaid.OaidManager
import
com.mints.street.model.ApiModel
import
com.mints.street.model.ApiModel
import
com.mints.street.netwrok.base.HttpSubscribeImpl
import
com.mints.street.netwrok.base.HttpSubscribeImpl
import
com.mints.street.utils.DeviceUuidFactory
import
com.mints.street.utils.DeviceUuidFactory
...
@@ -65,7 +66,7 @@ class LoginViewModel(application: Application) : BaseViewModel(application) {
...
@@ -65,7 +66,7 @@ class LoginViewModel(application: Application) : BaseViewModel(application) {
override
fun
onBusinessSuccess
(
response
:
BaseResponse
<
UserBean
>)
{
override
fun
onBusinessSuccess
(
response
:
BaseResponse
<
UserBean
>)
{
//提交设备信息【注:这里海哥的意思是说在测试的环境下,进行当前的注册是利用手机号进行注册,由于开通了微信登录,就不需要再手机号登录的时候进行设备信息的提交】
//提交设备信息【注:这里海哥的意思是说在测试的环境下,进行当前的注册是利用手机号进行注册,由于开通了微信登录,就不需要再手机号登录的时候进行设备信息的提交】
//
this@LoginViewModel.saveTerminalInfo()
this
@LoginViewModel
.
saveTerminalInfo
()
//保存用户信息到Usermanager
//保存用户信息到Usermanager
UserManager
.
INSTANCE
.
saveUserInfo
(
response
.
result
)
UserManager
.
INSTANCE
.
saveUserInfo
(
response
.
result
)
...
@@ -96,9 +97,7 @@ class LoginViewModel(application: Application) : BaseViewModel(application) {
...
@@ -96,9 +97,7 @@ class LoginViewModel(application: Application) : BaseViewModel(application) {
vo
[
"mac1"
]
=
macAddress
vo
[
"mac1"
]
=
macAddress
vo
[
"androidid"
]
=
deviceInfo
.
getAndroidId
(
null
)
vo
[
"androidid"
]
=
deviceInfo
.
getAndroidId
(
null
)
vo
[
"imei"
]
=
deviceInfo
.
iMEI
vo
[
"imei"
]
=
deviceInfo
.
iMEI
// if (!TextUtils.isEmpty(App.OAID)) {
vo
[
"oaid"
]
=
OaidManager
.
getOaid
()
// vo["oaid"] = App.OAID
// }
vo
[
"os"
]
=
"android"
vo
[
"os"
]
=
"android"
vo
[
"model"
]
=
deviceInfo
.
newModel
vo
[
"model"
]
=
deviceInfo
.
newModel
vo
[
"uuid"
]
=
DeviceUuidFactory
().
deviceUuid
vo
[
"uuid"
]
=
DeviceUuidFactory
().
deviceUuid
...
...
app/src/main/java/com/mints/street/main/MainActivity.kt
View file @
101d6b03
...
@@ -21,6 +21,7 @@ import com.mints.street.main.home.SearchMapActivity
...
@@ -21,6 +21,7 @@ import com.mints.street.main.home.SearchMapActivity
import
com.mints.street.main.my.MyFragment
import
com.mints.street.main.my.MyFragment
import
com.mints.street.main.vr.VRFragment
import
com.mints.street.main.vr.VRFragment
import
com.mints.street.manager.UmengManager
import
com.mints.street.manager.UmengManager
import
com.mints.street.manager.oaid.OaidManager
import
com.tbruyelle.rxpermissions2.RxPermissions
import
com.tbruyelle.rxpermissions2.RxPermissions
import
com.umeng.analytics.MobclickAgent
import
com.umeng.analytics.MobclickAgent
import
me.goldze.mvvmhabit.base.AppManager
import
me.goldze.mvvmhabit.base.AppManager
...
@@ -40,6 +41,8 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
...
@@ -40,6 +41,8 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
}
}
override
fun
initData
()
{
override
fun
initData
()
{
super
.
initData
()
super
.
initData
()
OaidManager
.
init
()
//初始化viewpager2
//初始化viewpager2
binding
.
mainViewpager
.
initMain
(
this
)
binding
.
mainViewpager
.
initMain
(
this
)
...
@@ -65,11 +68,6 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
...
@@ -65,11 +68,6 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
R
.
id
.
menu_my
R
.
id
.
menu_my
)
)
// test
UmengManager
.
initUm
()
val
rxPermissions
=
RxPermissions
(
this
)
val
rxPermissions
=
RxPermissions
(
this
)
rxPermissions
.
request
(
Manifest
.
permission
.
ACCESS_COARSE_LOCATION
,
rxPermissions
.
request
(
Manifest
.
permission
.
ACCESS_COARSE_LOCATION
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
,
...
...
app/src/main/java/com/mints/street/main/home/HomeFragment.kt
View file @
101d6b03
...
@@ -26,6 +26,7 @@ import com.mints.street.BR
...
@@ -26,6 +26,7 @@ import com.mints.street.BR
import
com.mints.street.R
import
com.mints.street.R
import
com.mints.street.bean.PositioningBean
import
com.mints.street.bean.PositioningBean
import
com.mints.street.databinding.FragmentHomeBinding
import
com.mints.street.databinding.FragmentHomeBinding
import
com.mints.street.manager.UmengManager
import
com.mints.street.webview.MintsWebViewActivity
import
com.mints.street.webview.MintsWebViewActivity
import
me.goldze.mvvmhabit.base.AppManager
import
me.goldze.mvvmhabit.base.AppManager
import
me.goldze.mvvmhabit.utils.KLog
import
me.goldze.mvvmhabit.utils.KLog
...
@@ -87,7 +88,13 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE
...
@@ -87,7 +88,13 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE
override
fun
onActivityCreated
(
savedInstanceState
:
Bundle
?)
{
override
fun
onActivityCreated
(
savedInstanceState
:
Bundle
?)
{
super
.
onActivityCreated
(
savedInstanceState
)
super
.
onActivityCreated
(
savedInstanceState
)
initMap
()
initMap
()
// 打开激活
uploadDeviceInfo
()
}
private
fun
uploadDeviceInfo
()
{
UmengManager
.
initUm
()
}
}
override
fun
initData
()
{
override
fun
initData
()
{
...
...
app/src/main/java/com/mints/street/main/home/HomeViewModel.kt
View file @
101d6b03
...
@@ -7,7 +7,14 @@ import androidx.lifecycle.MutableLiveData
...
@@ -7,7 +7,14 @@ import androidx.lifecycle.MutableLiveData
import
com.google.gson.Gson
import
com.google.gson.Gson
import
com.mints.street.BR
import
com.mints.street.BR
import
com.mints.street.R
import
com.mints.street.R
import
com.mints.street.bean.BaseResponse
import
com.mints.street.bean.MapBean
import
com.mints.street.bean.MapBean
import
com.mints.street.bean.VipBean
import
com.mints.street.common.DeviceInfo
import
com.mints.street.manager.oaid.OaidManager
import
com.mints.street.model.ApiModel
import
com.mints.street.netwrok.base.HttpSubscribeImpl
import
com.mints.street.utils.DeviceUuidFactory
import
me.goldze.mvvmhabit.base.AppManager
import
me.goldze.mvvmhabit.base.AppManager
import
me.goldze.mvvmhabit.base.BaseViewModel
import
me.goldze.mvvmhabit.base.BaseViewModel
import
me.goldze.mvvmhabit.binding.command.BindingAction
import
me.goldze.mvvmhabit.binding.command.BindingAction
...
@@ -59,6 +66,36 @@ class HomeViewModel(application: Application):BaseViewModel(application) {
...
@@ -59,6 +66,36 @@ class HomeViewModel(application: Application):BaseViewModel(application) {
}
}
}
}
/**
* 打开激活
*/
fun
comSaveTerminalInfo
()
{
val
vo
=
HashMap
<
String
,
Any
>()
val
deviceInfo
=
DeviceInfo
.
instance
val
macAddress
:
String
=
deviceInfo
.
getMacAddress
()
val
mac
=
macAddress
.
replace
(
":"
,
""
)
vo
[
"mac"
]
=
mac
vo
[
"mac1"
]
=
macAddress
vo
[
"androidid"
]
=
deviceInfo
.
getAndroidId
(
null
)
vo
[
"imei"
]
=
deviceInfo
.
iMEI
vo
[
"oaid"
]
=
OaidManager
.
getOaid
()
vo
[
"os"
]
=
"android"
vo
[
"model"
]
=
deviceInfo
.
newModel
vo
[
"uuid"
]
=
DeviceUuidFactory
().
deviceUuid
vo
[
"osversion"
]
=
deviceInfo
.
oSVersion
vo
[
"appversion"
]
=
deviceInfo
.
versionName
ApiModel
.
comSaveTerminalInfo
(
lifecycleProvider
,
vo
).
safeSubscribe
(
object
:
HttpSubscribeImpl
<
BaseResponse
<
Any
>>(
this
@HomeViewModel
,
true
)
{
override
fun
onBusinessSuccess
(
response
:
BaseResponse
<
Any
>)
{
}
override
fun
onError
(
e
:
Throwable
)
{
}
})
}
override
fun
onActivityResult
(
requestCode
:
Int
,
resultCode
:
Int
,
data
:
Intent
?)
{
override
fun
onActivityResult
(
requestCode
:
Int
,
resultCode
:
Int
,
data
:
Intent
?)
{
if
(
requestCode
==
200
&&
resultCode
==
SearchMapActivity
.
REQUEST_CODE
){
if
(
requestCode
==
200
&&
resultCode
==
SearchMapActivity
.
REQUEST_CODE
){
data
?.
let
{
data
?.
let
{
...
...
app/src/main/java/com/mints/street/main/my/AboutusActivity.kt
View file @
101d6b03
...
@@ -3,13 +3,18 @@ package com.mints.street.main.my
...
@@ -3,13 +3,18 @@ package com.mints.street.main.my
import
android.graphics.Color
import
android.graphics.Color
import
android.os.Bundle
import
android.os.Bundle
import
android.view.View
import
android.view.View
import
com.blankj.utilcode.util.ToastUtils
import
com.bytedance.hume.readapk.HumeSDK
import
com.mints.street.databinding.ActivityAboutusBinding
import
com.mints.street.databinding.ActivityAboutusBinding
import
com.fry.base.base.BaseActivity
import
com.fry.base.base.BaseActivity
import
com.mints.street.AppApplication
import
com.mints.street.BR
import
com.mints.street.BR
import
com.mints.street.R
import
com.mints.street.R
import
com.mints.street.utils.CommonUtils
import
com.mints.street.webview.MintsWebViewActivity
import
com.mints.street.webview.MintsWebViewActivity
import
kotlinx.android.synthetic.main.activity_aboutus.*
import
kotlinx.android.synthetic.main.activity_aboutus.*
import
kotlinx.android.synthetic.main.include_header.*
import
kotlinx.android.synthetic.main.include_header.*
import
me.goldze.mvvmhabit.utils.systembar.StatusBarUtil
class
AboutusActivity
:
BaseActivity
<
ActivityAboutusBinding
,
AboutusViewModel
>(),
View
.
OnClickListener
{
class
AboutusActivity
:
BaseActivity
<
ActivityAboutusBinding
,
AboutusViewModel
>(),
View
.
OnClickListener
{
...
@@ -32,6 +37,13 @@ class AboutusActivity : BaseActivity<ActivityAboutusBinding, AboutusViewModel>()
...
@@ -32,6 +37,13 @@ class AboutusActivity : BaseActivity<ActivityAboutusBinding, AboutusViewModel>()
iv_left_icon
.
visibility
=
View
.
VISIBLE
iv_left_icon
.
visibility
=
View
.
VISIBLE
tv_user
.
setOnClickListener
(
this
)
tv_user
.
setOnClickListener
(
this
)
tv_privacy
.
setOnClickListener
(
this
)
tv_privacy
.
setOnClickListener
(
this
)
iv_app
.
setOnLongClickListener
{
ToastUtils
.
showLong
(
"自有渠道:"
+
CommonUtils
.
getAppMetaData
(
AppApplication
.
getContext
(),
"CHANNEL_NAME"
)
+
"\n 头条渠道:"
+
HumeSDK
.
getChannel
(
AppApplication
.
getContext
()))
true
}
}
}
override
fun
onClick
(
v
:
View
?)
{
override
fun
onClick
(
v
:
View
?)
{
...
...
app/src/main/java/com/mints/street/main/my/MyFragment.kt
View file @
101d6b03
...
@@ -15,6 +15,7 @@ import androidx.lifecycle.Observer
...
@@ -15,6 +15,7 @@ import androidx.lifecycle.Observer
import
cn.sharesdk.framework.ShareSDK
import
cn.sharesdk.framework.ShareSDK
import
cn.sharesdk.wechat.friends.Wechat
import
cn.sharesdk.wechat.friends.Wechat
import
com.bumptech.glide.Glide
import
com.bumptech.glide.Glide
import
com.coorchice.library.utils.LogUtils
import
com.fry.base.base.BaseFragment
import
com.fry.base.base.BaseFragment
import
com.google.android.material.bottomsheet.BottomSheetDialog
import
com.google.android.material.bottomsheet.BottomSheetDialog
import
com.mints.street.BR
import
com.mints.street.BR
...
@@ -26,6 +27,7 @@ import com.mints.street.login.LoginActivity
...
@@ -26,6 +27,7 @@ import com.mints.street.login.LoginActivity
import
com.mints.street.login.LoginApi
import
com.mints.street.login.LoginApi
import
com.mints.street.login.OnLoginListener
import
com.mints.street.login.OnLoginListener
import
com.mints.street.manager.UserManager
import
com.mints.street.manager.UserManager
import
com.mints.street.manager.oaid.OaidManager
import
com.mints.street.utils.json.JsonUtil
import
com.mints.street.utils.json.JsonUtil
import
com.mints.street.webview.MintsWebViewActivity
import
com.mints.street.webview.MintsWebViewActivity
import
com.scwang.smartrefresh.layout.api.RefreshLayout
import
com.scwang.smartrefresh.layout.api.RefreshLayout
...
@@ -69,8 +71,6 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
...
@@ -69,8 +71,6 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
super
.
initData
()
super
.
initData
()
StatusBarUtil
.
setHeightAndPadding
(
AppManager
.
getAppManager
().
currentActivity
,
binding
.
llMyRoot
)
StatusBarUtil
.
setHeightAndPadding
(
AppManager
.
getAppManager
().
currentActivity
,
binding
.
llMyRoot
)
srl_my
.
setOnRefreshListener
(
this
)
srl_my
.
setOnRefreshListener
(
this
)
//隐藏立即领取
// bt_try.visibility = View.GONE
initView
()
initView
()
initListener
()
initListener
()
}
}
...
@@ -223,9 +223,20 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
...
@@ -223,9 +223,20 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
// 已登录
// 已登录
item_title_id
.
text
=
userManager
.
getWxName
()
item_title_id
.
text
=
userManager
.
getWxName
()
Glide
.
with
(
requireContext
()).
load
(
userManager
.
getWxHeader
()).
into
(
item_title_avatar
)
Glide
.
with
(
requireContext
()).
load
(
userManager
.
getWxHeader
()).
into
(
item_title_avatar
)
// 是否会员
if
(
userManager
.
getVipFlag
()){
tv_tips
.
text
=
"恭喜您,已经成为全球会员啦~"
bt_try
.
visibility
=
View
.
INVISIBLE
}
else
{
tv_tips
.
text
=
"恭喜你被全球会员卡砸中~"
bt_try
.
visibility
=
View
.
VISIBLE
}
}
else
{
}
else
{
// 未登录
// 未登录
item_title_id
.
text
=
"未登录"
item_title_id
.
text
=
"未登录"
tv_tips
.
text
=
"恭喜你被全球会员卡砸中~"
bt_try
.
visibility
=
View
.
VISIBLE
item_title_avatar
.
setImageResource
(
R
.
mipmap
.
ic_my
)
item_title_avatar
.
setImageResource
(
R
.
mipmap
.
ic_my
)
}
}
}
}
...
...
app/src/main/java/com/mints/street/main/my/MyViewModel.kt
View file @
101d6b03
...
@@ -6,6 +6,7 @@ import com.mints.street.bean.BaseResponse
...
@@ -6,6 +6,7 @@ import com.mints.street.bean.BaseResponse
import
com.mints.street.bean.UserBean
import
com.mints.street.bean.UserBean
import
com.mints.street.common.DeviceInfo
import
com.mints.street.common.DeviceInfo
import
com.mints.street.manager.UserManager
import
com.mints.street.manager.UserManager
import
com.mints.street.manager.oaid.OaidManager
import
com.mints.street.model.ApiModel
import
com.mints.street.model.ApiModel
import
com.mints.street.netwrok.base.HttpSubscribeImpl
import
com.mints.street.netwrok.base.HttpSubscribeImpl
import
com.mints.street.utils.DeviceUuidFactory
import
com.mints.street.utils.DeviceUuidFactory
...
@@ -84,9 +85,7 @@ class MyViewModel(application: Application) : BaseViewModel(application) {
...
@@ -84,9 +85,7 @@ class MyViewModel(application: Application) : BaseViewModel(application) {
vo
[
"mac1"
]
=
macAddress
vo
[
"mac1"
]
=
macAddress
vo
[
"androidid"
]
=
deviceInfo
.
getAndroidId
(
null
)
vo
[
"androidid"
]
=
deviceInfo
.
getAndroidId
(
null
)
vo
[
"imei"
]
=
deviceInfo
.
iMEI
vo
[
"imei"
]
=
deviceInfo
.
iMEI
// if (!TextUtils.isEmpty(App.OAID)) {
vo
[
"oaid"
]
=
OaidManager
.
getOaid
()
// vo["oaid"] = App.OAID
// }
vo
[
"os"
]
=
"android"
vo
[
"os"
]
=
"android"
vo
[
"model"
]
=
deviceInfo
.
newModel
vo
[
"model"
]
=
deviceInfo
.
newModel
vo
[
"uuid"
]
=
DeviceUuidFactory
().
deviceUuid
vo
[
"uuid"
]
=
DeviceUuidFactory
().
deviceUuid
...
...
app/src/main/java/com/mints/street/main/my/PermissionsActivity.kt
View file @
101d6b03
...
@@ -6,11 +6,14 @@ import android.os.Bundle
...
@@ -6,11 +6,14 @@ import android.os.Bundle
import
android.view.View
import
android.view.View
import
com.fry.base.base.BaseActivity
import
com.fry.base.base.BaseActivity
import
com.github.iielse.switchbutton.SwitchView
import
com.github.iielse.switchbutton.SwitchView
import
com.mints.street.AppApplication
import
com.mints.street.BR
import
com.mints.street.BR
import
com.mints.street.R
import
com.mints.street.R
import
com.mints.street.common.Constant
import
com.mints.street.common.Constant
import
com.mints.street.databinding.ActivityPermissionsBinding
import
com.mints.street.databinding.ActivityPermissionsBinding
import
com.mints.street.main.MainActivity
import
com.mints.street.main.MainActivity
import
com.mints.street.utils.NetUtils
import
com.mints.street.utils.nodoubleclick.AntiShake
import
com.mints.street.webview.MintsWebViewActivity
import
com.mints.street.webview.MintsWebViewActivity
import
com.tbruyelle.rxpermissions2.RxPermissions
import
com.tbruyelle.rxpermissions2.RxPermissions
import
com.tencent.mmkv.MMKV
import
com.tencent.mmkv.MMKV
...
@@ -76,6 +79,9 @@ class PermissionsActivity : BaseActivity<ActivityPermissionsBinding, Permission
...
@@ -76,6 +79,9 @@ class PermissionsActivity : BaseActivity<ActivityPermissionsBinding, Permission
when
(
v
?.
id
){
when
(
v
?.
id
){
R
.
id
.
btnPermissionsDont
->
ToastUtils
.
showLong
(
"请您同意授权,否则将无法使用APP功能"
)
R
.
id
.
btnPermissionsDont
->
ToastUtils
.
showLong
(
"请您同意授权,否则将无法使用APP功能"
)
R
.
id
.
btnPermissionsNext
->{
R
.
id
.
btnPermissionsNext
->{
if
(
AntiShake
.
check
(
v
?.
id
))
return
com
.
blankj
.
utilcode
.
util
.
ToastUtils
.
showLong
(
"努力加载中..."
)
val
rxPermissions
=
RxPermissions
(
this
)
val
rxPermissions
=
RxPermissions
(
this
)
rxPermissions
.
request
(
rxPermissions
.
request
(
if
(
svPosition
.
isOpened
&&
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
)
Manifest
.
permission
.
ACCESS_BACKGROUND_LOCATION
else
""
,
if
(
svPosition
.
isOpened
&&
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
)
Manifest
.
permission
.
ACCESS_BACKGROUND_LOCATION
else
""
,
...
@@ -90,9 +96,19 @@ class PermissionsActivity : BaseActivity<ActivityPermissionsBinding, Permission
...
@@ -90,9 +96,19 @@ class PermissionsActivity : BaseActivity<ActivityPermissionsBinding, Permission
MMKV
.
mmkvWithID
(
Constant
.
FIRST_OPEN_PERMISSIONS
).
encode
(
Constant
.
FIRST_OPEN_PERMISSIONS
,
true
)
MMKV
.
mmkvWithID
(
Constant
.
FIRST_OPEN_PERMISSIONS
).
encode
(
Constant
.
FIRST_OPEN_PERMISSIONS
,
true
)
}
}
R
.
id
.
tv_regist
->{
R
.
id
.
tv_regist
->{
if
(!
NetUtils
.
isNetworkConnected
(
AppApplication
.
getContext
()))
{
com
.
blankj
.
utilcode
.
util
.
ToastUtils
.
showShort
(
"网络异常,请检测网络"
)
return
}
MintsWebViewActivity
.
startWebView
(
name
=
"用户协议"
,
url
=
"http://test.mints-id.com/map-api/map/register.html"
)
MintsWebViewActivity
.
startWebView
(
name
=
"用户协议"
,
url
=
"http://test.mints-id.com/map-api/map/register.html"
)
}
}
R
.
id
.
tv_private
->{
R
.
id
.
tv_private
->{
if
(!
NetUtils
.
isNetworkConnected
(
AppApplication
.
getContext
()))
{
com
.
blankj
.
utilcode
.
util
.
ToastUtils
.
showShort
(
"网络异常,请检测网络"
)
return
}
MintsWebViewActivity
.
startWebView
(
name
=
"隐私协议"
,
url
=
"http://test.mints-id.com/map-api/map/privacy.html"
)
MintsWebViewActivity
.
startWebView
(
name
=
"隐私协议"
,
url
=
"http://test.mints-id.com/map-api/map/privacy.html"
)
}
}
}
}
...
...
app/src/main/java/com/mints/street/manager/UserManager.kt
View file @
101d6b03
...
@@ -171,8 +171,8 @@ class UserManager {
...
@@ -171,8 +171,8 @@ class UserManager {
}
}
fun
getVipFlag
():
Boolean
{
fun
getVipFlag
():
Boolean
{
val
kv
=
MMKV
.
mmkvWithID
(
EXPIRETIME
)
val
kv
=
MMKV
.
mmkvWithID
(
VIP_FLAG
)
return
kv
.
decodeBool
(
EXPIRETIME
,
false
)
return
kv
.
decodeBool
(
VIP_FLAG
,
false
)
}
}
fun
setVipFlag
(
vipFlag
:
Boolean
){
fun
setVipFlag
(
vipFlag
:
Boolean
){
...
...
app/src/main/java/com/mints/street/manager/oaid/MiitHelper.java
0 → 100644
View file @
101d6b03
package
com
.
mints
.
street
.
manager
.
oaid
;
import
android.content.Context
;
import
android.util.Log
;
import
androidx.annotation.NonNull
;
import
com.bun.miitmdid.core.MdidSdkHelper
;
import
com.bun.miitmdid.interfaces.IIdentifierListener
;
import
com.bun.miitmdid.interfaces.IdSupplier
;
public
class
MiitHelper
implements
IIdentifierListener
{
private
AppIdsUpdater
_listener
;
public
MiitHelper
(
AppIdsUpdater
callback
)
{
_listener
=
callback
;
}
public
void
initDeviceIds
(
Context
cxt
)
{
long
timeb
=
System
.
currentTimeMillis
();
int
nres
=
CallFromReflect
(
cxt
);
// int nres=DirectCall(cxt);
long
timee
=
System
.
currentTimeMillis
();
long
offset
=
timee
-
timeb
;
// if (nres == ErrorCode.INIT_ERROR_DEVICE_NOSUPPORT) {//1008612 不支持的设备
// WenshuApplication.setIsSupportOaid(false, nres);
// } else if (nres == ErrorCode.INIT_ERROR_LOAD_CONFIGFILE) {//1008613 加载配置文件出错
// WenshuApplication.setIsSupportOaid(false, nres);
// } else if (nres == ErrorCode.INIT_ERROR_MANUFACTURER_NOSUPPORT) {//1008611 不支持的设备厂商
// WenshuApplication.setIsSupportOaid(false, nres);
// } else if (nres == ErrorCode.INIT_ERROR_RESULT_DELAY) {//1008614 获取接口是异步的,结果会在回调中返回,回调执行的回调可能在工作线程
// //TODO 这种情况,还不清楚怎么解决呢。暂且先返false
// WenshuApplication.setIsSupportOaid(false, nres);
// } else if (nres == ErrorCode.INIT_HELPER_CALL_ERROR) {//1008615 反射调用出错
// WenshuApplication.setIsSupportOaid(false, nres);
// }
Log
.
d
(
getClass
().
getSimpleName
(),
"return value: "
+
String
.
valueOf
(
nres
));
}
/*
* 通过反射调用,解决android 9以后的类加载升级,导至找不到so中的方法
*
* */
private
int
CallFromReflect
(
Context
cxt
)
{
return
MdidSdkHelper
.
InitSdk
(
cxt
,
true
,
this
);
}
@Override
public
void
OnSupport
(
boolean
isSupport
,
IdSupplier
_supplier
)
{
if
(
_supplier
==
null
)
{
return
;
}
/* String oaid=_supplier.getOaid();
String vaid=_supplier.getVAID();
String aaid=_supplier.getAAID();
String udid=_supplier.getUDID();
StringBuilder builder=new StringBuilder();
builder.append("support: ").append(isSupport?"true":"false").append("\n");
builder.append("UDID: ").append(udid).append("\n");
builder.append("OAID: ").append(oaid).append("\n");
builder.append("VAID: ").append(vaid).append("\n");
builder.append("AAID: ").append(aaid).append("\n");
String idstext=builder.toString();*/
// WenshuApplication.setIsSupportOaid(isSupport);
String
oaid
=
_supplier
.
getOAID
();
// _supplier.shutDown(); //关闭接口
if
(
_listener
!=
null
)
{
_listener
.
OnIdsAvalid
(
oaid
);
}
}
public
interface
AppIdsUpdater
{
void
OnIdsAvalid
(
@NonNull
String
ids
);
}
}
app/src/main/java/com/mints/street/manager/oaid/OaidManager.kt
0 → 100644
View file @
101d6b03
package
com.mints.street.manager.oaid
import
com.mints.street.AppApplication
object
OaidManager
{
private
var
OAID
=
""
private
val
appIdsUpdater
:
MiitHelper
.
AppIdsUpdater
=
MiitHelper
.
AppIdsUpdater
({
ids
->
OAID
=
ids
})
/**
* 移动安装联盟 获取OAID等设备标识符
*/
fun
init
()
{
try
{
val
miitHelper
=
MiitHelper
(
appIdsUpdater
)
miitHelper
.
initDeviceIds
(
AppApplication
.
getContext
())
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
}
fun
getOaid
()=
OAID
}
\ No newline at end of file
app/src/main/java/com/mints/street/model/ApiModel.kt
View file @
101d6b03
...
@@ -13,6 +13,14 @@ import retrofit2.http.Body
...
@@ -13,6 +13,14 @@ import retrofit2.http.Body
*/
*/
object
ApiModel
{
object
ApiModel
{
/**
* 打开激活
*/
fun
comSaveTerminalInfo
(
lifecycleProvider
:
LifecycleProvider
<
Any
>?,
map
:
Map
<
String
,
Any
>):
Observable
<
Response
<
BaseResponse
<
Any
>>>
{
return
HttpManager
.
getInstance
()
.
execute
(
lifecycleProvider
,
MainApi
.
newInstance
().
comSaveTerminalInfo
(
map
))
}
/**
/**
* 发送验证码
* 发送验证码
*/
*/
...
...
app/src/main/java/com/mints/street/splash/SplashActivity.kt
View file @
101d6b03
...
@@ -17,10 +17,8 @@ import com.mints.street.common.DeviceInfo
...
@@ -17,10 +17,8 @@ import com.mints.street.common.DeviceInfo
import
com.mints.street.databinding.ActivitySplashBinding
import
com.mints.street.databinding.ActivitySplashBinding
import
com.mints.street.main.MainActivity
import
com.mints.street.main.MainActivity
import
com.mints.street.main.my.PermissionsActivity
import
com.mints.street.main.my.PermissionsActivity
import
com.mints.street.manager.CsjGroMoreManager
import
com.mints.street.ad.CsjGroMoreManager
import
com.mints.street.manager.UserManager
import
com.tencent.mmkv.MMKV
import
com.tencent.mmkv.MMKV
import
me.goldze.mvvmhabit.base.AppManager
import
me.goldze.mvvmhabit.utils.systembar.StatusBarUtil
import
me.goldze.mvvmhabit.utils.systembar.StatusBarUtil
/**
/**
...
@@ -50,6 +48,8 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() {
...
@@ -50,6 +48,8 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() {
return
return
}
}
StatusBarUtil
.
immersive
(
this
)
//校验App签名
//校验App签名
checkAppSign
()
checkAppSign
()
}
}
...
@@ -124,7 +124,7 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() {
...
@@ -124,7 +124,7 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() {
//自定义兜底方案 选择使用
//自定义兜底方案 选择使用
val
ttNetworkRequestInfo
:
TTNetworkRequestInfo
val
ttNetworkRequestInfo
:
TTNetworkRequestInfo
//穿山甲兜底
//穿山甲兜底
ttNetworkRequestInfo
=
PangleNetworkRequestInfo
(
CsjGroMoreManager
.
TT_AD_APPID
,
CsjGroMoreManager
.
AD_CSJ_SPLASH_ID
)
ttNetworkRequestInfo
=
PangleNetworkRequestInfo
(
CsjGroMoreManager
.
TT_AD_APPID
,
CsjGroMoreManager
.
AD_CSJ_SPLASH_ID
)
//step4:请求广告,调用开屏广告异步请求接口,对请求回调的广告作渲染处理
//step4:请求广告,调用开屏广告异步请求接口,对请求回调的广告作渲染处理
...
...
app/src/main/java/com/mints/street/utils/NetUtils.java
0 → 100644
View file @
101d6b03
/*
* Copyright (c) 2015 [1076559197@qq.com | tchen0707@gmail.com]
*
* Licensed under the Apache License, Version 2.0 (the "License”);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
mints
.
street
.
utils
;
import
android.content.Context
;
import
android.net.ConnectivityManager
;
import
android.net.NetworkInfo
;
import
android.net.Uri
;
import
android.telephony.TelephonyManager
;
import
android.text.TextUtils
;
import
java.util.Locale
;
/**
* 描述:NetUtils
* 作者:孟崔广
* 时间:2021/7/10 17:51
*/
public
class
NetUtils
{
public
enum
NetType
{
WIFI
,
CMNET
,
CMWAP
,
NONE
}
public
static
boolean
isNetworkAvailable
(
Context
context
)
{
ConnectivityManager
mgr
=
(
ConnectivityManager
)
context
.
getSystemService
(
Context
.
CONNECTIVITY_SERVICE
);
NetworkInfo
[]
info
=
mgr
.
getAllNetworkInfo
();
if
(
info
!=
null
)
{
for
(
int
i
=
0
;
i
<
info
.
length
;
i
++)
{
if
(
info
[
i
].
getState
()
==
NetworkInfo
.
State
.
CONNECTED
)
{
return
true
;
}
}
}
return
false
;
}
public
static
boolean
isNetworkConnected
(
Context
context
)
{
if
(
context
!=
null
)
{
ConnectivityManager
mConnectivityManager
=
(
ConnectivityManager
)
context
.
getSystemService
(
Context
.
CONNECTIVITY_SERVICE
);
NetworkInfo
mNetworkInfo
=
mConnectivityManager
.
getActiveNetworkInfo
();
if
(
mNetworkInfo
!=
null
)
{
return
mNetworkInfo
.
isAvailable
();
}
}
return
false
;
}
public
static
boolean
isWifiConnected
(
Context
context
)
{
if
(
context
!=
null
)
{
ConnectivityManager
mConnectivityManager
=
(
ConnectivityManager
)
context
.
getSystemService
(
Context
.
CONNECTIVITY_SERVICE
);
NetworkInfo
mWiFiNetworkInfo
=
mConnectivityManager
.
getNetworkInfo
(
ConnectivityManager
.
TYPE_WIFI
);
// if (mWiFiNetworkInfo != null) {
// return mWiFiNetworkInfo.isAvailable();
// }
if
(
mWiFiNetworkInfo
.
isConnected
())
{
return
true
;
}
}
return
false
;
}
public
static
boolean
isMobileConnected
(
Context
context
)
{
if
(
context
!=
null
)
{
ConnectivityManager
mConnectivityManager
=
(
ConnectivityManager
)
context
.
getSystemService
(
Context
.
CONNECTIVITY_SERVICE
);
NetworkInfo
mMobileNetworkInfo
=
mConnectivityManager
.
getNetworkInfo
(
ConnectivityManager
.
TYPE_MOBILE
);
if
(
mMobileNetworkInfo
!=
null
)
{
return
mMobileNetworkInfo
.
isAvailable
();
}
}
return
false
;
}
public
static
int
getConnectedType
(
Context
context
)
{
if
(
context
!=
null
)
{
ConnectivityManager
mConnectivityManager
=
(
ConnectivityManager
)
context
.
getSystemService
(
Context
.
CONNECTIVITY_SERVICE
);
NetworkInfo
mNetworkInfo
=
mConnectivityManager
.
getActiveNetworkInfo
();
if
(
mNetworkInfo
!=
null
&&
mNetworkInfo
.
isAvailable
())
{
return
mNetworkInfo
.
getType
();
}
}
return
-
1
;
}
public
static
NetType
getAPNType
(
Context
context
)
{
ConnectivityManager
connMgr
=
(
ConnectivityManager
)
context
.
getSystemService
(
Context
.
CONNECTIVITY_SERVICE
);
NetworkInfo
networkInfo
=
connMgr
.
getActiveNetworkInfo
();
if
(
networkInfo
==
null
)
{
return
NetType
.
NONE
;
}
int
nType
=
networkInfo
.
getType
();
if
(
nType
==
ConnectivityManager
.
TYPE_MOBILE
)
{
Locale
netDefault
=
Locale
.
getDefault
();
String
extraInfo
=
networkInfo
.
getExtraInfo
();
if
(
netDefault
!=
null
&&
!
TextUtils
.
isEmpty
(
extraInfo
)
&&
TextUtils
.
equals
(
extraInfo
.
toLowerCase
(
netDefault
),
"cmnet"
))
{
return
NetType
.
CMNET
;
}
else
{
return
NetType
.
CMWAP
;
}
}
else
if
(
nType
==
ConnectivityManager
.
TYPE_WIFI
)
{
return
NetType
.
WIFI
;
}
return
NetType
.
NONE
;
}
public
static
String
getNetworkState
(
Context
context
)
{
String
strNetworkType
=
"UNKNOWN"
;
final
NetworkInfo
activeNetworkInfo
=
((
ConnectivityManager
)
context
.
getSystemService
(
Context
.
CONNECTIVITY_SERVICE
)).
getActiveNetworkInfo
();
if
(
activeNetworkInfo
!=
null
&&
activeNetworkInfo
.
getType
()
==
1
)
{
strNetworkType
=
"WIFI"
;
}
else
if
(
activeNetworkInfo
!=
null
&&
activeNetworkInfo
.
getType
()
==
0
)
{
String
subtypeName
=
activeNetworkInfo
.
getSubtypeName
();
switch
(((
TelephonyManager
)
context
.
getSystemService
(
Context
.
TELEPHONY_SERVICE
)).
getNetworkType
())
{
case
TelephonyManager
.
NETWORK_TYPE_GPRS
:
case
TelephonyManager
.
NETWORK_TYPE_EDGE
:
case
TelephonyManager
.
NETWORK_TYPE_CDMA
:
case
TelephonyManager
.
NETWORK_TYPE_1xRTT
:
case
TelephonyManager
.
NETWORK_TYPE_IDEN
:
//api<8 : replace by 11
strNetworkType
=
"2G"
;
break
;
case
TelephonyManager
.
NETWORK_TYPE_UMTS
:
case
TelephonyManager
.
NETWORK_TYPE_EVDO_0
:
case
TelephonyManager
.
NETWORK_TYPE_EVDO_A
:
case
TelephonyManager
.
NETWORK_TYPE_HSDPA
:
case
TelephonyManager
.
NETWORK_TYPE_HSUPA
:
case
TelephonyManager
.
NETWORK_TYPE_HSPA
:
case
TelephonyManager
.
NETWORK_TYPE_EVDO_B
:
//api<9 : replace by 14
case
TelephonyManager
.
NETWORK_TYPE_EHRPD
:
//api<11 : replace by 12
case
TelephonyManager
.
NETWORK_TYPE_HSPAP
:
//api<13 : replace by 15
strNetworkType
=
"3G"
;
break
;
case
TelephonyManager
.
NETWORK_TYPE_LTE
:
strNetworkType
=
"4G"
;
break
;
case
TelephonyManager
.
NETWORK_TYPE_NR
:
strNetworkType
=
"5G"
;
break
;
default
:
if
(
subtypeName
.
equalsIgnoreCase
(
"TD-SCDMA"
)
||
subtypeName
.
equalsIgnoreCase
(
"WCDMA"
)
||
subtypeName
.
equalsIgnoreCase
(
"CDMA2000"
))
{
strNetworkType
=
"3G"
;
break
;
}
strNetworkType
=
subtypeName
;
break
;
}
}
return
strNetworkType
;
}
public
static
String
getNetworkStateForCpd
(
Context
context
)
{
String
networkState
=
getNetworkState
(
context
);
String
networkStateForCpd
;
switch
(
networkState
)
{
case
"WIFI"
:
networkStateForCpd
=
"1"
;
break
;
case
"2G"
:
networkStateForCpd
=
"2"
;
break
;
case
"3G"
:
networkStateForCpd
=
"3"
;
break
;
case
"4G"
:
networkStateForCpd
=
"4"
;
break
;
case
"5G"
:
networkStateForCpd
=
"5"
;
break
;
default
:
networkStateForCpd
=
"0"
;
break
;
}
return
networkStateForCpd
;
}
/**
* 根据传入的URL获取一级域名
*
* @param url
* @return
*/
public
static
String
getDomain
(
String
url
)
{
String
domain
=
""
;
if
(!
TextUtils
.
isEmpty
(
url
)
&&
url
.
startsWith
(
"http"
))
{
try
{
String
host
=
Uri
.
parse
(
url
).
getHost
();
if
(!
TextUtils
.
isEmpty
(
host
)
&&
host
.
contains
(
"."
))
{
domain
=
host
.
substring
(
host
.
indexOf
(
"."
),
host
.
length
());
}
}
catch
(
Exception
ex
)
{
}
}
return
domain
;
}
}
app/src/main/java/com/mints/street/utils/nodoubleclick/AntiShake.java
0 → 100644
View file @
101d6b03
package
com
.
mints
.
street
.
utils
.
nodoubleclick
;
public
class
AntiShake
{
private
static
LimitQueue
<
OneClick
>
queue
=
new
LimitQueue
<>(
20
);
public
static
boolean
check
(
Object
o
)
{
String
flag
;
if
(
o
==
null
)
{
flag
=
Thread
.
currentThread
().
getStackTrace
()[
2
].
getMethodName
();
}
else
{
flag
=
o
.
toString
();
}
for
(
OneClick
util
:
queue
.
getArrayList
())
{
if
(
util
.
getMethodName
().
equals
(
flag
))
{
return
util
.
check
();
}
}
OneClick
clickUtil
=
new
OneClick
(
flag
);
queue
.
offer
(
clickUtil
);
return
clickUtil
.
check
();
}
}
app/src/main/java/com/mints/street/utils/nodoubleclick/LimitQueue.java
0 → 100644
View file @
101d6b03
package
com
.
mints
.
street
.
utils
.
nodoubleclick
;
import
java.util.ArrayList
;
import
java.util.LinkedList
;
public
class
LimitQueue
<
E
>
{
private
int
limitedSize
;
private
LinkedList
<
E
>
linkedList
=
new
LinkedList
<>();
public
LimitQueue
(
int
size
)
{
this
.
limitedSize
=
size
;
}
public
void
offer
(
E
e
)
{
if
(
linkedList
.
size
()
>=
limitedSize
)
{
linkedList
.
poll
();
}
linkedList
.
offer
(
e
);
}
public
E
get
(
int
position
)
{
return
linkedList
.
get
(
position
);
}
public
E
getLast
()
{
return
linkedList
.
getLast
();
}
public
E
getFirst
()
{
return
linkedList
.
getFirst
();
}
public
int
getLimit
()
{
return
limitedSize
;
}
public
void
setLimitedSize
(
int
size
)
{
this
.
limitedSize
=
size
;
}
public
int
size
()
{
return
linkedList
.
size
();
}
public
ArrayList
<
E
>
getArrayList
()
{
ArrayList
<
E
>
arrayList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
linkedList
.
size
();
i
++)
{
arrayList
.
add
(
linkedList
.
get
(
i
));
}
return
arrayList
;
}
@Override
public
String
toString
()
{
StringBuilder
buffer
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
linkedList
.
size
();
i
++)
{
buffer
.
append
(
linkedList
.
get
(
i
));
buffer
.
append
(
" "
);
}
return
buffer
.
toString
();
}
}
\ No newline at end of file
app/src/main/java/com/mints/street/utils/nodoubleclick/NoDoubleClickListener.java
0 → 100644
View file @
101d6b03
package
com
.
mints
.
street
.
utils
.
nodoubleclick
;
import
android.view.View
;
import
java.util.Calendar
;
/**
* 描述:防止过快点击造成多次事件
* 作者:孟崔广
* 时间:2021/7/10 17:51
* 邮箱:mengcga@163.com
*/
public
abstract
class
NoDoubleClickListener
implements
View
.
OnClickListener
{
public
static
final
int
MIN_CLICK_DELAY_TIME
=
3000
;
private
long
lastClickTime
=
0
;
@Override
final
public
void
onClick
(
View
v
)
{
long
currentTime
=
Calendar
.
getInstance
().
getTimeInMillis
();
if
(
currentTime
-
lastClickTime
>
MIN_CLICK_DELAY_TIME
)
{
lastClickTime
=
currentTime
;
onNoDoubleClick
(
v
);
}
}
public
void
onNoDoubleClick
(
View
v
)
{
}
}
app/src/main/java/com/mints/street/utils/nodoubleclick/OneClick.java
0 → 100644
View file @
101d6b03
package
com
.
mints
.
street
.
utils
.
nodoubleclick
;
import
java.util.Calendar
;
/**
* 描述:OneClick
* 作者:孟崔广
* 时间:2021/7/10 17:51
* 邮箱:mengcga@163.com
*/
public
class
OneClick
{
private
String
methodName
;
private
static
final
int
CLICK_DELAY_TIME
=
2000
;
private
long
lastClickTime
=
0
;
public
OneClick
(
String
methodName
)
{
this
.
methodName
=
methodName
;
}
public
String
getMethodName
()
{
return
methodName
;
}
public
boolean
check
()
{
long
currentTime
=
Calendar
.
getInstance
().
getTimeInMillis
();
if
(
currentTime
-
lastClickTime
>
CLICK_DELAY_TIME
)
{
lastClickTime
=
currentTime
;
return
false
;
}
else
{
return
true
;
}
}
}
app/src/main/res/layout/activity_aboutus.xml
View file @
101d6b03
...
@@ -25,8 +25,8 @@
...
@@ -25,8 +25,8 @@
<ImageView
<ImageView
android:id=
"@+id/iv_app"
android:id=
"@+id/iv_app"
android:layout_width=
"
12
0dp"
android:layout_width=
"
7
0dp"
android:layout_height=
"
12
0dp"
android:layout_height=
"
7
0dp"
android:layout_alignParentBottom=
"true"
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:layout_centerHorizontal=
"true"
android:layout_marginBottom=
"65dp"
android:layout_marginBottom=
"65dp"
...
...
app/src/main/res/layout/view_data_page2.xml
View file @
101d6b03
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"10dp"
android:layout_marginBottom=
"10dp"
android:text=
"
国内外
高清街景"
android:text=
"
3D
高清街景"
android:textStyle=
"bold"
android:textStyle=
"bold"
android:textColor=
"#99000000"
android:textColor=
"#99000000"
android:typeface=
"serif"
android:typeface=
"serif"
...
...
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