package com.pichillilorenzo.flutter_inappwebview_android.pull_to_refresh;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.pichillilorenzo.flutter_inappwebview_android.ISettings;
import java.util.HashMap;
import java.util.Map;
import xyz.stream.download.config.InnerConstant;

/* JADX INFO: loaded from: classes.dex */
public class PullToRefreshSettings implements ISettings<PullToRefreshLayout> {
    public static final String LOG_TAG = "PullToRefreshSettings";

    @Nullable
    public String backgroundColor;

    @Nullable
    public String color;

    @Nullable
    public Integer distanceToTriggerSync;
    public Boolean enabled = Boolean.TRUE;

    @Nullable
    public Integer size;

    @Nullable
    public Integer slingshotDistance;

    @Override // com.pichillilorenzo.flutter_inappwebview_android.ISettings
    @NonNull
    public /* bridge */ /* synthetic */ ISettings<PullToRefreshLayout> parse(@NonNull Map map) {
        return parse2((Map<String, Object>) map);
    }

    @Override // com.pichillilorenzo.flutter_inappwebview_android.ISettings
    @NonNull
    public Map<String, Object> toMap() {
        HashMap map = new HashMap();
        map.put("enabled", this.enabled);
        map.put("color", this.color);
        map.put("backgroundColor", this.backgroundColor);
        map.put("distanceToTriggerSync", this.distanceToTriggerSync);
        map.put("slingshotDistance", this.slingshotDistance);
        map.put(InnerConstant.Db.size, this.size);
        return map;
    }

    @Override // com.pichillilorenzo.flutter_inappwebview_android.ISettings
    @NonNull
    public Map<String, Object> getRealSettings(@NonNull PullToRefreshLayout pullToRefreshLayout) {
        return toMap();
    }

    @Override // com.pichillilorenzo.flutter_inappwebview_android.ISettings
    @NonNull
    /* JADX INFO: renamed from: parse, reason: avoid collision after fix types in other method */
    public ISettings<PullToRefreshLayout> parse2(@NonNull Map<String, Object> map) {
        for (Map.Entry<String, Object> entry : map.entrySet()) {
            String key = entry.getKey();
            Object value = entry.getValue();
            if (value != null) {
                key.getClass();
                switch (key) {
                    case "distanceToTriggerSync":
                        this.distanceToTriggerSync = (Integer) value;
                        break;
                    case "enabled":
                        this.enabled = (Boolean) value;
                        break;
                    case "size":
                        this.size = (Integer) value;
                        break;
                    case "color":
                        this.color = (String) value;
                        break;
                    case "backgroundColor":
                        this.backgroundColor = (String) value;
                        break;
                    case "slingshotDistance":
                        this.slingshotDistance = (Integer) value;
                        break;
                }
            }
        }
        return this;
    }
}
