// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static JsonObject getExpeditionInfo(int mission_no, String locale) {
//     JsonObject data = null;
//     int mission_key = mission_no;
//     String key = String.valueOf(mission_key);
//     if (!kcExpeditionData.has(key)) {
//         if (mission_no % 2 == 1) key = "203";
//         else key = "204";
//     }
//     JsonObject rawdata = kcExpeditionData.getAsJsonObject(key);
//     data = new JsonParser().parse(rawdata.toString()).getAsJsonObject();
//     JsonObject name = data.getAsJsonObject("name");
//     if (name.has(locale)) {
//         data.addProperty("name", name.get(locale).getAsString());
//     } else {
//         data.addProperty("name", name.get("en").getAsString());
//     }
//     return data;
// }
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static String getShipTypeAbbr(int idx) {
//     if (kcStypeData != null && idx < kcStypeData.size()) {
//         return kcStypeData.get(idx).getAsString();
//     } else {
//         return "";
//     }
// }
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaUtils.java
// public static String joinStr(List<String> list, String delim) {
//     String resultStr = "";
//     if (list.size() > 0) {
//         int i;
//         for (i = 0; i < list.size() - 1; i++) {
//             resultStr = resultStr.concat(list.get(i));
//             resultStr = resultStr.concat(delim);
//         }
//         resultStr = resultStr.concat(list.get(i));
//     }
//     return resultStr;
// }


import android.content.Context;
import androidx.core.content.ContextCompat;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.google.common.base.Predicate;
import com.google.common.collect.Collections2;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import static com.antest1.kcanotify.KcaApiData.getExpeditionInfo;
import static com.antest1.kcanotify.KcaApiData.getShipTypeAbbr;
import static com.antest1.kcanotify.KcaUtils.joinStr;
        boolean has_flag_lv = data.has("flag-lv");
        boolean has_flag_cond = data.has("flag-cond");
        boolean has_flag_info = has_flag_lv || has_flag_cond;
        boolean has_total_lv = data.has("total-lv");
        boolean has_total_cond = data.has("total-cond");
        boolean has_drum_ship = data.has("drum-ship");
        boolean has_drum_num = data.has("drum-num");
        boolean has_drum_num_optional = data.has("drum-num-optional");
        boolean has_drum_info = has_drum_ship || has_drum_num || has_drum_num_optional;
        boolean has_total_asw = data.has("total-asw");
        boolean has_total_fp = data.has("total-fp");
        boolean has_total_los = data.has("total-los");
        boolean has_total_firepower = data.has("total-firepower");

        ((TextView) root_view.findViewById(R.id.view_excheck_fleet_total_num))
                .setText(KcaUtils.format(getStringWithLocale(R.string.excheckview_total_num_format), total_num));

        setItemViewVisibilityById(root_view, R.id.view_excheck_flagship, has_flag_info);
        if (has_flag_info) {
            setItemViewVisibilityById(root_view, R.id.view_excheck_flagship_lv, has_flag_lv);
            if (has_flag_lv) {
                int flag_lv = data.get("flag-lv").getAsInt();
                setItemTextViewById(root_view, R.id.view_excheck_flagship_lv,
                        KcaUtils.format(getStringWithLocale(R.string.excheckview_flag_lv_format), flag_lv));
            }
            setItemViewVisibilityById(root_view, R.id.view_excheck_flagship_cond, has_flag_cond);
            if (has_flag_cond) {
                String[] flag_cond = data.get("flag-cond").getAsString().split("/");
                List<String> abbr_text_list = new ArrayList<>();
                for (int i = 0; i < flag_cond.length; i++) {
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static JsonObject getExpeditionInfo(int mission_no, String locale) {
//     JsonObject data = null;
//     int mission_key = mission_no;
//     String key = String.valueOf(mission_key);
//     if (!kcExpeditionData.has(key)) {
//         if (mission_no % 2 == 1) key = "203";
//         else key = "204";
//     }
//     JsonObject rawdata = kcExpeditionData.getAsJsonObject(key);
//     data = new JsonParser().parse(rawdata.toString()).getAsJsonObject();
//     JsonObject name = data.getAsJsonObject("name");
//     if (name.has(locale)) {
//         data.addProperty("name", name.get(locale).getAsString());
//     } else {
//         data.addProperty("name", name.get("en").getAsString());
//     }
//     return data;
// }
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static String getShipTypeAbbr(int idx) {
//     if (kcStypeData != null && idx < kcStypeData.size()) {
//         return kcStypeData.get(idx).getAsString();
//     } else {
//         return "";
//     }
// }
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaUtils.java
// public static String joinStr(List<String> list, String delim) {
//     String resultStr = "";
//     if (list.size() > 0) {
//         int i;
//         for (i = 0; i < list.size() - 1; i++) {
//             resultStr = resultStr.concat(list.get(i));
//             resultStr = resultStr.concat(delim);
//         }
//         resultStr = resultStr.concat(list.get(i));
//     }
//     return resultStr;
// }


// Path: app/src/main/java/com/antest1/kcanotify/KcaExpeditionTableViewAdpater.java
import android.content.Context;
import androidx.core.content.ContextCompat;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.google.common.base.Predicate;
import com.google.common.collect.Collections2;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import static com.antest1.kcanotify.KcaApiData.getExpeditionInfo;
import static com.antest1.kcanotify.KcaApiData.getShipTypeAbbr;
import static com.antest1.kcanotify.KcaUtils.joinStr;

        boolean has_flag_lv = data.has("flag-lv");
        boolean has_flag_cond = data.has("flag-cond");
        boolean has_flag_info = has_flag_lv || has_flag_cond;
        boolean has_total_lv = data.has("total-lv");
        boolean has_total_cond = data.has("total-cond");
        boolean has_drum_ship = data.has("drum-ship");
        boolean has_drum_num = data.has("drum-num");
        boolean has_drum_num_optional = data.has("drum-num-optional");
        boolean has_drum_info = has_drum_ship || has_drum_num || has_drum_num_optional;
        boolean has_total_asw = data.has("total-asw");
        boolean has_total_fp = data.has("total-fp");
        boolean has_total_los = data.has("total-los");
        boolean has_total_firepower = data.has("total-firepower");

        ((TextView) root_view.findViewById(R.id.view_excheck_fleet_total_num))
                .setText(KcaUtils.format(getStringWithLocale(R.string.excheckview_total_num_format), total_num));

        setItemViewVisibilityById(root_view, R.id.view_excheck_flagship, has_flag_info);
        if (has_flag_info) {
            setItemViewVisibilityById(root_view, R.id.view_excheck_flagship_lv, has_flag_lv);
            if (has_flag_lv) {
                int flag_lv = data.get("flag-lv").getAsInt();
                setItemTextViewById(root_view, R.id.view_excheck_flagship_lv,
                        KcaUtils.format(getStringWithLocale(R.string.excheckview_flag_lv_format), flag_lv));
            }
            setItemViewVisibilityById(root_view, R.id.view_excheck_flagship_cond, has_flag_cond);
            if (has_flag_cond) {
                String[] flag_cond = data.get("flag-cond").getAsString().split("/");
                List<String> abbr_text_list = new ArrayList<>();
                for (int i = 0; i < flag_cond.length; i++) {
                    abbr_text_list.add(getShipTypeAbbr(Integer.parseInt(flag_cond[i])));