Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_goodmoney
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_goodmoney
Commits
68fb9a75
Commit
68fb9a75
authored
Apr 28, 2021
by
张释方
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加公众号弹框
parent
07e9a8f8
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
406 additions
and
35 deletions
+406
-35
build.gradle
GoodMoney/app/build.gradle
+3
-0
CircleTextView.java
.../java/com/mints/goodmoney/call/widget/CircleTextView.java
+4
-4
Constant.kt
.../app/src/main/java/com/mints/goodmoney/common/Constant.kt
+7
-2
UserTaskMsgBean.java
...n/java/com/mints/goodmoney/mvp/model/UserTaskMsgBean.java
+10
-0
HomePresenter.kt
.../java/com/mints/goodmoney/mvp/presenters/HomePresenter.kt
+41
-0
LoanService.java
...pp/src/main/java/com/mints/goodmoney/net/LoanService.java
+7
-0
MainActivity.kt
...ain/java/com/mints/goodmoney/ui/activitys/MainActivity.kt
+2
-0
WxLoginActivity.kt
.../java/com/mints/goodmoney/ui/activitys/WxLoginActivity.kt
+0
-1
MainFragment.kt
...main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
+78
-4
MoneyFragment.kt
...ain/java/com/mints/goodmoney/ui/fragment/MoneyFragment.kt
+2
-0
MyFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
+84
-8
DialogUtils.kt
...java/com/mints/goodmoney/ui/widgets/dialog/DialogUtils.kt
+10
-0
GzhDialog.kt
...n/java/com/mints/goodmoney/ui/widgets/dialog/GzhDialog.kt
+53
-0
shape_btn_bg_blue.xml
GoodMoney/app/src/main/res/drawable/shape_btn_bg_blue.xml
+9
-0
dialog_drawcash.xml
GoodMoney/app/src/main/res/layout/dialog_drawcash.xml
+3
-3
dialog_gzh.xml
GoodMoney/app/src/main/res/layout/dialog_gzh.xml
+80
-0
dialog_task.xml
GoodMoney/app/src/main/res/layout/dialog_task.xml
+1
-1
floating_view.xml
GoodMoney/app/src/main/res/layout/floating_view.xml
+8
-8
bg_btn_gzh.png
GoodMoney/app/src/main/res/mipmap-xhdpi/bg_btn_gzh.png
+0
-0
bg_gzh.png
GoodMoney/app/src/main/res/mipmap-xhdpi/bg_gzh.png
+0
-0
ic_close_y.png
GoodMoney/app/src/main/res/mipmap-xhdpi/ic_close_y.png
+0
-0
iv_close_gzh.png
GoodMoney/app/src/main/res/mipmap-xhdpi/iv_close_gzh.png
+0
-0
attrs.xml
GoodMoney/app/src/main/res/values/attrs.xml
+4
-4
No files found.
GoodMoney/app/build.gradle
View file @
68fb9a75
...
...
@@ -355,6 +355,9 @@ dependencies {
implementation
(
name:
'mduisdk_v3.1.0.18_support_msa_1.0.23'
,
ext:
'aar'
)
implementation
'com.tencent.tbs.tbssdk:sdk:43903'
// //芒果联盟
// implementation 'com.openppeace.mgmob:mgmob:1.3.5-alpha5'//MGMob
// testImplementation 'junit:junit:4.13'
// androidTestImplementation 'androidx.test.ext:junit:1.1.2'
// androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/call/widget/CircleTextView.java
View file @
68fb9a75
...
...
@@ -38,10 +38,10 @@ public class CircleTextView extends View {
private
void
initCustomAttrs
(
Context
context
,
AttributeSet
attrs
)
{
TypedArray
ta
=
context
.
obtainStyledAttributes
(
attrs
,
R
.
styleable
.
CircleTextView
);
mFontSize
=
DimensionUtil
.
sp2px
(
context
,
ta
.
getInteger
(
R
.
styleable
.
CircleTextView_size
,
16
));
mCustomText
=
ta
.
getString
(
R
.
styleable
.
CircleTextView_text
);
mCustomColor
=
ta
.
getColor
(
R
.
styleable
.
CircleTextView_color
,
Color
.
BLUE
);
mCustomRadius
=
DimensionUtil
.
dip2px
(
context
,
ta
.
getInteger
(
R
.
styleable
.
CircleTextView_radius
,
30
));
mFontSize
=
DimensionUtil
.
sp2px
(
context
,
ta
.
getInteger
(
R
.
styleable
.
CircleTextView_
goodmoney_
size
,
16
));
mCustomText
=
ta
.
getString
(
R
.
styleable
.
CircleTextView_
goodmoney_
text
);
mCustomColor
=
ta
.
getColor
(
R
.
styleable
.
CircleTextView_
goodmoney_
color
,
Color
.
BLUE
);
mCustomRadius
=
DimensionUtil
.
dip2px
(
context
,
ta
.
getInteger
(
R
.
styleable
.
CircleTextView_
goodmoney_
radius
,
30
));
ta
.
recycle
();
mCirclePaint
=
new
Paint
();
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/common/Constant.kt
View file @
68fb9a75
...
...
@@ -6,12 +6,17 @@ import com.mints.goodmoney.manager.UserManager
object
Constant
{
/**
* 首次弹出权限声明
*/
const
val
LOAN_PERMISSION_FLAG
=
"loan_permission_flag"
/**
* 设置公众号弹窗出现后状态值
*/
const
val
STATUS_CODE_ONE
=
1
const
val
STATUS_CODE_TWO
=
2
/**
* 获取TAGNAME
*/
...
...
@@ -187,7 +192,7 @@ object Constant {
// 热门活动类型
//小满
const
val
HOT_ACTIVITY_SHEEP
=
"TO_XMKJ"
const
val
HOT_ACTIVITY_YYZ
=
"TO_YYZ"
const
val
HOT_ACTIVITY_YYZ
=
"TO_YYZ"
const
val
HOT_ACTIVITY_WATER
=
"water"
const
val
HOT_ACTIVITY_WALK
=
"walk"
const
val
HOT_ACTIVITY_CARD
=
"card"
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/UserTaskMsgBean.java
View file @
68fb9a75
...
...
@@ -19,6 +19,16 @@ public class UserTaskMsgBean implements Serializable {
private
boolean
needReportClickAdEvent
;
public
boolean
isShowWechatTips
()
{
return
showWechatTips
;
}
public
void
setShowWechatTips
(
boolean
showWechatTips
)
{
this
.
showWechatTips
=
showWechatTips
;
}
private
boolean
showWechatTips
;
public
boolean
isNeedReportClickAdEvent
()
{
return
needReportClickAdEvent
;
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/HomePresenter.kt
View file @
68fb9a75
...
...
@@ -216,4 +216,45 @@ class HomePresenter : BasePresenter<HomeView>() {
}
}
/**
* 公众号弹框参数传递
*/
fun
setWechatTipsStatus
(
status
:
Int
)
{
LogUtil
.
d
(
"GzhPresenter"
,
"setWechatTipsStatus*******************************************"
)
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"status"
]
=
status
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
setWechatTipsStatus
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
Any
>>()
{
override
fun
onCompleted
()
{
LogUtil
.
d
(
"GzhPresenter"
,
"********************onCompleted**********************"
)
if
(
isLinkView
)
return
}
override
fun
onError
(
e
:
Throwable
)
{
LogUtil
.
d
(
"GzhPresenter"
,
"********************onError**********************${e.printStackTrace()}"
)
e
.
printStackTrace
().
toString
()
if
(
isLinkView
)
return
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
Any
>)
{
if
(
isLinkView
)
return
val
code
:
Int
=
baseResponse
.
getStatus
()
val
message
:
String
=
baseResponse
.
getMessage
()
when
(
code
)
{
200
->
{
//请求成功后可以在这里响应请求
LogUtil
.
d
(
"GzhPresenter"
,
"********************成功了**********************"
)
}
else
->
{
view
.
showToast
(
message
)
//请求成功后可以在这里响应请求
LogUtil
.
d
(
"GzhPresenter"
,
"*********************不成功*********************"
)
}
}
}
})
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/net/LoanService.java
View file @
68fb9a75
...
...
@@ -622,6 +622,13 @@ public interface LoanService {
@POST
(
"api/myRotationChart"
)
Observable
<
BaseResponse
<
RotationChartBean
>>
myRotationChart
();
/**
* 参数判断(公众号弹框)
* @param vo
* @return
*/
@POST
(
"api/setWechatTipsStatus"
)
Observable
<
BaseResponse
<
JsonObject
>>
setWechatTipsStatus
(
@Body
Map
<
String
,
Object
>
vo
);
/**
* 默认http工厂
*/
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/MainActivity.kt
View file @
68fb9a75
...
...
@@ -20,6 +20,7 @@ import com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.mvp.views.MainView
import
com.mints.goodmoney.ui.activitys.base.BaseActivity
import
com.mints.goodmoney.ui.fragment.*
import
com.mints.goodmoney.utils.LogUtil
import
dagger.hilt.android.AndroidEntryPoint
import
kotlinx.android.synthetic.main.activity_main.*
...
...
@@ -54,6 +55,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
override
fun
initViewsAndEvents
()
{
showShortVedioLayout
()
if
(
moneyFragment
==
null
)
{
moneyFragment
=
MoneyFragment
()
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/WxLoginActivity.kt
View file @
68fb9a75
...
...
@@ -134,7 +134,6 @@ class WxLoginActivity : BaseActivity()
progressDialog
?.
dismiss
()
if
(
TextUtils
.
equals
(
channel
,
Constant
.
CHANNEL_SHARE
))
{
readyGo
(
MainActivity
::
class
.
java
)
}
finish
()
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
View file @
68fb9a75
package
com.mints.goodmoney.ui.fragment
import
android.app.Dialog
import
android.content.*
import
android.os.Bundle
import
android.os.Handler
import
android.os.Looper
...
...
@@ -21,6 +22,7 @@ import com.mints.goodmoney.ad.video.VideoAdingManager
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.*
import
com.mints.goodmoney.mvp.model.BaseResponse
import
com.mints.goodmoney.mvp.model.FlowAdRulesBean
import
com.mints.goodmoney.mvp.model.MainVideoMsgBean
import
com.mints.goodmoney.mvp.model.UserTaskMsgBean
...
...
@@ -29,10 +31,10 @@ import com.mints.goodmoney.mvp.views.HomeView
import
com.mints.goodmoney.ui.activitys.AwardActivity
import
com.mints.goodmoney.ui.activitys.WebActivity
import
com.mints.goodmoney.ui.fragment.base.BaseFragment
import
com.mints.goodmoney.ui.widgets.dialog.BindWxDialog
import
com.mints.goodmoney.ui.widgets.dialog.DialogListener
import
com.mints.goodmoney.ui.widgets.countdowntimer.CountDownTimerSupport
import
com.mints.goodmoney.ui.widgets.countdowntimer.OnCountDownTimerListener
import
com.mints.goodmoney.ui.widgets.dialog.BindWxDialog
import
com.mints.goodmoney.ui.widgets.dialog.DialogListener
import
com.mints.goodmoney.ui.widgets.dialog.DialogUtils
import
com.mints.goodmoney.ui.widgets.seekbar.BubbleUtils
import
com.mints.goodmoney.utils.LogUtil
...
...
@@ -62,6 +64,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
private
var
bindWxDialog
:
BindWxDialog
?
=
null
private
var
userMsgBean
:
UserTaskMsgBean
?
=
null
private
lateinit
var
baseResponse
:
BaseResponse
<
UserTaskMsgBean
>
// 视频相关
private
var
rewardDoubleCoin
=
0
// 大金币
...
...
@@ -214,6 +217,10 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
return
}
LogUtil
.
d
(
"GzhPresenter"
,
"getHallBaseMsgSuc************************************"
)
// 公众号弹框
GzhDialogShow
(
data
)
userMsgBean
=
data
if
(
userMsgBean
?.
shareNews
!=
null
)
{
...
...
@@ -315,11 +322,23 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
}
/**
* 公众号弹出(判断)
*/
private
fun
GzhDialogShow
(
data
:
UserTaskMsgBean
)
{
LogUtil
.
d
(
"GzhPresenter"
,
"GzhDialogShow***************************************"
)
//用户 第二天打开应用并且非重新下载安装
if
(
data
.
isShowWechatTips
&&
!
ps
.
getBoolean
(
Constant
.
LOAN_PERMISSION_FLAG
,
true
))
{
gzhDialog
()
//服务器交互,做回调 //弹窗打开传入1
homePresenter
.
setWechatTipsStatus
(
Constant
.
STATUS_CODE_ONE
)
}
}
private
fun
showPowerDialog
()
{
if
(
ps
.
getBoolean
(
Constant
.
LOAN_PERMISSION_FLAG
,
true
))
{
powerDialog
()
}
else
{
// 数美初始化
ShumeiManager
.
getInstance
().
initShumei
()
}
...
...
@@ -522,6 +541,61 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
cdvvYilanTime
?.
start
()
}
/**
* 公众号弹框点击响应
*/
private
fun
gzhDialog
()
{
DialogUtils
.
showGzhDialog
(
requireActivity
(),
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
when
(
v
?.
id
)
{
R
.
id
.
tv_focus
->
{
//马上关注
// //将“淘金空间”复制到粘贴板上
val
clipboardManager
=
baseApplication
.
getSystemService
(
Context
.
CLIPBOARD_SERVICE
)
as
ClipboardManager
val
clipData
=
ClipData
.
newPlainText
(
"Label"
,
"淘金空间"
)
clipboardManager
.
setPrimaryClip
(
clipData
)
showToast
(
"已复制内容到剪贴板"
)
//直接跳转到微信搜索界面
getWechatApi
()
dialog
?.
dismiss
()
homePresenter
.
setWechatTipsStatus
(
Constant
.
STATUS_CODE_TWO
)
}
R
.
id
.
tv_subscribe
->
{
//我已订阅
//关闭当前页面
//并不在提示当前弹窗
if
(
activity
!=
null
&&
!
activity
!!
.
isFinishing
&&
dialog
!=
null
&&
dialog
.
isShowing
)
{
dialog
.
dismiss
()
homePresenter
.
setWechatTipsStatus
(
Constant
.
STATUS_CODE_TWO
)
}
}
R
.
id
.
iv_Close
->
{
//关闭当前界面
//关闭后当天不在显示
if
(
activity
!=
null
&&
!
activity
!!
.
isFinishing
&&
dialog
!=
null
&&
dialog
.
isShowing
)
{
dialog
.
dismiss
()
}
}
}
}
})
}
/**
* 跳转到微信搜索页面
*/
private
fun
getWechatApi
()
{
try
{
val
intent
=
Intent
(
Intent
.
ACTION_MAIN
)
val
cmp
=
ComponentName
(
"com.tencent.mm"
,
"com.tencent.mm.ui.LauncherUI"
)
intent
.
addCategory
(
Intent
.
CATEGORY_LAUNCHER
)
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
)
intent
.
component
=
cmp
startActivity
(
intent
)
}
catch
(
e
:
ActivityNotFoundException
)
{
showToast
(
"检查到您手机没有安装微信,请安装后使用该功能"
)
}
}
/**
* 权限弹窗
*/
...
...
@@ -675,7 +749,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
override
fun
onFinish
()
{
if
(
isAdded
&&
!
requireActivity
().
isFinishing
)
{
LogUtil
.
d
(
TAG
,
"onFinish"
)
LogUtil
.
d
(
TAG
,
"onFinish"
)
tv_fragment_main_redbox
.
text
=
"可拆开"
rl_fragment_main_redbox
.
isClickable
=
true
showRedbox
(
rl_fragment_main_redbox
)
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MoneyFragment.kt
View file @
68fb9a75
...
...
@@ -8,6 +8,7 @@ import com.chineseall.reader17ksdk.feature.main.bookshop.wellchosen.WellChosenFr
import
com.mints.goodmoney.R
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.ui.fragment.base.BaseFragment
import
com.mints.goodmoney.utils.LogUtil
import
dagger.hilt.android.AndroidEntryPoint
import
kotlinx.android.synthetic.main.fragment_main_money.*
...
...
@@ -67,6 +68,7 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
if
(
AppConfig
.
showAdFlag
)
{
if
(
mainFragment
==
null
)
{
mainFragment
=
MainFragment
()
LogUtil
.
d
(
"mainFragment"
,
"mainFragment是空的。。。。。。。。。。。。。。。。。。"
)
}
if
(!
mainFragment
!!
.
isAdded
)
{
// 提交事务
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
View file @
68fb9a75
...
...
@@ -3,10 +3,7 @@ package com.mints.goodmoney.ui.fragment
import
android.Manifest
import
android.annotation.SuppressLint
import
android.app.Dialog
import
android.content.BroadcastReceiver
import
android.content.Context
import
android.content.Intent
import
android.content.IntentFilter
import
android.content.*
import
android.os.Bundle
import
android.text.TextUtils
import
android.view.LayoutInflater
...
...
@@ -130,6 +127,7 @@ class MyFragment : BaseFragment(),
initManager
()
initView
()
initRecy
()
readyGo
(
WxLoginActivity
::
class
.
java
)
}
...
...
@@ -159,9 +157,13 @@ class MyFragment : BaseFragment(),
DownloadApkManager
.
tryOnceInstallApk
()
if
(!
TextUtils
.
isEmpty
(
userManager
.
userID
))
{
LogUtil
.
d
(
"lixianshouyi"
,
"用户已经登录........................"
)
myPresenter
.
getAutoUserHallBaseMsg
()
refreshHighTask
()
}
else
{
LogUtil
.
d
(
"lixianshouyi"
,
"用户还么有登录........................"
)
// 游客登录
myPresenter
.
userLogin
()
}
...
...
@@ -206,6 +208,8 @@ class MyFragment : BaseFragment(),
}
override
fun
getUserTaskMsgSuc
(
data
:
MyInfo
?)
{
LogUtil
.
d
(
"lixianshouyi"
,
"getUserTaskMsgSuc......................................."
)
srl_my
.
finishRefresh
(
true
)
if
(
data
==
null
)
{
...
...
@@ -224,14 +228,17 @@ class MyFragment : BaseFragment(),
}
override
fun
getUserTaskMsgFail
()
{
srl_my
.
finishRefresh
(
false
)
LogUtil
.
d
(
"lixianshouyi"
,
"getUserTaskMsgFail......................................."
)
srl_my
.
finishRefresh
(
false
)
userConfig
=
null
vp_grid
.
visibility
=
View
.
GONE
setUserLoginStatus
()
}
override
fun
getMyHotActivitySuc
(
data
:
BannerBean
?)
{
LogUtil
.
d
(
"lixianshouyi"
,
"getMyHotActivitySuc......................................."
)
if
(
activity
!=
null
&&
!
requireActivity
().
isFinishing
)
{
data
?.
let
{
/*if (it.ListBean().toUrl.equals(Constant.HOT_ACTIVITY_SHEEP)){
...
...
@@ -296,6 +303,7 @@ class MyFragment : BaseFragment(),
}
override
fun
getSignInHomePageMsgSuc
(
signBean
:
SignCardBean
?)
{
LogUtil
.
d
(
"lixianshouyi"
,
"getSignInHomePageMsgSuc......................................."
)
if
(
signBean
==
null
)
{
signCardBean
=
null
return
...
...
@@ -307,13 +315,16 @@ class MyFragment : BaseFragment(),
}
override
fun
signInHomePageSuc
()
{
LogUtil
.
d
(
"lixianshouyi"
,
"signInHomePageSuc......................................."
)
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
curSignCoin
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_SIGNIN_HOMEPAGE_AWARD
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
}
//游客登陆成功
override
fun
userLoginSuc
()
{
LogUtil
.
d
(
"lixianshouyi"
,
"userLoginSuc......................................."
)
SceneManager
.
signIn
(
requireActivity
())
myPresenter
.
getAutoUserHallBaseMsg
()
...
...
@@ -321,6 +332,7 @@ class MyFragment : BaseFragment(),
}
override
fun
getHallBaseMsgSuc
(
data
:
UserTaskMsgBean
)
{
LogUtil
.
d
(
"lixianshouyi"
,
"getHallBaseMsgSuc......................................."
)
if
(
requireActivity
().
isFinishing
)
{
return
}
...
...
@@ -358,6 +370,66 @@ class MyFragment : BaseFragment(),
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_OFFLINE_DOUBLE
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
}
//添加判断如果是第二天登录则打开公众号界面
//点击后直接关闭
// gzhDialog()//公众号
}
}
private
fun
gzhDialog
()
{
DialogUtils
.
showGzhDialog
(
requireActivity
(),
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
when
(
v
?.
id
)
{
R
.
id
.
tv_focus
->
{
//并将“淘金空间”复制到粘贴板上
// val clipboardManager = dialog?.ownerActivity?.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
// val clipData = ClipData.newPlainText("Label", "淘金空间")
// clipboardManager.setPrimaryClip(clipData)
// // Toast 提示
// showToast("已复制内容到剪贴板")
//直接跳转到微信搜索界面
getWechatApi
()
}
R
.
id
.
tv_subscribe
->
{
//关闭当前页面
//并不在提示当前弹窗
if
(
activity
!=
null
&&
!
activity
!!
.
isFinishing
&&
dialog
!=
null
&&
dialog
.
isShowing
)
{
dialog
.
dismiss
()
ps
.
put
(
Constant
.
LOAN_PERMISSION_FLAG
,
false
)
// 数美初始化
ShumeiManager
.
getInstance
().
initShumei
()
}
}
R
.
id
.
iv_Close
->
{
//关闭当前界面
//再次打开时会继续弹出该弹窗
if
(
activity
!=
null
&&
!
activity
!!
.
isFinishing
&&
dialog
!=
null
&&
dialog
.
isShowing
)
{
dialog
.
dismiss
()
ps
.
put
(
Constant
.
LOAN_PERMISSION_FLAG
,
false
)
// 数美初始化
ShumeiManager
.
getInstance
().
initShumei
()
}
}
}
}
})
}
/**
* 跳转到微信搜索页面
*/
private
fun
getWechatApi
()
{
LogUtil
.
d
(
"getWeChatApi"
,
"点击事件响应了。。。。。。。。。。。。。。。。。。。"
)
try
{
val
intent
=
Intent
(
Intent
.
ACTION_MAIN
)
val
cmp
=
ComponentName
(
"com.tencent.mm"
,
"com.tencent.mm.ui.LauncherUI"
)
intent
.
addCategory
(
Intent
.
CATEGORY_LAUNCHER
)
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
)
intent
.
component
=
cmp
startActivity
(
intent
)
}
catch
(
e
:
ActivityNotFoundException
)
{
showToast
(
"检查到您手机没有安装微信,请安装后使用该功能"
)
}
}
...
...
@@ -495,6 +567,7 @@ class MyFragment : BaseFragment(),
private
fun
setUserLoginStatus
()
{
if
(
userManager
.
userIsLogin
())
{
LogUtil
.
d
(
"lixianshouyi"
,
"setUserLoginStatus。。。。。。。。。。。。。。。。。。。。。。。。。。"
)
// 已登录
if
(
userManager
.
wxOpenid
.
isNotEmpty
())
{
GlideUtils
.
loadImageViewLoding
(
context
,
userManager
.
wxHeader
,
item_title_avatar
,
R
.
mipmap
.
ic_my
,
R
.
mipmap
.
ic_my
)
...
...
@@ -874,7 +947,7 @@ class MyFragment : BaseFragment(),
MainMyAdapter
.
TO_MOKU
->
{
gotoMoku
()
}
MainMyAdapter
.
TO_YYZ
->
{
MainMyAdapter
.
TO_YYZ
->
{
// 愉悦赚事件
if
(!
userManager
.
userIsLogin
())
{
readyGo
(
WxLoginActivity
::
class
.
java
)
...
...
@@ -887,6 +960,7 @@ class MyFragment : BaseFragment(),
}
}
//点击事件
override
fun
onClick
(
v
:
View
?)
{
if
(
AntiShake
.
check
(
view
?.
id
))
return
...
...
@@ -899,7 +973,6 @@ class MyFragment : BaseFragment(),
R
.
id
.
ll_my_login
->
{
if
(!
userManager
.
userIsLogin
())
{
readyGo
(
WxLoginActivity
::
class
.
java
)
// readyGo(ZaActivity::class.java)
}
}
R
.
id
.
tv_left_subtitle
->
{
...
...
@@ -1207,8 +1280,10 @@ class MyFragment : BaseFragment(),
private
fun
initManager
()
{
BannerManager
.
init
()
videoAdingManager
=
VideoAdingManager
.
getInstance
(
activity
)
LogUtil
.
d
(
"lixianshouyi"
,
"进入到initManager。。。。。。。。。。。。。。。。。。。。。。。。。。"
)
//登录成功
if
(!
TextUtils
.
isEmpty
(
userManager
.
userID
))
{
LogUtil
.
d
(
"lixianshouyi"
,
"用户登陆成功!!!。。。。。。。。。。。。。。。。。。。。。。。。。。"
)
// 登录成功的用户初始化鱼丸盒子
if
(
userManager
.
userIsLogin
())
{
YwhzManager
.
init
(
baseApplication
)
...
...
@@ -1222,6 +1297,7 @@ class MyFragment : BaseFragment(),
if
(!
TextUtils
.
isEmpty
(
MintsApplication
.
OAID
))
{
MokuManager
.
initOaid
(
MintsApplication
.
OAID
)
}
}
private
fun
initView
()
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/widgets/dialog/DialogUtils.kt
View file @
68fb9a75
...
...
@@ -54,6 +54,16 @@ object DialogUtils {
dialogListener
.
setDialog
(
bonusDialog
)
}
/**
* 公众号请求弹框
*/
fun
showGzhDialog
(
ctx
:
Context
,
dialogListener
:
DialogListener
)
{
val
weakReference
=
WeakReference
<
Context
>(
ctx
)
val
bonusDialog
=
GzhDialog
(
weakReference
.
get
()
!!
,
dialogListener
)
bonusDialog
.
show
()
dialogListener
.
setDialog
(
bonusDialog
)
}
/**
*
* 权限请求弹框
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/widgets/dialog/GzhDialog.kt
0 → 100644
View file @
68fb9a75
package
com.mints.goodmoney.ui.widgets.dialog
import
android.app.Dialog
import
android.content.ComponentName
import
android.content.Context
import
android.content.Intent
import
android.graphics.Paint
import
android.view.Gravity
import
android.view.KeyEvent
import
android.view.View
import
android.view.WindowManager
import
android.widget.ImageView
import
android.widget.TextView
import
com.mints.goodmoney.R
import
com.mints.library.utils.nodoubleclick.AntiShake
class
GzhDialog
(
context
:
Context
,
private
val
listener
:
DialogListener
)
:
Dialog
(
context
,
R
.
style
.
dialog
)
{
private
val
lp
:
WindowManager
.
LayoutParams
private
val
iv_Close
:
ImageView
private
val
tv_focus
:
TextView
private
val
tv_subscribe
:
TextView
init
{
setContentView
(
R
.
layout
.
dialog_gzh
)
// 设置window属性
lp
=
window
!!
.
attributes
lp
.
gravity
=
Gravity
.
CENTER
lp
.
width
=
WindowManager
.
LayoutParams
.
WRAP_CONTENT
lp
.
windowAnimations
=
R
.
style
.
DialogAnimBottom
window
!!
.
attributes
=
lp
// 设置外部不可关闭
setCancelable
(
false
)
setCanceledOnTouchOutside
(
false
)
setOnKeyListener
{
_
,
i
,
_
->
i
==
KeyEvent
.
KEYCODE_BACK
}
// 查找View
tv_focus
=
findViewById
(
R
.
id
.
tv_focus
)
tv_subscribe
=
findViewById
(
R
.
id
.
tv_subscribe
)
iv_Close
=
findViewById
(
R
.
id
.
iv_Close
)
//设置文字底部下划线,不同android系统显示效果不同,未使用
// tv_subscribe.paint.setFlags(Paint.UNDERLINE_TEXT_FLAG)
// tv_subscribe.paint.setAntiAlias(true)//抗锯齿
tv_focus
.
setOnClickListener
(
listener
)
tv_subscribe
.
setOnClickListener
(
listener
)
iv_Close
.
setOnClickListener
(
listener
)
}
}
\ No newline at end of file
GoodMoney/app/src/main/res/drawable/shape_btn_bg_blue.xml
0 → 100644
View file @
68fb9a75
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<solid
android:color=
"@color/blue"
/>
<corners
android:radius=
"5dip"
/>
</shape>
\ No newline at end of file
GoodMoney/app/src/main/res/layout/dialog_drawcash.xml
View file @
68fb9a75
...
...
@@ -27,10 +27,10 @@
<ImageView
android:id=
"@+id/btn_dialog_drawcash_back"
android:layout_width=
"
30dp
"
android:layout_height=
"
30dp
"
android:layout_width=
"
wrap_content
"
android:layout_height=
"
wrap_content
"
android:layout_alignParentRight=
"true"
android:layout_marginRight=
"1
0
dp"
android:layout_marginRight=
"1
6
dp"
android:src=
"@mipmap/ic_activity_quit"
></ImageView>
</RelativeLayout>
...
...
GoodMoney/app/src/main/res/layout/dialog_gzh.xml
0 → 100644
View file @
68fb9a75
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerInParent=
"true"
android:background=
"@mipmap/bg_gzh"
android:orientation=
"vertical"
>
<ImageView
android:id=
"@+id/iv_Close"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"bottom|end"
android:layout_marginTop=
"35dp"
android:layout_marginRight=
"10dp"
android:src=
"@mipmap/iv_close_gzh"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"186dp"
android:layout_marginLeft=
"20dp"
android:layout_marginRight=
"20dp"
android:text=
"参与最新赚钱活动、获取提现福利、VIP客服反馈..."
android:textColor=
"@color/black"
android:gravity=
"center"
android:textSize=
"14sp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginLeft=
"20dp"
android:layout_marginRight=
"20dp"
android:text=
"更多惊喜等你来看!"
android:textColor=
"@color/black"
android:gravity=
"center"
android:textSize=
"14sp"
/>
<TextView
android:id=
"@+id/tv_focus"
android:layout_width=
"200dp"
android:layout_height=
"36dp"
android:layout_gravity=
"center_horizontal"
android:layout_marginLeft=
"20dp"
android:layout_marginTop=
"36dp"
android:layout_marginRight=
"20dp"
android:layout_marginBottom=
"10dp"
android:background=
"@mipmap/bg_btn_gzh"
android:gravity=
"center"
android:text=
"马上关注"
android:textColor=
"@color/white"
/>
<TextView
android:id=
"@+id/tv_subscribe"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginLeft=
"20dp"
android:layout_marginRight=
"20dp"
android:gravity=
"center"
android:text=
"我已订阅"
android:textColor=
"@color/black"
/>
<View
android:layout_width=
"55dp"
android:layout_height=
"1px"
android:layout_gravity=
"center_horizontal"
android:layout_marginBottom=
"60dp"
android:background=
"@color/black"
/>
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
GoodMoney/app/src/main/res/layout/dialog_task.xml
View file @
68fb9a75
...
...
@@ -69,7 +69,7 @@
<TextView
android:id=
"@+id/dialog_btn_download"
android:layout_width=
"120dp"
android:layout_height=
"
40
dp"
android:layout_height=
"
54
dp"
android:layout_marginTop=
"20dp"
android:background=
"@drawable/shape_btn_switch"
android:gravity=
"center"
...
...
GoodMoney/app/src/main/res/layout/floating_view.xml
View file @
68fb9a75
...
...
@@ -58,10 +58,10 @@
android:layout_width=
"80dp"
android:layout_height=
"80dp"
android:layout_alignParentBottom=
"true"
app:color=
"#FF0000"
app:radius=
"32"
app:size=
"25"
app:text=
"挂断"
/>
app:
goodmoney_
color=
"#FF0000"
app:
goodmoney_
radius=
"32"
app:
goodmoney_
size=
"25"
app:
goodmoney_
text=
"挂断"
/>
</com.mints.goodmoney.call.widget.LockSlidingView>
<com.mints.goodmoney.call.widget.LockSlidingView
...
...
@@ -75,10 +75,10 @@
android:layout_width=
"80dp"
android:layout_height=
"80dp"
android:layout_alignParentBottom=
"true"
app:color=
"#0000FF"
app:radius=
"32"
app:size=
"25"
app:text=
"接听"
/>
app:
goodmoney_
color=
"#0000FF"
app:
goodmoney_
radius=
"32"
app:
goodmoney_
size=
"25"
app:
goodmoney_
text=
"接听"
/>
</com.mints.goodmoney.call.widget.LockSlidingView>
</RelativeLayout>
...
...
GoodMoney/app/src/main/res/mipmap-xhdpi/bg_btn_gzh.png
0 → 100644
View file @
68fb9a75
1.91 KB
GoodMoney/app/src/main/res/mipmap-xhdpi/bg_gzh.png
0 → 100644
View file @
68fb9a75
73.3 KB
GoodMoney/app/src/main/res/mipmap-xhdpi/ic_close_y.png
0 → 100644
View file @
68fb9a75
2.72 KB
GoodMoney/app/src/main/res/mipmap-xhdpi/iv_close_gzh.png
0 → 100644
View file @
68fb9a75
692 Bytes
GoodMoney/app/src/main/res/values/attrs.xml
View file @
68fb9a75
...
...
@@ -175,10 +175,10 @@
</declare-styleable>
<declare-styleable
name=
"CircleTextView"
>
<attr
name=
"size"
format=
"integer"
/>
<attr
name=
"color"
format=
"color"
/>
<attr
name=
"text"
format=
"string"
/>
<attr
name=
"radius"
format=
"integer"
/>
<attr
name=
"
goodmoney_
size"
format=
"integer"
/>
<attr
name=
"
goodmoney_
color"
format=
"color"
/>
<attr
name=
"
goodmoney_
text"
format=
"string"
/>
<attr
name=
"
goodmoney_
radius"
format=
"integer"
/>
</declare-styleable>
...
...
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