From fc444e076b5b5f7364e5239f8453a0b5d6d27a6c Mon Sep 17 00:00:00 2001 From: HuanChengFly <609486518@qq.com> Date: Mon, 6 Apr 2020 12:49:32 +0800 Subject: [PATCH] =?UTF-8?q?fix(photoviewactivity.kt):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=20Java=20=E6=97=A0=E6=B3=95=E8=B0=83=E7=94=A8=20launch=20?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tieba/post/activities/PhotoViewActivity.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/huanchengfly/tieba/post/activities/PhotoViewActivity.kt b/app/src/main/java/com/huanchengfly/tieba/post/activities/PhotoViewActivity.kt index 4d051c3f..00b7fe73 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/activities/PhotoViewActivity.kt +++ b/app/src/main/java/com/huanchengfly/tieba/post/activities/PhotoViewActivity.kt @@ -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) { launch(context, photoViewBeanList.toTypedArray(), 0) } + @JvmStatic fun launch(context: Context, photoViewBeanList: List, position: Int) { launch(context, photoViewBeanList.toTypedArray(), position) } + @JvmStatic @JvmOverloads - fun launch(context: Context, photoViewBeans: Array?, position: Int = 0) { + fun launch(context: Context, photoViewBeans: Array, position: Int = 0) { context.startActivity(Intent(context, PhotoViewActivity::class.java) .putExtra(EXTRA_BEANS, photoViewBeans) .putExtra(EXTRA_POSITION, position)