// 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;
        holder.label_total_num.setText(item.get("total-num").getAsString());

        if (item.has("flag-lv")) {
            String flagship_lv = item.get("flag-lv").getAsString();
            holder.label_flagship_lv.setText(KcaUtils.format("Lv ".concat(flagship_lv)));
        } else {
            holder.label_flagship_lv.setText("");
        }

        JsonArray exp_info = item.getAsJsonArray("exp");
        int hq_exp = exp_info.get(0).getAsInt();
        int ship_exp = exp_info.get(1).getAsInt();
        holder.value_hq_exp.setText(String.valueOf(hq_exp * (is_great_success ? 2 : 1)));
        holder.value_ship_exp.setText(String.valueOf(ship_exp * (is_great_success ? 2 : 1)));

        JsonArray resource = item.getAsJsonArray("resource");

        int fuel = resource.get(0).getAsInt();
        int ammo = resource.get(1).getAsInt();
        int steel = resource.get(2).getAsInt();
        int bauxite = resource.get(3).getAsInt();

        holder.value_fuel.setText(String.valueOf(calcResourcesBonus(fuel)));
        holder.value_ammo.setText(String.valueOf(calcResourcesBonus(ammo)));
        holder.value_steel.setText(String.valueOf(calcResourcesBonus(steel)));
        holder.value_bauxite.setText(String.valueOf(calcResourcesBonus(bauxite)));
        List<String> resource_str_list = new ArrayList<>();
        for(int i = 0; i < resource.size(); i++) {
            resource_str_list.add(String.valueOf(calcResourcesBonus(resource.get(i).getAsInt())));
        }
// 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;

        holder.label_total_num.setText(item.get("total-num").getAsString());

        if (item.has("flag-lv")) {
            String flagship_lv = item.get("flag-lv").getAsString();
            holder.label_flagship_lv.setText(KcaUtils.format("Lv ".concat(flagship_lv)));
        } else {
            holder.label_flagship_lv.setText("");
        }

        JsonArray exp_info = item.getAsJsonArray("exp");
        int hq_exp = exp_info.get(0).getAsInt();
        int ship_exp = exp_info.get(1).getAsInt();
        holder.value_hq_exp.setText(String.valueOf(hq_exp * (is_great_success ? 2 : 1)));
        holder.value_ship_exp.setText(String.valueOf(ship_exp * (is_great_success ? 2 : 1)));

        JsonArray resource = item.getAsJsonArray("resource");

        int fuel = resource.get(0).getAsInt();
        int ammo = resource.get(1).getAsInt();
        int steel = resource.get(2).getAsInt();
        int bauxite = resource.get(3).getAsInt();

        holder.value_fuel.setText(String.valueOf(calcResourcesBonus(fuel)));
        holder.value_ammo.setText(String.valueOf(calcResourcesBonus(ammo)));
        holder.value_steel.setText(String.valueOf(calcResourcesBonus(steel)));
        holder.value_bauxite.setText(String.valueOf(calcResourcesBonus(bauxite)));
        List<String> resource_str_list = new ArrayList<>();
        for(int i = 0; i < resource.size(); i++) {
            resource_str_list.add(String.valueOf(calcResourcesBonus(resource.get(i).getAsInt())));
        }
        holder.value_resources_abs.setText(joinStr(resource_str_list, "/"));