From a5fb899537891ebd48fa15b7ed3807bde1c6e45d Mon Sep 17 00:00:00 2001 From: SkyD666 <1161046314@qq.com> Date: Fri, 5 Nov 2021 19:59:29 +0800 Subject: [PATCH 001/104] =?UTF-8?q?[feature|document]=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E6=92=AD=E6=94=BE=E9=A1=B5=E9=9D=A2=E5=B8=83=E5=B1=80=E9=80=BB?= =?UTF-8?q?=E8=BE=91=EF=BC=9B=E6=B7=BB=E5=8A=A0http=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E7=9A=84=E8=AF=B4=E6=98=8E=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +- .../java/com/skyd/imomoe/model/impls/Const.kt | 6 +- .../main/java/com/skyd/imomoe/util/View.kt | 3 + .../imomoe/view/activity/AboutActivity.kt | 13 +- .../skyd/imomoe/view/activity/PlayActivity.kt | 322 +++++++++--------- .../view/component/player/AnimeVideoPlayer.kt | 56 ++- .../player/DetailPlayerActivity.java | 21 +- .../res/layout-sw600dp-land/activity_play.xml | 135 ++++++-- .../res/layout-sw600dp-port/activity_play.xml | 239 +++++++------ app/src/main/res/layout/activity_play.xml | 239 +++++++------ .../res/layout/layout_anime_video_player.xml | 83 +---- app/src/main/res/values/strings.xml | 2 + doc/about_http_security.md | 17 + doc/about_secret.gradle.md | 2 +- 14 files changed, 669 insertions(+), 473 deletions(-) create mode 100644 doc/about_http_security.md diff --git a/README.md b/README.md index 2a596fd9..ca39d6dd 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,8 @@ ## [>>必看安全说明<<](#安全说明) +## [>>关于http网站或数据源的安全问题<<](doc/about_http_security.md) + ## 特色功能 1. 支持显示**排行榜** @@ -103,7 +105,7 @@ ## 附加说明 -默认数据源来自http://www.yhdm.io/ +默认数据源来自http://www.yinghuacd.com/ ## 免责声明 diff --git a/app/src/main/java/com/skyd/imomoe/model/impls/Const.kt b/app/src/main/java/com/skyd/imomoe/model/impls/Const.kt index f9768f5f..4f80370e 100644 --- a/app/src/main/java/com/skyd/imomoe/model/impls/Const.kt +++ b/app/src/main/java/com/skyd/imomoe/model/impls/Const.kt @@ -12,11 +12,11 @@ class Const : IConst { override fun ANIME_SEARCH(): String = "/search/" } - override fun MAIN_URL(): String = "http://www.yhdm.so" + override fun MAIN_URL(): String = "http://www.yinghuacd.com" - override fun versionName(): String = "1.0.0" + override fun versionName(): String = "1.0.1" - override fun versionCode(): Int = 1 + override fun versionCode(): Int = 2 override fun about(): String { return "默认数据源\n数据来源:${MAIN_URL()}" diff --git a/app/src/main/java/com/skyd/imomoe/util/View.kt b/app/src/main/java/com/skyd/imomoe/util/View.kt index 3901ada0..b6f4be22 100644 --- a/app/src/main/java/com/skyd/imomoe/util/View.kt +++ b/app/src/main/java/com/skyd/imomoe/util/View.kt @@ -5,16 +5,19 @@ import android.view.animation.AlphaAnimation fun View.gone(animate: Boolean = false, dur: Long = 500L) { + if (visibility == View.GONE) return if (animate) startAnimation(AlphaAnimation(1f, 0f).apply { duration = dur }) visibility = View.GONE } fun View.visible(animate: Boolean = false, dur: Long = 500L) { + if (visibility == View.VISIBLE) return visibility = View.VISIBLE if (animate) startAnimation(AlphaAnimation(0f, 1f).apply { duration = dur }) } fun View.invisible(animate: Boolean = false, dur: Long = 500L) { + if (visibility == View.INVISIBLE) return visibility = View.INVISIBLE if (animate) startAnimation(AlphaAnimation(0f, 1f).apply { duration = dur }) } diff --git a/app/src/main/java/com/skyd/imomoe/view/activity/AboutActivity.kt b/app/src/main/java/com/skyd/imomoe/view/activity/AboutActivity.kt index e5afe8b2..00d8a5bc 100644 --- a/app/src/main/java/com/skyd/imomoe/view/activity/AboutActivity.kt +++ b/app/src/main/java/com/skyd/imomoe/view/activity/AboutActivity.kt @@ -14,6 +14,7 @@ import com.skyd.imomoe.util.Util import com.skyd.imomoe.util.Util.getAppVersionName import com.skyd.imomoe.util.Util.openBrowser import com.skyd.imomoe.util.visible +import java.net.URL import java.util.* class AboutActivity : BaseActivity() { @@ -46,7 +47,17 @@ class AboutActivity : BaseActivity() { tvAboutActivityVersion.text = getAppVersionName() rlAboutActivityImomoe.setOnClickListener { - openBrowser(Api.MAIN_URL) + var warningString: String = getString(R.string.jump_to_data_source_website_warning) + if (URL(Api.MAIN_URL).protocol == "http") { + warningString = + getString(R.string.jump_to_browser_http_warning) + "\n" + warningString + } + MaterialDialog(this@AboutActivity).show { + title(res = R.string.warning) + message(text = warningString) + positiveButton(res = R.string.ok) { openBrowser(Api.MAIN_URL) } + negativeButton { dismiss() } + } } ivAboutActivityCustomDataSourceAbout.setOnClickListener { diff --git a/app/src/main/java/com/skyd/imomoe/view/activity/PlayActivity.kt b/app/src/main/java/com/skyd/imomoe/view/activity/PlayActivity.kt index 4a3cf3f4..1e574ea7 100644 --- a/app/src/main/java/com/skyd/imomoe/view/activity/PlayActivity.kt +++ b/app/src/main/java/com/skyd/imomoe/view/activity/PlayActivity.kt @@ -6,23 +6,17 @@ import android.content.Intent import android.content.res.Configuration import android.graphics.Color import android.os.Bundle +import android.os.Handler +import android.os.Looper import android.view.View import android.view.ViewGroup -import android.widget.ImageView import android.widget.TextView -import androidx.appcompat.widget.Toolbar -import androidx.constraintlayout.widget.ConstraintLayout -import androidx.coordinatorlayout.widget.CoordinatorLayout -import androidx.core.view.ViewCompat -import androidx.core.widget.NestedScrollView import androidx.lifecycle.Observer import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.lifecycleScope import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.RecyclerView -import androidx.swiperefreshlayout.widget.SwipeRefreshLayout import com.google.android.material.appbar.AppBarLayout -import com.google.android.material.appbar.CollapsingToolbarLayout import com.google.android.material.bottomsheet.BottomSheetDialog import com.shuyu.gsyvideoplayer.GSYVideoManager import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder @@ -38,9 +32,11 @@ import com.skyd.imomoe.bean.FavoriteAnimeBean import com.skyd.imomoe.config.Api import com.skyd.imomoe.config.Const import com.skyd.imomoe.database.getAppDataBase +import com.skyd.imomoe.databinding.ActivityPlayBinding import com.skyd.imomoe.model.DataSourceManager import com.skyd.imomoe.util.AnimeEpisode2ViewHolder import com.skyd.imomoe.util.MD5.getMD5 +import com.skyd.imomoe.util.Util import com.skyd.imomoe.util.Util.dp import com.skyd.imomoe.util.Util.getDetailLinkByEpisodeLink import com.skyd.imomoe.util.Util.getResColor @@ -61,7 +57,6 @@ import com.skyd.imomoe.view.adapter.spansize.PlaySpanSize import com.skyd.imomoe.view.component.player.AnimeVideoPlayer import com.skyd.imomoe.view.component.player.DanmakuVideoPlayer import com.skyd.imomoe.view.component.player.DetailPlayerActivity -import com.skyd.imomoe.view.component.textview.TypefaceTextView import com.skyd.imomoe.view.fragment.MoreDialogFragment import com.skyd.imomoe.view.fragment.ShareDialogFragment import com.skyd.imomoe.viewmodel.PlayViewModel @@ -71,13 +66,13 @@ import tv.danmaku.ijk.media.player.IjkMediaPlayer import kotlin.math.abs -class PlayActivity : DetailPlayerActivity() { +class PlayActivity : DetailPlayerActivity() { override var statusBarSkin: Boolean = false private var isFavorite: Boolean = false private var favoriteBeanDataReady: Int = 0 set(value) { field = value - if (value == 2) ivPlayActivityFavorite.isEnabled = true + if (value == 2) mBinding.ivPlayActivityFavorite.isEnabled = true } private var partUrl: String = "" private var detailPartUrl: String = "" @@ -89,86 +84,80 @@ class PlayActivity : DetailPlayerActivity() { private var currentNightMode: Int = 0 private var lastCanCollapsed: Boolean? = null - private lateinit var ivPlayActivityFavorite: ImageView - private lateinit var avpPlayActivity: DanmakuVideoPlayer - private var ivPlayActivityToolbarMore: ImageView? = null - private lateinit var rvPlayActivity: RecyclerView - private lateinit var srlPlayActivity: SwipeRefreshLayout - private lateinit var tvPlayActivityTitle: TypefaceTextView - private var nsvPlayActivity: NestedScrollView? = null - private var tvPlayActivityToolbarTitle: TextView? = null - private var ablPlayActivity: AppBarLayout? = null - private fun initView() { - ivPlayActivityFavorite = findViewById(R.id.iv_play_activity_favorite) - ivPlayActivityToolbarMore = findViewById(R.id.iv_play_activity_toolbar_more) - rvPlayActivity = findViewById(R.id.rv_play_activity) - srlPlayActivity = findViewById(R.id.srl_play_activity) - tvPlayActivityTitle = findViewById(R.id.tv_play_activity_title) - nsvPlayActivity = findViewById(R.id.nsv_play_activity) - tvPlayActivityToolbarTitle = findViewById(R.id.tv_play_activity_toolbar_title) - ablPlayActivity = findViewById(R.id.abl_play_activity) - avpPlayActivity = findViewById(R.id.avp_play_activity) - - val tbPlayActivity: Toolbar? = findViewById(R.id.tb_play_activity) - val ctlPlayActivity: CollapsingToolbarLayout? = findViewById(R.id.ctl_play_activity) - val clPlayActivityToolbarLayout: ConstraintLayout? = - findViewById(R.id.cl_play_activity_toolbar_layout) - val ivPlayActivityToolbarBack: ImageView? = findViewById(R.id.iv_play_activity_toolbar_back) - - if (tbPlayActivity != null && ctlPlayActivity != null && - clPlayActivityToolbarLayout != null && ivPlayActivityToolbarBack != null && - tvPlayActivityToolbarTitle != null - ) { + currentNightMode = resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK + setColorStatusBar(window, Color.BLACK) + + mBinding.apply { setSupportActionBar(tbPlayActivity) supportActionBar?.setDisplayShowTitleEnabled(false) - ablPlayActivity?.addOnOffsetChangedListener(AppBarLayout.OnOffsetChangedListener { appBarLayout, verticalOffset -> - when { - abs(verticalOffset) > ctlPlayActivity.scrimVisibleHeightTrigger -> { - if (tbPlayActivity.visibility != View.VISIBLE) { - clPlayActivityToolbarLayout.visible() - tbPlayActivity.visible() + if (ctlPlayActivity != null && ablPlayActivity != null) { + ablPlayActivity.addOnOffsetChangedListener(AppBarLayout.OnOffsetChangedListener { appBarLayout, verticalOffset -> + when { + abs(verticalOffset) > ctlPlayActivity.scrimVisibleHeightTrigger -> { + tvPlayActivityToolbarTitle?.visible() } - } - else -> { - if (tbPlayActivity.visibility != View.GONE) { - clPlayActivityToolbarLayout.gone() - tbPlayActivity.gone(true, 600) + else -> { + tvPlayActivityToolbarTitle?.gone() } } - } - }) + }) + } ivPlayActivityToolbarBack.setOnClickListener { finish() } tvPlayActivityToolbarTitle?.setOnClickListener { (avpPlayActivity.currentPlayer as AnimeVideoPlayer).clickStartIcon() } + + avpPlayActivity.setTopContainer(tbPlayActivity) + + ivPlayActivityToolbarDownload.setOnClickListener { getSheetDialog("download").show() } + ivPlayActivityToolbarBack.setOnClickListener { onBackPressed() } + + // 分享按钮 + ivPlayActivityToolbarShare.setOnClickListener { + ShareDialogFragment().setShareContent(Api.MAIN_URL + viewModel.partUrl) + .show(supportFragmentManager, "share_dialog") + } + // 更多按钮 + ivPlayActivityToolbarMore.setOnClickListener { + MoreDialogFragment().run { + setOnClickListener( + arrayOf(View.OnClickListener { dismiss() }, + View.OnClickListener { + startActivity( + Intent(this@PlayActivity, DlnaActivity::class.java) + .putExtra("url", avpPlayActivity.getUrl()) + .putExtra("title", avpPlayActivity.getTitle()) + ) + dismiss() + }, View.OnClickListener { + if (!openVideoByExternalPlayer( + this@PlayActivity, + viewModel.animeEpisodeDataBean.videoUrl + ) + ) getString(R.string.matched_app_not_found).showToast() + dismiss() + }) + ) + show(supportFragmentManager, "more_dialog") + } + } } } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - setContentView(R.layout.activity_play) + viewModel = ViewModelProvider(this).get(PlayViewModel::class.java) initView() - currentNightMode = resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK - - setColorStatusBar(window, Color.BLACK) - - viewModel = ViewModelProvider(this).get(PlayViewModel::class.java) viewModel.setActivity(this) adapter = PlayAdapter(this, viewModel.playBeanDataList) initVideoBuilderMode() - avpPlayActivity.run { - getDownloadButton()?.setOnClickListener { getSheetDialog("download").show() } - // 设置返回按键功能 - backButton?.setOnClickListener { onBackPressed() } - } - partUrl = intent.getStringExtra("partUrl") ?: "" detailPartUrl = intent.getStringExtra("detailPartUrl") ?: "" @@ -177,67 +166,35 @@ class PlayActivity : DetailPlayerActivity() { if (detailPartUrl.isBlank() || detailPartUrl == const.actionUrl.ANIME_DETAIL()) detailPartUrl = getDetailLinkByEpisodeLink(partUrl) + mBinding.apply { + rvPlayActivity.layoutManager = GridLayoutManager(this@PlayActivity, 4) + .apply { spanSizeLookup = PlaySpanSize(adapter) } + // 复用AnimeShow的ItemDecoration + rvPlayActivity.addItemDecoration(AnimeShowItemDecoration()) + rvPlayActivity.setHasFixedSize(true) + rvPlayActivity.adapter = adapter - // 分享按钮 - avpPlayActivity.getShareButton()?.setOnClickListener { - ShareDialogFragment().setShareContent(Api.MAIN_URL + viewModel.partUrl) - .show(supportFragmentManager, "share_dialog") - } - // 更多按钮 - View.OnClickListener { - MoreDialogFragment().run { - setOnClickListener( - arrayOf(View.OnClickListener { dismiss() }, - View.OnClickListener { - startActivity( - Intent(this@PlayActivity, DlnaActivity::class.java) - .putExtra("url", avpPlayActivity.getUrl()) - .putExtra("title", avpPlayActivity.getTitle()) - ) - dismiss() - }, View.OnClickListener { - if (!openVideoByExternalPlayer( - this@PlayActivity, - viewModel.animeEpisodeDataBean.videoUrl - ) - ) getString(R.string.matched_app_not_found).showToast() - dismiss() - }) - ) - show(supportFragmentManager, "more_dialog") - } - }.let { - avpPlayActivity.getMoreButton()?.setOnClickListener(it) - ivPlayActivityToolbarMore?.setOnClickListener(it) + srlPlayActivity.setOnRefreshListener { viewModel.getPlayData(partUrl) } + srlPlayActivity.setColorSchemeResources(getSkinResourceId(R.color.main_color_skin)) } - rvPlayActivity.layoutManager = GridLayoutManager(this@PlayActivity, 4) - .apply { spanSizeLookup = PlaySpanSize(adapter) } - // 复用AnimeShow的ItemDecoration - rvPlayActivity.addItemDecoration(AnimeShowItemDecoration()) - rvPlayActivity.setHasFixedSize(true) - rvPlayActivity.adapter = adapter - - srlPlayActivity.setOnRefreshListener { viewModel.getPlayData(partUrl) } - srlPlayActivity.setColorSchemeResources(getSkinResourceId(R.color.main_color_skin)) - lifecycleScope.launch(Dispatchers.IO) { val favoriteAnime = getAppDataBase().favoriteAnimeDao().getFavoriteAnime(detailPartUrl) runOnUiThread { isFavorite = if (favoriteAnime == null) { - ivPlayActivityFavorite.setImageDrawable(getResDrawable(R.drawable.ic_star_border_main_color_2_24_skin)) + mBinding.ivPlayActivityFavorite.setImageDrawable(getResDrawable(R.drawable.ic_star_border_main_color_2_24_skin)) false } else { - ivPlayActivityFavorite.setImageDrawable(getResDrawable(R.drawable.ic_star_main_color_2_24_skin)) + mBinding.ivPlayActivityFavorite.setImageDrawable(getResDrawable(R.drawable.ic_star_main_color_2_24_skin)) true } - ivPlayActivityFavorite.setOnClickListener { + mBinding.ivPlayActivityFavorite.setOnClickListener { if (isFavorite) { Thread { getAppDataBase().favoriteAnimeDao().deleteFavoriteAnime(detailPartUrl) }.start() isFavorite = false - ivPlayActivityFavorite.setImageDrawable(getResDrawable(R.drawable.ic_star_border_main_color_2_24_skin)) + mBinding.ivPlayActivityFavorite.setImageDrawable(getResDrawable(R.drawable.ic_star_border_main_color_2_24_skin)) getString(R.string.remove_favorite_succeed).showToast() } else { Thread { @@ -254,13 +211,13 @@ class PlayActivity : DetailPlayerActivity() { ) }.start() isFavorite = true - ivPlayActivityFavorite.setImageDrawable(getResDrawable(R.drawable.ic_star_main_color_2_24_skin)) + mBinding.ivPlayActivityFavorite.setImageDrawable(getResDrawable(R.drawable.ic_star_main_color_2_24_skin)) getString(R.string.favorite_succeed).showToast() } } } } - ivPlayActivityFavorite.isEnabled = false + mBinding.ivPlayActivityFavorite.isEnabled = false viewModel.mldAnimeCover.observe(this, { if (it) { @@ -269,17 +226,17 @@ class PlayActivity : DetailPlayerActivity() { }) viewModel.mldPlayBean.observe(this, { - srlPlayActivity.isRefreshing = false + mBinding.srlPlayActivity.isRefreshing = false val title = viewModel.playBean?.title?.title - tvPlayActivityTitle.text = title + mBinding.tvPlayActivityTitle.text = title adapter.notifyDataSetChanged() favoriteBeanDataReady++ if (isFirstTime) { - avpPlayActivity.startPlay() + mBinding.avpPlayActivity.startPlay() isFirstTime = false } }) @@ -313,11 +270,11 @@ class PlayActivity : DetailPlayerActivity() { }) viewModel.mldAnimeEpisodeDataRefreshed.observe(this, { - if (it) avpPlayActivity.currentPlayer + if (it) mBinding.avpPlayActivity.currentPlayer .startPlay(partUrl = viewModel.animeEpisodeDataBean.actionUrl) }) - srlPlayActivity.isRefreshing = true + mBinding.srlPlayActivity.isRefreshing = true viewModel.getPlayData(partUrl) viewModel.getAnimeCoverImageBean(detailPartUrl) @@ -326,12 +283,14 @@ class PlayActivity : DetailPlayerActivity() { GSYVideoManager.instance().optionModelList = listOf(videoOptionModel) } + override fun getBinding() = ActivityPlayBinding.inflate(layoutInflater) + fun startPlay(url: String, currentEpisodeIndex: Int, title: String) { viewModel.refreshAnimeEpisodeData(url, currentEpisodeIndex, title) } fun startPlay2(url: String, title: String, partUrl: String = this@PlayActivity.partUrl) { - avpPlayActivity.startPlay(url, title, partUrl) + mBinding.avpPlayActivity.startPlay(url, title, partUrl) } private fun GSYBaseVideoPlayer.startPlay( @@ -409,35 +368,33 @@ class PlayActivity : DetailPlayerActivity() { } override fun onVideoSizeChanged() { - val tag = avpPlayActivity.tag - if (tag is String && tag == "sw600dp-land") return - avpPlayActivity.measure( - View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED), - View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED) - ) - val videoHeight: Int = avpPlayActivity.currentVideoHeight - val videoWidth: Int = avpPlayActivity.currentVideoWidth - val ratio = videoWidth.toDouble() / videoHeight - val playerWidth: Int = avpPlayActivity.width - if (abs(playerWidth.toDouble() / avpPlayActivity.height - ratio) < 0.001) return - var playerHeight = playerWidth / ratio - val playerParent = window.decorView as ViewGroup - playerParent.measure( - View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED), - View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED) - ) - val parentHeight = playerParent.height - if (playerHeight > parentHeight * 0.75) playerHeight = parentHeight * 0.75 - val layoutParams: ViewGroup.LayoutParams = avpPlayActivity.layoutParams - ValueAnimator.ofInt(layoutParams.height, playerHeight.toInt()) - .setDuration(200) - .apply { - addUpdateListener { animation -> - layoutParams.height = animation.animatedValue as Int - avpPlayActivity.requestLayout() + mBinding.apply { + val tag = avpPlayActivity.tag + if (tag is String && tag == "sw600dp-land") return + avpPlayActivity.measure( + View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED), + View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED) + ) + val videoHeight: Int = avpPlayActivity.currentVideoHeight + val videoWidth: Int = avpPlayActivity.currentVideoWidth + val ratio = videoWidth.toDouble() / videoHeight + val playerWidth: Int = avpPlayActivity.width + if (abs(playerWidth.toDouble() / avpPlayActivity.height - ratio) < 0.001) return + var playerHeight = playerWidth / ratio + val parentHeight = Util.getScreenHeight(true) + if (playerHeight > parentHeight * 0.75) playerHeight = parentHeight * 0.75 + val layoutParams: ViewGroup.LayoutParams = avpPlayActivity.layoutParams + avpPlayActivity.requestLayout() + ValueAnimator.ofInt(layoutParams.height, playerHeight.toInt()) + .setDuration(200) + .apply { + addUpdateListener { animation -> + layoutParams.height = animation.animatedValue as Int + avpPlayActivity.requestLayout() + } + start() } - start() - } + } } override fun onPlayError(url: String?, vararg objects: Any?) { @@ -461,7 +418,7 @@ class PlayActivity : DetailPlayerActivity() { super.onPrepared(url, *objects) //调整触摸滑动快进的比例 //毫秒,刚好划一屏1分35秒 - avpPlayActivity.currentPlayer.apply { + mBinding.avpPlayActivity.currentPlayer.apply { seekRatio = duration / 90_000f if (danmuUrl.isNotBlank() && this is DanmakuVideoPlayer && !this@PlayActivity.isDestroyed) { this@PlayActivity.getString(R.string.the_video_has_danmu).showToast() @@ -472,33 +429,58 @@ class PlayActivity : DetailPlayerActivity() { override fun videoPlayStatusChanged(playing: Boolean) { super.videoPlayStatusChanged(playing) - canCollapsed(!playing) - tvPlayActivityToolbarTitle?.text = - if (avpPlayActivity.currentState == CURRENT_STATE_AUTO_COMPLETE) - getString(R.string.replay_video) - else getString(R.string.play_video_now) + mBinding.apply { + canCollapsed(!playing) + tvPlayActivityToolbarTitle?.text = + if (avpPlayActivity.currentState == CURRENT_STATE_AUTO_COMPLETE) + getString(R.string.replay_video) + else getString(R.string.play_video_now) + } + } + + override fun needShowToolbar(show: Boolean) { + super.needShowToolbar(show) + mBinding.apply { + if (show) { + avpPlayActivity.setTopContainer(null) + tbPlayActivity.visible() + } else { + avpPlayActivity.setTopContainer(tbPlayActivity) + } + } } private fun canCollapsed(enable: Boolean) { if (lastCanCollapsed == enable) return lastCanCollapsed = enable - nsvPlayActivity?.let { - ViewCompat.setNestedScrollingEnabled(it, enable) - } - ablPlayActivity?.let { - val params = it.layoutParams as CoordinatorLayout.LayoutParams - if (params.behavior == null) params.behavior = AppBarLayout.Behavior() - val behaviour = params.behavior as AppBarLayout.Behavior - behaviour.setDragCallback(object : AppBarLayout.Behavior.DragCallback() { - override fun canDrag(appBarLayout: AppBarLayout): Boolean { - return enable - } - }) - if (!enable) it.setExpanded(true) +// mBinding.nsvPlayActivity?.let { +// ViewCompat.setNestedScrollingEnabled(it, enable) +// } + mBinding.ablPlayActivity?.let { +// val params = it.layoutParams as CoordinatorLayout.LayoutParams +// if (params.behavior == null) params.behavior = AppBarLayout.Behavior() +// val behaviour = params.behavior as AppBarLayout.Behavior +// behaviour.setDragCallback(object : AppBarLayout.Behavior.DragCallback() { +// override fun canDrag(appBarLayout: AppBarLayout): Boolean { +// return enable +// } +// }) + val mAppBarChildAt: View = it.getChildAt(0) + val mAppBarParams = mAppBarChildAt.layoutParams as AppBarLayout.LayoutParams + mAppBarParams.scrollFlags = if (enable) { + AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL or + AppBarLayout.LayoutParams.SCROLL_FLAG_EXIT_UNTIL_COLLAPSED + } else { + AppBarLayout.LayoutParams.SCROLL_FLAG_NO_SCROLL + } + mAppBarChildAt.layoutParams = mAppBarParams + Handler(Looper.getMainLooper()).postDelayed({ + if (!enable) it.setExpanded(true) + }, 500) } } - override fun getGSYVideoPlayer(): DanmakuVideoPlayer = avpPlayActivity + override fun getGSYVideoPlayer(): DanmakuVideoPlayer = mBinding.avpPlayActivity override fun getGSYVideoOptionBuilder(): GSYVideoOptionBuilder { return GSYVideoOptionBuilder() @@ -544,9 +526,9 @@ class PlayActivity : DetailPlayerActivity() { action ) recyclerView.adapter = adapter - viewModel.mldEpisodesList.observe(this, Observer { + viewModel.mldEpisodesList.observe(this, { adapter.notifyDataSetChanged() - avpPlayActivity.setEpisodeAdapter( + mBinding.avpPlayActivity.setEpisodeAdapter( PlayerEpisodeRecyclerViewAdapter( this, viewModel.episodesList @@ -637,7 +619,7 @@ class PlayActivity : DetailPlayerActivity() { ) holder.tvTitle.text = item.title holder.itemView.setOnClickListener { - activity.avpPlayActivity.currentPlayer.run { + activity.mBinding.avpPlayActivity.currentPlayer.run { if (this is AnimeVideoPlayer) { getRightContainer()?.gone() // 因为右侧界面显示时,不在xx秒后隐藏界面,所以要恢复xx秒后隐藏控制界面 diff --git a/app/src/main/java/com/skyd/imomoe/view/component/player/AnimeVideoPlayer.kt b/app/src/main/java/com/skyd/imomoe/view/component/player/AnimeVideoPlayer.kt index 66294ce4..ababd23e 100644 --- a/app/src/main/java/com/skyd/imomoe/view/component/player/AnimeVideoPlayer.kt +++ b/app/src/main/java/com/skyd/imomoe/view/component/player/AnimeVideoPlayer.kt @@ -31,14 +31,13 @@ import com.skyd.imomoe.util.Util.getScreenBrightness import com.skyd.imomoe.util.Util.openVideoByExternalPlayer import com.skyd.imomoe.util.Util.showToast import com.skyd.imomoe.util.gone +import com.skyd.imomoe.util.invisible import com.skyd.imomoe.util.visible import com.skyd.imomoe.view.activity.DlnaActivity import com.skyd.imomoe.view.adapter.SkinRvAdapter import com.skyd.imomoe.view.component.ZoomView import com.skyd.imomoe.view.component.textview.TypefaceTextView import com.skyd.skin.SkinManager -import tv.danmaku.ijk.media.exo2.IjkExo2MediaPlayer -import tv.danmaku.ijk.media.player.IjkMediaPlayer import java.io.File import java.io.Serializable import kotlin.math.abs @@ -143,6 +142,9 @@ open class AnimeVideoPlayer : StandardGSYVideoPlayer { // 显示系统时间 private var mSystemTimeTextView: TextView? = null + // top阴影 + private var mViewTopContainerShadow: View? = null + constructor(context: Context) : super(context) constructor(context: Context, fullFlag: Boolean?) : super(context, fullFlag) @@ -156,14 +158,14 @@ open class AnimeVideoPlayer : StandardGSYVideoPlayer { override fun init(context: Context?) { super.init(context) - mDownloadButton = findViewById(R.id.iv_download) + mDownloadButton = findViewById(R.id.iv_play_activity_toolbar_download) mMoreScaleTextView = findViewById(R.id.tv_more_scale) mSpeedTextView = findViewById(R.id.tv_speed) // mClingImageView = findViewById(R.id.iv_cling) mRightContainer = findViewById(R.id.layout_right) mSpeedRecyclerView = findViewById(R.id.rv_right) mEpisodeRecyclerView = findViewById(R.id.rv_right) - mShareImageView = findViewById(R.id.iv_share) + mShareImageView = findViewById(R.id.iv_play_activity_toolbar_share) mNextImageView = findViewById(R.id.iv_next) mEpisodeTextView = findViewById(R.id.tv_episode) mSettingImageView = findViewById(R.id.iv_setting) @@ -171,13 +173,14 @@ open class AnimeVideoPlayer : StandardGSYVideoPlayer { mReverseRadioGroup = findViewById(R.id.rg_reverse) mBottomProgressCheckBox = findViewById(R.id.cb_bottom_progress) mBottomProgress = super.mBottomProgressBar - mMoreImageView = findViewById(R.id.iv_more) + mMoreImageView = findViewById(R.id.iv_play_activity_toolbar_more) mOpenByExternalPlayerTextView = findViewById(R.id.tv_open_by_external_player) // mMediaCodecCheckBox = findViewById(R.id.cb_media_codec) mRestoreScreenTextView = findViewById(R.id.tv_restore_screen) mTouchDownHighSpeedTextView = findViewById(R.id.tv_touch_down_high_speed) mBiggerSurface = findViewById(R.id.bigger_surface) mSystemTimeTextView = findViewById(R.id.tv_system_time) + mViewTopContainerShadow = findViewById(R.id.view_top_container_shadow) mRightContainer?.gone() mSettingContainer?.gone() @@ -320,6 +323,17 @@ open class AnimeVideoPlayer : StandardGSYVideoPlayer { } } + fun setTopContainer(top: ViewGroup?) { + mTopContainer = top + mViewTopContainerShadow = if (top == null) { + mViewTopContainerShadow?.visible() + null + } else { + findViewById(R.id.view_top_container_shadow) + } + restartTimerTask() + } + private fun showRightContainer() { mRightContainer?.let { hideAllWidget() @@ -338,6 +352,7 @@ open class AnimeVideoPlayer : StandardGSYVideoPlayer { setViewShowState(mRightContainer, INVISIBLE) setViewShowState(mSettingContainer, INVISIBLE) setViewShowState(mRestoreScreenTextView, View.GONE) + setViewShowState(mViewTopContainerShadow, View.INVISIBLE) } override fun onClickUiToggle(e: MotionEvent?) { @@ -568,29 +583,34 @@ open class AnimeVideoPlayer : StandardGSYVideoPlayer { //正常 override fun changeUiToNormal() { super.changeUiToNormal() + mViewTopContainerShadow?.visible() initFirstLoad = true mUiCleared = false } override fun changeUiToPauseShow() { super.changeUiToPauseShow() + mViewTopContainerShadow?.visible() mUiCleared = false } override fun changeUiToClear() { super.changeUiToClear() + mViewTopContainerShadow?.invisible() mUiCleared = true } //准备中 override fun changeUiToPreparingShow() { super.changeUiToPreparingShow() + mViewTopContainerShadow?.visible() mUiCleared = false } //播放中 override fun changeUiToPlayingShow() { super.changeUiToPlayingShow() + mViewTopContainerShadow?.visible() // if (initFirstLoad) { // mBottomContainer.gone() // mStartButton.gone() @@ -602,11 +622,37 @@ open class AnimeVideoPlayer : StandardGSYVideoPlayer { //自动播放结束 override fun changeUiToCompleteShow() { super.changeUiToCompleteShow() + mViewTopContainerShadow?.visible() mBottomContainer.gone() mTouchDownHighSpeedTextView?.gone() mUiCleared = false } + override fun changeUiToError() { + super.changeUiToError() + mViewTopContainerShadow?.invisible() + } + + override fun changeUiToPrepareingClear() { + super.changeUiToPrepareingClear() + mViewTopContainerShadow?.invisible() + } + + override fun changeUiToPlayingBufferingClear() { + super.changeUiToPlayingBufferingClear() + mViewTopContainerShadow?.invisible() + } + + override fun changeUiToCompleteClear() { + super.changeUiToCompleteClear() + mViewTopContainerShadow?.invisible() + } + + override fun changeUiToPlayingBufferingShow() { + super.changeUiToPlayingBufferingShow() + mViewTopContainerShadow?.visible() + } + override fun onVideoPause() { super.onVideoPause() mVideoAllCallBack.let { diff --git a/app/src/main/java/com/skyd/imomoe/view/component/player/DetailPlayerActivity.java b/app/src/main/java/com/skyd/imomoe/view/component/player/DetailPlayerActivity.java index f2a9def0..f0c2b635 100644 --- a/app/src/main/java/com/skyd/imomoe/view/component/player/DetailPlayerActivity.java +++ b/app/src/main/java/com/skyd/imomoe/view/component/player/DetailPlayerActivity.java @@ -3,6 +3,10 @@ import android.content.res.Configuration; import android.os.Bundle; import android.view.View; + +import androidx.viewbinding.ViewBinding; + +import com.skyd.imomoe.view.activity.BaseActivity; import com.skyd.skin.core.SkinBaseActivity; import com.shuyu.gsyvideoplayer.GSYVideoManager; import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder; @@ -16,7 +20,7 @@ /** * 详情模式播放页面基础类 */ -public abstract class DetailPlayerActivity extends SkinBaseActivity implements MyVideoAllCallBack { +public abstract class DetailPlayerActivity extends BaseActivity implements MyVideoAllCallBack { protected boolean isPlay; @@ -134,6 +138,7 @@ public void onConfigurationChanged(@NotNull Configuration newConfig) { @Override public void onStartPrepared(String url, Object... objects) { videoPlayStatusChanged(true); + needShowToolbar(true); } @Override @@ -192,6 +197,7 @@ public void onClickSeekbarFullscreen(String url, Object... objects) { @Override public void onAutoComplete(String url, Object... objects) { videoPlayStatusChanged(false); + needShowToolbar(true); } @Override @@ -234,6 +240,7 @@ public void onTouchScreenSeekLight(String url, Object... objects) { @Override public void onPlayError(String url, Object... objects) { videoPlayStatusChanged(false); + needShowToolbar(true); } @Override @@ -254,6 +261,7 @@ public void onClickBlankFullscreen(String url, Object... objects) { @Override public void onComplete(String url, Object... objects) { videoPlayStatusChanged(false); + needShowToolbar(true); } public boolean hideActionBarWhenFull() { @@ -301,11 +309,13 @@ public boolean isAutoFullWithSize() { @Override public void onVideoPause() { videoPlayStatusChanged(false); + needShowToolbar(true); } @Override public void onVideoResume() { videoPlayStatusChanged(true); + needShowToolbar(false); } /** @@ -316,4 +326,13 @@ public void onVideoResume() { protected void videoPlayStatusChanged(boolean playing) { } + + /** + * 是否需要必须显示工具栏 + * + * @param show false:不需要显示;true:需要显示 + */ + protected void needShowToolbar(boolean show) { + + } } diff --git a/app/src/main/res/layout-sw600dp-land/activity_play.xml b/app/src/main/res/layout-sw600dp-land/activity_play.xml index 2049684e..30ee1395 100644 --- a/app/src/main/res/layout-sw600dp-land/activity_play.xml +++ b/app/src/main/res/layout-sw600dp-land/activity_play.xml @@ -26,12 +26,113 @@ android:layout_weight="2" android:orientation="vertical"> - + android:layout_weight="1"> + + + + + + + + + + + + + + + + + + + + + - + android:layout_weight="1"> - - - + android:layout_height="match_parent" + android:overScrollMode="never" + android:paddingTop="7dp" + app:layout_constraintTop_toBottomOf="@id/view_play_activity_line_1" /> - - + \ No newline at end of file diff --git a/app/src/main/res/layout-sw600dp-port/activity_play.xml b/app/src/main/res/layout-sw600dp-port/activity_play.xml index be1a2202..323e61af 100644 --- a/app/src/main/res/layout-sw600dp-port/activity_play.xml +++ b/app/src/main/res/layout-sw600dp-port/activity_play.xml @@ -28,29 +28,91 @@ + android:gravity="center_vertical"> + + + + + + + + - - - - - + android:layout_height="match_parent" + app:layout_behavior="@string/appbar_scrolling_view_behavior"> - + android:layout_height="match_parent"> - - - - - - - - - - - - - - - + android:layout_height="match_parent" + android:scaleType="fitXY" /> + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_play.xml b/app/src/main/res/layout/activity_play.xml index be1a2202..323e61af 100644 --- a/app/src/main/res/layout/activity_play.xml +++ b/app/src/main/res/layout/activity_play.xml @@ -28,29 +28,91 @@ + android:gravity="center_vertical"> + + + + + + + + - - - - - + android:layout_height="match_parent" + app:layout_behavior="@string/appbar_scrolling_view_behavior"> - + android:layout_height="match_parent"> - - - - - - - - - - - - - - - + android:layout_height="match_parent" + android:scaleType="fitXY" /> + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/layout_anime_video_player.xml b/app/src/main/res/layout/layout_anime_video_player.xml index 208c9aa8..7b2cb70f 100644 --- a/app/src/main/res/layout/layout_anime_video_player.xml +++ b/app/src/main/res/layout/layout_anime_video_player.xml @@ -225,87 +225,12 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" /> - - - - - - - - - - - - - + app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toBottomOf="@id/view_top_container_shadow" /> 继续播放 立即播放 重新播放 + 此网址使用HTTP协议,不能保证安全性,是否要继续打开浏览器访问? + 若要访问,请千万不要在页面下载任何APP和Jar包等可执行文件 diff --git a/doc/about_http_security.md b/doc/about_http_security.md new file mode 100644 index 00000000..8051e3be --- /dev/null +++ b/doc/about_http_security.md @@ -0,0 +1,17 @@ +# 关于http网站或数据源的安全问题 + +- #### 背景 + + 作者在某一天发现访问数据源网站(http)会302重定向到一个“黄色诈骗网站”,经研究后发现是我的**DNS被劫持了**。 + +- #### DNS是什么? + + DNS的功能是把域名解析成IP地址,从而进行请求。 + +- #### DNS被劫持后有什么危害? + + 当DNS被劫持后,将域名解析为IP时会返回一个**虚假的IP**,此IP不仅会让APP**无法加载数据**,如果使用浏览器访问此IP(或此域名),还会把浏览器302重定向到了“黄色诈骗网站”,**诱导**浏览器**下载诈骗APP**。因此当您**访问http的数据源网站**时,**务必小心**,**不要下载来历不明APP和Jar包**。 + +- #### DNS被劫持后的初步解决方法? + + 尝试设置网络代理或换用其他网络。 diff --git a/doc/about_secret.gradle.md b/doc/about_secret.gradle.md index 0d680011..a63029d3 100644 --- a/doc/about_secret.gradle.md +++ b/doc/about_secret.gradle.md @@ -6,7 +6,7 @@ - #### 编译时提示缺少此文件怎么办? - 你可以尝试将用到此文件内容的代码全部注释。 + 你可以尝试将用到此文件内容的代码全部**注释**。**不建议**对文件内容**随意设置值**,然后进行编译,因为某些功能需要的密钥是唯一的,若随意设置值,可能**仍然会导致编译失败**或其他问题。 - #### 此文件的内容结构是怎样的? From e3af1c8fafeb4afa50bc5e7e429663a089f971dd Mon Sep 17 00:00:00 2001 From: SkyD666 <1161046314@qq.com> Date: Mon, 15 Nov 2021 00:15:21 +0800 Subject: [PATCH 002/104] =?UTF-8?q?[feature|optimize|fix]=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E8=BE=93=E5=85=A5=E5=BC=B9=E5=B9=95=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E6=92=AD=E6=94=BE=EF=BC=9B=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=BC=B9=E5=B9=95=E5=BF=AB=E8=BF=9B/=E5=90=8E=E9=80=80?= =?UTF-8?q?=EF=BC=9B=E5=85=A8=E5=B1=8F=E6=92=AD=E6=94=BE=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=97=B6=E9=97=B4=EF=BC=9B=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=83=A8=E5=88=86=E7=95=8C=E9=9D=A2=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=92=8C=E4=B8=BB=E9=A2=98=E6=97=A0=E6=B3=95=E6=8D=A2?= =?UTF-8?q?=E8=82=A4=E7=9A=84=E9=97=AE=E9=A2=98=E4=BE=8B=E5=A6=82MaterialD?= =?UTF-8?q?ialog=EF=BC=9B=E4=BC=98=E5=8C=96=E6=8D=A2=E8=82=A4=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E9=80=BB=E8=BE=91=E7=BB=93=E6=9E=84=EF=BC=9B=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E9=A6=96=E9=A1=B5Banner=E6=8C=87=E7=A4=BA=E5=99=A8?= =?UTF-8?q?=E6=9C=89=E6=97=B6=E4=B8=8D=E8=83=BD=E5=8F=8A=E6=97=B6=E6=8D=A2?= =?UTF-8?q?=E8=82=A4=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=9B=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E9=99=8D=E4=BD=8E=E5=85=A8=E5=B1=8F=E4=B8=8B=E7=9A=84=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E4=BA=AE=E5=BA=A6=EF=BC=9B=E4=BF=AE=E5=A4=8DAnimeDeta?= =?UTF-8?q?ilActivity=E7=95=8C=E9=9D=A2=E8=8E=B7=E5=8F=96=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E6=94=B6=E8=97=8F=E5=90=8E=E5=9C=A8IO=E7=BA=BF?= =?UTF-8?q?=E7=A8=8B=E8=BF=9B=E8=A1=8C=E7=95=8C=E9=9D=A2=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/dictionaries/Sky_D.xml | 2 + .idea/gradle.xml | 2 +- .idea/misc.xml | 61 ++ .idea/runConfigurations.xml | 10 - andresguard.gradle | 1 + app/build.gradle | 3 +- app/proguard-rules.pro | 14 + app/src/main/AndroidManifest.xml | 2 +- .../{GetDataEnum.kt => ResponseDataType.kt} | 2 +- .../AnimeSendDanmakuBean.kt} | 6 +- .../AnimeSendDanmakuResultBean.kt} | 5 +- .../imomoe/bean/danmaku/SendDanmakuBean.kt | 5 + .../imomoe/model/interfaces/IClassifyModel.kt | 1 + .../imomoe/model/interfaces/IPlayModel.kt | 1 + .../skyd/imomoe/model/util/ParseHtmlUtil.kt | 2 +- .../{DanmuService.kt => DanmakuService.kt} | 8 +- .../main/java/com/skyd/imomoe/util/IOUtil.kt | 13 + app/src/main/java/com/skyd/imomoe/util/MD5.kt | 58 +- .../java/com/skyd/imomoe/util/RvAdapter.kt | 12 +- .../main/java/com/skyd/imomoe/util/Share.kt | 4 +- .../main/java/com/skyd/imomoe/util/Util.kt | 41 +- .../main/java/com/skyd/imomoe/util/View.kt | 9 + .../downloadanime/AnimeDownloadService.kt | 4 +- .../com/skyd/imomoe/util/html/SnifferVideo.kt | 9 +- .../BannerIndicatorDotSelectedColorAttr.kt | 23 + .../BannerIndicatorDotUnselectedColorAttr.kt | 23 + .../view/activity/AnimeDetailActivity.kt | 14 +- .../view/activity/AnimeDownloadActivity.kt | 3 +- .../skyd/imomoe/view/activity/BaseActivity.kt | 4 +- .../imomoe/view/activity/ClassifyActivity.kt | 32 +- .../imomoe/view/activity/HistoryActivity.kt | 3 +- .../imomoe/view/activity/LicenseActivity.kt | 21 +- .../skyd/imomoe/view/activity/PlayActivity.kt | 64 +- .../skyd/imomoe/view/activity/RankActivity.kt | 10 +- .../imomoe/view/activity/SearchActivity.kt | 7 +- .../imomoe/view/activity/SettingActivity.kt | 7 +- .../view/activity/SimplePlayActivity.kt | 9 +- .../imomoe/view/adapter/AnimeShowAdapter.kt | 5 +- .../bannerview/indicator/DotIndicator.kt | 38 +- .../component/player/AnimeDanmakuLoader.kt | 48 -- .../player/AnimeDanmakuLoaderFactory.kt | 21 - .../component/player/AnimeDanmakuParser.kt | 101 --- .../view/component/player/AnimeJSONSource.kt | 78 --- .../view/component/player/AnimeVideoPlayer.kt | 291 ++++---- .../view/component/player/DanmakuAdapter.kt | 69 -- .../component/player/DanmakuVideoPlayer.kt | 661 ++++++++++-------- .../view/component/player/danmaku/Const.kt | 7 + .../danmaku/anime/AnimeDanmakuParser.kt | 83 +++ .../danmaku/anime/AnimeDanmakuSender.kt | 62 ++ .../danmaku/bili/BiliBiliDanmakuParser.kt | 147 ++++ .../imomoe/view/fragment/AnimeShowFragment.kt | 6 +- .../view/fragment/EverydayAnimeFragment.kt | 1 - .../skyd/imomoe/view/fragment/HomeFragment.kt | 29 +- .../skyd/imomoe/view/fragment/RankFragment.kt | 6 +- .../listener/dsl/OnItemSelectedListener.kt | 35 + .../listener/dsl/OnSeekBarChangeListener.kt | 43 ++ .../listener/dsl/OnTabSelectedListener.kt | 43 ++ .../imomoe/viewmodel/AnimeDetailViewModel.kt | 6 +- .../viewmodel/AnimeDownloadViewModel.kt | 18 +- .../imomoe/viewmodel/AnimeShowViewModel.kt | 8 +- .../imomoe/viewmodel/ClassifyViewModel.kt | 14 +- .../imomoe/viewmodel/RankListViewModel.kt | 8 +- .../skyd/imomoe/viewmodel/SearchViewModel.kt | 8 +- .../skyd/imomoe/viewmodel/SettingViewModel.kt | 5 +- ...arrow_circle_down_main_color_2_24_skin.xml | 2 +- .../ic_arrow_circle_down_white_24_skin.xml | 2 +- .../res/drawable/ic_fast_forward_white_24.xml | 9 + .../res/drawable/ic_fast_rewind_white_24.xml | 9 + .../main/res/drawable/ic_restore_white_24.xml | 9 + .../res/layout/fragment_everyday_anime.xml | 1 + app/src/main/res/layout/fragment_home.xml | 3 +- .../main/res/layout/item_anime_cover_10.xml | 1 + .../main/res/layout/item_anime_cover_3.xml | 41 +- .../main/res/layout/item_anime_cover_6.xml | 23 +- .../main/res/layout/item_anime_cover_8.xml | 33 +- .../main/res/layout/item_anime_cover_9.xml | 47 +- .../item_horizontal_recycler_view_1.xml | 16 +- app/src/main/res/layout/item_more_1.xml | 11 +- .../res/layout/layout_anime_video_player.xml | 4 +- .../layout/layout_anime_video_player_land.xml | 132 +++- app/src/main/res/layout/layout_toolbar_1.xml | 4 +- app/src/main/res/values/colors.xml | 2 +- app/src/main/res/values/strings.xml | 26 +- app/src/main/res/values/themes_skin.xml | 2 +- .../main/java/com/skyd/skin/SkinManager.kt | 575 ++------------- .../java/com/skyd/skin/core/SkinAttrsSet.kt | 4 +- .../skyd/skin/core/attrs/BackgroundAttr.kt | 28 +- .../skin/core/attrs/BackgroundTintAttr.kt | 19 +- .../skyd/skin/core/attrs/ButtonTintAttr.kt | 20 +- .../core/attrs/CardBackgroundColorAttr.kt | 21 +- .../skyd/skin/core/attrs/ColorPrimaryAttr.kt | 18 +- .../skyd/skin/core/attrs/ContentScrimAttr.kt | 12 +- .../skyd/skin/core/attrs/DrawableEndAttr.kt | 33 +- .../skyd/skin/core/attrs/DrawableStartAttr.kt | 33 +- .../skin/core/attrs/DrawableTopCompatAttr.kt | 36 +- .../skyd/skin/core/attrs/ImageViewTintAttr.kt | 17 +- .../skin/core/attrs/IndeterminateTintAttr.kt | 20 +- .../skin/core/attrs/ProgressDrawableAttr.kt | 25 +- .../core/attrs/ScrollbarThumbVerticalAttr.kt | 30 +- .../java/com/skyd/skin/core/attrs/SkinAttr.kt | 1 + .../java/com/skyd/skin/core/attrs/SrcAttr.kt | 28 +- .../skin/core/attrs/SrlPrimaryColorAttr.kt | 35 +- .../skin/core/attrs/TabIndicatorColorAttr.kt | 18 +- .../skyd/skin/core/attrs/TabTextColorAttr.kt | 17 +- .../com/skyd/skin/core/attrs/TextColorAttr.kt | 16 +- .../skyd/skin/core/attrs/TextColorHintAttr.kt | 21 +- .../com/skyd/skin/core/attrs/ThumbAttr.kt | 24 +- .../com/skyd/skin/core/attrs/ThumbTintAttr.kt | 20 +- .../com/skyd/skin/core/attrs/TrackTintAttr.kt | 20 +- .../src/main/res/values/themes_skin_blue.xml | 2 +- .../skin_dark/ExampleInstrumentedTest.kt | 2 +- .../src/main/res/values/themes_skin_dark.xml | 2 +- .../skin_dark/ExampleUnitTest.kt | 2 +- .../skin_lemon/ExampleInstrumentedTest.kt | 2 +- .../src/main/res/values/themes_skin_lemon.xml | 2 +- .../skin_lemon/ExampleUnitTest.kt | 2 +- .../ExampleInstrumentedTest.kt | 2 +- .../src/main/AndroidManifest.xml | 2 +- .../res/values/themes_skin_sweat_soybean.xml | 2 +- .../skin_sweat_soybean/ExampleUnitTest.kt | 2 +- version.gradle | 18 +- 121 files changed, 2071 insertions(+), 1773 deletions(-) delete mode 100644 .idea/runConfigurations.xml rename app/src/main/java/com/skyd/imomoe/bean/{GetDataEnum.kt => ResponseDataType.kt} (67%) rename app/src/main/java/com/skyd/imomoe/bean/{SendDanmuBean.kt => danmaku/AnimeSendDanmakuBean.kt} (85%) rename app/src/main/java/com/skyd/imomoe/bean/{SendDanmuResultBean.kt => danmaku/AnimeSendDanmakuResultBean.kt} (68%) create mode 100644 app/src/main/java/com/skyd/imomoe/bean/danmaku/SendDanmakuBean.kt rename app/src/main/java/com/skyd/imomoe/net/service/{DanmuService.kt => DanmakuService.kt} (74%) create mode 100644 app/src/main/java/com/skyd/imomoe/util/IOUtil.kt create mode 100644 app/src/main/java/com/skyd/imomoe/util/skin/attrs/BannerIndicatorDotSelectedColorAttr.kt create mode 100644 app/src/main/java/com/skyd/imomoe/util/skin/attrs/BannerIndicatorDotUnselectedColorAttr.kt delete mode 100644 app/src/main/java/com/skyd/imomoe/view/component/player/AnimeDanmakuLoader.kt delete mode 100644 app/src/main/java/com/skyd/imomoe/view/component/player/AnimeDanmakuLoaderFactory.kt delete mode 100644 app/src/main/java/com/skyd/imomoe/view/component/player/AnimeDanmakuParser.kt delete mode 100644 app/src/main/java/com/skyd/imomoe/view/component/player/AnimeJSONSource.kt delete mode 100644 app/src/main/java/com/skyd/imomoe/view/component/player/DanmakuAdapter.kt create mode 100644 app/src/main/java/com/skyd/imomoe/view/component/player/danmaku/Const.kt create mode 100644 app/src/main/java/com/skyd/imomoe/view/component/player/danmaku/anime/AnimeDanmakuParser.kt create mode 100644 app/src/main/java/com/skyd/imomoe/view/component/player/danmaku/anime/AnimeDanmakuSender.kt create mode 100644 app/src/main/java/com/skyd/imomoe/view/component/player/danmaku/bili/BiliBiliDanmakuParser.kt create mode 100644 app/src/main/java/com/skyd/imomoe/view/listener/dsl/OnItemSelectedListener.kt create mode 100644 app/src/main/java/com/skyd/imomoe/view/listener/dsl/OnSeekBarChangeListener.kt create mode 100644 app/src/main/java/com/skyd/imomoe/view/listener/dsl/OnTabSelectedListener.kt create mode 100644 app/src/main/res/drawable/ic_fast_forward_white_24.xml create mode 100644 app/src/main/res/drawable/ic_fast_rewind_white_24.xml create mode 100644 app/src/main/res/drawable/ic_restore_white_24.xml rename skin_dark/src/androidTest/java/com/{cyeasybuy => skyd}/skin_dark/ExampleInstrumentedTest.kt (95%) rename skin_dark/src/test/java/com/{cyeasybuy => skyd}/skin_dark/ExampleUnitTest.kt (90%) rename skin_lemon/src/androidTest/java/com/{cyeasybuy => skyd}/skin_lemon/ExampleInstrumentedTest.kt (95%) rename skin_lemon/src/test/java/com/{cyeasybuy => skyd}/skin_lemon/ExampleUnitTest.kt (90%) rename skin_sweat_soybean/src/androidTest/java/com/{cyeasybuy => skyd}/skin_sweat_soybean/ExampleInstrumentedTest.kt (94%) rename skin_sweat_soybean/src/test/java/com/{cyeasybuy => skyd}/skin_sweat_soybean/ExampleUnitTest.kt (88%) diff --git a/.idea/dictionaries/Sky_D.xml b/.idea/dictionaries/Sky_D.xml index 8fc5169a..6505d716 100644 --- a/.idea/dictionaries/Sky_D.xml +++ b/.idea/dictionaries/Sky_D.xml @@ -2,6 +2,7 @@ anime + bilibili bugly ctiao danmaku @@ -12,6 +13,7 @@ iframe imomoe jsoup + kuaishou mobileqq sakura shuyu diff --git a/.idea/gradle.xml b/.idea/gradle.xml index c6e6e30f..34d74680 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -4,7 +4,7 @@