Skip to content

Commit

Permalink
[feature|optimize|fix]支持输入弹幕链接进行播放;支持弹幕快进/后退;全屏播放界面显示时间;修复部分界面显示问题和主题…
Browse files Browse the repository at this point in the history
…无法换肤的问题例如MaterialDialog;优化换肤模块逻辑结构;修复首页Banner指示器有时不能及时换肤的问题;支持降低全屏下的视频亮度;修复AnimeDetailActivity界面获取是否收藏后在IO线程进行界面更新的问题
  • Loading branch information
SkyD666 committed Nov 20, 2021
1 parent a5fb899 commit e3af1c8
Show file tree
Hide file tree
Showing 121 changed files with 2,071 additions and 1,773 deletions.
2 changes: 2 additions & 0 deletions .idea/dictionaries/Sky_D.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 61 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions .idea/runConfigurations.xml

This file was deleted.

1 change: 1 addition & 0 deletions andresguard.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ def whiteList = [
// skin
"R.drawable.*_skin*",
"R.color.*_skin*",
"R.style.*.skin*",
// for your icon
"R.mipmap.ic_launcher",
"R.mipmap.ic_launcher_round",
Expand Down
3 changes: 2 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ android {
exclude 'org/eclipse/jetty/**'
exclude 'org/fourthline/cling/**'
exclude 'okhttp3/internal/**'
exclude 'com/badlogic/**'
}

buildFeatures {
Expand Down Expand Up @@ -166,8 +167,8 @@ dependencies {
implementation deps.smart.refresh_layout_kernel
implementation deps.smart.refresh_header_material
implementation deps.smart.refresh_footer_ball
implementation deps.ctiao.DanmakuFlameMaster
implementation deps.coil_kt.coil
implementation deps.kuaishou.akdanmaku
implementation project(':skin')
implementation project(':skin_blue')
implementation project(':skin_dark')
Expand Down
14 changes: 14 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ public static final int *;
*** get*();
void set*(***);
public <init>(android.content.Context);
public <init>(android.content.Context, java.lang.Boolean);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
}
Expand Down Expand Up @@ -162,6 +163,19 @@ public static final int *;
#-keep class org.seamless.statemachine.** {;}
#-keepclassmembers class * implements org.fourthline.cling.support.avtransport.impl.state.AbstractState {;}

#-------------------------AkDanmaku v1.0.3
-dontwarn com.badlogic.gdx.backends.android.AndroidFragmentApplication
-dontwarn com.badlogic.gdx.utils.GdxBuild
-dontwarn com.badlogic.gdx.jnigen.BuildTarget*
-dontwarn com.badlogic.gdx.graphics.g2d.freetype.FreetypeBuild
-keep class com.kuaishou.akdanmaku.ecs.system.ActionSystem { *; }
-keep class com.kuaishou.akdanmaku.ecs.system.DanmakuSystem { *; }
-keep class com.kuaishou.akdanmaku.ecs.system.DataSystem { *; }
-keep class com.kuaishou.akdanmaku.ecs.system.RenderSystem { *; }
-keep class com.kuaishou.akdanmaku.ecs.system.layout.LayoutSystem { *; }
# Required if using Gdx-Controllers extension
-keep class com.badlogic.gdx.controllers.android.AndroidControllers

#-------------------------
-keep public class * extends android.app.Activity
-keep public class * extends android.app.AppCompatActivity
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.樱花动漫"
android:theme="@style/Theme.Anime.skin"
android:usesCleartextTraffic="true">
<activity android:name=".view.activity.NoticeActivity" />
<activity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.skyd.imomoe.bean

enum class GetDataEnum {
enum class ResponseDataType {
FAILED, REFRESH, LOAD_MORE
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.skyd.imomoe.bean
package com.skyd.imomoe.bean.danmaku

import com.google.gson.annotations.SerializedName
import java.io.Serializable

class SendDanmuBean(
class AnimeSendDanmakuBean(
@SerializedName("author")
var author: String,
@SerializedName("color")
Expand All @@ -20,4 +20,4 @@ class SendDanmuBean(
var time: Double,
@SerializedName("type")
var type: String
) : Serializable
) : SendDanmakuBean
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.skyd.imomoe.bean
package com.skyd.imomoe.bean.danmaku

import com.google.gson.annotations.SerializedName
import com.skyd.imomoe.bean.BaseBean

class SendDanmuResultBean(
class AnimeSendDanmakuResultBean(
override var type: String,
override var actionUrl: String,
@SerializedName("code")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.skyd.imomoe.bean.danmaku

import java.io.Serializable

interface SendDanmakuBean : Serializable
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.skyd.imomoe.bean.PageNumberBean
* 获取分类界面数据的接口
*/
interface IClassifyModel : IBase {
@Deprecated("This method will cause a memory leak!!!")
fun setActivity(activity: Activity)

fun clearActivity()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.skyd.imomoe.bean.PlayBean
* 获取播放界面数据的接口
*/
interface IPlayModel : IBase {
@Deprecated("This function will cause a memory leak!!!")
fun setActivity(activity: Activity)

fun clearActivity()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ object ParseHtmlUtil {
"a" -> {
url = liChildren[j].attr("href")
cover = liChildren[j].select("img").attr("src")
title = liChildren[j].select("p").first().ownText()
title = liChildren[j].select("p").first()!!.ownText()
describe = liChildren[j].select("p").select("span").text()
}
"em" -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.skyd.imomoe.net.service

import com.skyd.imomoe.bean.SendDanmuResultBean
import com.skyd.imomoe.bean.danmaku.AnimeSendDanmakuResultBean
import com.skyd.imomoe.config.Api
import okhttp3.RequestBody
import retrofit2.Call
Expand All @@ -9,12 +9,12 @@ import retrofit2.http.Headers
import retrofit2.http.POST
import retrofit2.http.Query

interface DanmuService {
interface DanmakuService {
@Headers(value = ["Content-Type: application/json", "Accept: application/json"])
@POST(Api.DANMU_URL)
fun sendDanmu(
fun sendDanmaku(
@Query("ac") ac: String,
@Query("key") key: String,
@Body json: RequestBody
): Call<SendDanmuResultBean>
): Call<AnimeSendDanmakuResultBean>
}
13 changes: 13 additions & 0 deletions app/src/main/java/com/skyd/imomoe/util/IOUtil.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.skyd.imomoe.util

import java.io.InputStream

fun InputStream.string(): String {
val out = StringBuffer()
val b = ByteArray(4096)
var n: Int
while (this.read(b).also { n = it } != -1) {
out.append(String(b, 0, n))
}
return out.toString()
}
58 changes: 28 additions & 30 deletions app/src/main/java/com/skyd/imomoe/util/MD5.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,35 @@ import java.security.MessageDigest
import java.security.NoSuchAlgorithmException


object MD5 {
fun getMD5(f: File): String? {
var bi: BigInteger? = null
try {
val buffer = ByteArray(8192)
var len = 0
val md = MessageDigest.getInstance("MD5")
val fis = FileInputStream(f)
while (fis.read(buffer).also { len = it } != -1) {
md.update(buffer, 0, len)
}
fis.close()
val b = md.digest()
bi = BigInteger(1, b)
} catch (e: NoSuchAlgorithmException) {
e.printStackTrace()
} catch (e: IOException) {
e.printStackTrace()
fun File.toMD5(): String? {
var bi: BigInteger? = null
try {
val buffer = ByteArray(8192)
var len: Int
val md = MessageDigest.getInstance("MD5")
val fis = FileInputStream(this)
while (fis.read(buffer).also { len = it } != -1) {
md.update(buffer, 0, len)
}
return bi?.toString(16)
fis.close()
val b = md.digest()
bi = BigInteger(1, b)
} catch (e: NoSuchAlgorithmException) {
e.printStackTrace()
} catch (e: IOException) {
e.printStackTrace()
}
return bi?.toString(16)
}

fun getMD5(s: String): String {
try {
val messageDigest = MessageDigest.getInstance("MD5")
val md5bytes = messageDigest.digest(s.toByteArray(charset("UTF-8")))
return ByteString.of(*md5bytes).hex()
} catch (e: NoSuchAlgorithmException) {
throw AssertionError(e)
} catch (e: UnsupportedEncodingException) {
throw AssertionError(e)
}
fun String.toMD5(): String {
try {
val messageDigest = MessageDigest.getInstance("MD5")
val md5bytes = messageDigest.digest(toByteArray(charset("UTF-8")))
return ByteString.of(*md5bytes).hex()
} catch (e: NoSuchAlgorithmException) {
throw AssertionError(e)
} catch (e: UnsupportedEncodingException) {
throw AssertionError(e)
}
}
}
12 changes: 6 additions & 6 deletions app/src/main/java/com/skyd/imomoe/util/RvAdapter.kt
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
package com.skyd.imomoe.util

import androidx.recyclerview.widget.RecyclerView
import com.skyd.imomoe.bean.GetDataEnum
import com.skyd.imomoe.bean.ResponseDataType

/**
* 根据GetDataEnum状态自动更新
* @param type 刷新/加载更多/加载失败
* @param deltaDataSet 新数据集
* @param dataSet 构造adapter时传入的list
*/
fun <T> RecyclerView.Adapter<RecyclerView.ViewHolder>.smartNotifyDataSetChanged(
type: GetDataEnum,
fun <T, VH : RecyclerView.ViewHolder> RecyclerView.Adapter<VH>.smartNotifyDataSetChanged(
type: ResponseDataType,
deltaDataSet: MutableList<T>,
dataSet: MutableList<T>
) {
when (type) {
GetDataEnum.REFRESH -> {
ResponseDataType.REFRESH -> {
val count = dataSet.size
dataSet.clear()
notifyItemRangeRemoved(0, count)
dataSet.addAll(deltaDataSet)
notifyItemRangeInserted(0, deltaDataSet.size)
}
GetDataEnum.LOAD_MORE -> {
ResponseDataType.LOAD_MORE -> {
val index = dataSet.size
dataSet.addAll(deltaDataSet)
notifyItemRangeInserted(index, deltaDataSet.size)
}
GetDataEnum.FAILED -> {
ResponseDataType.FAILED -> {
val count = dataSet.size
dataSet.clear()
notifyItemRangeRemoved(0, count)
Expand Down
Loading

0 comments on commit e3af1c8

Please sign in to comment.