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
8f58055b
Commit
8f58055b
authored
Jul 20, 2021
by
mengcuiguang2
Browse files
Options
Browse Files
Download
Plain Diff
代码合并
parents
b1810cca
101d6b03
Changes
39
Hide whitespace changes
Inline
Side-by-side
Showing
39 changed files
with
997 additions
and
188 deletions
+997
-188
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+0
-8
AppApplication.kt
app/src/main/java/com/mints/street/AppApplication.kt
+1
-2
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
GridPaymentAdapter.kt
.../main/java/com/mints/street/adapter/GridPaymentAdapter.kt
+3
-5
MainApi.kt
app/src/main/java/com/mints/street/api/MainApi.kt
+21
-1
VipBean.kt
app/src/main/java/com/mints/street/bean/VipBean.kt
+1
-1
WxPayParamBean.java
app/src/main/java/com/mints/street/bean/WxPayParamBean.java
+3
-3
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
+11
-0
MyFragment.kt
app/src/main/java/com/mints/street/main/my/MyFragment.kt
+20
-13
MyViewModel.kt
app/src/main/java/com/mints/street/main/my/MyViewModel.kt
+2
-3
OpenvipActivity.kt
...src/main/java/com/mints/street/main/my/OpenvipActivity.kt
+74
-24
OpenvipViewModel.kt
...rc/main/java/com/mints/street/main/my/OpenvipViewModel.kt
+46
-5
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
+25
-1
SplashActivity.kt
app/src/main/java/com/mints/street/splash/SplashActivity.kt
+9
-8
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
BrowserLayout.kt
app/src/main/java/com/mints/street/widget/BrowserLayout.kt
+175
-0
progress_bar_horizontal.xml
app/src/main/res/drawable/progress_bar_horizontal.xml
+17
-0
activity_aboutus.xml
app/src/main/res/layout/activity_aboutus.xml
+2
-2
activity_mints_web_view.xml
app/src/main/res/layout/activity_mints_web_view.xml
+2
-3
activity_moresettings.xml
app/src/main/res/layout/activity_moresettings.xml
+12
-0
activity_splash.xml
app/src/main/res/layout/activity_splash.xml
+4
-89
fragment_my.xml
app/src/main/res/layout/fragment_my.xml
+5
-1
item_settings.xml
app/src/main/res/layout/item_settings.xml
+0
-4
progress_horizontal.xml
app/src/main/res/layout/progress_horizontal.xml
+25
-0
view_data_page2.xml
app/src/main/res/layout/view_data_page2.xml
+1
-1
ic_launcher_main.png
app/src/main/res/mipmap-xxhdpi/ic_launcher_main.png
+0
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
8f58055b
...
@@ -70,14 +70,6 @@
...
@@ -70,14 +70,6 @@
<category
android:name=
"android.intent.category.LAUNCHER"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.VIEW"
/>
<category
android:name=
"android.intent.category.DEFAULT"
/>
<category
android:name=
"android.intent.category.BROWSABLE"
/>
<data
android:scheme=
"um.60e80209a6f90557b7b19aa7"
/>
</intent-filter>
</activity>
</activity>
<activity
android:name=
".login.LoginActivity"
></activity>
<activity
android:name=
".login.LoginActivity"
></activity>
<activity
<activity
...
...
app/src/main/java/com/mints/street/AppApplication.kt
View file @
8f58055b
...
@@ -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
...
@@ -52,7 +51,7 @@ class AppApplication : BaseApp() {
...
@@ -52,7 +51,7 @@ class AppApplication : BaseApp() {
UmengManager
.
preInit
()
UmengManager
.
preInit
()
// GroMore
// GroMore
CsjGroMoreManager
.
init
(
this
)
//
CsjGroMoreManager.init(this)
//百度地图
//百度地图
// 在使用 SDK 各组间之前初始化 context 信息,传入 ApplicationContext
// 在使用 SDK 各组间之前初始化 context 信息,传入 ApplicationContext
// 默认本地个性化地图初始化方法
// 默认本地个性化地图初始化方法
...
...
app/src/main/java/com/mints/street/
manager
/CsjGroMoreManager.kt
→
app/src/main/java/com/mints/street/
ad
/CsjGroMoreManager.kt
View file @
8f58055b
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 @
8f58055b
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/adapter/GridPaymentAdapter.kt
View file @
8f58055b
...
@@ -16,10 +16,8 @@ class GridPaymentAdapter(val context: Context, val list: List<VipBean.ListBean>)
...
@@ -16,10 +16,8 @@ class GridPaymentAdapter(val context: Context, val list: List<VipBean.ListBean>)
AbstractVLayoutBaseAdapter
<
ItemGridPaymentAdpaterBinding
,
AbstractVLayoutBaseAdapter
<
ItemGridPaymentAdpaterBinding
,
List
<
VipBean
.
ListBean
>>(
context
,
list
,
3
)
{
List
<
VipBean
.
ListBean
>>(
context
,
list
,
3
)
{
//设置首次进来默认选中第一个
private
var
first
:
Int
=
1
private
var
datalist
:
List
<
VipBean
.
ListBean
>?
=
list
private
var
datalist
:
List
<
VipBean
.
ListBean
>?
=
list
private
var
mposition
:
Int
=
-
1
private
var
mposition
:
Int
=
0
//设置首次进来默认选中第一个
override
fun
onBindViewHolder
(
holder
:
BindingViewHolder
<
ItemGridPaymentAdpaterBinding
>,
position
:
Int
)
{
override
fun
onBindViewHolder
(
holder
:
BindingViewHolder
<
ItemGridPaymentAdpaterBinding
>,
position
:
Int
)
{
holder
.
binding
.
tvOldprice
.
paint
.
flags
=
Paint
.
STRIKE_THRU_TEXT_FLAG
holder
.
binding
.
tvOldprice
.
paint
.
flags
=
Paint
.
STRIKE_THRU_TEXT_FLAG
...
@@ -37,9 +35,8 @@ class GridPaymentAdapter(val context: Context, val list: List<VipBean.ListBean>)
...
@@ -37,9 +35,8 @@ class GridPaymentAdapter(val context: Context, val list: List<VipBean.ListBean>)
}
}
//设置默认选中
//设置默认选中
if
(
holder
.
adapterPosition
==
0
&&
first
==
1
)
{
//如果当前的view是第一个设置默认背景,并且是第一次设置背景
if
(
holder
.
adapterPosition
==
mposition
)
{
//如果当前的view是第一个设置默认背景,并且是第一次设置背景
holder
.
binding
.
bg
.
setBackgroundResource
(
R
.
drawable
.
shape_bg_payment_down
)
holder
.
binding
.
bg
.
setBackgroundResource
(
R
.
drawable
.
shape_bg_payment_down
)
first
=
2
//设置view背景后,将设置情况改变成第二次
}
}
...
@@ -72,6 +69,7 @@ class GridPaymentAdapter(val context: Context, val list: List<VipBean.ListBean>)
...
@@ -72,6 +69,7 @@ class GridPaymentAdapter(val context: Context, val list: List<VipBean.ListBean>)
override
fun
getLayoutId
(
viewType
:
Int
)
=
R
.
layout
.
item_grid_payment_adpater
override
fun
getLayoutId
(
viewType
:
Int
)
=
R
.
layout
.
item_grid_payment_adpater
fun
getPosition
()=
mposition
}
}
app/src/main/java/com/mints/street/api/MainApi.kt
View file @
8f58055b
...
@@ -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
>>>
/**
/**
* 获取验证码
* 获取验证码
*
*
...
@@ -43,7 +51,7 @@ interface MainApi {
...
@@ -43,7 +51,7 @@ interface MainApi {
* 开通vip
* 开通vip
*/
*/
@POST
(
"api/getVipProductsByType"
)
@POST
(
"api/getVipProductsByType"
)
fun
getVipProductsByType
(
@Body
vo
:
@JvmSuppressWildcards
Map
<
String
,
Int
>):
Observable
<
Response
<
BaseResponse
<
VipBean
>>>
fun
getVipProductsByType
(
@Body
vo
:
@JvmSuppressWildcards
Map
<
String
,
Any
>):
Observable
<
Response
<
BaseResponse
<
VipBean
>>>
/**
/**
* 获取vip支付渠道
* 获取vip支付渠道
...
@@ -51,6 +59,18 @@ interface MainApi {
...
@@ -51,6 +59,18 @@ interface MainApi {
@POST
(
"api/getPayChannels"
)
@POST
(
"api/getPayChannels"
)
fun
getPayChannels
(
@Body
vo
:
@JvmSuppressWildcards
Map
<
String
,
Any
>):
Observable
<
Response
<
BaseResponse
<
PaymentBean
>>>
fun
getPayChannels
(
@Body
vo
:
@JvmSuppressWildcards
Map
<
String
,
Any
>):
Observable
<
Response
<
BaseResponse
<
PaymentBean
>>>
/**
* 获取支付参数
*/
@POST
(
"api/getVipPayParams"
)
fun
getVipPayParams
(
@Body
vo
:
@JvmSuppressWildcards
Map
<
String
,
Any
>):
Observable
<
Response
<
BaseResponse
<
WxPayParamBean
>>>
/**
* 支付成功
*/
@POST
(
"api/trade/queryVipOrder"
)
fun
queryVipOrder
(
@Body
vo
:
@JvmSuppressWildcards
Map
<
String
,
Any
>):
Observable
<
Response
<
BaseResponse
<
Any
>>>
/**
/**
* 获取用户登录信息
* 获取用户登录信息
*/
*/
...
...
app/src/main/java/com/mints/street/bean/VipBean.kt
View file @
8f58055b
...
@@ -12,7 +12,7 @@ class VipBean : Serializable {
...
@@ -12,7 +12,7 @@ class VipBean : Serializable {
var
remarks
:
String
=
""
// 看更多地图
var
remarks
:
String
=
""
// 看更多地图
var
title
:
String
=
""
// 包年会员
var
title
:
String
=
""
// 包年会员
var
activityType
:
Int
=
0
// 0
var
activityType
:
Int
=
0
// 0
var
oldPrice
:
Int
=
0
// 138
var
oldPrice
:
Double
=
0.
0
// 138
var
pid
:
String
=
""
// 1
var
pid
:
String
=
""
// 1
}
}
}
}
...
...
app/src/main/java/com/mints/street/bean/WxPayParamBean.java
View file @
8f58055b
...
@@ -12,15 +12,15 @@ public class WxPayParamBean implements Serializable {
...
@@ -12,15 +12,15 @@ public class WxPayParamBean implements Serializable {
* tid : 2016514565805500001
* tid : 2016514565805500001
*/
*/
private
ParamsBean
p
arams
;
private
ParamsBean
appPayP
arams
;
private
long
tid
;
private
long
tid
;
public
ParamsBean
getParams
()
{
public
ParamsBean
getParams
()
{
return
p
arams
;
return
appPayP
arams
;
}
}
public
void
setParams
(
ParamsBean
params
)
{
public
void
setParams
(
ParamsBean
params
)
{
this
.
p
arams
=
params
;
this
.
appPayP
arams
=
params
;
}
}
public
long
getTid
()
{
public
long
getTid
()
{
...
...
app/src/main/java/com/mints/street/login/LoginViewModel.kt
View file @
8f58055b
...
@@ -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 @
8f58055b
...
@@ -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 @
8f58055b
...
@@ -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 @
8f58055b
...
@@ -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 @
8f58055b
...
@@ -3,10 +3,14 @@ package com.mints.street.main.my
...
@@ -3,10 +3,14 @@ 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.*
...
@@ -37,6 +41,13 @@ class AboutusActivity : BaseActivity<ActivityAboutusBinding, AboutusViewModel>()
...
@@ -37,6 +41,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 @
8f58055b
...
@@ -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
()
}
}
...
@@ -78,17 +78,13 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
...
@@ -78,17 +78,13 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
override
fun
onResume
()
{
override
fun
onResume
()
{
super
.
onResume
()
super
.
onResume
()
//查询用户登录信息
if
(
userManager
.
userIsLogin
())
{
viewModel
.
getmyInfo
()
//查询用户登录信息
setUserLoginStatus
()
viewModel
.
getmyInfo
()
//
}
else
{
// if (userManager.userIsLogin()) {
//重新显示界面信息
// //查询用户登录信息
setUserLoginStatus
()
// viewModel.getmyInfo()
}
// } else {
// //重新显示界面信息
// setUserLoginStatus()
// }
}
}
private
fun
initListener
()
{
private
fun
initListener
()
{
...
@@ -247,9 +243,20 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
...
@@ -247,9 +243,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 @
8f58055b
...
@@ -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/OpenvipActivity.kt
View file @
8f58055b
...
@@ -3,6 +3,8 @@ package com.mints.street.main.my
...
@@ -3,6 +3,8 @@ package com.mints.street.main.my
import
android.app.Dialog
import
android.app.Dialog
import
android.graphics.Color
import
android.graphics.Color
import
android.os.Bundle
import
android.os.Bundle
import
android.text.TextUtils
import
android.view.KeyEvent
import
android.view.View
import
android.view.View
import
android.widget.ImageView
import
android.widget.ImageView
import
android.widget.TextView
import
android.widget.TextView
...
@@ -36,8 +38,9 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
...
@@ -36,8 +38,9 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
private
var
vLayout
:
VirtualLayoutManager
?
=
null
private
var
vLayout
:
VirtualLayoutManager
?
=
null
private
var
mAdapter
:
DelegateAdapter
?
=
null
private
var
mAdapter
:
DelegateAdapter
?
=
null
private
var
pw_flag
:
Int
=
1
private
var
gridPaymentAdapter
:
GridPaymentAdapter
?
=
null
private
var
vipList
:
MutableList
<
VipBean
.
ListBean
>?
=
null
private
var
vipList
:
MutableList
<
VipBean
.
ListBean
>?
=
null
private
var
currentPayType
=
""
override
fun
initVariableId
()
=
BR
.
viewModel
override
fun
initVariableId
()
=
BR
.
viewModel
override
fun
initContentView
(
savedInstanceState
:
Bundle
?)
=
R
.
layout
.
activity_openvip
override
fun
initContentView
(
savedInstanceState
:
Bundle
?)
=
R
.
layout
.
activity_openvip
...
@@ -48,11 +51,14 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
...
@@ -48,11 +51,14 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
override
fun
initData
()
{
override
fun
initData
()
{
super
.
initData
()
super
.
initData
()
if
(!
TextUtils
.
isEmpty
(
UserManager
.
INSTANCE
.
getUserID
())){
//获取vip福利信息
viewModel
.
getVipProductsByType
()
//获取支付方式
viewModel
.
getpaymentwey
(
"android"
)
}
StatusBarUtil
.
setHeightAndPadding
(
this
,
binding
.
viewBg
)
StatusBarUtil
.
setHeightAndPadding
(
this
,
binding
.
viewBg
)
//获取vip福利信息
viewModel
.
openvipInfo
()
//获取支付方式
viewModel
.
getpaymentwey
(
"android"
)
initView
()
initView
()
initListener
()
initListener
()
}
}
...
@@ -147,7 +153,29 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
...
@@ -147,7 +153,29 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
viewModel
.
Vipdata
.
observe
(
this
,
Observer
<
VipBean
>
{
viewModel
.
Vipdata
.
observe
(
this
,
Observer
<
VipBean
>
{
vipList
=
it
.
list
as
MutableList
<
VipBean
.
ListBean
>?
vipList
=
it
.
list
as
MutableList
<
VipBean
.
ListBean
>?
//展示 推荐套餐内容
//展示 推荐套餐内容
mAdapter
?.
addAdapter
(
GridPaymentAdapter
(
this
,
it
.
list
!!
))
gridPaymentAdapter
=
GridPaymentAdapter
(
this
,
it
.
list
!!
)
mAdapter
?.
addAdapter
(
gridPaymentAdapter
)
})
viewModel
.
vippayParams
.
observe
(
this
,
Observer
<
WxPayParamBean
>
{
if
(
TextUtils
.
equals
(
currentPayType
,
"WEIXIN"
))
{
if
(
it
==
null
||
it
.
params
==
null
)
{
ToastUtils
.
showShort
(
"微信支付维护中"
)
return
@Observer
}
wxPay
(
it
)
}
else
{
if
(
it
==
null
||
it
.
params
==
null
)
{
ToastUtils
.
showShort
(
"支付宝支付维护中"
)
return
@Observer
}
alipay
(
it
)
}
})
viewModel
.
isPaySuc
.
observe
(
this
,
Observer
<
Boolean
>
{
if
(
it
){
ToastUtils
.
showShort
(
"支付成功"
)
finish
()
}
})
})
viewModel
.
Paymentdata
.
observe
(
this
,
Observer
<
PaymentBean
>
{
viewModel
.
Paymentdata
.
observe
(
this
,
Observer
<
PaymentBean
>
{
if
(
it
.
list
.
isNullOrEmpty
())
{
if
(
it
.
list
.
isNullOrEmpty
())
{
...
@@ -159,9 +187,13 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
...
@@ -159,9 +187,13 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
for
(
str
in
it
.
list
!!
)
{
for
(
str
in
it
.
list
!!
)
{
if
(
str
.
equals
(
"WEIXIN"
))
{
if
(
str
.
equals
(
"WEIXIN"
))
{
ly_weixin
.
visibility
=
View
.
VISIBLE
ly_weixin
.
visibility
=
View
.
VISIBLE
currentPayType
=
"WEIXIN"
}
}
if
(
str
.
equals
(
"ALIPAY"
))
{
if
(
str
.
equals
(
"ALIPAY"
))
{
ly_alipay
.
visibility
=
View
.
VISIBLE
ly_alipay
.
visibility
=
View
.
VISIBLE
if
(
TextUtils
.
isEmpty
(
currentPayType
)){
currentPayType
=
"ALIPAY"
}
}
}
}
}
}
}
...
@@ -170,6 +202,15 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
...
@@ -170,6 +202,15 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
}
}
override
fun
onKeyDown
(
keyCode
:
Int
,
event
:
KeyEvent
?):
Boolean
{
when
(
keyCode
)
{
KeyEvent
.
KEYCODE_BACK
->
{
backvipDialog
()
}
}
return
true
}
private
fun
setfirstpaymentwey
(
paymentwey
:
String
)
{
private
fun
setfirstpaymentwey
(
paymentwey
:
String
)
{
if
(
paymentwey
.
equals
(
"WEIXIN"
))
{
if
(
paymentwey
.
equals
(
"WEIXIN"
))
{
setOnChecked
(
1
)
setOnChecked
(
1
)
...
@@ -182,26 +223,29 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
...
@@ -182,26 +223,29 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
when
(
v
?.
id
)
{
when
(
v
?.
id
)
{
R
.
id
.
iv_left_icon
->
{
R
.
id
.
iv_left_icon
->
{
backvipDialog
()
backvipDialog
()
// finish()
}
}
R
.
id
.
ly_weixin
->
{
//微信支付
R
.
id
.
ly_weixin
->
{
//微信支付
//设置选中样式
//设置选中样式
pw_flag
=
1
setOnChecked
(
1
)
setOnChecked
(
pw_flag
)
currentPayType
=
"WEIXIN"
}
}
R
.
id
.
ly_alipay
->
{
//支付宝支付
R
.
id
.
ly_alipay
->
{
//支付宝支付
//设置选中样式
//设置选中样式
pw_flag
=
2
setOnChecked
(
2
)
setOnChecked
(
pw_flag
)
currentPayType
=
"ALIPAY"
}
}
R
.
id
.
bt_try
->
{
//点击开通全球会员按钮
R
.
id
.
bt_try
->
{
//点击开通全球会员按钮
if
(
vipList
!=
null
&&
vipList
!!
.
size
>
0
)
{
payVip
()
// if (TextUtils.equals("weixin", payDialog?.payChannel)) {
}
// vipPresenter?.getVipPayParams("WEIXIN", vipList!![vipAdapter?.getPosition()].pid)
}
// } else {
}
// vipPresenter?.getVipPayParams("ALIPAY", vipList!![vipAdapter?.getPosition()].pid)
// }
private
fun
payVip
(){
}
if
(
vipList
!=
null
&&
vipList
!!
.
size
>
0
&&
gridPaymentAdapter
!=
null
)
{
if
(
TextUtils
.
equals
(
"WEIXIN"
,
currentPayType
))
{
viewModel
.
getVipPayParams
(
"WEIXIN"
,
vipList
!!
[
gridPaymentAdapter
!!
.
getPosition
()].
pid
)
}
else
{
viewModel
.
getVipPayParams
(
"ALIPAY"
,
vipList
!!
[
gridPaymentAdapter
!!
.
getPosition
()].
pid
)
}
}
}
}
}
}
...
@@ -209,14 +253,15 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
...
@@ -209,14 +253,15 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
private
fun
backvipDialog
()
{
private
fun
backvipDialog
()
{
DialogUtils
.
showbackvipDialog
(
this
,
object
:
DialogListener
()
{
DialogUtils
.
showbackvipDialog
(
this
,
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
if
(
dialog
!=
null
&&
dialog
.
isShowing
)
{
dialog
.
dismiss
()
}
when
(
v
?.
id
)
{
when
(
v
?.
id
)
{
R
.
id
.
tv_payment
->
{
//继续支付
R
.
id
.
tv_payment
->
{
//继续支付
if
(
dialog
!=
null
&&
dialog
.
isShowing
)
{
payVip
()
dialog
.
dismiss
()
}
}
}
R
.
id
.
tv_close
->
{
//取消
R
.
id
.
tv_close
->
{
//取消
startActivityThenKill
(
MainActivity
::
class
.
java
)
finish
(
)
}
}
}
}
...
@@ -256,8 +301,9 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
...
@@ -256,8 +301,9 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
if
(
isPay
)
{
if
(
isPay
)
{
//支付成功
//支付成功
UserManager
.
INSTANCE
.
setVipFlag
(
true
)
UserManager
.
INSTANCE
.
setVipFlag
(
true
)
com
.
blankj
.
utilcode
.
util
.
ToastUtils
.
showShort
(
"支付成功"
)
finish
()
}
}
// vipPresenter?.queryVipOrder(wxParanBean.tid.toString(), isPay)
})
{
throwable
->
})
{
throwable
->
ToastUtils
.
showShort
(
"支付异常,请联系管理员"
)
ToastUtils
.
showShort
(
"支付异常,请联系管理员"
)
}
}
...
@@ -269,8 +315,12 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
...
@@ -269,8 +315,12 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
if
(
isPay
)
{
if
(
isPay
)
{
//支付成功
//支付成功
UserManager
.
INSTANCE
.
setVipFlag
(
true
)
UserManager
.
INSTANCE
.
setVipFlag
(
true
)
com
.
blankj
.
utilcode
.
util
.
ToastUtils
.
showShort
(
"支付成功"
)
finish
()
}
}
// vipPresenter?.queryVipOrder(wxParanBean.tid.toString(), isPay)
// viewModel.queryVipOrder(wxParanBean.tid.toString())
com
.
blankj
.
utilcode
.
util
.
ToastUtils
.
showShort
(
"支付成功"
)
finish
()
})
{
throwable
->
})
{
throwable
->
ToastUtils
.
showShort
(
"支付异常,请联系管理员"
)
ToastUtils
.
showShort
(
"支付异常,请联系管理员"
)
}
}
...
...
app/src/main/java/com/mints/street/main/my/OpenvipViewModel.kt
View file @
8f58055b
...
@@ -6,6 +6,7 @@ import androidx.lifecycle.MutableLiveData
...
@@ -6,6 +6,7 @@ import androidx.lifecycle.MutableLiveData
import
com.mints.street.bean.BaseResponse
import
com.mints.street.bean.BaseResponse
import
com.mints.street.bean.PaymentBean
import
com.mints.street.bean.PaymentBean
import
com.mints.street.bean.VipBean
import
com.mints.street.bean.VipBean
import
com.mints.street.bean.WxPayParamBean
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
me.goldze.mvvmhabit.base.BaseViewModel
import
me.goldze.mvvmhabit.base.BaseViewModel
...
@@ -16,26 +17,27 @@ class OpenvipViewModel(application: Application) : BaseViewModel(application) {
...
@@ -16,26 +17,27 @@ class OpenvipViewModel(application: Application) : BaseViewModel(application) {
val
Vipdata
:
MutableLiveData
<
VipBean
>
=
MutableLiveData
()
val
Vipdata
:
MutableLiveData
<
VipBean
>
=
MutableLiveData
()
val
Paymentdata
:
MutableLiveData
<
PaymentBean
>
=
MutableLiveData
()
val
Paymentdata
:
MutableLiveData
<
PaymentBean
>
=
MutableLiveData
()
val
vippayParams
:
MutableLiveData
<
WxPayParamBean
>
=
MutableLiveData
()
val
isPaySuc
:
MutableLiveData
<
Boolean
>
=
MutableLiveData
()
/**
/**
* 开通Vip
* 开通Vip
*
*
* @param mobile
* @param mobile
*/
*/
fun
openvipInfo
()
{
fun
getVipProductsByType
()
{
val
vo
=
HashMap
<
String
,
Int
>()
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"type"
]
=
1
vo
[
"type"
]
=
1
ApiModel
.
openvip
(
lifecycleProvider
,
vo
).
safeSubscribe
(
ApiModel
.
getVipProductsByType
(
lifecycleProvider
,
vo
).
safeSubscribe
(
object
:
HttpSubscribeImpl
<
BaseResponse
<
VipBean
>>(
object
:
HttpSubscribeImpl
<
BaseResponse
<
VipBean
>>(
this
@OpenvipViewModel
,
true
)
{
this
@OpenvipViewModel
,
true
)
{
override
fun
onBusinessSuccess
(
response
:
BaseResponse
<
VipBean
>)
{
override
fun
onBusinessSuccess
(
response
:
BaseResponse
<
VipBean
>)
{
Vipdata
.
value
=
response
.
result
Vipdata
.
value
=
response
.
result
KLog
.
e
(
"openvip"
,
response
.
result
.
toString
())
}
}
override
fun
onError
(
e
:
Throwable
)
{
override
fun
onError
(
e
:
Throwable
)
{
KLog
.
e
(
"
openvip"
,
"请求错误:$e"
)
KLog
.
e
(
"
getVipProductsByType"
,
e
.
printStackTrace
()
)
}
}
})
})
}
}
...
@@ -61,4 +63,43 @@ class OpenvipViewModel(application: Application) : BaseViewModel(application) {
...
@@ -61,4 +63,43 @@ class OpenvipViewModel(application: Application) : BaseViewModel(application) {
)
)
}
}
/**
* 获取支付参数
*/
fun
getVipPayParams
(
payChannel
:
String
,
pid
:
String
)
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"payChannel"
]
=
payChannel
vo
[
"pid"
]
=
pid
ApiModel
.
getVipPayParams
(
lifecycleProvider
,
vo
).
safeSubscribe
(
object
:
HttpSubscribeImpl
<
BaseResponse
<
WxPayParamBean
>>(
this
@OpenvipViewModel
,
true
)
{
override
fun
onBusinessSuccess
(
response
:
BaseResponse
<
WxPayParamBean
>)
{
vippayParams
.
value
=
response
.
result
}
override
fun
onError
(
e
:
Throwable
)
{
KLog
.
e
(
"getVipPayParams"
,
e
.
printStackTrace
())
}
}
)
}
/**
* 支付成功
*/
fun
queryVipOrder
(
tid
:
String
)
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"tid"
]
=
tid
ApiModel
.
queryVipOrder
(
lifecycleProvider
,
vo
).
safeSubscribe
(
object
:
HttpSubscribeImpl
<
BaseResponse
<
Any
>>(
this
@OpenvipViewModel
,
true
)
{
override
fun
onBusinessSuccess
(
response
:
BaseResponse
<
Any
>)
{
isPaySuc
.
value
=
true
}
override
fun
onError
(
e
:
Throwable
)
{
}
}
)
}
}
}
app/src/main/java/com/mints/street/main/my/PermissionsActivity.kt
View file @
8f58055b
...
@@ -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 @
8f58055b
...
@@ -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 @
8f58055b
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 @
8f58055b
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 @
8f58055b
...
@@ -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
))
}
/**
/**
* 发送验证码
* 发送验证码
*/
*/
...
@@ -41,7 +49,7 @@ object ApiModel {
...
@@ -41,7 +49,7 @@ object ApiModel {
/**
/**
* 开通会员
* 开通会员
*/
*/
fun
openvip
(
lifecycleProvider
:
LifecycleProvider
<
Any
>?,
map
:
Map
<
String
,
Int
>):
Observable
<
Response
<
BaseResponse
<
VipBean
>>>
{
fun
getVipProductsByType
(
lifecycleProvider
:
LifecycleProvider
<
Any
>?,
map
:
Map
<
String
,
Any
>):
Observable
<
Response
<
BaseResponse
<
VipBean
>>>
{
return
HttpManager
.
getInstance
()
return
HttpManager
.
getInstance
()
.
execute
(
lifecycleProvider
,
MainApi
.
newInstance
().
getVipProductsByType
(
map
))
.
execute
(
lifecycleProvider
,
MainApi
.
newInstance
().
getVipProductsByType
(
map
))
}
}
...
@@ -54,6 +62,22 @@ object ApiModel {
...
@@ -54,6 +62,22 @@ object ApiModel {
.
execute
(
lifecycleProvider
,
MainApi
.
newInstance
().
getPayChannels
(
map
))
.
execute
(
lifecycleProvider
,
MainApi
.
newInstance
().
getPayChannels
(
map
))
}
}
/**
* 获取支付参数
*/
fun
getVipPayParams
(
lifecycleProvider
:
LifecycleProvider
<
Any
>?,
map
:
Map
<
String
,
Any
>):
Observable
<
Response
<
BaseResponse
<
WxPayParamBean
>>>
{
return
HttpManager
.
getInstance
()
.
execute
(
lifecycleProvider
,
MainApi
.
newInstance
().
getVipPayParams
(
map
))
}
/**
* 支付成功
*/
fun
queryVipOrder
(
lifecycleProvider
:
LifecycleProvider
<
Any
>?,
map
:
Map
<
String
,
Any
>):
Observable
<
Response
<
BaseResponse
<
Any
>>>
{
return
HttpManager
.
getInstance
()
.
execute
(
lifecycleProvider
,
MainApi
.
newInstance
().
queryVipOrder
(
map
))
}
/**
/**
* 获取用户登录信息
* 获取用户登录信息
*/
*/
...
...
app/src/main/java/com/mints/street/splash/SplashActivity.kt
View file @
8f58055b
...
@@ -17,9 +17,9 @@ import com.mints.street.common.DeviceInfo
...
@@ -17,9 +17,9 @@ 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.utils.systembar.StatusBarUtil
/**
/**
* 描述:gromore开屏页
* 描述:gromore开屏页
...
@@ -28,7 +28,7 @@ import com.tencent.mmkv.MMKV
...
@@ -28,7 +28,7 @@ import com.tencent.mmkv.MMKV
*/
*/
class
SplashActivity
:
BaseActivity
<
ActivitySplashBinding
,
SplashViewModel
>()
{
class
SplashActivity
:
BaseActivity
<
ActivitySplashBinding
,
SplashViewModel
>()
{
private
var
m
SplashContainer
:
FrameLayout
?
=
null
private
var
m
splash
:
FrameLayout
?
=
null
private
var
mTTSplashAd
:
TTSplashAd
?
=
null
private
var
mTTSplashAd
:
TTSplashAd
?
=
null
private
val
AD_TIME_OUT
=
3000
private
val
AD_TIME_OUT
=
3000
private
var
onPaused
=
false
private
var
onPaused
=
false
...
@@ -48,6 +48,7 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() {
...
@@ -48,6 +48,7 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() {
return
return
}
}
StatusBarUtil
.
immersive
(
this
)
//校验App签名
//校验App签名
checkAppSign
()
checkAppSign
()
...
@@ -81,8 +82,8 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() {
...
@@ -81,8 +82,8 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() {
mTTSplashAd
?.
destroy
()
mTTSplashAd
?.
destroy
()
mTTSplashAd
=
null
mTTSplashAd
=
null
m
SplashContainer
?.
removeAllViews
()
m
splash
?.
removeAllViews
()
m
SplashContainer
=
null
m
splash
=
null
}
}
/**
/**
...
@@ -94,7 +95,7 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() {
...
@@ -94,7 +95,7 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() {
finish
()
finish
()
}
else
{
}
else
{
// try {
// try {
// m
SplashContainer
= findViewById(R.id.splash_container)
// m
splash
= findViewById(R.id.splash_container)
// //加载开屏广告
// //加载开屏广告
// loadSplashAd()
// loadSplashAd()
// } catch (e: Exception) {
// } catch (e: Exception) {
...
@@ -123,7 +124,7 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() {
...
@@ -123,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:请求广告,调用开屏广告异步请求接口,对请求回调的广告作渲染处理
...
@@ -134,7 +135,7 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() {
...
@@ -134,7 +135,7 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() {
}
}
override
fun
onSplashAdLoadSuccess
()
{
override
fun
onSplashAdLoadSuccess
()
{
mTTSplashAd
?.
showAd
(
m
SplashContainer
)
mTTSplashAd
?.
showAd
(
m
splash
)
}
}
override
fun
onAdLoadTimeout
()
{
override
fun
onAdLoadTimeout
()
{
...
...
app/src/main/java/com/mints/street/utils/NetUtils.java
0 → 100644
View file @
8f58055b
/*
* 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 @
8f58055b
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 @
8f58055b
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 @
8f58055b
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 @
8f58055b
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/java/com/mints/street/widget/BrowserLayout.kt
0 → 100644
View file @
8f58055b
package
com.mints.street.widget
import
android.content.Context
import
android.content.Intent
import
android.net.Uri
import
android.os.Build
import
android.util.AttributeSet
import
android.util.TypedValue
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.webkit.WebChromeClient
import
android.webkit.WebSettings
import
android.webkit.WebView
import
android.webkit.WebViewClient
import
android.widget.LinearLayout
import
android.widget.ProgressBar
import
android.widget.TextView
import
com.mints.street.R
class
BrowserLayout
:
LinearLayout
{
private
var
mContext
:
Context
?
=
null
private
var
mWebView
:
WebView
?
=
null
private
var
mWebTitle
:
TextView
?
=
null
private
val
mBarHeight
=
5
private
var
mProgressBar
:
ProgressBar
?
=
null
constructor
(
context
:
Context
)
:
super
(
context
)
{
init
(
context
)
}
constructor
(
context
:
Context
,
attrs
:
AttributeSet
?
)
:
super
(
context
,
attrs
)
{
init
(
context
)
}
private
fun
init
(
context
:
Context
)
{
mContext
=
context
orientation
=
VERTICAL
mProgressBar
=
LayoutInflater
.
from
(
context
)
.
inflate
(
R
.
layout
.
progress_horizontal
,
null
)
as
ProgressBar
mProgressBar
!!
.
max
=
100
mProgressBar
!!
.
progress
=
0
addView
(
mProgressBar
,
LayoutParams
.
MATCH_PARENT
,
TypedValue
.
applyDimension
(
TypedValue
.
COMPLEX_UNIT_PX
,
mBarHeight
.
toFloat
(),
resources
.
displayMetrics
).
toInt
()
)
mWebView
=
WebView
(
context
)
mWebView
!!
.
settings
.
javaScriptEnabled
=
true
mWebView
!!
.
scrollBarStyle
=
View
.
SCROLLBARS_INSIDE_OVERLAY
mWebView
!!
.
settings
.
defaultTextEncodingName
=
"UTF-8"
mWebView
!!
.
settings
.
cacheMode
=
WebSettings
.
LOAD_NO_CACHE
mWebView
!!
.
settings
.
builtInZoomControls
=
true
mWebView
!!
.
settings
.
setSupportMultipleWindows
(
true
)
//将图片调整到适合webview的大小
mWebView
!!
.
settings
.
useWideViewPort
=
false
mWebView
!!
.
settings
.
loadWithOverviewMode
=
true
mWebView
!!
.
settings
.
setSupportZoom
(
true
)
mWebView
!!
.
settings
.
pluginState
=
WebSettings
.
PluginState
.
ON
mWebView
!!
.
settings
.
domStorageEnabled
=
true
mWebView
!!
.
settings
.
loadsImagesAutomatically
=
true
mWebView
!!
.
settings
.
displayZoomControls
=
false
// 支持打开新窗口
mWebView
!!
.
settings
.
javaScriptCanOpenWindowsAutomatically
=
true
try
{
mWebView
!!
.
setLayerType
(
View
.
LAYER_TYPE_NONE
,
null
)
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
//支持自动加载图片
mWebView
!!
.
settings
.
loadsImagesAutomatically
=
true
//解决5.0后https地址中图片不显示的问题(图片地址为http)
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
mWebView
!!
.
settings
.
mixedContentMode
=
WebSettings
.
MIXED_CONTENT_ALWAYS_ALLOW
}
//允许webview对文件的操作
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN
)
{
mWebView
!!
.
settings
.
allowUniversalAccessFromFileURLs
=
true
mWebView
!!
.
settings
.
allowFileAccessFromFileURLs
=
true
}
mWebView
!!
.
settings
.
allowFileAccess
=
true
val
lps
=
LayoutParams
(
LayoutParams
.
MATCH_PARENT
,
0
,
1f
)
addView
(
mWebView
,
lps
)
mWebView
!!
.
setWebChromeClient
(
object
:
WebChromeClient
()
{
override
fun
onReceivedTitle
(
view
:
WebView
,
title
:
String
)
{
super
.
onReceivedTitle
(
view
,
title
)
if
(
mWebTitle
!=
null
)
{
mWebTitle
!!
.
text
=
title
}
}
override
fun
onProgressChanged
(
view
:
WebView
,
newProgress
:
Int
)
{
super
.
onProgressChanged
(
view
,
newProgress
)
if
(
newProgress
==
100
)
{
mProgressBar
!!
.
visibility
=
View
.
GONE
}
else
{
mProgressBar
!!
.
visibility
=
View
.
VISIBLE
mProgressBar
!!
.
progress
=
newProgress
}
}
})
mWebView
!!
.
webViewClient
=
object
:
WebViewClient
()
{
override
fun
shouldOverrideUrlLoading
(
view
:
WebView
,
url
:
String
):
Boolean
{
if
(
url
.
startsWith
(
"tel:"
))
{
try
{
val
intent
=
Intent
(
Intent
.
ACTION_DIAL
,
Uri
.
parse
(
url
))
intent
.
flags
=
Intent
.
FLAG_ACTIVITY_NEW_TASK
mContext
!!
.
startActivity
(
intent
)
}
catch
(
e
:
Exception
)
{
}
return
true
}
return
super
.
shouldOverrideUrlLoading
(
view
,
url
)
}
override
fun
onPageFinished
(
view
:
WebView
,
url
:
String
)
{
super
.
onPageFinished
(
view
,
url
)
}
}
}
fun
loadUrl
(
url
:
String
?)
{
mWebView
!!
.
loadUrl
(
url
!!
)
}
fun
canGoBack
():
Boolean
{
return
if
(
null
!=
mWebView
)
mWebView
!!
.
canGoBack
()
else
false
}
fun
canGoForward
():
Boolean
{
return
if
(
null
!=
mWebView
)
mWebView
!!
.
canGoForward
()
else
false
}
fun
goBack
()
{
if
(
null
!=
mWebView
)
{
mWebView
!!
.
goBack
()
}
}
fun
goForward
()
{
if
(
null
!=
mWebView
)
{
mWebView
!!
.
goForward
()
}
}
val
webView
:
WebView
?
get
()
=
if
(
mWebView
!=
null
)
mWebView
else
null
fun
setWebTitle
(
mWebTitle
:
TextView
?)
{
this
.
mWebTitle
=
mWebTitle
}
fun
clearWebView
()
{
if
(
mWebView
!=
null
)
{
val
parent
=
mWebView
!!
.
parent
as
ViewGroup
parent
?.
removeView
(
mWebView
)
mWebView
!!
.
removeAllViews
()
mWebView
!!
.
destroy
()
mWebView
=
null
}
}
}
\ No newline at end of file
app/src/main/res/drawable/progress_bar_horizontal.xml
0 → 100644
View file @
8f58055b
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:id=
"@android:id/background"
android:drawable=
"@drawable/progress_bar_bg"
/>
<item
android:id=
"@android:id/progress"
>
<clip>
<shape>
<solid
android:color=
"#3D5AFE"
/>
</shape>
</clip>
</item>
</layer-list>
\ No newline at end of file
app/src/main/res/layout/activity_aboutus.xml
View file @
8f58055b
...
@@ -26,8 +26,8 @@
...
@@ -26,8 +26,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/activity_mints_web_view.xml
View file @
8f58055b
...
@@ -16,11 +16,10 @@
...
@@ -16,11 +16,10 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
app:ctb_theme=
"dark"
app:ctb_theme=
"dark"
app:layout_constraintTop_toTopOf=
"parent"
/>
app:layout_constraintTop_toTopOf=
"parent"
/>
<WebView
<WebView
android:id=
"@+id/webview"
android:id=
"@+id/webview"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
android:layout_height=
"match_parent"
/>
</LinearLayout>
</LinearLayout>
</layout>
</layout>
\ No newline at end of file
app/src/main/res/layout/activity_moresettings.xml
View file @
8f58055b
...
@@ -30,10 +30,22 @@
...
@@ -30,10 +30,22 @@
android:id=
"@+id/item_phone"
android:id=
"@+id/item_phone"
layout=
"@layout/item_settings"
/>
layout=
"@layout/item_settings"
/>
<View
style=
"@style/view_line_E6E6E6"
android:layout_marginStart=
"20dp"
android:layout_marginEnd=
"20dp"
android:layout_alignParentBottom=
"true"
/>
<include
<include
android:id=
"@+id/item_userAgree"
android:id=
"@+id/item_userAgree"
layout=
"@layout/item_settings"
/>
layout=
"@layout/item_settings"
/>
<View
style=
"@style/view_line_E6E6E6"
android:layout_marginStart=
"20dp"
android:layout_marginEnd=
"20dp"
android:layout_alignParentBottom=
"true"
/>
<include
<include
android:id=
"@+id/item_privacyAgree"
android:id=
"@+id/item_privacyAgree"
layout=
"@layout/item_settings"
/>
layout=
"@layout/item_settings"
/>
...
...
app/src/main/res/layout/activity_splash.xml
View file @
8f58055b
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<FrameLayout
<FrameLayout
android:id=
"@+id/fl_splash"
android:id=
"@+id/fl_splash"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@android:color/white"
>
<!--这里模拟一张oneshot单的焦点图展示-->
<ImageView
android:id=
"@+id/oneshot_image"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"10dp"
android:layout_marginRight=
"10dp"
android:layout_marginTop=
"400px"
/>
<RelativeLayout
android:id=
"@+id/splash_main"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@android:color/white"
>
android:background=
"@android:color/darker_gray"
>
</FrameLayout>
<!-- 广点通开屏广告支持“半屏/全屏”展示,开发者可以把Logo区域放在屏幕底部,然后在Logo上方提供一个容器来放置半开屏广告,请注意此容器高度不得小于400dp -->
<!-- 1.Logo区域:展示半开屏广告时使用,如果想展示全开屏广告,可以不需要这个Logo区域 -->
<!-- 注意:如需要这个Logo区域,建议开发者使用自己的Logo资源,而不是联盟的Logo资源@drawable/gdt_splash_logo,资源规格可参照@drawable/gdt_splash_logo -->
<FrameLayout
android:id=
"@+id/splash_container"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_above=
"@id/app_logo"
/>
<!-- 2.预设开屏图片区域: -->
<!-- 开发者可以把自家App设计开屏图片摆放在这里,本示例中放置了一张静态图片。!-->
<!-- 注意1:直接将此图放在广告容器的下面即可,始终不要将广告容器splash_container的设为invisible,否则将不会展示广告无法计费,返回错误码600。-->
<!-- 注意2:建议开发者使用自己的开屏图片资源,而不是联盟的@drawable/splash_holder,资源规格可参照@drawable/splash_holder -->
<ImageView
android:id=
"@+id/splash_holder"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_above=
"@id/app_logo"
android:scaleType=
"fitXY"
/>
<!-- 3.开屏广告容器区域:-->
<!-- 注意:该区域高度不得小于400dp。在本示例中没有写死splash_container的高度值,是因为第1部分的app_logo区域是一个高度很小的图片。 -->
<ImageView
android:id=
"@+id/app_logo"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"10dp"
/>
<!-- 4.自定义跳过按钮区域:开发者可以根据需要自己实现不同样式的跳过按钮 -->
<!-- 注意1:根据广告法规定,跳过按钮必须在屏幕当中出现。因此广告展示的时候,必须让将SkipView显示出来,即visible,否则将SDK将不展示广告,返回错误码608。。 -->
<!-- 注意2:SDK除了会检查跳过按钮的可见性,还将检测它的尺寸,其尺寸不得小于3dp*3dp,否则将SDK将不展示广告,返回错误码608。 -->
<TextView
android:id=
"@+id/skip_view"
android:layout_width=
"96dp"
android:layout_height=
"wrap_content"
android:layout_alignParentEnd=
"true"
android:layout_alignParentTop=
"true"
android:layout_marginBottom=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_marginTop=
"16dp"
android:background=
"@drawable/shape_bg_circle"
android:gravity=
"center"
android:text=
"点击跳过"
android:textColor=
"@android:color/white"
android:textSize=
"14sp"
android:visibility=
"gone"
/>
<!-- 本示例省略了自定义的倒计时,和跳过按钮放在一起实现了。开发者也可以实现自己的倒计时View,方法是在onADTick回调中获得广告剩余的展示时间,并自由决定倒计时View的样式,SDK对倒计时的View没有要求。 -->
<!-- 自定义wifi预加载按钮,需设置状态为不显示,当素材为视频且视频开始播放时,SDK内部会处理为显示状态-->
<TextView
android:id=
"@+id/preload_view"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentLeft=
"true"
android:layout_alignParentTop=
"true"
android:layout_margin=
"16dp"
android:background=
"@drawable/shape_bg_circle"
android:gravity=
"center"
android:text=
"已Wi-Fi预加载"
android:textColor=
"@android:color/white"
android:textSize=
"14sp"
android:visibility=
"gone"
/>
</RelativeLayout>
</FrameLayout>
<data>
<data>
<variable
<variable
...
...
app/src/main/res/layout/fragment_my.xml
View file @
8f58055b
...
@@ -125,7 +125,11 @@
...
@@ -125,7 +125,11 @@
<include
<include
android:id=
"@+id/aboutus"
android:id=
"@+id/aboutus"
layout=
"@layout/item_settings"
/>
layout=
"@layout/item_settings"
/>
<View
style=
"@style/view_line_E6E6E6"
android:layout_marginStart=
"20dp"
android:layout_marginEnd=
"20dp"
android:layout_alignParentBottom=
"true"
/>
<include
<include
android:id=
"@+id/moresettings"
android:id=
"@+id/moresettings"
layout=
"@layout/item_settings"
/>
layout=
"@layout/item_settings"
/>
...
...
app/src/main/res/layout/item_settings.xml
View file @
8f58055b
...
@@ -32,8 +32,4 @@
...
@@ -32,8 +32,4 @@
android:layout_centerVertical=
"true"
android:layout_centerVertical=
"true"
android:visibility=
"gone"
/>
android:visibility=
"gone"
/>
<View
style=
"@style/view_line_E6E6E6"
android:layout_alignParentBottom=
"true"
/>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/progress_horizontal.xml
0 → 100644
View file @
8f58055b
<!--
~ 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.
-->
<ProgressBar
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/my_profile_tracker"
style=
"?android:attr/progressBarStyleHorizontal"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@null"
android:max=
"60"
android:indeterminateOnly=
"false"
android:progressDrawable=
"@drawable/progress_bar_horizontal"
/>
app/src/main/res/layout/view_data_page2.xml
View file @
8f58055b
...
@@ -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"
...
...
app/src/main/res/mipmap-xxhdpi/ic_launcher_main.png
View replaced file @
b1810cca
View file @
8f58055b
21.9 KB
|
W:
|
H:
43.6 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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