fix: 一些闪退问题
This commit is contained in:
parent
bb83341335
commit
8da97b5d04
|
|
@ -103,8 +103,8 @@ interface MiniTiebaApi {
|
||||||
@Field("agree_type") agree_type: Int = 2,
|
@Field("agree_type") agree_type: Int = 2,
|
||||||
@Field("obj_type") obj_type: Int = 3,
|
@Field("obj_type") obj_type: Int = 3,
|
||||||
@Field("op_type") op_type: Int = 0,
|
@Field("op_type") op_type: Int = 0,
|
||||||
@Field("tbs") tbs: String = AccountUtil.getLoginInfo()!!.tbs,
|
@Field("tbs") tbs: String? = AccountUtil.getLoginInfo()?.tbs,
|
||||||
@Field("stoken") stoken: String = AccountUtil.getSToken()!!
|
@Field("stoken") stoken: String? = AccountUtil.getSToken()
|
||||||
): Call<AgreeBean>
|
): Call<AgreeBean>
|
||||||
|
|
||||||
@Headers("${Header.FORCE_LOGIN}: ${Header.FORCE_LOGIN_TRUE}")
|
@Headers("${Header.FORCE_LOGIN}: ${Header.FORCE_LOGIN_TRUE}")
|
||||||
|
|
|
||||||
|
|
@ -433,8 +433,8 @@ interface OfficialTiebaApi {
|
||||||
)
|
)
|
||||||
fun addStoreAsync(
|
fun addStoreAsync(
|
||||||
@Field("data") data: String,
|
@Field("data") data: String,
|
||||||
@Field("stoken") stoken: String = AccountUtil.getSToken()!!,
|
@Field("stoken") stoken: String? = AccountUtil.getSToken(),
|
||||||
@retrofit2.http.Header("client_user_token") client_user_token: String? = AccountUtil.getUid(),
|
@retrofit2.http.Header("client_user_token") clientUserToken: String? = AccountUtil.getUid(),
|
||||||
): Deferred<ApiResult<CommonResponse>>
|
): Deferred<ApiResult<CommonResponse>>
|
||||||
|
|
||||||
@POST("/c/c/post/addstore")
|
@POST("/c/c/post/addstore")
|
||||||
|
|
|
||||||
|
|
@ -1,42 +1,13 @@
|
||||||
package com.huanchengfly.tieba.post.models
|
package com.huanchengfly.tieba.post.models
|
||||||
|
|
||||||
import android.os.Parcel
|
|
||||||
import android.os.Parcelable
|
import android.os.Parcelable
|
||||||
|
import kotlinx.parcelize.Parcelize
|
||||||
|
|
||||||
|
@Parcelize
|
||||||
data class PhotoViewBean @JvmOverloads constructor(
|
data class PhotoViewBean @JvmOverloads constructor(
|
||||||
var url: String?,
|
var url: String?,
|
||||||
var originUrl: String?,
|
var originUrl: String?,
|
||||||
var isLongPic: Boolean = false,
|
var isLongPic: Boolean = false,
|
||||||
var index: String? = null,
|
var index: String? = null,
|
||||||
var isGif: Boolean = false
|
var isGif: Boolean = false
|
||||||
) : Parcelable {
|
) : Parcelable
|
||||||
constructor(parcel: Parcel) : this(
|
|
||||||
parcel.readString(),
|
|
||||||
parcel.readString(),
|
|
||||||
parcel.readByte() != 0.toByte(),
|
|
||||||
parcel.readString(),
|
|
||||||
parcel.readByte() != 0.toByte()
|
|
||||||
)
|
|
||||||
|
|
||||||
override fun writeToParcel(parcel: Parcel, flags: Int) {
|
|
||||||
parcel.writeString(url)
|
|
||||||
parcel.writeString(originUrl)
|
|
||||||
parcel.writeByte(if (isLongPic) 1 else 0)
|
|
||||||
parcel.writeString(index)
|
|
||||||
parcel.writeByte(if (isGif) 1 else 0)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun describeContents(): Int {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object CREATOR : Parcelable.Creator<PhotoViewBean> {
|
|
||||||
override fun createFromParcel(parcel: Parcel): PhotoViewBean {
|
|
||||||
return PhotoViewBean(parcel)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun newArray(size: Int): Array<PhotoViewBean?> {
|
|
||||||
return arrayOfNulls(size)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -399,7 +399,7 @@ fun ThreadPage(
|
||||||
seeLz: Boolean = false,
|
seeLz: Boolean = false,
|
||||||
sortType: Int = 0,
|
sortType: Int = 0,
|
||||||
from: String = "",
|
from: String = "",
|
||||||
extra: ThreadPageExtra = ThreadPageNoExtra,
|
extra: ThreadPageExtra? = null,
|
||||||
threadInfo: ThreadInfo? = null,
|
threadInfo: ThreadInfo? = null,
|
||||||
scrollToReply: Boolean = false,
|
scrollToReply: Boolean = false,
|
||||||
viewModel: ThreadViewModel = pageViewModel()
|
viewModel: ThreadViewModel = pageViewModel()
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ import com.huanchengfly.tieba.post.toJson
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
import kotlinx.coroutines.withContext
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.lang.ref.WeakReference
|
import java.lang.ref.WeakReference
|
||||||
|
|
||||||
|
|
@ -173,7 +174,9 @@ object EmoticonManager {
|
||||||
}
|
}
|
||||||
updateCache()
|
updateCache()
|
||||||
coroutineScope.launch {
|
coroutineScope.launch {
|
||||||
fetchEmoticons(context)
|
withContext(Dispatchers.IO) {
|
||||||
|
runCatching { fetchEmoticons(context) }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -413,7 +413,7 @@ class ShowPermissionTipInterceptor(val permissions: List<String>, val descriptio
|
||||||
callback: OnPermissionCallback?
|
callback: OnPermissionCallback?
|
||||||
) {
|
) {
|
||||||
mRequestFlag = false
|
mRequestFlag = false
|
||||||
tipDialog?.dismiss()
|
runCatching { tipDialog?.dismiss() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue