Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
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
杨凯
YDL-Component-Medical
Commits
ff0a1570
Commit
ff0a1570
authored
Jun 30, 2022
by
范玉宾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
meditation share to miniWX feat done
parent
59b07fb3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
170 additions
and
113 deletions
+170
-113
config.gradle
config.gradle
+2
-2
PlayMeditationActivity.kt
m-muse/src/main/java/com/yidianling/muse/activity/PlayMeditationActivity.kt
+118
-81
MeditationPlayModuleBean.kt
m-muse/src/main/java/com/yidianling/muse/bean/MeditationPlayModuleBean.kt
+26
-21
ShareMeditationDialog.kt
m-muse/src/main/java/com/yidianling/muse/widget/ShareMeditationDialog.kt
+24
-9
No files found.
config.gradle
View file @
ff0a1570
...
...
@@ -13,7 +13,7 @@ ext {
"m-im"
:
"0.0.21.64"
,
"m-dynamic"
:
"0.0.7.74"
,
"m-article"
:
"0.0.0.10"
,
"m-muse"
:
"0.0.28.8
1
"
,
"m-muse"
:
"0.0.28.8
2
"
,
"m-tests"
:
"0.0.24.18"
,
"m-course"
:
"0.0.43.39"
,
...
...
@@ -100,7 +100,7 @@ ext {
"m-dynamic"
:
"0.0.7.74"
,
"m-article"
:
"0.0.0.10"
,
"m-muse"
:
"0.0.28.8
1
"
,
"m-muse"
:
"0.0.28.8
2
"
,
"m-tests"
:
"0.0.24.18"
,
"m-course"
:
"0.0.43.39"
,
...
...
m-muse/src/main/java/com/yidianling/muse/activity/PlayMeditationActivity.kt
View file @
ff0a1570
package
com.yidianling.muse.activity
//import com.yidianling.muse.dialog.ChooseMusicDialog
import
android.content.Intent
import
android.media.MediaPlayer
import
android.os.Bundle
...
...
@@ -17,6 +16,7 @@ import com.ydl.ydlcommon.base.BaseActivity
import
com.ydl.ydlcommon.data.http.ThrowableConsumer
import
com.ydl.ydlcommon.event.MeditationEvent
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.utils.Utils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.remind.ToastHelper.Companion.show
...
...
@@ -58,6 +58,11 @@ class PlayMeditationActivity : BaseActivity() {
private
var
mMediaUrl
=
""
private
var
mMediaCoverUrl
=
""
private
var
mMinProgramId
:
String
?
=
null
private
var
mCateId
:
Int
?
=
null
private
var
mTagId
:
String
?
=
null
private
var
mMark
:
Int
?
=
null
private
var
mTitle
=
""
private
var
mDesc
=
""
private
var
mStatus
=
0
...
...
@@ -90,6 +95,11 @@ class PlayMeditationActivity : BaseActivity() {
private
var
mBuried
:
String
?
=
null
private
var
mVideoId
:
String
?
=
null
private
var
mIndexForMini
=
0
private
var
mMinProgramPath
:
String
?
=
null
/**
* 传递过来的mediaId 用于判断正在播放的是否是同一条音频
*/
...
...
@@ -139,6 +149,11 @@ class PlayMeditationActivity : BaseActivity() {
val
module
=
it
.
data
mMediaId
=
module
.
mediaId
mMinProgramId
=
module
.
minProgramId
mCateId
=
module
.
cateId
mTagId
=
module
.
tagId
mMark
=
module
.
mark
meditations
.
clear
()
module
.
mediaList
?.
forEach
{
meditationPlayBean
->
...
...
@@ -148,7 +163,10 @@ class PlayMeditationActivity : BaseActivity() {
if
(
meditationPlayBean
.
mediaId
==
mMediaId
)
{
currentMeditation
=
meditationPlayBean
.
copy
(
meditationType
=
mMeditationType
,
meditationId
=
mMeditationId
!!
)
meditationPlayBean
.
copy
(
meditationType
=
mMeditationType
,
meditationId
=
mMeditationId
!!
)
mMediaId
=
module
?.
mediaId
?:
0L
mTitle
=
meditationPlayBean
.
title
...
...
@@ -168,56 +186,28 @@ class PlayMeditationActivity : BaseActivity() {
collected
=
mStatus
==
1
mVideoId
=
meditationPlayBean
.
videoId
mIndexForMini
=
0
updateUI
()
initMediaPlayer
(
mMediaUrl
,
currentPosition
,
mMediaIdFromLocal
==
mMediaId
)
formatMiniPath
()
initMediaPlayer
(
mMediaUrl
,
currentPosition
,
mMediaIdFromLocal
==
mMediaId
)
}
}
// mediaListLink = module.playDetailUrl?:""
//
// val mediaList = module.mediaList
// if(!mediaList.isNullOrEmpty()){
// val meditation = mediaList[0]
//
//
//
// currentMeditation = meditation.copy(meditationType = mMeditationType,meditationId = mMeditationId!!)
// mTitle = meditation.title
// mDesc = meditation.desc?:""
// mMediaUrl = meditation.mediaUrl
// mMediaCoverUrl = meditation.coverImageUrl
// val currentPosition = meditation.broadcastTime
// mBusinessType = meditation.businessType
// mBuried = meditation.buried
// mStatus = meditation.status
//
// collected = mStatus == 1
//
// updateUI()
//
// initMediaPlayer(
// mMediaUrl,
// currentPosition,
// mMediaIdFromLocal == mMediaId
// )
//
// //快进点击事件
// ActionCountUtils.baiDuCountSign3(
// MuseBIConstants.YDL_MUSE_MEDITATION_MUSIC_PLAY_PAGE,
// MuseBIConstants.YDL_MUSE_PLAY_PAGE_VISIT,
// currentMeditation?.title ?: "",
// mBuried ?: "",
// ""
// )
// }
}
},
object
:
ThrowableConsumer
()
{
override
fun
accept
(
msg
:
String
)
{
show
(
msg
)
}
})
}
else
{
}
else
{
MuseHttp
.
getInstance
().
getMeditationPlayDetail
(
meditionType
=
1
,
mediaId
=
mMediaIdFromLocal
!!
,
...
...
@@ -231,17 +221,26 @@ class PlayMeditationActivity : BaseActivity() {
val
module
=
it
.
data
mMediaId
=
module
.
mediaId
mMinProgramId
=
module
.
minProgramId
mCateId
=
module
.
cateId
mTagId
=
module
.
tagId
mMark
=
module
.
mark
meditations
.
clear
()
module
.
mediaList
?.
forEach
{
meditationPlayBean
->
module
.
mediaList
?.
forEach
Indexed
{
index
,
meditationPlayBean
->
meditations
.
add
(
meditationPlayBean
)
if
(
meditationPlayBean
.
mediaId
==
mMediaId
)
{
mIndexForMini
=
index
currentMeditation
=
meditationPlayBean
.
copy
(
meditationType
=
mMeditationType
,
meditationId
=
mMeditationId
!!
)
meditationPlayBean
.
copy
(
meditationType
=
mMeditationType
,
meditationId
=
mMeditationId
!!
)
mMediaId
=
module
?.
mediaId
?:
0L
mTitle
=
meditationPlayBean
.
title
...
...
@@ -261,9 +260,17 @@ class PlayMeditationActivity : BaseActivity() {
collected
=
mStatus
==
1
mVideoId
=
meditationPlayBean
.
videoId
formatMiniPath
()
updateUI
()
initMediaPlayer
(
mMediaUrl
,
currentPosition
,
mMediaIdFromLocal
==
mMediaId
)
initMediaPlayer
(
mMediaUrl
,
currentPosition
,
mMediaIdFromLocal
==
mMediaId
)
}
}
}
...
...
@@ -322,7 +329,7 @@ class PlayMeditationActivity : BaseActivity() {
""
)
if
(!
mediaListLink
.
isNullOrBlank
())
{
ChooseMusicActivity
.
launch
(
this
,
H5Params
(
mediaListLink
,
""
)
)
ChooseMusicActivity
.
launch
(
this
,
H5Params
(
mediaListLink
,
""
)
)
}
}
...
...
@@ -392,7 +399,7 @@ class PlayMeditationActivity : BaseActivity() {
""
)
if
(
mMeditationType
==
0
)
{
if
(
mMeditationType
==
0
)
{
if
(
mMeditationId
!=
null
&&
mMediaId
!=
null
)
{
MediaPlayerTimeUtil
.
uploadPlayRecord
(
meditationId
=
mMeditationId
!!
.
toInt
(),
...
...
@@ -407,7 +414,7 @@ class PlayMeditationActivity : BaseActivity() {
finish
()
}
}
else
{
}
else
{
if
(
quitDialog
==
null
)
{
quitDialog
=
QuitMeditationDialog
.
newInstance
()
}
...
...
@@ -441,9 +448,13 @@ class PlayMeditationActivity : BaseActivity() {
mBuried
?:
""
,
""
)
val
event
=
MeditationFloatEvent
(
true
,
meditation
=
currentMeditation
?.
copy
(
meditationType
=
mMeditationType
,
meditationId
=
mMeditationId
?:
0
))
val
event
=
MeditationFloatEvent
(
true
,
meditation
=
currentMeditation
?.
copy
(
meditationType
=
mMeditationType
,
meditationId
=
mMeditationId
?:
0
)
)
EventBus
.
getDefault
().
post
(
event
)
Handler
().
postDelayed
({
...
...
@@ -466,13 +477,15 @@ class PlayMeditationActivity : BaseActivity() {
shareTitle
=
mTitle
,
shareContent
=
mDesc
,
shareUrl
=
mMediaUrl
,
shareImageUrl
=
mMediaCoverUrl
shareImageUrl
=
mMediaCoverUrl
,
miniId
=
"gh_c154608001f0"
,
// miniId = mMinProgramId!!,
miniPath
=
mMinProgramPath
!!
)
}
if
(
shareDialog
!=
null
&&
shareDialog
?.
isAdded
==
false
)
{
shareDialog
?.
show
(
supportFragmentManager
,
ShareMeditationDialog
.
TAG
)
}
}
iv_time_off
.
setOnClickListener
{
...
...
@@ -485,7 +498,7 @@ class PlayMeditationActivity : BaseActivity() {
""
)
val
intent
=
Intent
(
this
,
MeditationTimeOffActivity
::
class
.
java
)
intent
.
putExtra
(
"BG_IMAGE_URL"
,
mMediaCoverUrl
)
intent
.
putExtra
(
"BG_IMAGE_URL"
,
mMediaCoverUrl
)
startActivityForResult
(
intent
,
request_code
)
}
...
...
@@ -499,7 +512,7 @@ class PlayMeditationActivity : BaseActivity() {
""
)
val
intent
=
Intent
(
this
,
MeditationTimeOffActivity
::
class
.
java
)
intent
.
putExtra
(
"BG_IMAGE_URL"
,
mMediaCoverUrl
)
intent
.
putExtra
(
"BG_IMAGE_URL"
,
mMediaCoverUrl
)
startActivityForResult
(
intent
,
request_code
)
}
...
...
@@ -578,7 +591,7 @@ class PlayMeditationActivity : BaseActivity() {
)
var
currentPosition
=
0
meditations
?.
forEachIndexed
{
index
,
meditationDetail
->
if
(
meditationDetail
.
mediaId
==
mMediaId
){
if
(
meditationDetail
.
mediaId
==
mMediaId
)
{
currentPosition
=
index
}
}
...
...
@@ -595,17 +608,22 @@ class PlayMeditationActivity : BaseActivity() {
)
val
meditation
=
meditations
[
currentPosition
-
1
]
currentMeditation
=
meditation
.
copy
(
meditationId
=
mMeditationId
!!
)
mMediaId
=
meditation
.
mediaId
mMediaCoverUrl
=
meditation
.
coverImageUrl
mMediaUrl
=
meditation
.
mediaUrl
val
currentPosition
=
meditation
.
broadcastTime
mStatus
=
meditation
.
status
mTitle
=
meditation
.
title
mDesc
=
meditation
.
title
mVideoId
=
meditation
.
videoId
mIndexForMini
=
currentPosition
-
1
formatMiniPath
()
updateUI
(
needRefresh
=
false
)
initMediaPlayer
(
mMediaUrl
,
0
,
mMediaIdFromLocal
==
mMediaId
)
...
...
@@ -627,7 +645,7 @@ class PlayMeditationActivity : BaseActivity() {
)
var
currentPosition
=
0
meditations
?.
forEachIndexed
{
index
,
meditationDetail
->
if
(
meditationDetail
.
mediaId
==
mMediaId
){
if
(
meditationDetail
.
mediaId
==
mMediaId
)
{
currentPosition
=
index
}
}
...
...
@@ -655,6 +673,11 @@ class PlayMeditationActivity : BaseActivity() {
mTitle
=
meditation
.
title
mDesc
=
meditation
.
title
mVideoId
=
meditation
.
videoId
mIndexForMini
=
currentMeditationIndex
+
1
formatMiniPath
()
updateUI
(
needRefresh
=
false
)
...
...
@@ -743,10 +766,11 @@ class PlayMeditationActivity : BaseActivity() {
})
val
isLoop
=
MediaPlayerManager
.
getInstance
(
this
@PlayMeditationActivity
)
?.
getTimeOffStatus
()
==
true
val
isLoop
=
MediaPlayerManager
.
getInstance
(
this
@PlayMeditationActivity
)
?.
getTimeOffStatus
()
==
true
initPlayCompletionListener
(
isLoop
=
isLoop
)
MeditationFloatPermissionUtil
.
checkSuspendedWindowPermission
(
this
){
MeditationFloatPermissionUtil
.
checkSuspendedWindowPermission
(
this
)
{
}
...
...
@@ -756,9 +780,9 @@ class PlayMeditationActivity : BaseActivity() {
mMediaPlayer
?.
setOnCompletionListener
{
val
duration
=
currentMeditation
?.
duration
?.
toInt
()
?:
0
val
currentDuration
=
(
mMediaPlayer
?.
currentPosition
?:
0
)/
1000
if
(
currentDuration
==
duration
)
{
val
duration
=
currentMeditation
?.
duration
?.
toInt
()
?:
0
val
currentDuration
=
(
mMediaPlayer
?.
currentPosition
?:
0
)
/
1000
if
(
currentDuration
==
duration
)
{
val
playTime
=
(
seekbar_play_progress
.
progress
/
1000.00
).
roundToInt
()
MediaPlayerTimeUtil
.
uploadPlayRecord
(
...
...
@@ -770,13 +794,12 @@ class PlayMeditationActivity : BaseActivity() {
)
}
if
(
isLoop
){
if
(
isSingle
||
meditations
.
size
==
1
){
switchSound
()
// MediaPlayerManager.getInstance(this)?.setAudioPath(mMediaUrl)
}
else
{
switchSound
()
}
if
(
isLoop
)
{
if
(
isSingle
||
meditations
.
size
==
1
)
{
switchSound
()
}
else
{
switchSound
()
}
}
isPlaying
=
if
(
it
.
isPlaying
)
{
...
...
@@ -796,18 +819,20 @@ class PlayMeditationActivity : BaseActivity() {
}
private
fun
switchSound
(){
var
meditation
:
MeditationPlayModuleBean
.
MeditationDetail
?
=
null
private
fun
switchSound
()
{
var
meditation
:
MeditationPlayModuleBean
.
MeditationDetail
?
=
null
meditations
?.
forEachIndexed
{
index
,
meditationDetail
->
if
(
meditationDetail
.
mediaId
==
mMediaId
){
if
(
meditationDetail
.
mediaId
==
mMediaId
)
{
currentMeditationIndex
=
index
}
}
if
(
mMeditationId
==
null
||
mMediaId
==
null
)
return
if
(
currentMeditationIndex
<
meditations
.
size
-
1
)
{
meditation
=
meditations
[
currentMeditationIndex
+
1
]
mIndexForMini
=
currentMeditationIndex
+
1
}
else
{
meditation
=
meditations
[
0
]
mIndexForMini
=
0
}
currentMeditation
=
meditation
.
copy
(
meditationId
=
mMeditationId
!!
)
...
...
@@ -819,6 +844,10 @@ class PlayMeditationActivity : BaseActivity() {
mTitle
=
meditation
.
title
mDesc
=
meditation
.
title
mVideoId
=
meditation
.
videoId
formatMiniPath
()
updateUI
(
needRefresh
=
false
)
initMediaPlayer
(
mMediaUrl
,
0
,
mMediaIdFromLocal
==
mMediaId
)
...
...
@@ -826,7 +855,7 @@ class PlayMeditationActivity : BaseActivity() {
private
fun
initMediaPlayer
(
path
:
String
,
current
:
Int
,
isSameOne
:
Boolean
=
false
)
{
if
(
MediaPlayerManager
.
getInstance
(
this
)
?.
getAudioPath
()
!=
null
&&
if
(
MediaPlayerManager
.
getInstance
(
this
)
?.
getAudioPath
()
!=
null
&&
MediaPlayerManager
.
getInstance
(
this
)
?.
getMediaId
()
==
mMediaId
)
{
if
(
mMediaPlayer
?.
isPlaying
==
true
)
{
...
...
@@ -888,7 +917,8 @@ class PlayMeditationActivity : BaseActivity() {
mTimer
.
schedule
(
object
:
TimerTask
()
{
override
fun
run
()
{
if
(!
isSeekbarChanging
)
{
seekbar_play_progress
.
progress
=
mMediaPlayer
?.
currentPosition
?:
0
seekbar_play_progress
.
progress
=
mMediaPlayer
?.
currentPosition
?:
0
}
}
},
0
,
50
)
...
...
@@ -921,7 +951,7 @@ class PlayMeditationActivity : BaseActivity() {
MediaPlayerManager
.
getInstance
(
this
)
?.
setTimeOffStatus
(
true
)
initRxTimeOff
((
minute
*
60
*
1000
).
toLong
(),
1
)
}
val
event
=
MeditationFloatEvent
(
false
,
time
=
(
minute
*
60
*
1000
).
toLong
())
val
event
=
MeditationFloatEvent
(
false
,
time
=
(
minute
*
60
*
1000
).
toLong
())
EventBus
.
getDefault
().
post
(
event
)
}
else
{
initPlayCompletionListener
()
...
...
@@ -931,13 +961,13 @@ class PlayMeditationActivity : BaseActivity() {
tv_time_off
.
visibility
=
View
.
GONE
tv_time_off_pure_music
.
visibility
=
View
.
GONE
mMediaPlayer
?.
isLooping
=
false
val
event
=
MeditationFloatEvent
(
false
,
time
=
0
)
val
event
=
MeditationFloatEvent
(
false
,
time
=
0
)
EventBus
.
getDefault
().
post
(
event
)
}
}
}
private
fun
updateUI
(
needRefresh
:
Boolean
=
true
)
{
private
fun
updateUI
(
needRefresh
:
Boolean
=
true
)
{
tv_title
.
text
=
mTitle
tv_content
.
text
=
mDesc
Glide
.
with
(
this
)
...
...
@@ -952,10 +982,10 @@ class PlayMeditationActivity : BaseActivity() {
}
)
if
(
needRefresh
)
{
if
(
MediaPlayerManager
.
getInstance
(
this
)
?.
getTimeOffStatus
()
==
true
)
{
if
(
needRefresh
)
{
if
(
MediaPlayerManager
.
getInstance
(
this
)
?.
getTimeOffStatus
()
==
true
)
{
val
timeOff
=
MediaPlayerManager
.
getInstance
(
this
)
?.
getTimeOff
()
if
(
timeOff
!=
null
&&
timeOff
>
0
&&
mMeditationType
!=
null
)
{
if
(
timeOff
!=
null
&&
timeOff
>
0
&&
mMeditationType
!=
null
)
{
initRxTimeOff
(
timeOff
,
mMeditationType
!!
)
}
}
...
...
@@ -1064,4 +1094,10 @@ class PlayMeditationActivity : BaseActivity() {
const
val
request_code
=
0
x0001
}
private
fun
formatMiniPath
()
{
mMinProgramPath
=
"/pages/player/index?meditationId=${mMeditationId}"
+
"&meditionType=${mMeditationType}&mediaId=${mMediaId}&collectStatus=${mStatus}&index=${mIndexForMini}&videoId=${mVideoId}&cateId=${mCateId}&mark=${mMark}&tagId=${mTagId}"
LogUtil
.
d
(
"Lancet======"
,
mMinProgramPath
)
}
}
\ No newline at end of file
m-muse/src/main/java/com/yidianling/muse/bean/MeditationPlayModuleBean.kt
View file @
ff0a1570
...
...
@@ -5,32 +5,37 @@ package com.yidianling.muse.bean
* Created by xj on 2019/9/16.
*/
class
MeditationPlayModuleBean
:
HomeItemBaseBean
{
constructor
()
:
super
(
false
)
constructor
(
isRealEmpty
:
Boolean
):
super
(
isRealEmpty
)
constructor
()
:
super
(
false
)
constructor
(
isRealEmpty
:
Boolean
)
:
super
(
isRealEmpty
)
var
meditationId
:
Long
?
=
null
var
mediaId
:
Long
?
=
null
var
mediaType
:
Int
?=
null
var
playDetailUrl
:
String
?
=
null
var
meditationId
:
Long
?
=
null
var
mediaId
:
Long
?
=
null
var
mediaType
:
Int
?
=
null
var
playDetailUrl
:
String
?
=
null
val
minProgramId
:
String
?
=
null
val
cateId
:
Int
?
=
null
val
tagId
:
String
?
=
null
val
mark
:
Int
?
=
null
var
mediaList
:
ArrayList
<
MeditationDetail
>?
=
null
data class
MeditationDetail
(
val
meditationType
:
Int
?
=
null
,
val
mediaId
:
Long
?=
null
,
val
meditationId
:
Long
,
val
title
:
String
,
val
author
:
String
,
val
coverImageUrl
:
String
,
val
mediaUrl
:
String
,
val
duration
:
Float
?=
null
,
val
status
:
Int
,
val
broadcastTime
:
Int
,
val
businessType
:
Int
,
val
buried
:
String
?=
null
,
val
desc
:
String
?=
null
,
val
coverImageUrlIcon
:
String
)
val
meditationType
:
Int
?
=
null
,
val
mediaId
:
Long
?
=
null
,
val
meditationId
:
Long
,
val
title
:
String
,
val
author
:
String
,
val
coverImageUrl
:
String
,
val
mediaUrl
:
String
,
val
duration
:
Float
?
=
null
,
val
status
:
Int
,
val
broadcastTime
:
Int
,
val
businessType
:
Int
,
val
buried
:
String
?
=
null
,
val
desc
:
String
?
=
null
,
val
coverImageUrlIcon
:
String
,
val
videoId
:
String
?
=
null
)
override
fun
toString
():
String
{
return
"MeditationPlayModuleBean(meditationId=$meditationId, mediaId=$mediaId, mediaType=$mediaType, playDetailUrl=$playDetailUrl, mediaList=$mediaList)"
...
...
m-muse/src/main/java/com/yidianling/muse/widget/ShareMeditationDialog.kt
View file @
ff0a1570
...
...
@@ -60,10 +60,12 @@ class ShareMeditationDialog : DialogFragment() {
private
fun
initView
(
view
:
View
?)
{
val
shareImageUrl
=
arguments
?.
getString
(
KEY_SHARE_IMAGE_URL
)
?:
""
val
shareTitle
=
arguments
?.
getString
(
KEY_SHARE_TITLE
)
?:
""
val
shareContent
=
arguments
?.
getString
(
KEY_SHARE_CONTENT
)
?:
""
val
shareUrl
=
arguments
?.
getString
(
KEY_SHARE_URL
)
?:
""
val
shareImageUrl
=
arguments
?.
getString
(
KEY_SHARE_IMAGE_URL
)
?:
""
val
shareTitle
=
arguments
?.
getString
(
KEY_SHARE_TITLE
)
?:
""
val
shareContent
=
arguments
?.
getString
(
KEY_SHARE_CONTENT
)
?:
""
val
shareUrl
=
arguments
?.
getString
(
KEY_SHARE_URL
)
?:
""
val
shareMiniId
=
arguments
?.
getString
(
KEY_SHARE_MINI_ID
)
?:
""
val
shareMiniPath
=
arguments
?.
getString
(
KEY_SHARE_MINI_PATH
)
?:
""
ivSharePicture
=
view
?.
findViewById
(
R
.
id
.
iv_share_picture
)
...
...
@@ -82,13 +84,15 @@ class ShareMeditationDialog : DialogFragment() {
llQQFriend
=
view
?.
findViewById
(
R
.
id
.
ll_qq_friend
)
llWeChat
?.
setOnClickListener
{
ShareUtils
.
shareTo
(
SHARE_MEDIA
.
WEIXIN
,
ShareUtils
.
shareSmailWeixin
(
activity
as
Activity
,
shareTitle
,
shareUrl
,
shareContent
,
shareImageUrl
shareImageUrl
,
path
=
shareMiniPath
,
id
=
shareMiniId
,
shareListener
=
null
)
dismiss
()
}
...
...
@@ -147,13 +151,24 @@ class ShareMeditationDialog : DialogFragment() {
private
const
val
KEY_SHARE_URL
=
"key_share_url"
private
const
val
KEY_SHARE_CONTENT
=
"key_share_content"
private
const
val
KEY_SHARE_IMAGE_URL
=
"key_share_image_url"
fun
newInstance
(
shareTitle
:
String
,
shareUrl
:
String
,
shareContent
:
String
,
shareImageUrl
:
String
):
ShareMeditationDialog
{
private
const
val
KEY_SHARE_MINI_ID
=
"key_share_mini_id"
private
const
val
KEY_SHARE_MINI_PATH
=
"key_share_mini_path"
fun
newInstance
(
shareTitle
:
String
,
shareUrl
:
String
,
shareContent
:
String
,
shareImageUrl
:
String
,
miniId
:
String
,
miniPath
:
String
):
ShareMeditationDialog
{
val
args
=
Bundle
()
args
.
putString
(
KEY_SHARE_TITLE
,
shareTitle
)
args
.
putString
(
KEY_SHARE_CONTENT
,
shareContent
)
args
.
putString
(
KEY_SHARE_URL
,
shareUrl
)
args
.
putString
(
KEY_SHARE_IMAGE_URL
,
shareImageUrl
)
args
.
putString
(
KEY_SHARE_MINI_ID
,
miniId
)
args
.
putString
(
KEY_SHARE_MINI_PATH
,
miniPath
)
val
fragment
=
ShareMeditationDialog
()
fragment
.
arguments
=
args
return
fragment
...
...
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