// 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;
        JsonArray reward2 = reward.get(1).getAsJsonArray();

        setRewardData(holder.value_spitem1_type, reward1.get(0).getAsInt(), holder.value_spitem1_count, reward1.get(1).getAsInt());
        setRewardData(holder.value_spitem2_type, reward2.get(0).getAsInt(), holder.value_spitem2_count, reward2.get(1).getAsInt());
        setRewardData(holder.value_spitem1_abs, reward1.get(0).getAsInt(), null, 0);
        setRewardData(holder.value_spitem2_abs, reward2.get(0).getAsInt(), null, 0);

        holder.view_abs.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                view.setVisibility(View.GONE);
                active.add(target);
                holder.view_full.setVisibility(View.VISIBLE);
            }
        });

        holder.view_full.setVisibility(View.GONE);
        holder.view_full.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                view.setVisibility(View.GONE);
                active.remove(Integer.valueOf(target));
                holder.view_abs.setVisibility(View.VISIBLE);
            }
        });

        holder.value_condition.setTag(target);
        v.findViewById(R.id.expedition_item_abstract).setVisibility(active.contains(target) ? View.GONE : View.VISIBLE);
        v.findViewById(R.id.expedition_item_full).setVisibility(active.contains(target) ? View.VISIBLE : View.GONE);

// 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;

        JsonArray reward2 = reward.get(1).getAsJsonArray();

        setRewardData(holder.value_spitem1_type, reward1.get(0).getAsInt(), holder.value_spitem1_count, reward1.get(1).getAsInt());
        setRewardData(holder.value_spitem2_type, reward2.get(0).getAsInt(), holder.value_spitem2_count, reward2.get(1).getAsInt());
        setRewardData(holder.value_spitem1_abs, reward1.get(0).getAsInt(), null, 0);
        setRewardData(holder.value_spitem2_abs, reward2.get(0).getAsInt(), null, 0);

        holder.view_abs.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                view.setVisibility(View.GONE);
                active.add(target);
                holder.view_full.setVisibility(View.VISIBLE);
            }
        });

        holder.view_full.setVisibility(View.GONE);
        holder.view_full.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                view.setVisibility(View.GONE);
                active.remove(Integer.valueOf(target));
                holder.view_abs.setVisibility(View.VISIBLE);
            }
        });

        holder.value_condition.setTag(target);
        v.findViewById(R.id.expedition_item_abstract).setVisibility(active.contains(target) ? View.GONE : View.VISIBLE);
        v.findViewById(R.id.expedition_item_full).setVisibility(active.contains(target) ? View.VISIBLE : View.GONE);

        setConditionContent(v.findViewWithTag(target), getExpeditionInfo(target, locale));