package epson.print;

import android.content.Context;

import com.epson.cameracopy.ui.CameraPreviewActivity;
import com.epson.iprint.prtlogger.Analytics;
import com.epson.memcardacc.MemcardPhotocopyTop;
import com.epson.memcardacc.MemcardTop;

import java.util.HashMap;

import epson.print.activity.AFolderPhoto;
import epson.print.copy.CopyActivity;
import epson.scan.activity.ScanActivity;
import epson.server.screens.StorageServer;

class IprintHomeMenuLogging {
    private static HashMap<String, String> sClassNameToButtonIdMap;
    private final String CAMERADECOPY_APPID = "CameraCopy";
    private final String CARDPRINT = "CardPrint";
    private final String CREATIVE_PRINT_APPID = "Creative";
    private final String MULTIROLLPRINT = "MultiRollPrint";
    private final String NENGA_SEC = "Nenga";
    private final String THREE_D_PRINT_APPID = "3DFramePrint";

    public void countupMoreApp(Context context) {
    }

    static {
        setMap();
    }

    IprintHomeMenuLogging() {
    }

    private static synchronized void setMap() {
        synchronized (IprintHomeMenuLogging.class) {
            if (sClassNameToButtonIdMap == null) {
                sClassNameToButtonIdMap = new HashMap<>();
                sClassNameToButtonIdMap.put(AFolderPhoto.class.getName(), Analytics.ACTION_ID_HOME_PHOTO);
                sClassNameToButtonIdMap.put(fileBrower.class.getName(), Analytics.ACTION_ID_HOME_DOCUMENT);
                sClassNameToButtonIdMap.put(StorageServer.class.getName(), Analytics.ACTION_ID_HOME_ONLINE_STORAGE);
                sClassNameToButtonIdMap.put(WebviewActivity.class.getName(), Analytics.ACTION_ID_HOME_WEB);
                sClassNameToButtonIdMap.put(ScanActivity.class.getName(), Analytics.ACTION_ID_HOME_SCAN);
                sClassNameToButtonIdMap.put(CopyActivity.class.getName(), Analytics.ACTION_ID_HOME_COPY);
                sClassNameToButtonIdMap.put(CameraPreviewActivity.class.getName(), Analytics.ACTION_ID_HOME_CAMERACOPY);
                sClassNameToButtonIdMap.put(MemcardTop.class.getName(), Analytics.ACTION_ID_HOME_MEMORYCARD_ACCESS);
                sClassNameToButtonIdMap.put(MemcardPhotocopyTop.class.getName(), Analytics.ACTION_ID_HOME_PHOTO_TRANSFER);
            }
        }
    }

    public void sendUiTapData(@NonNull Context context, @NonNull String str) {
        Analytics.sendAction(context, sClassNameToButtonIdMap.get(str));
    }

    public void countUpInstalledOtherApps(Context context, IconTextArrayItem iconTextArrayItem) {
        if (!iconTextArrayItem.appId.equals("Creative") && !iconTextArrayItem.appId.equalsIgnoreCase("3DFramePrint") && !iconTextArrayItem.appId.equalsIgnoreCase("CameraCopy") && !iconTextArrayItem.appId.equalsIgnoreCase("MultiRollPrint") && !iconTextArrayItem.appId.equalsIgnoreCase("CardPrint")) {
            iconTextArrayItem.appId.equalsIgnoreCase("Nenga");
        }
    }

    public void countUpNotInstalledOtherApps(Context context, IconTextArrayItem iconTextArrayItem) {
        if (!iconTextArrayItem.appId.equals("Creative") && !iconTextArrayItem.appId.equalsIgnoreCase("3DFramePrint") && !iconTextArrayItem.appId.equalsIgnoreCase("CameraCopy") && !iconTextArrayItem.appId.equalsIgnoreCase("MultiRollPrint") && !iconTextArrayItem.appId.equalsIgnoreCase("CardPrint")) {
            iconTextArrayItem.appId.equalsIgnoreCase("Nenga");
        }
    }
}
