fix(photoviewactivity.kt): 修复 Java 无法调用 launch 方法

This commit is contained in:
HuanChengFly 2020-04-06 12:49:32 +08:00
parent b02f17d419
commit fc444e076b
1 changed files with 6 additions and 1 deletions

View File

@ -288,20 +288,25 @@ class PhotoViewActivity : BaseActivity(), OnChangeBottomBarVisibilityListener, T
const val OBJ_TYPE_THREAD_PAGE = "pb"
const val OBJ_TYPE_FORUM_PAGE = "frs"
private val handler = Handler()
@JvmStatic
fun launch(context: Context, photoViewBean: PhotoViewBean) {
launch(context, arrayOf(photoViewBean))
}
@JvmStatic
fun launch(context: Context, photoViewBeanList: List<PhotoViewBean>) {
launch(context, photoViewBeanList.toTypedArray(), 0)
}
@JvmStatic
fun launch(context: Context, photoViewBeanList: List<PhotoViewBean>, position: Int) {
launch(context, photoViewBeanList.toTypedArray(), position)
}
@JvmStatic
@JvmOverloads
fun launch(context: Context, photoViewBeans: Array<PhotoViewBean>?, position: Int = 0) {
fun launch(context: Context, photoViewBeans: Array<PhotoViewBean>, position: Int = 0) {
context.startActivity(Intent(context, PhotoViewActivity::class.java)
.putExtra(EXTRA_BEANS, photoViewBeans)
.putExtra(EXTRA_POSITION, position)