mikaelzero / mojito

微信、bilibili大图、长图、gif、视频、自定义view的转场效果,The transition effect of wechat, bilibili large image, long image, GIF, video and custom view
Apache License 2.0
1.51k stars 164 forks source link

媒体列表过大时会超出bundle限制 #47

Closed Hansnowqiang closed 4 years ago

Hansnowqiang commented 4 years ago

数据单独搞个中转类吧。。。用bundle传输有限制

mikaelzero commented 4 years ago

你指的是哪里的数据

Hansnowqiang commented 4 years ago

调用

        Mojito.with(context)
            .urls(data,data)
            .position(if (isShowCamera) position else position + 1)

start方法

        ImageMojitoActivity.hasShowedAnim = false
        val activity = scanForActivity(context)
        val intent = Intent(activity, ImageMojitoActivity::class.java)
        intent.putExtra(MojitoConstant.KEY_ACTIVITY_PARAMS, configBean)
        activity?.startActivity(intent)
        activity?.overridePendingTransition(0, 0)

configBean里的数据

 private val configBean = ActivityConfig()
    fun urls(imageUrl: String): MojitoWrapper {
        configBean.originImageUrls = listOf(imageUrl)
        return this
    }

    fun urls(imageUrl: String, targetUrl: String): MojitoWrapper {
        configBean.originImageUrls = listOf(imageUrl)
        configBean.targetImageUrls = listOf(targetUrl)
        return this
    }

    fun urls(imageUrls: List<String>?): MojitoWrapper {
        configBean.originImageUrls = imageUrls
        return this
    }

    fun urls(imageUrls: List<String>?, targetImageUrls: List<String>?): MojitoWrapper {
        configBean.originImageUrls = imageUrls
        configBean.targetImageUrls = targetImageUrls
        return this
    }

    fun position(position: Int, headerSize: Int = 0): MojitoWrapper {
        configBean.headerSize = headerSize
        configBean.position = position - headerSize
        return this
    }

我现在我的华为P20上如果传入所有图片就会造成超出binder传输限制的崩溃

mikaelzero commented 4 years ago

你的图片数量多少个? 经过测试大概几千张图的时候才会出错,而几千张的情况有实际使用场景吗

Hansnowqiang commented 4 years ago

我不是产品。。。我不想和你讨论使用场景有没有,反正我遇到了,您改不改随意。。。

Hansnowqiang commented 4 years ago

我只是希望你的作品更完善,我又不是你们老板,你改不改是你的事情。