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
fe10f7fb
Commit
fe10f7fb
authored
Mar 03, 2022
by
mengcuiguang2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
0edc09f2
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
33 additions
and
144 deletions
+33
-144
build.gradle
GoodMoney/app/build.gradle
+5
-5
MintsApplication.java
...p/src/main/java/com/mints/goodmoney/MintsApplication.java
+12
-14
AwardActivity.kt
...in/java/com/mints/goodmoney/ui/activitys/AwardActivity.kt
+6
-93
MainActivity.kt
...ain/java/com/mints/goodmoney/ui/activitys/MainActivity.kt
+5
-5
MainFragment.kt
...main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
+1
-2
MoneyFragment.kt
...ain/java/com/mints/goodmoney/ui/fragment/MoneyFragment.kt
+2
-20
BaseAppCompatActivity.java
...in/java/com/mints/library/base/BaseAppCompatActivity.java
+0
-5
activity_main.xml
GoodMoney/app/src/main/res/layout/activity_main.xml
+2
-0
No files found.
GoodMoney/app/build.gradle
View file @
fe10f7fb
...
...
@@ -14,8 +14,8 @@ android {
applicationId
"com.mints.goodmoney"
minSdkVersion
rootProject
.
ext
.
androidMinSdkVersion
targetSdkVersion
rootProject
.
ext
.
androidTargetSdkVersion
versionCode
26
versionName
"1.
2.5
"
versionCode
38
versionName
"1.
3.8
"
flavorDimensions
"default"
// dex突破65535的限制
...
...
@@ -224,9 +224,9 @@ dependencies {
// 应用管理中心分包
implementation
(
name:
'humesdk-1.0.0'
,
ext:
'aar'
)
// umeng
implementation
'com.umeng.umsdk:common:9.3.8'
// (必选)
implementation
'com.umeng.umsdk:asms:1.2.2'
// asms包依赖(必选)
implementation
'com.umeng.umsdk:crash:0.0.4'
// native crash包依赖(必选)
//
implementation 'com.umeng.umsdk:common:9.3.8' // (必选)
//
implementation 'com.umeng.umsdk:asms:1.2.2' // asms包依赖(必选)
//
implementation 'com.umeng.umsdk:crash:0.0.4' // native crash包依赖(必选)
// TalkingDada(已集成)
// 一览视频
implementation
(
"com.yilan.sdk:ui:3.3.1.2"
)
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/MintsApplication.java
View file @
fe10f7fb
...
...
@@ -35,8 +35,6 @@ import com.orhanobut.logger.FormatStrategy;
import
com.orhanobut.logger.Logger
;
import
com.orhanobut.logger.PrettyFormatStrategy
;
import
com.tendcloud.tenddata.TCAgent
;
import
com.umeng.analytics.MobclickAgent
;
import
com.umeng.commonsdk.UMConfigure
;
import
com.ximalaya.ting.android.opensdk.constants.ConstantsOpenSdk
;
import
com.ximalaya.ting.android.opensdk.datatrasfer.CommonRequest
;
import
com.ximalaya.ting.android.opensdk.player.service.XmPlayerConfig
;
...
...
@@ -114,7 +112,7 @@ public class MintsApplication extends MultiDexApplication {
private
void
thirdConfig
()
{
// 友盟SDK预初始化函数
// preInit预初始化函数耗时极少,不会影响App首次冷启动用户体验
UMConfigure
.
preInit
(
this
,
CommonUtils
.
getAppMetaData
(
MintsApplication
.
getContext
(),
"UMENG_KEY"
),
CommonUtils
.
getAppMetaData
(
MintsApplication
.
getContext
(),
"CHANNEL_NAME"
));
//
UMConfigure.preInit(this,CommonUtils.getAppMetaData(MintsApplication.getContext(), "UMENG_KEY"), CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME"));
// 初始化toast
initToast
();
...
...
@@ -238,17 +236,17 @@ public class MintsApplication extends MultiDexApplication {
* 友盟初始化
*/
public
void
initUm
(
Context
context
)
{
try
{
/*
* 参数4:设备类型,必须参数,传参数为UMConfigure.DEVICE_TYPE_PHONE则表示手机;传参数为UMConfigure.DEVICE_TYPE_BOX则表示盒子;默认为手机。
* 参数5:Push推送业务的secret,需要集成Push功能时必须传入Push的secret,否则传空。
*/
UMConfigure
.
init
(
MintsApplication
.
getContext
(),
CommonUtils
.
getAppMetaData
(
MintsApplication
.
getContext
(),
"UMENG_KEY"
),
CommonUtils
.
getAppMetaData
(
MintsApplication
.
getContext
(),
"CHANNEL_NAME"
),
UMConfigure
.
DEVICE_TYPE_PHONE
,
""
);
UMConfigure
.
setLogEnabled
(
BuildConfig
.
DEBUG
);
MobclickAgent
.
setPageCollectionMode
(
MobclickAgent
.
PageMode
.
LEGACY_MANUAL
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
//
try {
//
/*
//
* 参数4:设备类型,必须参数,传参数为UMConfigure.DEVICE_TYPE_PHONE则表示手机;传参数为UMConfigure.DEVICE_TYPE_BOX则表示盒子;默认为手机。
//
* 参数5:Push推送业务的secret,需要集成Push功能时必须传入Push的secret,否则传空。
//
*/
//
UMConfigure.init(MintsApplication.getContext(), CommonUtils.getAppMetaData(MintsApplication.getContext(), "UMENG_KEY"), CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME"), UMConfigure.DEVICE_TYPE_PHONE, "");
//
UMConfigure.setLogEnabled(BuildConfig.DEBUG);
//
MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.LEGACY_MANUAL);
//
} catch (Exception e) {
//
e.printStackTrace();
//
}
}
/**
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/AwardActivity.kt
View file @
fe10f7fb
...
...
@@ -30,7 +30,6 @@ import com.mints.goodmoney.utils.*
import
com.mints.goodmoney.utils.AppUtil.getAppName
import
com.mints.goodmoney.utils.rxutil.CommonRxTask
import
com.mints.goodmoney.utils.rxutil.RxjavaUtil
import
com.umeng.analytics.MobclickAgent
import
kotlinx.android.synthetic.main.activity_award.*
import
java.math.BigDecimal
import
java.util.*
...
...
@@ -333,11 +332,11 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
*/
private
fun
pushUmengEvent
()
{
if
(!
TextUtils
.
isEmpty
(
carrierType
)
&&
curCoin
>
0
)
{
// 埋点上送事件
val
map
=
mutableMapOf
<
String
,
String
>()
map
[
"userId"
]
=
UserManager
.
getInstance
().
userID
map
[
"coin"
]
=
""
+
curCoin
MobclickAgent
.
onEvent
(
this
,
carrierType
,
map
)
//
// 埋点上送事件
//
val map = mutableMapOf<String, String>()
//
map["userId"] = UserManager.getInstance().userID
//
map["coin"] = "" + curCoin
//
MobclickAgent.onEvent(this, carrierType, map)
}
}
...
...
@@ -360,17 +359,12 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
override
fun
onResume
()
{
super
.
onResume
()
MobclickAgent
.
onPageStart
(
this
::
class
.
java
.
simpleName
)
MobclickAgent
.
onResume
(
this
)
awardPresenter
.
getCoinMsg
()
}
override
fun
onPause
()
{
super
.
onPause
()
MobclickAgent
.
onPageEnd
(
this
::
class
.
java
.
simpleName
)
MobclickAgent
.
onPause
(
this
)
}
override
fun
onDestroy
()
{
...
...
@@ -414,88 +408,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
}
override
fun
onClick
(
v
:
View
)
{
when
(
v
.
id
)
{
R
.
id
.
ivAwardBack
->
{
finish
()
}
R
.
id
.
tvAwardHigh
->
{
when
(
superTaskStatus
)
{
// 播放激励视频,注册安装监听
0
->
{
// 是否开启应用使用情况权限
if
(
AppUtil
.
isOpenUsageStats
())
{
registerBroad
()
awardVideo
()
}
else
{
AppTryPlayManager
.
openAppUsageStats
(
this
)
}
}
// 下载完成,点击去试玩
1
->
{
if
(
mCurrentPkg
==
null
)
{
showToast
(
"任务异常,请重试~"
)
awardPresenter
.
setHighTaskType
(
"0"
)
}
else
{
if
(
AppUtil
.
checkPackInfo
(
mContext
,
mCurrentPkg
!!
))
{
AppTryPlayManager
.
toTryPlay
(
mCurrentPkg
!!
)
}
else
{
showToast
(
"未找到当前APP、可能被卸载,请重试~"
)
}
}
}
// 试玩时间不足,继续试玩
2
->
{
if
(
mCurrentPkg
==
null
)
{
showToast
(
"任务异常,请重试~"
)
awardPresenter
.
setHighTaskType
(
"0"
)
}
else
{
if
(
AppUtil
.
checkPackInfo
(
mContext
,
mCurrentPkg
!!
))
{
AppTryPlayManager
.
toTryPlay
(
mCurrentPkg
!!
)
}
else
{
showToast
(
"未找到当前APP、可能被卸载,请重试~"
)
}
}
}
// 试玩完成,领取奖励
3
->
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"carrierType"
]
=
Constant
.
CARRIER_HIGH_ACTIVITY
awardPresenter
.
reportAddCoinMsg
(
vo
)
readyGoThenKill
(
DrawcashActivity
::
class
.
java
)
}
}
}
R
.
id
.
tvAwardNext
->
{
// 普通视频奖励 走公共下载监听
AppConfig
.
isSuperTask
=
false
superTaskStatus
=
4
when
(
carrierType
)
{
// 只有看视频才能领金币
Constant
.
CARRIER_OFFLINE_DOUBLE
,
Constant
.
CARRIER_SIGNIN_HOMEPAGE_CARD
,
Constant
.
CARRIER_CHALLENGE_TURN
,
Constant
.
CARRIER_CHALLENGE_CARD
,
Constant
.
CARRIER_WALK_BUBBLE
,
Constant
.
CARRIER_EATMEAL_SUBSIDY
,
Constant
.
CARRIER_WALK
,
Constant
.
CARRIER_HOMEWATER
->
{
awardVideo
()
}
Constant
.
CARRIER_BLESSINGBAG_DOUBLE
,
Constant
.
CARRIER_CHALLENGE_SHAREFRIEND_DOUBLE
,
Constant
.
CARRIER_HOMEVEDIO_DOUBLE
,
Constant
.
CARRIER_SMALLHOMEVEDIO_DOUBLE
,
Constant
.
CARRIER_RUISHINEWS_DOUBLE
->
{
// 翻倍载体上送友盟
pushUmengEvent
()
awardVideo
()
}
Constant
.
CARRIER_NEW_VISITOR
->
{
readyGoThenKill
(
WxLoginActivity
::
class
.
java
)
}
else
->
{
finish
()
}
}
}
}
finish
()
}
/**
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/MainActivity.kt
View file @
fe10f7fb
...
...
@@ -322,10 +322,10 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
}
fun
showShortVedioLayout
()
{
if
(
AppConfig
.
showAdFlag
)
{
tab_rl_two
.
visibility
=
View
.
VISIBLE
}
else
{
tab_rl_two
.
visibility
=
View
.
GONE
}
//
if (AppConfig.showAdFlag) {
//
tab_rl_two.visibility = View.VISIBLE
//
} else {
//
tab_rl_two.visibility = View.GONE
//
}
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
View file @
fe10f7fb
...
...
@@ -155,9 +155,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
private
fun
uploadDeviceInfo
()
{
// if (!ps.getBoolean(Constant.FIRST_DEVICE_FLAG, false)) {
homePresenter
.
comSaveTerminalInfo
(
ps
)
baseApplication
.
initUm
(
context
)
baseApplication
.
TalkingDataConfig
()
ReaderManager
.
init
()
//
ReaderManager.init()
// }
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MoneyFragment.kt
View file @
fe10f7fb
...
...
@@ -75,20 +75,14 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
currentFragment
=
mainFragment
}
xtFragmentMoney
.
setxTabDisplayNum
(
5
)
xtFragmentMoney
.
setxTabDisplayNum
(
3
)
val
newTab1
=
xtFragmentMoney
.
newTab
()
newTab1
.
text
=
"视频"
val
newTab3
=
xtFragmentMoney
.
newTab
()
newTab3
.
text
=
"书城"
val
newTab4
=
xtFragmentMoney
.
newTab
()
newTab4
.
text
=
"听书"
val
newTab5
=
xtFragmentMoney
.
newTab
()
newTab5
.
text
=
"游戏"
val
newTab6
=
xtFragmentMoney
.
newTab
()
newTab6
.
text
=
"来电秀"
xtFragmentMoney
.
addTab
(
newTab1
)
xtFragmentMoney
.
addTab
(
newTab3
)
xtFragmentMoney
.
addTab
(
newTab4
)
xtFragmentMoney
.
addTab
(
newTab5
)
xtFragmentMoney
.
addTab
(
newTab6
)
xtFragmentMoney
.
addOnTabSelectedListener
(
this
)
...
...
@@ -181,24 +175,12 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
}
1
->
{
if
(
bookStoreFragment
==
null
)
{
bookStoreFragment
=
ReaderFragment
()
}
addOrShowFragment
(
childFragmentManager
,
bookStoreFragment
!!
,
FRAGMENT_TAG_BOOKSTORE
)
}
2
->
{
if
(
xmlyGameFragment
==
null
)
{
xmlyGameFragment
=
XmlyFragment
()
}
addOrShowFragment
(
childFragmentManager
,
xmlyGameFragment
!!
,
FRAGMENT_TAG_XMLY
)
}
3
->
{
if
(
liebaoGameFragment
==
null
)
{
liebaoGameFragment
=
LiebaoGameFragment
()
}
addOrShowFragment
(
childFragmentManager
,
liebaoGameFragment
!!
,
FRAGMENT_TAG_GAME
)
}
4
->
{
2
->
{
if
(
kuYinyueFragment
==
null
)
{
kuYinyueFragment
=
KuYinYueFragment
()
}
...
...
GoodMoney/app/src/main/java/com/mints/library/base/BaseAppCompatActivity.java
View file @
fe10f7fb
...
...
@@ -25,7 +25,6 @@ import com.mints.library.net.netstatus.NetUtils;
import
com.mints.library.utils.CommonUtils
;
import
com.readystatesoftware.systembartint.SystemBarTintManager
;
import
com.tendcloud.tenddata.TCAgent
;
import
com.umeng.analytics.MobclickAgent
;
/**
* 描述:BaseAppCompatActivity
...
...
@@ -164,8 +163,6 @@ public abstract class BaseAppCompatActivity extends TransitionActivity {
// talkingData页面留存
TCAgent
.
onPageStart
(
this
,
getClass
().
getSimpleName
());
// 友盟
MobclickAgent
.
onResume
(
this
);
}
@Override
...
...
@@ -175,8 +172,6 @@ public abstract class BaseAppCompatActivity extends TransitionActivity {
// talkingData页面留存
TCAgent
.
onPageEnd
(
this
,
getClass
().
getSimpleName
());
// 友盟
MobclickAgent
.
onPause
(
this
);
}
@Override
...
...
GoodMoney/app/src/main/res/layout/activity_main.xml
View file @
fe10f7fb
...
...
@@ -55,6 +55,7 @@
android:layout_height=
"match_parent"
android:layout_weight=
"1.0"
android:gravity=
"center"
android:visibility=
"gone"
android:orientation=
"vertical"
>
<ImageView
...
...
@@ -100,6 +101,7 @@
</LinearLayout>
<LinearLayout
android:visibility=
"gone"
android:id=
"@+id/tab_rl_four"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
...
...
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