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
Show 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 {
...
@@ -14,8 +14,8 @@ android {
applicationId
"com.mints.goodmoney"
applicationId
"com.mints.goodmoney"
minSdkVersion
rootProject
.
ext
.
androidMinSdkVersion
minSdkVersion
rootProject
.
ext
.
androidMinSdkVersion
targetSdkVersion
rootProject
.
ext
.
androidTargetSdkVersion
targetSdkVersion
rootProject
.
ext
.
androidTargetSdkVersion
versionCode
26
versionCode
38
versionName
"1.
2.5
"
versionName
"1.
3.8
"
flavorDimensions
"default"
flavorDimensions
"default"
// dex突破65535的限制
// dex突破65535的限制
...
@@ -224,9 +224,9 @@ dependencies {
...
@@ -224,9 +224,9 @@ dependencies {
// 应用管理中心分包
// 应用管理中心分包
implementation
(
name:
'humesdk-1.0.0'
,
ext:
'aar'
)
implementation
(
name:
'humesdk-1.0.0'
,
ext:
'aar'
)
// umeng
// umeng
implementation
'com.umeng.umsdk:common:9.3.8'
// (必选)
//
implementation 'com.umeng.umsdk:common:9.3.8' // (必选)
implementation
'com.umeng.umsdk:asms:1.2.2'
// asms包依赖(必选)
//
implementation 'com.umeng.umsdk:asms:1.2.2' // asms包依赖(必选)
implementation
'com.umeng.umsdk:crash:0.0.4'
// native crash包依赖(必选)
//
implementation 'com.umeng.umsdk:crash:0.0.4' // native crash包依赖(必选)
// TalkingDada(已集成)
// TalkingDada(已集成)
// 一览视频
// 一览视频
implementation
(
"com.yilan.sdk:ui:3.3.1.2"
)
{
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;
...
@@ -35,8 +35,6 @@ import com.orhanobut.logger.FormatStrategy;
import
com.orhanobut.logger.Logger
;
import
com.orhanobut.logger.Logger
;
import
com.orhanobut.logger.PrettyFormatStrategy
;
import
com.orhanobut.logger.PrettyFormatStrategy
;
import
com.tendcloud.tenddata.TCAgent
;
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.constants.ConstantsOpenSdk
;
import
com.ximalaya.ting.android.opensdk.datatrasfer.CommonRequest
;
import
com.ximalaya.ting.android.opensdk.datatrasfer.CommonRequest
;
import
com.ximalaya.ting.android.opensdk.player.service.XmPlayerConfig
;
import
com.ximalaya.ting.android.opensdk.player.service.XmPlayerConfig
;
...
@@ -114,7 +112,7 @@ public class MintsApplication extends MultiDexApplication {
...
@@ -114,7 +112,7 @@ public class MintsApplication extends MultiDexApplication {
private
void
thirdConfig
()
{
private
void
thirdConfig
()
{
// 友盟SDK预初始化函数
// 友盟SDK预初始化函数
// preInit预初始化函数耗时极少,不会影响App首次冷启动用户体验
// 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
// 初始化toast
initToast
();
initToast
();
...
@@ -238,17 +236,17 @@ public class MintsApplication extends MultiDexApplication {
...
@@ -238,17 +236,17 @@ public class MintsApplication extends MultiDexApplication {
* 友盟初始化
* 友盟初始化
*/
*/
public
void
initUm
(
Context
context
)
{
public
void
initUm
(
Context
context
)
{
try
{
//
try {
/*
//
/*
* 参数4:设备类型,必须参数,传参数为UMConfigure.DEVICE_TYPE_PHONE则表示手机;传参数为UMConfigure.DEVICE_TYPE_BOX则表示盒子;默认为手机。
//
* 参数4:设备类型,必须参数,传参数为UMConfigure.DEVICE_TYPE_PHONE则表示手机;传参数为UMConfigure.DEVICE_TYPE_BOX则表示盒子;默认为手机。
* 参数5:Push推送业务的secret,需要集成Push功能时必须传入Push的secret,否则传空。
//
* 参数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.init(MintsApplication.getContext(), CommonUtils.getAppMetaData(MintsApplication.getContext(), "UMENG_KEY"), CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME"), UMConfigure.DEVICE_TYPE_PHONE, "");
UMConfigure
.
setLogEnabled
(
BuildConfig
.
DEBUG
);
//
UMConfigure.setLogEnabled(BuildConfig.DEBUG);
MobclickAgent
.
setPageCollectionMode
(
MobclickAgent
.
PageMode
.
LEGACY_MANUAL
);
//
MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.LEGACY_MANUAL);
}
catch
(
Exception
e
)
{
//
} catch (Exception e) {
e
.
printStackTrace
();
//
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.*
...
@@ -30,7 +30,6 @@ import com.mints.goodmoney.utils.*
import
com.mints.goodmoney.utils.AppUtil.getAppName
import
com.mints.goodmoney.utils.AppUtil.getAppName
import
com.mints.goodmoney.utils.rxutil.CommonRxTask
import
com.mints.goodmoney.utils.rxutil.CommonRxTask
import
com.mints.goodmoney.utils.rxutil.RxjavaUtil
import
com.mints.goodmoney.utils.rxutil.RxjavaUtil
import
com.umeng.analytics.MobclickAgent
import
kotlinx.android.synthetic.main.activity_award.*
import
kotlinx.android.synthetic.main.activity_award.*
import
java.math.BigDecimal
import
java.math.BigDecimal
import
java.util.*
import
java.util.*
...
@@ -333,11 +332,11 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
...
@@ -333,11 +332,11 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
*/
*/
private
fun
pushUmengEvent
()
{
private
fun
pushUmengEvent
()
{
if
(!
TextUtils
.
isEmpty
(
carrierType
)
&&
curCoin
>
0
)
{
if
(!
TextUtils
.
isEmpty
(
carrierType
)
&&
curCoin
>
0
)
{
// 埋点上送事件
//
// 埋点上送事件
val
map
=
mutableMapOf
<
String
,
String
>()
//
val map = mutableMapOf<String, String>()
map
[
"userId"
]
=
UserManager
.
getInstance
().
userID
//
map["userId"] = UserManager.getInstance().userID
map
[
"coin"
]
=
""
+
curCoin
//
map["coin"] = "" + curCoin
MobclickAgent
.
onEvent
(
this
,
carrierType
,
map
)
//
MobclickAgent.onEvent(this, carrierType, map)
}
}
}
}
...
@@ -360,17 +359,12 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
...
@@ -360,17 +359,12 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
override
fun
onResume
()
{
override
fun
onResume
()
{
super
.
onResume
()
super
.
onResume
()
MobclickAgent
.
onPageStart
(
this
::
class
.
java
.
simpleName
)
MobclickAgent
.
onResume
(
this
)
awardPresenter
.
getCoinMsg
()
awardPresenter
.
getCoinMsg
()
}
}
override
fun
onPause
()
{
override
fun
onPause
()
{
super
.
onPause
()
super
.
onPause
()
MobclickAgent
.
onPageEnd
(
this
::
class
.
java
.
simpleName
)
MobclickAgent
.
onPause
(
this
)
}
}
override
fun
onDestroy
()
{
override
fun
onDestroy
()
{
...
@@ -414,89 +408,8 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
...
@@ -414,89 +408,8 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
}
}
override
fun
onClick
(
v
:
View
)
{
override
fun
onClick
(
v
:
View
)
{
when
(
v
.
id
)
{
R
.
id
.
ivAwardBack
->
{
finish
()
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
()
}
}
}
}
}
/**
/**
* 获取激励视频
* 获取激励视频
...
...
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 {
...
@@ -322,10 +322,10 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
}
}
fun
showShortVedioLayout
()
{
fun
showShortVedioLayout
()
{
if
(
AppConfig
.
showAdFlag
)
{
//
if (AppConfig.showAdFlag) {
tab_rl_two
.
visibility
=
View
.
VISIBLE
//
tab_rl_two.visibility = View.VISIBLE
}
else
{
//
} else {
tab_rl_two
.
visibility
=
View
.
GONE
//
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 {
...
@@ -155,9 +155,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
private
fun
uploadDeviceInfo
()
{
private
fun
uploadDeviceInfo
()
{
// if (!ps.getBoolean(Constant.FIRST_DEVICE_FLAG, false)) {
// if (!ps.getBoolean(Constant.FIRST_DEVICE_FLAG, false)) {
homePresenter
.
comSaveTerminalInfo
(
ps
)
homePresenter
.
comSaveTerminalInfo
(
ps
)
baseApplication
.
initUm
(
context
)
baseApplication
.
TalkingDataConfig
()
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 {
...
@@ -75,20 +75,14 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
currentFragment
=
mainFragment
currentFragment
=
mainFragment
}
}
xtFragmentMoney
.
setxTabDisplayNum
(
5
)
xtFragmentMoney
.
setxTabDisplayNum
(
3
)
val
newTab1
=
xtFragmentMoney
.
newTab
()
val
newTab1
=
xtFragmentMoney
.
newTab
()
newTab1
.
text
=
"视频"
newTab1
.
text
=
"视频"
val
newTab3
=
xtFragmentMoney
.
newTab
()
newTab3
.
text
=
"书城"
val
newTab4
=
xtFragmentMoney
.
newTab
()
newTab4
.
text
=
"听书"
val
newTab5
=
xtFragmentMoney
.
newTab
()
val
newTab5
=
xtFragmentMoney
.
newTab
()
newTab5
.
text
=
"游戏"
newTab5
.
text
=
"游戏"
val
newTab6
=
xtFragmentMoney
.
newTab
()
val
newTab6
=
xtFragmentMoney
.
newTab
()
newTab6
.
text
=
"来电秀"
newTab6
.
text
=
"来电秀"
xtFragmentMoney
.
addTab
(
newTab1
)
xtFragmentMoney
.
addTab
(
newTab1
)
xtFragmentMoney
.
addTab
(
newTab3
)
xtFragmentMoney
.
addTab
(
newTab4
)
xtFragmentMoney
.
addTab
(
newTab5
)
xtFragmentMoney
.
addTab
(
newTab5
)
xtFragmentMoney
.
addTab
(
newTab6
)
xtFragmentMoney
.
addTab
(
newTab6
)
xtFragmentMoney
.
addOnTabSelectedListener
(
this
)
xtFragmentMoney
.
addOnTabSelectedListener
(
this
)
...
@@ -181,24 +175,12 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
...
@@ -181,24 +175,12 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
}
}
1
->
{
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
)
{
if
(
liebaoGameFragment
==
null
)
{
liebaoGameFragment
=
LiebaoGameFragment
()
liebaoGameFragment
=
LiebaoGameFragment
()
}
}
addOrShowFragment
(
childFragmentManager
,
liebaoGameFragment
!!
,
FRAGMENT_TAG_GAME
)
addOrShowFragment
(
childFragmentManager
,
liebaoGameFragment
!!
,
FRAGMENT_TAG_GAME
)
}
}
4
->
{
2
->
{
if
(
kuYinyueFragment
==
null
)
{
if
(
kuYinyueFragment
==
null
)
{
kuYinyueFragment
=
KuYinYueFragment
()
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;
...
@@ -25,7 +25,6 @@ import com.mints.library.net.netstatus.NetUtils;
import
com.mints.library.utils.CommonUtils
;
import
com.mints.library.utils.CommonUtils
;
import
com.readystatesoftware.systembartint.SystemBarTintManager
;
import
com.readystatesoftware.systembartint.SystemBarTintManager
;
import
com.tendcloud.tenddata.TCAgent
;
import
com.tendcloud.tenddata.TCAgent
;
import
com.umeng.analytics.MobclickAgent
;
/**
/**
* 描述:BaseAppCompatActivity
* 描述:BaseAppCompatActivity
...
@@ -164,8 +163,6 @@ public abstract class BaseAppCompatActivity extends TransitionActivity {
...
@@ -164,8 +163,6 @@ public abstract class BaseAppCompatActivity extends TransitionActivity {
// talkingData页面留存
// talkingData页面留存
TCAgent
.
onPageStart
(
this
,
getClass
().
getSimpleName
());
TCAgent
.
onPageStart
(
this
,
getClass
().
getSimpleName
());
// 友盟
MobclickAgent
.
onResume
(
this
);
}
}
@Override
@Override
...
@@ -175,8 +172,6 @@ public abstract class BaseAppCompatActivity extends TransitionActivity {
...
@@ -175,8 +172,6 @@ public abstract class BaseAppCompatActivity extends TransitionActivity {
// talkingData页面留存
// talkingData页面留存
TCAgent
.
onPageEnd
(
this
,
getClass
().
getSimpleName
());
TCAgent
.
onPageEnd
(
this
,
getClass
().
getSimpleName
());
// 友盟
MobclickAgent
.
onPause
(
this
);
}
}
@Override
@Override
...
...
GoodMoney/app/src/main/res/layout/activity_main.xml
View file @
fe10f7fb
...
@@ -55,6 +55,7 @@
...
@@ -55,6 +55,7 @@
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1.0"
android:layout_weight=
"1.0"
android:gravity=
"center"
android:gravity=
"center"
android:visibility=
"gone"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<ImageView
<ImageView
...
@@ -100,6 +101,7 @@
...
@@ -100,6 +101,7 @@
</LinearLayout>
</LinearLayout>
<LinearLayout
<LinearLayout
android:visibility=
"gone"
android:id=
"@+id/tab_rl_four"
android:id=
"@+id/tab_rl_four"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
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