导航菜单

页面标题

页面副标题

Cashalo v2.25.0.0 - ImageDestinationProcessorAssets.java 源代码

正在查看: Cashalo v2.25.0.0 应用的 ImageDestinationProcessorAssets.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package io.noties.markwon.image.destination;

import android.net.Uri;
import android.text.TextUtils;

public class ImageDestinationProcessorAssets extends ImageDestinationProcessor {
    static final String BASE = "file:///android_asset/";
    static final String MOCK = "https://android.asset/";
    private final ImageDestinationProcessorRelativeToAbsolute assetsProcessor;
    private final ImageDestinationProcessor processor;

    public static ImageDestinationProcessorAssets create(ImageDestinationProcessor imageDestinationProcessor) {
        return new ImageDestinationProcessorAssets(imageDestinationProcessor);
    }

    public ImageDestinationProcessorAssets() {
        this(null);
    }

    public ImageDestinationProcessorAssets(ImageDestinationProcessor imageDestinationProcessor) {
        this.assetsProcessor = new ImageDestinationProcessorRelativeToAbsolute(MOCK);
        this.processor = imageDestinationProcessor;
    }

    @Override
    public String process(String str) {
        if (TextUtils.isEmpty(Uri.parse(str).getScheme())) {
            return this.assetsProcessor.process(str).replace(MOCK, BASE);
        }
        ImageDestinationProcessor imageDestinationProcessor = this.processor;
        return imageDestinationProcessor != null ? imageDestinationProcessor.process(str) : str;
    }
}