Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
android
/
dayu
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
aa85fc68
authored
Jul 15, 2020
by
mReturn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v2.5.9
parent
1e9f718d
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
60 additions
and
43 deletions
app/src/main/java/com/dayu/bigfish/MyApplication.java
baseSDK/src/main/java/com/dayu/base/ui/activity/BaseActivity.java
baseSDK/src/main/java/com/dayu/common/Constants.java
baseSDK/src/main/java/com/dayu/utils/CommonUtils.java
baseSDK/src/main/java/com/dayu/widgets/RedPacketsDialog.java
baseSDK/src/main/res/layout/dialog_red_packets.xml
learnCenter/src/main/java/com/dayu/learncenter/ui/activity/CourseDetailActivity.java
learnCenter/src/main/java/com/dayu/learncenter/ui/fragment/CommonLearnFragment.java
app/src/main/java/com/dayu/bigfish/MyApplication.java
View file @
aa85fc68
...
...
@@ -129,7 +129,7 @@ public class MyApplication extends BaseApplication {
// UMConfigure.init(this, UMConfigure.DEVICE_TYPE_PHONE, null);
// UMConfigure.init(this,"599a41697f2c743210000990","Channel ID",
// UMConfigure.DEVICE_TYPE_PHONE,"78d43fa94358512f9d00acf9b50f7474");
UMConfigure
.
init
(
this
,
UMConfigure
.
DEVICE_TYPE_PHONE
,
"78d43fa94358512f9d00acf9b50f7474"
);
UMConfigure
.
init
(
this
,
UMConfigure
.
DEVICE_TYPE_PHONE
,
"78d43fa94358512f9d00acf9b50f7474"
);
UMConfigure
.
setLogEnabled
(
true
);
UMConfigure
.
setEncryptEnabled
(
true
);
MobclickAgent
.
setScenarioType
(
mContext
,
EScenarioType
.
E_UM_NORMAL
);
...
...
@@ -147,17 +147,17 @@ public class MyApplication extends BaseApplication {
@Override
public
void
dealWithCustomAction
(
Context
context
,
UMessage
msg
)
{
LogUtils
.
e
(
"Upush click0: "
+
msg
.
extra
.
get
(
Constants
.
ORDER_ID
)+
" "
+
msg
.
custom
+
UserManager
.
getInstance
().
hasUserInfo
());
LogUtils
.
e
(
"Upush click0: "
+
msg
.
extra
.
get
(
Constants
.
ORDER_ID
)
+
" "
+
msg
.
custom
+
UserManager
.
getInstance
().
hasUserInfo
());
if
(
Constants
.
TO_DETAIL
.
equals
(
msg
.
custom
)
&&
msg
.
extra
.
containsKey
(
Constants
.
ORDER_ID
)
&&
UserManager
.
getInstance
().
hasUserInfo
()){
&&
msg
.
extra
.
containsKey
(
Constants
.
ORDER_ID
)
&&
UserManager
.
getInstance
().
hasUserInfo
())
{
Bundle
bundle
=
new
Bundle
();
bundle
.
putInt
(
Constants
.
ORDER_ID
,
Integer
.
parseInt
(
msg
.
extra
.
get
(
Constants
.
ORDER_ID
)));
Intent
intent
=
new
Intent
(
mContext
,
OrderDetailsActivity
.
class
);
intent
.
putExtra
(
Constants
.
BUNDLE
,
bundle
);
Intent
intent
=
new
Intent
(
mContext
,
OrderDetailsActivity
.
class
);
intent
.
putExtra
(
Constants
.
BUNDLE
,
bundle
);
startActivity
(
intent
);
MobclickAgent
.
onEvent
(
BaseApplication
.
getContext
(),
"push_check_order_detail"
);
}
else
{
startActivity
(
new
Intent
(
mContext
,
InitializeActivity
.
class
));
}
else
{
startActivity
(
new
Intent
(
mContext
,
InitializeActivity
.
class
));
}
}
};
...
...
@@ -168,17 +168,17 @@ public class MyApplication extends BaseApplication {
mPushAgent
.
register
(
new
IUmengRegisterCallback
()
{
@Override
public
void
onSuccess
(
String
s
)
{
SPUtils
.
put
(
Constants
.
UMENG_DEVICE_TOKEN
,
s
);
LogUtils
.
e
(
"Upush device_token: "
+
s
);
SPUtils
.
put
(
Constants
.
UMENG_DEVICE_TOKEN
,
s
);
LogUtils
.
e
(
"Upush device_token: "
+
s
);
}
@Override
public
void
onFailure
(
String
s
,
String
s1
)
{
LogUtils
.
e
(
"Upush init failure: "
+
s
+
" "
+
s1
);
LogUtils
.
e
(
"Upush init failure: "
+
s
+
" "
+
s1
);
}
});
MiPushRegistar
.
register
(
mContext
,
"2882303761518127164"
,
"5201812712164"
);
MiPushRegistar
.
register
(
mContext
,
"2882303761518127164"
,
"5201812712164"
);
HuaWeiRegister
.
register
(
this
);
OppoRegister
.
register
(
this
,
"a69IwYs2f8gg48ck000W4c0kc"
,
"425bEd757209c8101bEfE57eba86ddca"
);
VivoRegister
.
register
(
this
);
...
...
@@ -203,13 +203,18 @@ public class MyApplication extends BaseApplication {
startLocationService
();
}
@Override
public
void
runFrontGround
()
{
startLocationService
();
EventBus
.
getDefault
().
post
(
new
AppReturnFrontEvent
());
}
long
frontTime
;
private
void
startLocationService
()
{
if
(
System
.
currentTimeMillis
()
-
frontTime
>
600
)
{
frontTime
=
System
.
currentTimeMillis
();
// startService(new Intent(mContext, LocationService.class));
try
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
...
...
@@ -221,6 +226,7 @@ public class MyApplication extends BaseApplication {
e
.
printStackTrace
();
}
}
}
public
static
MyApplication
getAppContext
()
{
return
myApplication
;
...
...
baseSDK/src/main/java/com/dayu/base/ui/activity/BaseActivity.java
View file @
aa85fc68
...
...
@@ -236,10 +236,16 @@ public abstract class BaseActivity<P extends BasePresenter, B extends ViewDataBi
mUserInfo
=
info
;
}
long
frontTime
;
@Subscribe
public
void
onAppFront
(
AppReturnFrontEvent
event
)
{
if
(
System
.
currentTimeMillis
()-
frontTime
>
600
){
frontTime
=
System
.
currentTimeMillis
();
LogUtil
.
e
(
"app_front 000"
);
getRedPacketsData
();
}
}
@Subscribe
public
void
getRedPacketEvent
(
GetRedPacketDataEvent
event
)
{
...
...
baseSDK/src/main/java/com/dayu/common/Constants.java
View file @
aa85fc68
...
...
@@ -58,36 +58,36 @@ public class Constants {
/**
* uat测试环境配置.
*/
public
static
String
ENVIROMENT
=
"uat"
;
public
static
int
LOG_LEVEL
=
LogUtils
.
LEVEL_ALL
;
public
static
String
BASE_URL
=
"http://47.95.223.6:3112"
;
public
static
String
WEB_SOP
=
"http://47.95.223.6:9004/#/sop"
;
public
static
String
WEB_SOP_DETAIL
=
"http://47.95.223.6:9004/#/sopdetail"
;
public
static
String
WEB_ZHI_SHI
=
"http://47.95.223.6:9004/#/detail"
;
public
static
String
CHECK_MULTI_WEB_SOP
=
"http://47.95.223.6:9004/#/manyServiceResult"
;
public
static
String
MULTI_WEB_SOP
=
"http://47.95.223.6:9004/#/manySop"
;
public
static
final
String
UP_PHOTO
=
"/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply"
;
public
static
final
String
UP_VIDEO
=
"/file/uploadVideoOne?targetPath=test/video"
;
public
static
final
boolean
IS_DEBUG
=
false
;
public
static
String
VIDEO_SHARE_URL
=
"http://uat.kf.ai:9099/#/shareVideo?type=_type&id="
;
//uat 学习视频分享链接 type(课程: course 直播: live)
//
public static String ENVIROMENT = "uat";
//
public static int LOG_LEVEL = LogUtils.LEVEL_ALL;
//
public static String BASE_URL = "http://47.95.223.6:3112";
//
public static String WEB_SOP = "http://47.95.223.6:9004/#/sop";
//
public static String WEB_SOP_DETAIL = "http://47.95.223.6:9004/#/sopdetail";
//
public static String WEB_ZHI_SHI = "http://47.95.223.6:9004/#/detail";
//
public static String CHECK_MULTI_WEB_SOP = "http://47.95.223.6:9004/#/manyServiceResult";
//
public static String MULTI_WEB_SOP = "http://47.95.223.6:9004/#/manySop";
//
public static final String UP_PHOTO = "/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply";
//
public static final String UP_VIDEO = "/file/uploadVideoOne?targetPath=test/video";
//
public static final boolean IS_DEBUG = false;
//
public static String VIDEO_SHARE_URL = "http://uat.kf.ai:9099/#/shareVideo?type=_type&id="; //uat 学习视频分享链接 type(课程: course 直播: live)
/**
* 正式环境.
*/
//
public static String ENVIROMENT = "release";
//
public static int LOG_LEVEL = LogUtils.LEVEL_OFF;
//
public static String BASE_URL = "https://mobile.kf.ai";
//
public static String WEB_SOP = "https://sop.kf.ai/#/sop";
//
public static String WEB_SOP_DETAIL = "https://sop.kf.ai/#/sopdetail";
//
public static String WEB_ZHI_SHI = "https://sop.kf.ai/#/detail";
//
public static String CHECK_MULTI_WEB_SOP = "https://sop.kf.ai/#/manyServiceResult";
//
public static String MULTI_WEB_SOP = "https://sop.kf.ai/#/manySop";
//
public static final String UP_PHOTO = "/file/uploadMore?targetPath=online/sp/mobile/android/business/checkApply";
//
public static final String UP_VIDEO = "/file/uploadVideoOne?targetPath=online/video";
//
public static final boolean IS_DEBUG = false;
//
public static String VIDEO_SHARE_URL = "http://app.dl.kf.ai/ext/#/shareVideo?type=_type&id="; //学习视频分享链接 type(课程: course 直播: live)
public
static
String
ENVIROMENT
=
"release"
;
public
static
int
LOG_LEVEL
=
LogUtils
.
LEVEL_OFF
;
public
static
String
BASE_URL
=
"https://mobile.kf.ai"
;
public
static
String
WEB_SOP
=
"https://sop.kf.ai/#/sop"
;
public
static
String
WEB_SOP_DETAIL
=
"https://sop.kf.ai/#/sopdetail"
;
public
static
String
WEB_ZHI_SHI
=
"https://sop.kf.ai/#/detail"
;
public
static
String
CHECK_MULTI_WEB_SOP
=
"https://sop.kf.ai/#/manyServiceResult"
;
public
static
String
MULTI_WEB_SOP
=
"https://sop.kf.ai/#/manySop"
;
public
static
final
String
UP_PHOTO
=
"/file/uploadMore?targetPath=online/sp/mobile/android/business/checkApply"
;
public
static
final
String
UP_VIDEO
=
"/file/uploadVideoOne?targetPath=online/video"
;
public
static
final
boolean
IS_DEBUG
=
false
;
public
static
String
VIDEO_SHARE_URL
=
"http://app.dl.kf.ai/ext/#/shareVideo?type=_type&id="
;
//学习视频分享链接 type(课程: course 直播: live)
/**
...
...
@@ -155,7 +155,7 @@ public class Constants {
public
final
static
String
COMMITE_LOCAITON
=
" /api-user/"
+
"/engineerPathParticle"
;
public
final
static
String
AppLogoUrl
=
"
https://dayuoss.oss-cn-beijing.aliyuncs.com/saas/151508298725_.pic_hd.jpg"
;
public
final
static
String
AppLogoUrl
=
"https://dayuoss.oss-cn-beijing.aliyuncs.com/saas/151508298725_.pic_hd.jpg"
;
/***********************其他配置**********************************/
...
...
baseSDK/src/main/java/com/dayu/utils/CommonUtils.java
View file @
aa85fc68
...
...
@@ -302,12 +302,14 @@ public class CommonUtils {
*/
public
static
void
shareUrl
(
Activity
activity
,
String
url
,
String
imgUrl
,
String
title
,
String
description
,
SHARE_MEDIA
platform
,
UMShareListener
callBack
)
{
UMWeb
web
=
new
UMWeb
(
url
);
web
.
setTitle
(
title
);
if
(
TextUtils
.
isEmpty
(
imgUrl
))
{
web
.
setThumb
(
new
UMImage
(
activity
,
Constants
.
AppLogoUrl
));
}
else
{
web
.
setThumb
(
new
UMImage
(
activity
,
imgUrl
));
// ToastUtils.showShortToast("img: "+imgUrl);
}
web
.
setDescription
(
description
);
new
ShareAction
(
activity
).
withMedia
(
web
)
...
...
baseSDK/src/main/java/com/dayu/widgets/RedPacketsDialog.java
View file @
aa85fc68
...
...
@@ -65,7 +65,6 @@ public class RedPacketsDialog {
return
;
this
.
redPacketList
=
redPacketList
;
context
=
activity
;
if
(
mDialog
==
null
||
tvName
==
null
)
initDialog
();
if
(
redPacketList
.
size
()
>
index
)
tvMoney
.
setText
(
redPacketList
.
get
(
index
).
getActivityTitle
());
...
...
@@ -149,9 +148,9 @@ public class RedPacketsDialog {
playAudio
();
this
.
hasBankIfno
=
hasBankIfno
;
if
(
data
.
getStatus
()
==
1
){
if
(
data
.
getStatus
()
==
1
)
{
tvMoney
.
setText
(
"中奖金额"
+
data
.
getBonusPrice
()
+
"元"
);
}
else
{
}
else
{
tvMoney
.
setText
(
"很可惜,您未中奖"
);
}
GlideImageLoader
.
load
(
context
,
ivIcon
,
data
.
getPrizeUrl
(),
R
.
drawable
.
icon_app_logo
);
...
...
baseSDK/src/main/res/layout/dialog_red_packets.xml
View file @
aa85fc68
...
...
@@ -28,7 +28,7 @@
android:layout_height=
"wrap_content"
android:textSize=
"16sp"
android:textColor=
"#d8b983"
android:text=
"大鱼
U
服"
android:text=
"大鱼
云
服"
android:layout_marginTop=
"10dp"
/>
<TextView
...
...
learnCenter/src/main/java/com/dayu/learncenter/ui/activity/CourseDetailActivity.java
View file @
aa85fc68
...
...
@@ -323,12 +323,13 @@ public class CourseDetailActivity extends BaseActivity<SImplePresenter, Activity
String
url
=
Constants
.
VIDEO_SHARE_URL
.
replace
(
"_type"
,
"course"
)+
courseDetail
.
getId
();
WechatShareDialog
.
getInstance
().
showBottomDialog
(
mActivity
,
pos
->
{
if
(
pos
==
0
){
CommonUtils
.
shareUrl
(
mActivity
,
url
,
""
,
courseDetail
.
getName
(),
courseDetail
.
getBrief
(),
SHARE_MEDIA
.
WEIXIN
,
null
);
String
path
=
Constants
.
LEAEN_PROGRAM_PATH
.
replace
(
"_type"
,
"course"
)+
courseDetail
.
getId
();
CommonUtils
.
shareProgramPath
(
mActivity
,
CommonUtils
.
getVideoImg
(
courseDetail
.
getUrl
()),
courseDetail
.
getName
(),
courseDetail
.
getBrief
(),
path
,
SHARE_MEDIA
.
WEIXIN
,
null
);
AddShareRecordData
data
=
new
AddShareRecordData
(
mUserId
,
mUserInfo
.
getAccountName
(),
"微信"
,
courseDetail
.
getId
(),
1
);
addShareRecord
(
data
);
}
else
{
CommonUtils
.
shareUrl
(
mActivity
,
url
,
""
,
courseDetail
.
getName
(),
courseDetail
.
getBrief
(),
SHARE_MEDIA
.
WEIXIN_CIRCLE
,
null
);
CommonUtils
.
shareUrl
(
mActivity
,
url
,
CommonUtils
.
getVideoImg
(
courseDetail
.
getUrl
())
,
courseDetail
.
getName
(),
courseDetail
.
getBrief
(),
SHARE_MEDIA
.
WEIXIN_CIRCLE
,
null
);
AddShareRecordData
data
=
new
AddShareRecordData
(
mUserId
,
mUserInfo
.
getAccountName
(),
"朋友圈"
,
courseDetail
.
getId
(),
1
);
addShareRecord
(
data
);
...
...
learnCenter/src/main/java/com/dayu/learncenter/ui/fragment/CommonLearnFragment.java
View file @
aa85fc68
...
...
@@ -25,6 +25,7 @@ import com.dayu.learncenter.presenter.common_learn.CommonLearnPresenter;
import
com.dayu.learncenter.ui.activity.CourseDetailActivity
;
import
com.dayu.learncenter.ui.activity.EditCourseActivity
;
import
com.dayu.utils.CommonUtils
;
import
com.dayu.utils.LogUtils
;
import
com.dayu.widgets.WechatShareDialog
;
import
com.umeng.analytics.MobclickAgent
;
import
com.umeng.socialize.bean.SHARE_MEDIA
;
...
...
@@ -184,7 +185,9 @@ public class CommonLearnFragment extends BaseFragment<CommonLearnPresenter, Frag
"微信"
,
item
.
getId
(),
1
);
addShareRecord
(
data
);
}
else
{
CommonUtils
.
shareUrl
(
mActivity
,
url
,
CommonUtils
.
getVideoImg
(
item
.
getUrl
()),
item
.
getName
(),
item
.
getBrief
(),
SHARE_MEDIA
.
WEIXIN_CIRCLE
,
null
);
String
imgUrl
=
CommonUtils
.
getVideoImg
(
item
.
getUrl
());
LogUtils
.
e
(
"shareImg: "
+
imgUrl
);
CommonUtils
.
shareUrl
(
mActivity
,
url
,
imgUrl
,
item
.
getName
(),
item
.
getBrief
(),
SHARE_MEDIA
.
WEIXIN_CIRCLE
,
null
);
AddShareRecordData
data
=
new
AddShareRecordData
(
mUserId
,
mUserInfo
.
getAccountName
(),
"朋友圈"
,
item
.
getId
(),
1
);
addShareRecord
(
data
);
...
...
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