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
5780ffd9
Commit
5780ffd9
authored
Jun 04, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
9c361906
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
44 additions
and
274 deletions
+44
-274
build.gradle
GoodMoney/app/build.gradle
+2
-2
ChannelManager.kt
...c/main/java/com/mints/goodmoney/manager/ChannelManager.kt
+1
-1
CsjGroMoreManager.kt
...ain/java/com/mints/goodmoney/manager/CsjGroMoreManager.kt
+22
-3
AdcodeBean.java
...c/main/java/com/mints/goodmoney/mvp/model/AdcodeBean.java
+10
-25
SplashGroMoreActivity.java
...m/mints/goodmoney/ui/activitys/SplashGroMoreActivity.java
+9
-10
PanFragment.kt
.../main/java/com/mints/goodmoney/ui/fragment/PanFragment.kt
+0
-225
TurnTableFragment.kt
...java/com/mints/goodmoney/ui/fragment/TurnTableFragment.kt
+0
-8
No files found.
GoodMoney/app/build.gradle
View file @
5780ffd9
...
...
@@ -15,8 +15,8 @@ android {
applicationId
"com.mints.goodmoney"
minSdkVersion
rootProject
.
ext
.
androidMinSdkVersion
targetSdkVersion
rootProject
.
ext
.
androidTargetSdkVersion
versionCode
3
3
versionName
"1.3.
3
"
versionCode
3
4
versionName
"1.3.
4
"
flavorDimensions
"default"
// dex突破65535的限制
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/ChannelManager.kt
View file @
5780ffd9
package
com.mints.goodmoney.manager
import
com.mints.goodmoney.mvp.model.AdcodeBean
import
com.mints.goodmoney.mvp.model.UserMsgBean
/**
* 渠道管理
...
...
@@ -16,5 +15,6 @@ object ChannelManager {
fun
updataCodeIdForRegisterChannel
(
idBean
:
AdcodeBean
?)
{
TtCsjAdManager
.
updataIdByChannel
(
idBean
)
YlhAdManager
.
updataIdByChannel
(
idBean
)
CsjGroMoreManager
.
updataIdByChannel
(
idBean
)
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/CsjGroMoreManager.kt
View file @
5780ffd9
package
com.mints.goodmoney.manager
import
android.text.TextUtils
import
com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.mvp.model.AdcodeBean
object
CsjGroMoreManager
{
const
val
AD_UNIT_EXPRESS_ID
=
"946167770"
const
val
AD_UNIT_SPLASH_ID
=
"887459392"
const
val
AD_UNIT_VIDEO_ID
=
"946018378"
var
AD_UNIT_EXPRESS_ID
=
"946167770"
var
AD_UNIT_SPLASH_ID
=
"887459392"
var
AD_UNIT_VIDEO_ID
=
"946018378"
fun
init
(
application
:
MintsApplication
)
{
TTGroMoreAdManagerHolder
.
init
(
application
)
}
/**
* 更新代码位
*/
fun
updataIdByChannel
(
idBean
:
AdcodeBean
?)
{
// 渠道对象不为空
if
(
idBean
!=
null
)
{
if
(!
TextUtils
.
isEmpty
(
idBean
.
groExpress
))
{
AD_UNIT_EXPRESS_ID
=
idBean
.
groExpress
}
if
(!
TextUtils
.
isEmpty
(
idBean
.
groSplash
))
{
AD_UNIT_SPLASH_ID
=
idBean
.
groSplash
}
if
(!
TextUtils
.
isEmpty
(
idBean
.
groVideo
))
{
AD_UNIT_VIDEO_ID
=
idBean
.
groVideo
}
}
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/AdcodeBean.java
View file @
5780ffd9
...
...
@@ -14,15 +14,12 @@ public class AdcodeBean implements Serializable {
private
String
ylhv1
;
//开屏
private
String
ylhv2
;
//激励
private
String
shareylhv1
;
private
String
shareylhv2
;
private
String
shareylhv3
;
private
String
sharecsjv1
;
private
String
sharecsjv2
;
private
String
sharecsjv3
;
private
String
key
;
private
String
groExpress
;
private
String
groSplash
;
private
String
groVideo
;
public
String
getCsjv1
()
{
return
csjv1
;
...
...
@@ -48,28 +45,16 @@ public class AdcodeBean implements Serializable {
return
ylhv2
;
}
public
String
getShareylhv1
()
{
return
shareylhv1
;
}
public
String
getShareylhv2
()
{
return
shareylhv2
;
}
public
String
getShareylhv3
()
{
return
shareylhv3
;
}
public
String
getSharecsjv1
()
{
return
sharecsjv1
;
public
String
getGroExpress
()
{
return
groExpress
;
}
public
String
get
Sharecsjv2
()
{
return
sharecsjv2
;
public
String
get
GroSplash
()
{
return
groSplash
;
}
public
String
get
Sharecsjv3
()
{
return
sharecsjv3
;
public
String
get
GroVideo
()
{
return
groVideo
;
}
public
String
getKey
()
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/SplashGroMoreActivity.java
View file @
5780ffd9
...
...
@@ -97,7 +97,7 @@ public class SplashGroMoreActivity extends BaseActivity {
//穿山甲兜底
// ttNetworkRequestInfo = new PangleNetworkRequestInfo(TtCsjAdManager.TT_AD_APPID, "887483103");
//gdt兜底
ttNetworkRequestInfo
=
new
GdtNetworkRequestInfo
(
YlhAdManager
.
YLH_AD_APPID
,
"2001697222975737"
);
//
ttNetworkRequestInfo = new GdtNetworkRequestInfo(YlhAdManager.YLH_AD_APPID, "2001697222975737");
//ks兜底
// ttNetworkRequestInfo = new KsNetworkRequestInfo("90009", "4000000042");
//百度兜底
...
...
@@ -105,7 +105,8 @@ public class SplashGroMoreActivity extends BaseActivity {
//step4:请求广告,调用开屏广告异步请求接口,对请求回调的广告作渲染处理
mTTSplashAd
.
loadAd
(
adSlot
,
ttNetworkRequestInfo
,
new
TTSplashAdLoadCallback
()
{
// mTTSplashAd.loadAd(adSlot, ttNetworkRequestInfo, new TTSplashAdLoadCallback() {
mTTSplashAd
.
loadAd
(
adSlot
,
new
TTSplashAdLoadCallback
()
{
@Override
public
void
onSplashAdLoadFail
(
AdError
adError
)
{
LogUtil
.
d
(
TAG
,
adError
.
message
);
...
...
@@ -125,14 +126,12 @@ public class SplashGroMoreActivity extends BaseActivity {
// 获取本次waterfall加载中,加载失败的adn错误信息。
if
(
mTTSplashAd
!=
null
)
{
HashMap
<
String
,
Object
>
vo
=
new
HashMap
<>();
vo
.
put
(
"adcode"
,
mTTSplashAd
.
getAdNetworkRitId
());
vo
.
put
(
"ecpm"
,
mTTSplashAd
.
getPreEcpm
());
vo
.
put
(
"adSource"
,
mTTSplashAd
.
getAdNetworkPlatformId
());
vo
.
put
(
"adType"
,
Constant
.
GRO_MORE_ADTYPE0
);
TrackManager
.
getInstance
().
cmtGroMoreInfo
(
vo
);
}
HashMap
<
String
,
Object
>
vo
=
new
HashMap
<>();
vo
.
put
(
"adcode"
,
mTTSplashAd
.
getAdNetworkRitId
());
vo
.
put
(
"ecpm"
,
mTTSplashAd
.
getPreEcpm
());
vo
.
put
(
"adSource"
,
mTTSplashAd
.
getAdNetworkPlatformId
());
vo
.
put
(
"adType"
,
Constant
.
GRO_MORE_ADTYPE0
);
TrackManager
.
getInstance
().
cmtGroMoreInfo
(
vo
);
}
Log
.
e
(
TAG
,
"load splash ad success "
);
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/PanFragment.kt
deleted
100644 → 0
View file @
9c361906
package
com.mints.goodmoney.ui.fragment
import
android.Manifest
import
android.os.Bundle
import
android.text.TextUtils
import
android.webkit.WebChromeClient
import
com.component.dly.xzzq_ywsdk.YwSDK_WebActivity
import
com.github.lzyzsd.jsbridge.CallBackFunction
import
com.github.lzyzsd.jsbridge.DefaultHandler
import
com.mints.goodmoney.BuildConfig
import
com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.R
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.MokuManager
import
com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.manager.YwhzManager
import
com.mints.goodmoney.mvp.model.PanActionInfo
import
com.mints.goodmoney.mvp.model.TurntableBean
import
com.mints.goodmoney.mvp.presenters.PanPresenter
import
com.mints.goodmoney.mvp.views.PanView
import
com.mints.goodmoney.ui.activitys.*
import
com.mints.goodmoney.ui.fragment.base.BaseFragment
import
com.mints.library.utils.json.JsonUtil
import
com.tbruyelle.rxpermissions.RxPermissions
import
kotlinx.android.synthetic.main.fragment_main_pan.*
import
net.grandcentrix.tray.AppPreferences
/**
* 描述:大转盘
* 作者:孟崔广
* 时间:2020/9/20 17:30
*/
class
PanFragment
:
BaseFragment
(),
PanView
{
private
val
panPresenter
by
lazy
{
PanPresenter
()
}
private
val
userManager
by
lazy
{
UserManager
.
getInstance
()
}
private
val
carrierType
=
Constant
.
CARRIER_CHALLENGE_TURN
private
val
ps
by
lazy
{
AppPreferences
(
context
)
}
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
fragment_main_pan
override
fun
initViewsAndEvents
()
{
panPresenter
.
attachView
(
this
)
if
(!
TextUtils
.
isEmpty
(
userManager
.
userID
))
{
// 登录成功的用户初始化鱼丸盒子
// if (userManager.userIsLogin()) {
// YwhzManager.init(baseApplication)
// }
if
(!
TextUtils
.
isEmpty
(
MintsApplication
.
OAID
))
{
MokuManager
.
initOaid
(
MintsApplication
.
OAID
)
}
}
}
override
fun
onHiddenChanged
(
hidden
:
Boolean
)
{
if
(
hidden
)
{
// 不在最前端界面显示
onPause
()
}
else
{
// 重新显示到最前端中
onResume
()
}
super
.
onHiddenChanged
(
hidden
)
}
override
fun
onResume
()
{
super
.
onResume
()
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_THREE
)
{
if
(
TextUtils
.
isEmpty
(
userManager
?.
userID
))
{
// 游客登录
panPresenter
.
userLogin
()
}
else
{
loadTurnUrl
()
}
}
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
panPresenter
.
detachView
()
}
override
fun
loginSuc
()
{
loadTurnUrl
()
}
/**
* 加载转盘url
*/
private
fun
loadTurnUrl
()
{
getTurnUrl
()
// blTurntableWebview.setOnTouchListener { _, event -> event.action == MotionEvent.ACTION_MOVE }
blTurntableWebview
.
setDefaultHandler
(
DefaultHandler
())
blTurntableWebview
.
webChromeClient
=
WebChromeClient
()
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
// blTurntableWebview.setOnScrollChangeListener(
// object : View.OnScrollChangeListener {
// override fun onScrollChange(v: View?, scrollX: Int, scrollY: Int, oldScrollX: Int, oldScrollY: Int) {
// blTurntableWebview.scrollTo(0,scrollY)
// }
// })
// }
blTurntableWebview
.
setOnLongClickListener
{
true
}
//注册监听方法当js中调用callHandler方法时会调用此方法(handlerName必须和js中相同)
blTurntableWebview
.
registerHandler
(
"getTurnResult"
)
{
data
,
_
->
val
turntableBean
:
TurntableBean
=
JsonUtil
.
parseJson
(
data
,
TurntableBean
::
class
.
java
)
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
turntableBean
.
coin
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
carrierType
)
bundle
.
putString
(
Constant
.
MAIN_EXTRA_ID
,
turntableBean
.
key
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
androidCallJsReferse
()
}
blTurntableWebview
.
registerHandler
(
"actionPageForType"
)
{
data
,
_
->
actionPageForType
(
data
)
}
blTurntableWebview
.
setDefaultHandler
(
object
:
DefaultHandler
()
{
override
fun
handler
(
data
:
String
,
function
:
CallBackFunction
)
{
showToast
(
data
)
}
})
}
private
fun
actionPageForType
(
data
:
String
?)
{
if
(
TextUtils
.
isEmpty
(
data
))
return
val
panActionInfo
:
PanActionInfo
=
JsonUtil
.
parseJson
(
data
,
PanActionInfo
::
class
.
java
)
//0-微转,1-珊瑚下载,2-分红,3-鱼丸盒子,4-每日任务
when
(
panActionInfo
.
actionType
)
{
0
->
{
if
(!
userManager
.
userIsLogin
())
{
readyGo
(
WxLoginActivity
::
class
.
java
)
return
}
shareArticle
(
panActionInfo
.
coin
)
}
1
->
{
if
(!
userManager
.
userIsLogin
())
{
readyGo
(
WxLoginActivity
::
class
.
java
)
return
}
readyGo
(
TaskCpdActivity
::
class
.
java
)
}
2
->
{
if
(!
userManager
.
userIsLogin
())
{
readyGo
(
WxLoginActivity
::
class
.
java
)
return
}
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
WRAPPER_TYPE
,
Constant
.
WRAPPER_TYPE_FRIENDS
)
readyGo
(
WrapperActivity
::
class
.
java
,
bundle
)
}
3
->
{
// if (!userManager.userIsLogin()) {
// readyGo(WxLoginActivity::class.java)
// return
// }
//
// try {
// activity?.let { YwSDK_WebActivity.open(it) }
// } catch (e: Exception) {
// e.printStackTrace()
// showToast("请重新退出账号登录")
// }
gotoMoku
()
}
4
->
{
val
activity
:
MainActivity
?
=
activity
as
MainActivity
?
activity
?.
let
{
it
.
turnDayTask
()
}
}
}
}
/**
* 获取转盘url
*/
private
fun
getTurnUrl
()
{
val
tokenID
=
userManager
.
tokenID
val
url
:
String
=
BuildConfig
.
MainIp
+
"turn/turnWithInner.html?carrierType="
+
carrierType
+
"&token="
+
tokenID
blTurntableWebview
.
loadUrl
(
url
)
}
/**
* 奖励成功刷新js界面
*/
private
fun
androidCallJsReferse
()
{
// 调用js中的方法(必须和js中的handlerName想同)
blTurntableWebview
.
callHandler
(
"refreshTurnTable"
,
""
)
{
}
}
/**
* 分享文章
*/
private
fun
shareArticle
(
coin
:
Int
)
{
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
WRAPPER_TYPE
,
Constant
.
WRAPPER_TYPE_WZ
)
readyGo
(
WrapperActivity
::
class
.
java
,
bundle
)
}
private
fun
gotoMoku
()
{
RxPermissions
(
requireActivity
())
.
request
(
Manifest
.
permission
.
READ_PHONE_STATE
,
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)
.
subscribe
{
granted
:
Boolean
->
if
(
granted
)
{
MokuManager
.
gotoMoku
(
requireContext
())
if
(
ps
.
getBoolean
(
Constant
.
MOKU_FLAG_GUIDE
,
true
))
{
readyGo
(
MokuGuideActivity
::
class
.
java
)
ps
.
put
(
Constant
.
MOKU_FLAG_GUIDE
,
false
)
}
}
else
{
showMissingPermissionDialog
(
"设备,存储"
)
}
}
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/TurnTableFragment.kt
View file @
5780ffd9
...
...
@@ -123,7 +123,6 @@ class TurnTableFragment : BaseFragment(), TurnTableView, AdapterView.OnItemClick
override
fun
onDestroy
()
{
super
.
onDestroy
()
turnTableView
.
setRotateListener
(
null
)
turnTablePresenter
.
detachView
()
}
...
...
@@ -170,8 +169,6 @@ class TurnTableFragment : BaseFragment(), TurnTableView, AdapterView.OnItemClick
return
}
LogUtil
.
d
(
"initTurnView"
,
"initTurnView"
)
turnTableData
=
data
if
(
data
.
configs
.
size
==
0
)
{
...
...
@@ -236,11 +233,6 @@ class TurnTableFragment : BaseFragment(), TurnTableView, AdapterView.OnItemClick
override
fun
rotating
(
valueAnimator
:
ValueAnimator
)
{}
override
fun
rotateBefore
(
goImg
:
ImageView
)
{
if
(!
NetUtils
.
isNetworkConnected
(
context
))
{
showToast
(
"网络异常,请检测网络"
)
return
}
if
(
data
.
surplus
<=
0
)
{
showToast
(
"抽奖次数已用完"
)
return
...
...
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