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
a8390d2b
Commit
a8390d2b
authored
Nov 08, 2021
by
霍志良
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/适配64位CPU' into APP埋点
# Conflicts: # config.gradle
parents
40ff720c
e18b0ace
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
143 additions
and
131 deletions
+143
-131
build.gradle
app/build.gradle
+1
-1
DemoAppLifecycles.kt
app/src/main/java/com/ydl/component/base/DemoAppLifecycles.kt
+6
-1
DemoGlobalConfig.java
app/src/main/java/com/ydl/component/base/DemoGlobalConfig.java
+2
-2
PlayFragment.java
app/src/main/java/com/ydl/component/music/PlayFragment.java
+2
-3
config.gradle
config.gradle
+20
-20
build.gradle
m-course/build.gradle
+1
-0
AndroidManifest.xml
m-course/src/main/AndroidManifest.xml
+2
-1
MyCourseActivity.java
m-course/src/main/java/com/yidianling/course/courseNew/mine/MyCourseActivity.java
+21
-20
CoursePlayActivity.kt
m-course/src/main/java/com/yidianling/course/coursePlay/CoursePlayActivity.kt
+3
-3
CoursePlayItemViewVideo.kt
m-course/src/main/java/com/yidianling/course/coursePlay/CoursePlayItemViewVideo.kt
+12
-27
activity_course_commeny.xml
m-course/src/main/res/layout/activity_course_commeny.xml
+1
-1
activity_course_play.xml
m-course/src/main/res/layout/activity_course_play.xml
+1
-1
activity_my_course.xml
m-course/src/main/res/layout/activity_my_course.xml
+28
-26
FMDetailActivity.java
m-fm/src/main/java/com/yidianling/fm/FMDetailActivity.java
+5
-5
build.gradle
m-im/build.gradle
+1
-1
MusePlugin.kt
m-muse/src/main/java/com/yidianling/muse/handler/MusePlugin.kt
+18
-14
BaseFlutterActivity.kt
ydl-flutter-base/src/main/java/com/channel/ydl_flutter_base/base/BaseFlutterActivity.kt
+1
-1
Flutter.java
ydl-flutter-base/src/main/java/com/channel/ydl_flutter_base/base/Flutter.java
+1
-1
build.gradle
ydl-media/build.gradle
+2
-1
PlayService.kt
ydl-media/src/main/java/com/ydl/media/audio/PlayService.kt
+13
-0
build.gradle
ydl-platform/build.gradle
+1
-1
build.gradle
ydl-webview/build.gradle
+1
-1
No files found.
app/build.gradle
View file @
a8390d2b
...
...
@@ -37,7 +37,7 @@ android {
multiDexEnabled
true
ndk
{
abiFilters
"arm
eabi-v7
a"
// 指定要ndk需要兼容的架构(这样其他依赖包里mips,x86,armeabi,arm-v8之类的so会被过滤掉)
abiFilters
"arm
64-v8
a"
// 指定要ndk需要兼容的架构(这样其他依赖包里mips,x86,armeabi,arm-v8之类的so会被过滤掉)
}
}
...
...
app/src/main/java/com/ydl/component/base/DemoAppLifecycles.kt
View file @
a8390d2b
...
...
@@ -78,7 +78,12 @@ class DemoAppLifecycles : IAppLifecycles {
// flutterEngine.getLocalizationChannel().channel.setMethodCallHandler(plugin);
val
intent
=
Intent
(
application
,
PlayService
::
class
.
java
)
application
.
startService
(
intent
)
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
application
.
startForegroundService
(
intent
)
}
else
{
application
.
startService
(
intent
)
}
// application.registerActivityLifecycleCallbacks(new CoursePlayLifecycle());
Stetho
.
initializeWithDefaults
(
application
)
...
...
app/src/main/java/com/ydl/component/base/DemoGlobalConfig.java
View file @
a8390d2b
...
...
@@ -21,9 +21,9 @@ import java.util.List;
public
final
class
DemoGlobalConfig
implements
IConfigModule
{
String
APP_DOMAIN
=
"https://api.github.com/"
;
// public static String appEnv = YDLConstants.ENV_AUTO_TEST;
public
static
String
appEnv
=
YDLConstants
.
ENV_TEST
;
//
public static String appEnv = YDLConstants.ENV_TEST;
// public static String appEnv = YDLConstants.ENV_NEW_TEST;//配置未上传到maven库
//
public static String appEnv = YDLConstants.ENV_PROD;
public
static
String
appEnv
=
YDLConstants
.
ENV_PROD
;
@Override
public
void
injectAppLifecycle
(
@NotNull
Context
context
,
@NotNull
List
<
IAppLifecycles
>
lifecycles
)
{
lifecycles
.
add
(
new
DemoAppLifecycles
());
...
...
app/src/main/java/com/ydl/component/music/PlayFragment.java
View file @
a8390d2b
...
...
@@ -215,12 +215,11 @@ public class PlayFragment extends Fragment implements View.OnClickListener,
tvArtist
.
setText
(
music
.
getArtist
());
sbProgress
.
setProgress
((
int
)
AudioPlayer
.
Companion
.
get
().
getAudioPosition
());
sbProgress
.
setSecondaryProgress
(
0
);
sbProgress
.
setMax
((
int
)
AudioPlayer
.
Companion
.
get
().
getDuration
());
//
sbProgress.setMax((int) AudioPlayer.Companion.get().getDuration());
mLastProgress
=
0
;
tvCurrentTime
.
setText
(
R
.
string
.
play_time_start
);
tvTotalTime
.
setText
(
formatTime
(
AudioPlayer
.
Companion
.
get
().
getDuration
()));
// tvTotalTime.setText(formatTime(AudioPlayer.Companion.get().getDuration()));
setCoverAndBg
(
music
);
if
(
AudioPlayer
.
Companion
.
get
().
isPlaying
()
||
AudioPlayer
.
Companion
.
get
().
isPreparing
())
{
ivPlay
.
setSelected
(
true
);
...
...
config.gradle
View file @
a8390d2b
...
...
@@ -14,9 +14,9 @@ ext {
"m-dynamic"
:
"0.0.7.34"
,
"m-article"
:
"0.0.0.10"
,
"m-muse"
:
"0.0.28.2
4
"
,
"m-muse"
:
"0.0.28.2
7
"
,
"m-tests"
:
"0.0.24.15"
,
"m-course"
:
"0.0.4
2.65
"
,
"m-course"
:
"0.0.4
3.32
"
,
//-------------- 业务模块 API 层 --------------
"m-audioim-api"
:
"0.0.6"
,
...
...
@@ -33,14 +33,14 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.40.
48
"
,
"ydl-platform"
:
"0.0.40.
50
"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.47"
,
"ydl-media"
:
"0.0.21.
10
"
,
"ydl-media"
:
"0.0.21.
37
"
,
"ydl-pay"
:
"0.0.18.19"
,
"m-audioim"
:
"0.0.49.29.41"
,
"ydl-flutter-base"
:
"0.0.14.
29
"
,
"ydl-flutter-base"
:
"0.0.14.
32
"
,
//以下 几乎不会动
"router"
:
"0.0.1"
,
...
...
@@ -88,18 +88,18 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide"
:
"0.0.49.1
3
"
,
"m-consultant"
:
"0.0.
60.01
"
,
"m-fm"
:
"0.0.30.0
4
"
,
"m-user"
:
"0.0.61.
8
1"
,
"m-home"
:
"0.0.22.
82
"
,
"m-im"
:
"0.0.
20.06
"
,
"m-dynamic"
:
"0.0.7.
34
"
,
"m-confide"
:
"0.0.49.1
7
"
,
"m-consultant"
:
"0.0.
59.93
"
,
"m-fm"
:
"0.0.30.0
7
"
,
"m-user"
:
"0.0.61.
7
1"
,
"m-home"
:
"0.0.22.
74
"
,
"m-im"
:
"0.0.
19.80
"
,
"m-dynamic"
:
"0.0.7.
29
"
,
"m-article"
:
"0.0.0.8"
,
"m-muse"
:
"0.0.28.2
4
"
,
"m-muse"
:
"0.0.28.2
7
"
,
"m-tests"
:
"0.0.24.15"
,
"m-course"
:
"0.0.4
2.65
"
,
"m-course"
:
"0.0.4
3.32
"
,
//-------------- 业务模块 API 层 --------------
"m-audioim-api"
:
"0.0.6"
,
"m-confide-api"
:
"0.0.2.11"
,
...
...
@@ -115,14 +115,14 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform"
:
"0.0.40.
48
"
,
"ydl-platform"
:
"0.0.40.
50
"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.47"
,
"ydl-media"
:
"0.0.21.
10
"
,
"ydl-media"
:
"0.0.21.
37
"
,
"ydl-pay"
:
"0.0.18.19"
,
"m-audioim"
:
"0.0.49.29.41"
,
"ydl-flutter-base"
:
"0.0.14.
29
"
,
"ydl-flutter-base"
:
"0.0.14.
32
"
,
//以下 几乎不会动
"router"
:
"0.0.1"
,
...
...
@@ -220,7 +220,7 @@ ext {
"systembartint"
:
"com.readystatesoftware.systembartint:systembartint:1.0.3"
,
"cube"
:
"in.srain.cube:cube-sdk:1.0.44@aar"
,
"support-multidex"
:
'androidx.multidex:multidex:2.0.0'
,
"ydl-ijkplayer-jjdxm"
:
"com.ydl:jjdxm-ijkplayer:0.0.
5
"
,
"ydl-ijkplayer-jjdxm"
:
"com.ydl:jjdxm-ijkplayer:0.0.
29
"
,
"robust"
:
"com.meituan.robust:robust:0.4.87"
,
"walle"
:
"com.meituan.android.walle:library:1.1.5"
,
"jpush"
:
"cn.jiguang.sdk:jpush:3.3.6"
,
...
...
@@ -261,7 +261,7 @@ ext {
"free_reflection"
:
"me.weishu:free_reflection:2.0.0"
,
"imagepicker"
:
"com.ydl:imagepicker:1.0.8.2"
,
"pictureselector"
:
"com.ydl:pictureselector:1.2.0"
,
"protector"
:
"com.ydl:protector:1.0.1
-SNAPSHOT
@aar"
,
"protector"
:
"com.ydl:protector:1.0.1
1
@aar"
,
"blankUtil"
:
"com.blankj:utilcode:1.25.9"
,
"ydl-hnet"
:
"com.ydl:h-net:0.0.8"
,
"ydl-user-router"
:
"com.ydl:router:1.0.0-SNAPSHOT@aar"
,
...
...
@@ -271,7 +271,7 @@ ext {
//flutter功能组件升级===>发布ydl-flutter组件===>引用flutter相关的业务模块
"ydl-flutter-base"
:
"com.ydl:ydl-flutter-base:${ydlCompileVersion["
ydl
-
flutter
-
base
"]}"
,
//组件化项目中的flutter base模块
"ydl-flutter"
:
"com.ydl:ydl-flutter:0.0.3
3
@aar"
,
//flutter aar
"ydl-flutter"
:
"com.ydl:ydl-flutter:0.0.3
8
@aar"
,
//flutter aar
// "ydl-flutter-sp" : "com.ydl:ydl-flutter-sp:0.0.2@aar", //flutter 缓存 aar
//基础组件 <<--- 先发这个,发完改这里的版本号
...
...
m-course/build.gradle
View file @
a8390d2b
...
...
@@ -66,6 +66,7 @@ dependencies {
api
'com.github.princekin-f:EasyFloat:1.3.2'
api
rootProject
.
ext
.
dependencies
[
"ydl-user-router"
]
api
rootProject
.
ext
.
dependencies
[
"butterknife"
]
if
(
rootProject
.
ext
.
dev_mode
){
//开发时使用
implementation
modularPublication
(
'com.ydl:m-consultant-api'
)
...
...
m-course/src/main/AndroidManifest.xml
View file @
a8390d2b
...
...
@@ -9,7 +9,8 @@ com.netease.nimlib.avchat,
com.netease.nimlib.nrtc,
com.netease.nimlib.chatroom,
com.netease.nimlib.lucene,
com.netease.nimlib.push
com.netease.nimlib.push,
tv.danmaku.ijk.media.player_arm64
"
/>
<uses-permission
android:name=
"android.permission.SYSTEM_ALERT_WINDOW"
/>
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE"
/>
...
...
m-course/src/main/java/com/yidianling/course/courseNew/mine/MyCourseActivity.java
View file @
a8390d2b
...
...
@@ -101,31 +101,32 @@ public class MyCourseActivity extends BaseActivity {
Class
<?>
tabLayout
=
tabs
.
getClass
();
Field
tabStrip
=
null
;
try
{
tabStrip
=
tabLayout
.
getDeclaredField
(
"mTabStrip"
);
tabStrip
=
tabLayout
.
getClass
().
getDeclaredField
(
"mTabStrip"
);
tabStrip
.
setAccessible
(
true
);
LinearLayout
llTab
=
null
;
try
{
llTab
=
(
LinearLayout
)
tabStrip
.
get
(
tabs
);
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
int
left
=
(
int
)
TypedValue
.
applyDimension
(
TypedValue
.
COMPLEX_UNIT_DIP
,
leftDip
,
Resources
.
getSystem
().
getDisplayMetrics
());
int
right
=
(
int
)
TypedValue
.
applyDimension
(
TypedValue
.
COMPLEX_UNIT_DIP
,
rightDip
,
Resources
.
getSystem
().
getDisplayMetrics
());
for
(
int
i
=
0
;
i
<
llTab
.
getChildCount
();
i
++)
{
View
child
=
llTab
.
getChildAt
(
i
);
child
.
setPadding
(
0
,
0
,
0
,
0
);
LinearLayout
.
LayoutParams
params
=
new
LinearLayout
.
LayoutParams
(
0
,
LinearLayout
.
LayoutParams
.
MATCH_PARENT
,
1
);
params
.
leftMargin
=
DisplayUtils
.
dip2px
(
this
,
left
);
params
.
rightMargin
=
DisplayUtils
.
dip2px
(
this
,
right
);
child
.
setLayoutParams
(
params
);
child
.
invalidate
();
}
}
catch
(
NoSuchFieldException
e
)
{
e
.
printStackTrace
();
}
tabStrip
.
setAccessible
(
true
);
LinearLayout
llTab
=
null
;
try
{
llTab
=
(
LinearLayout
)
tabStrip
.
get
(
tabs
);
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
int
left
=
(
int
)
TypedValue
.
applyDimension
(
TypedValue
.
COMPLEX_UNIT_DIP
,
leftDip
,
Resources
.
getSystem
().
getDisplayMetrics
());
int
right
=
(
int
)
TypedValue
.
applyDimension
(
TypedValue
.
COMPLEX_UNIT_DIP
,
rightDip
,
Resources
.
getSystem
().
getDisplayMetrics
());
for
(
int
i
=
0
;
i
<
llTab
.
getChildCount
();
i
++)
{
View
child
=
llTab
.
getChildAt
(
i
);
child
.
setPadding
(
0
,
0
,
0
,
0
);
LinearLayout
.
LayoutParams
params
=
new
LinearLayout
.
LayoutParams
(
0
,
LinearLayout
.
LayoutParams
.
MATCH_PARENT
,
1
);
params
.
leftMargin
=
DisplayUtils
.
dip2px
(
this
,
left
);
params
.
rightMargin
=
DisplayUtils
.
dip2px
(
this
,
right
);
child
.
setLayoutParams
(
params
);
child
.
invalidate
();
}
}
static
class
MyCourseFragmentAdapter
extends
FragmentPagerAdapter
{
...
...
m-course/src/main/java/com/yidianling/course/coursePlay/CoursePlayActivity.kt
View file @
a8390d2b
...
...
@@ -154,7 +154,7 @@ class CoursePlayActivity : BaseActivity() {
recy_list
?.
layoutManager
=
LinearLayoutManager
(
this
,
OrientationHelp
er
.
VERTICAL
,
LinearLayoutManag
er
.
VERTICAL
,
false
)
adapter
=
...
...
@@ -284,6 +284,7 @@ class CoursePlayActivity : BaseActivity() {
}
override
fun
onNewIntent
(
intent
:
Intent
?)
{
super
.
onNewIntent
(
intent
)
var
new_course_id
=
0
if
(
intent
!=
null
)
{
new_course_id
=
intent
.
getIntExtra
(
"course_id"
,
0
)
...
...
@@ -547,11 +548,10 @@ class CoursePlayActivity : BaseActivity() {
play_type
=
1
frame_video_play
.
visibility
=
View
.
VISIBLE
frame_audio_play
.
visibility
=
View
.
GONE
(
playVideoView
as
CoursePlayItemViewVideo
)
?.
play
(
index
)
if
(
AudioPlayer
.
get
().
isPlaying
)
{
AudioPlayer
.
get
().
playPause
()
}
(
playVideoView
as
CoursePlayItemViewVideo
)
?.
play
(
index
)
}
this
.
index
=
index
...
...
m-course/src/main/java/com/yidianling/course/coursePlay/CoursePlayItemViewVideo.kt
View file @
a8390d2b
...
...
@@ -6,6 +6,7 @@ import android.os.Handler
import
android.os.PowerManager
import
android.view.View
import
android.widget.RelativeLayout
import
com.dou361.ijkplayer.widget.IjkVideoView
import
com.dou361.ijkplayer.widget.PlayStateParams
import
com.dou361.ijkplayer.widget.PlayerView
import
com.ydl.media.audio.utils.PlayProgressUtil
...
...
@@ -17,7 +18,9 @@ import com.ydl.ydlcommon.view.dialog.CommonDialog
import
com.yidianling.course.R
import
com.yidianling.course.bean.CourseExtraBean
import
com.yidianling.course.bean.CourseMediaBean
import
tv.danmaku.ijk.media.player.AndroidMediaPlayer
import
tv.danmaku.ijk.media.player.IMediaPlayer
import
tv.danmaku.ijk.media.player.IjkMediaPlayer
import
java.text.SimpleDateFormat
import
java.util.*
...
...
@@ -31,7 +34,6 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface {
private
var
playList
:
ArrayList
<
CourseMediaBean
>
=
ArrayList
()
private
var
courseExtra
:
CourseExtraBean
?
=
null
var
activity
:
CoursePlayActivity
?
=
null
var
videoUrl
:
String
?
=
null
//播放模式
...
...
@@ -163,11 +165,12 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface {
// url = url.replace("https", "http")
videoUrl
=
url
var
hisTime
=
PlayProgressUtil
.
getProgress
(
context
,
url
)
try
{
activity
?.
videoView
=
PlayerView
(
activity
)
/*
activity?.videoView = PlayerView(activity)
.setScaleType(PlayStateParams.fitparent)
.hideMenu(true)
.hideRotation(true)
...
...
@@ -178,6 +181,7 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface {
.forbidTouch(false)
.setOnInfoListener(object : IMediaPlayer.OnInfoListener {
override fun onInfo(mp: IMediaPlayer, what: Int, extra: Int): Boolean {
LogUtil.e("课程播放--状态-$what")
if (what == PlayStateParams.MEDIA_INFO_VIDEO_INTERRUPT) {
activity?.videoView?.startPlay()
...
...
@@ -242,37 +246,18 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface {
.into(ivThumbnail)
}
}
.setPlaySource(url)
.
startPlay
()
.seekTo(hisTime)
// try {
// var videoViewField =
// activity?.videoView.run { javaClass.getDeclaredField("videoView") }
// videoViewField.isAccessible = true
//
// var ijkVideoView = videoViewField.get(activity?.videoView) as IjkVideoView
// var mMediaPlayerField = ijkVideoView.javaClass.getDeclaredField("mMediaPlayer")
//
// var mMediaPlayerObject = mMediaPlayerField.get(ijkVideoView)
// if (mMediaPlayerObject is IjkMediaPlayer) {
// mMediaPlayerObject.setOption(
// IjkMediaPlayer.OPT_CATEGORY_FORMAT,
// "dns_cache_clear",
// 1
// )
// }
// } catch (e: java.lang.Exception) {
//
// }
//
// activity?.videoView?.startPlay()?.seekTo(hisTime)
activity?.videoView?.setPlaySource(url)
activity?.videoView?.startPlay()
val layout = activity?.window?.attributes
layout?.screenBrightness = -1f
activity
?.
window
?.
attributes
=
layout
activity?.window?.attributes = layout
*/
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
LogUtil
.
e
(
"aaaaaaaaa:"
+
e
.
message
)
}
}
}
...
...
m-course/src/main/res/layout/activity_course_commeny.xml
View file @
a8390d2b
...
...
@@ -65,7 +65,7 @@
android:layout_marginRight=
"15dp"
android:background=
"@null"
android:gravity=
"start"
android:hint=
"评价
返28元课程兑换券
"
android:hint=
"评价"
android:maxLength=
"500"
android:paddingBottom=
"45dp"
android:textColor=
"@color/course_color_242424"
...
...
m-course/src/main/res/layout/activity_course_play.xml
View file @
a8390d2b
...
...
@@ -114,7 +114,7 @@
android:drawableLeft=
"@drawable/course_ico_comment_write"
android:drawablePadding=
"5dp"
android:gravity=
"center_vertical"
android:hint=
"评价
返28元课程兑换券
"
android:hint=
"评价"
android:paddingLeft=
"10dp"
android:textColor=
"@color/white"
android:textColorHint=
"#999999"
...
...
m-course/src/main/res/layout/activity_my_course.xml
View file @
a8390d2b
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
android:orientation=
"vertical"
>
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
android:orientation=
"vertical"
>
<include
layout=
"@layout/course_layout_title_bar"
/>
<include
layout=
"@layout/course_layout_title_bar"
/>
<com.yidianling.course.widget.CourseRedPacketView
android:id=
"@+id/courseRedPacketView"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:visibility=
"gone"
/>
android:id=
"@+id/courseRedPacketView"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:visibility=
"gone"
/>
<com.yidianling.course.widget.SearchBarView
android:id=
"@+id/search_bar"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
android:id=
"@+id/search_bar"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<com.google.android.material.tabs.TabLayout
android:id=
"@+id/my_courses_tabs"
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:background=
"@color/white"
app:tabGravity=
"fill"
app:tabIndicatorColor=
"@color/platform_main_theme"
app:tabMode=
"fixed"
app:tabSelectedTextColor=
"@color/platform_main_theme"
app:tabTextColor=
"#333"
/>
android:id=
"@+id/my_courses_tabs"
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:background=
"@color/white"
app:tabGravity=
"fill"
app:tabIndicatorColor=
"@color/platform_main_theme"
app:tabIndicatorFullWidth=
"false"
app:tabMode=
"fixed"
app:tabSelectedTextColor=
"@color/platform_main_theme"
app:tabTextColor=
"#333"
/>
<androidx.viewpager.widget.ViewPager
android:id=
"@+id/my_course_vp"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
app:layout_behavior=
"@string/appbar_scrolling_view_behavior"
/>
android:id=
"@+id/my_course_vp"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
app:layout_behavior=
"@string/appbar_scrolling_view_behavior"
/>
</LinearLayout>
\ No newline at end of file
m-fm/src/main/java/com/yidianling/fm/FMDetailActivity.java
View file @
a8390d2b
...
...
@@ -128,6 +128,7 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen
@Override
protected
void
onNewIntent
(
Intent
intent
)
{
super
.
onNewIntent
(
intent
);
if
(
null
==
intent
)
{
finish
();
return
;
...
...
@@ -311,7 +312,7 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen
@Override
public
void
onProgressChanged
(
SeekBar
seekBar
,
int
progress
,
boolean
fromUser
)
{
allTime
=
Integer
.
parseInt
(
String
.
valueOf
(
AudioPlayer
.
Companion
.
get
().
getDuration
()));
//
allTime = Integer.parseInt(String.valueOf(AudioPlayer.Companion.get().getDuration()));
int
current
=
seekBar
.
getProgress
()
*
allTime
/
1000
;
tv_allTime
.
setText
(
formatter
.
format
(
allTime
));
tv_currentTime
.
setText
(
formatter
.
format
(
current
));
...
...
@@ -326,7 +327,7 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen
@Override
public
void
onStopTrackingTouch
(
SeekBar
seekBar
)
{
allTime
=
Integer
.
parseInt
(
String
.
valueOf
(
AudioPlayer
.
Companion
.
get
().
getDuration
()));
//
allTime = Integer.parseInt(String.valueOf(AudioPlayer.Companion.get().getDuration()));
int
current
=
seekBar
.
getProgress
()
*
allTime
/
1000
;
tv_allTime
.
setText
(
formatter
.
format
(
allTime
));
tv_currentTime
.
setText
(
formatter
.
format
(
current
));
...
...
@@ -538,12 +539,11 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen
public
void
updateThread
()
{
runOnUiThread
(()
->
{
allTime
=
Integer
.
parseInt
(
String
.
valueOf
(
AudioPlayer
.
Companion
.
get
().
getDuration
()));
//
allTime = Integer.parseInt(String.valueOf(AudioPlayer.Companion.get().getDuration()));
currentTime
.
setTime
(
time
-
8
*
60
*
60
*
1000
);
int
percent
=
(
int
)
(
1000.0
*
time
/
allTime
);
fm_progress
.
setProgress
(
percent
);
tv_currentTime
.
setText
(
formatter
.
format
(
currentTime
));
tv_allTime
.
setText
(
formatter
.
format
(
allTime
));
});
}
...
...
@@ -622,7 +622,7 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen
@Override
public
void
onPrepared
(
long
duration
)
{
this
.
allTime
=
Integer
.
parseInt
(
String
.
valueOf
(
duration
));
tv_allTime
.
setText
(
formatter
.
format
(
allTime
));
iv_play
.
setVisibility
(
View
.
VISIBLE
);
refresh_icon
.
setVisibility
(
View
.
GONE
);
anim
.
cancel
();
...
...
m-im/build.gradle
View file @
a8390d2b
...
...
@@ -38,7 +38,7 @@ android {
flavorDimensions
"versionCode"
//Flavor 维度信息
ndk
{
abiFilters
"arm
eabi-v7
a"
abiFilters
"arm
64-v8
a"
}
}
...
...
m-muse/src/main/java/com/yidianling/muse/handler/MusePlugin.kt
View file @
a8390d2b
...
...
@@ -66,21 +66,25 @@ class MusePlugin : MethodChannel.MethodCallHandler {
}
// 播放音乐
ACTION_PLAY_MUSIC
->
{
var
musicUrl
:
String
?
=
methodCall
.
argument
<
String
>(
"url"
)
var
mContinue
:
Boolean
=
methodCall
.
argument
<
Boolean
>(
"mContinue"
)
!!
try
{
var
musicUrl
:
String
?
=
methodCall
.
argument
<
String
>(
"url"
)
var
mContinue
:
Boolean
=
methodCall
.
argument
<
Boolean
>(
"mContinue"
)
!!
if
(
mContinue
)
{
AudioPlayer
.
get
().
seekTo
(-
1
,
AudioPlayer
.
get
().
audioPosition
)
AudioPlayer
.
get
().
startPlayer
()
}
else
{
val
music
=
Music
()
music
.
path
=
musicUrl
?:
currentMusicUrl
music
.
album
=
""
music
.
artist
=
""
music
.
coverPath
=
""
music
.
title
=
""
PlayerFloatHelper
.
playingType
=
PlayTypeEnum
.
PLAY_TYPE_MUSE
AudioPlayer
.
get
().
singleCirclePlay
(
music
)
if
(
mContinue
)
{
AudioPlayer
.
get
().
seekTo
(-
1
,
AudioPlayer
.
get
().
audioPosition
)
AudioPlayer
.
get
().
startPlayer
()
}
else
{
val
music
=
Music
()
music
.
path
=
musicUrl
?:
currentMusicUrl
music
.
album
=
""
music
.
artist
=
""
music
.
coverPath
=
""
music
.
title
=
""
PlayerFloatHelper
.
playingType
=
PlayTypeEnum
.
PLAY_TYPE_MUSE
AudioPlayer
.
get
().
singleCirclePlay
(
music
)
}
}
catch
(
e
:
Exception
){
e
.
printStackTrace
()
}
}
// 暂停音乐
...
...
ydl-flutter-base/src/main/java/com/channel/ydl_flutter_base/base/BaseFlutterActivity.kt
View file @
a8390d2b
...
...
@@ -52,7 +52,7 @@ abstract class BaseFlutterActivity : FlutterActivity() {
public
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
GeneratedPluginRegistrant
.
registerWith
(
this
)
//
GeneratedPluginRegistrant.registerWith(this)
/**
* 获取统一路由传递过来的参数并初始化交互通道
...
...
ydl-flutter-base/src/main/java/com/channel/ydl_flutter_base/base/Flutter.java
View file @
a8390d2b
...
...
@@ -97,7 +97,7 @@ public final class Flutter {
arguments
.
bundlePath
=
FlutterMain
.
findAppBundlePath
(
activity
.
getApplicationContext
());
arguments
.
entrypoint
=
"main"
;
flutterView
.
runFromBundle
(
arguments
);
GeneratedPluginRegistrant
.
registerWith
(
flutterView
.
getPluginRegistry
());
//
GeneratedPluginRegistrant.registerWith(flutterView.getPluginRegistry());
}
@OnLifecycleEvent
(
Lifecycle
.
Event
.
ON_START
)
...
...
ydl-media/build.gradle
View file @
a8390d2b
...
...
@@ -39,7 +39,8 @@ dependencies {
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
implementation
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
api
(
rootProject
.
ext
.
dependencies
[
"ydl-ijkplayer-jjdxm"
])
{
api
(
rootProject
.
ext
.
dependencies
[
""
+
"ydl-ijkplayer-jjdxm"
])
{
exclude
group:
'com.android.support'
,
module:
'appcompat-v7'
}
...
...
ydl-media/src/main/java/com/ydl/media/audio/PlayService.kt
View file @
a8390d2b
package
com.ydl.media.audio
import
android.app.NotificationChannel
import
android.app.NotificationManager
import
android.app.Service
import
android.content.Context
import
android.content.Intent
import
android.os.Binder
import
android.os.Build
import
android.os.IBinder
import
android.util.Log
import
androidx.core.app.NotificationCompat
import
com.ydl.media.audio.constants.Extras
import
com.ydl.media.audio.manager.MediaSessionManager
import
com.ydl.media.audio.manager.NotifyManager
...
...
@@ -23,6 +27,15 @@ class PlayService : Service() {
override
fun
onCreate
()
{
super
.
onCreate
()
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
){
var
nm
=
getSystemService
(
NOTIFICATION_SERVICE
)
as
NotificationManager
;
//数字是随便写的“40”,
nm
.
createNotificationChannel
(
NotificationChannel
(
"40"
,
"App Service"
,
NotificationManager
.
IMPORTANCE_DEFAULT
));
var
builder
=
NotificationCompat
.
Builder
(
this
,
"40"
);
//其中的2,是也随便写的,正式项目也是随便写
startForeground
(
2
,
builder
.
build
());
}
Log
.
i
(
TAG
,
"onCreate: "
+
javaClass
.
simpleName
)
AudioPlayer
.
get
().
init
(
this
)
MediaSessionManager
.
get
().
init
(
this
)
...
...
ydl-platform/build.gradle
View file @
a8390d2b
...
...
@@ -23,7 +23,7 @@ android {
flavorDimensions
"versionCode"
ndk
{
abiFilters
"arm
eabi-v7
a"
abiFilters
"arm
64-v8
a"
}
vectorDrawables
.
useSupportLibrary
=
true
}
...
...
ydl-webview/build.gradle
View file @
a8390d2b
...
...
@@ -26,7 +26,7 @@ android {
}
ndk
{
abiFilters
"arm
eabi
"
abiFilters
"arm
64-v8a
"
}
}
...
...
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