// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final int STATE_HEAVYDMG = 3;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final int STATE_LIGHTDMG = 1;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final int STATE_MODERATEDMG = 2;


import android.content.Context;
import androidx.core.content.ContextCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.google.gson.JsonObject;
import java.util.ArrayList;
import java.util.List;
import static com.antest1.kcanotify.KcaConstants.STATE_HEAVYDMG;
import static com.antest1.kcanotify.KcaConstants.STATE_LIGHTDMG;
import static com.antest1.kcanotify.KcaConstants.STATE_MODERATEDMG;
    public View getView(int position, View convertView, ViewGroup parent) {
        final int pos = position;
        final Context context = parent.getContext();

        View v = convertView;
        if (v == null) {
            LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            v = inflater.inflate(R.layout.listview_dock, parent, false);
            ViewHolder holder = new ViewHolder();
            holder.shipname = (TextView) v.findViewById(R.id.dock_ship);
            holder.repairtime = (TextView) v.findViewById(R.id.dock_time);
            v.setTag(holder);
        }

        final JsonObject item = itemList.get(position).getAsJsonObject();

        ViewHolder holder = (ViewHolder) v.getTag();
        holder.shipname.setText(item.get("name").getAsString());
        holder.repairtime.setText(item.get("time").getAsString());
        int state = item.get("state").getAsInt();
        boolean in_dock = item.get("dock").getAsBoolean();
        if (in_dock) {
            holder.shipname.setTextColor(ContextCompat.getColor(context, R.color.colorNormalState));
        } else {
            holder.shipname.setTextColor(ContextCompat.getColor(context, R.color.white));
        }
        switch (state) {
            case STATE_HEAVYDMG:
                holder.repairtime.setBackgroundColor(ContextCompat.getColor(context, R.color.colorHeavyDmgState));
                break;
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final int STATE_HEAVYDMG = 3;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final int STATE_LIGHTDMG = 1;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final int STATE_MODERATEDMG = 2;


// Path: app/src/main/java/com/antest1/kcanotify/KcaDockingPopupListAdapter.java
import android.content.Context;
import androidx.core.content.ContextCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.google.gson.JsonObject;
import java.util.ArrayList;
import java.util.List;
import static com.antest1.kcanotify.KcaConstants.STATE_HEAVYDMG;
import static com.antest1.kcanotify.KcaConstants.STATE_LIGHTDMG;
import static com.antest1.kcanotify.KcaConstants.STATE_MODERATEDMG;

    public View getView(int position, View convertView, ViewGroup parent) {
        final int pos = position;
        final Context context = parent.getContext();

        View v = convertView;
        if (v == null) {
            LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            v = inflater.inflate(R.layout.listview_dock, parent, false);
            ViewHolder holder = new ViewHolder();
            holder.shipname = (TextView) v.findViewById(R.id.dock_ship);
            holder.repairtime = (TextView) v.findViewById(R.id.dock_time);
            v.setTag(holder);
        }

        final JsonObject item = itemList.get(position).getAsJsonObject();

        ViewHolder holder = (ViewHolder) v.getTag();
        holder.shipname.setText(item.get("name").getAsString());
        holder.repairtime.setText(item.get("time").getAsString());
        int state = item.get("state").getAsInt();
        boolean in_dock = item.get("dock").getAsBoolean();
        if (in_dock) {
            holder.shipname.setTextColor(ContextCompat.getColor(context, R.color.colorNormalState));
        } else {
            holder.shipname.setTextColor(ContextCompat.getColor(context, R.color.white));
        }
        switch (state) {
            case STATE_HEAVYDMG:
                holder.repairtime.setBackgroundColor(ContextCompat.getColor(context, R.color.colorHeavyDmgState));
                break;
            case STATE_MODERATEDMG: