// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static int loadShipExpInfoFromAssets(AssetManager am) {
//     try {
//         AssetManager.AssetInputStream ais = (AssetManager.AssetInputStream) am.open("exp_ship.json");
//         byte[] bytes = ByteStreams.toByteArray(ais);
//         JsonElement expShipData = new JsonParser().parse(new String(bytes));
//         if (expShipData.isJsonObject()) {
//             helper.putValue(DB_KEY_EXPSHIP, expShipData.toString());
//             return 1;
//         } else {
//             return -1;
//         }
//     } catch (IOException e) {
//         return 0;
//     }
// }
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static void loadTranslationData(Context context) {
//     loadTranslationData(context, false);
// }
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final String DB_KEY_DECKPORT = "key_deckport";
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final String DB_KEY_SHIPIFNO = "key_shipinfo";
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final int KCANOTIFY_DB_VERSION = 5;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final String PREF_KCA_LANGUAGE = "kca_language";
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final String PREF_SHIPINFO_FILTCOND = "shipinfo_filtcond";
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final String PREF_SHIPINFO_SHIPSTAT = "shipinfo_shipstat";
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final String PREF_SHIPINFO_SORTKEY = "shipinfo_sortkey";
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final String PREF_SHIPINFO_SPEQUIPS = "shipinfo_spequips";
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaUtils.java
// public static void doVibrate(Vibrator v, int time) {
//     if (Build.VERSION.SDK_INT >= 26) {
//         v.vibrate(VibrationEffect.createOneShot(time, VibrationEffect.DEFAULT_AMPLITUDE));
//     } else {
//         v.vibrate(time);
//     }
// }
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaUtils.java
// public static String getStringPreferences(Context ctx, String key) {
//     SharedPreferences pref = ctx.getSharedPreferences("pref", Context.MODE_PRIVATE);
//     try {
//         return String.valueOf(pref.getInt(key, 0));
//     } catch (Exception e) {
//         // Nothing to do
//     }
//     return pref.getString(key, "");
// }


import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.AssetManager;
import android.content.res.Configuration;
import android.graphics.PorterDuff;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Vibrator;
import androidx.core.content.ContextCompat;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import java.util.Locale;
import static android.widget.Toast.makeText;
import static com.antest1.kcanotify.KcaApiData.loadShipExpInfoFromAssets;
import static com.antest1.kcanotify.KcaApiData.loadTranslationData;
import static com.antest1.kcanotify.KcaConstants.DB_KEY_DECKPORT;
import static com.antest1.kcanotify.KcaConstants.DB_KEY_SHIPIFNO;
import static com.antest1.kcanotify.KcaConstants.KCANOTIFY_DB_VERSION;
import static com.antest1.kcanotify.KcaConstants.PREF_KCA_LANGUAGE;
import static com.antest1.kcanotify.KcaConstants.PREF_SHIPINFO_FILTCOND;
import static com.antest1.kcanotify.KcaConstants.PREF_SHIPINFO_SHIPSTAT;
import static com.antest1.kcanotify.KcaConstants.PREF_SHIPINFO_SORTKEY;
import static com.antest1.kcanotify.KcaConstants.PREF_SHIPINFO_SPEQUIPS;
import static com.antest1.kcanotify.KcaUtils.doVibrate;
import static com.antest1.kcanotify.KcaUtils.getStringPreferences;
            }
        });

        searchButton.setOnClickListener(view -> {
            is_search_on = !is_search_on;
            setButtonStyle(searchButton, is_search_on);
            if (is_search_on) {
                findViewById(R.id.shipinfo_search_area).setVisibility(View.VISIBLE);
            } else {
                findViewById(R.id.shipinfo_search_area).setVisibility(View.GONE);
            }
        });

        searchEditText.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {
                setSearchResult(s.toString());
            }

            @Override
            public void afterTextChanged(Editable s) {

            }
        });

// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static int loadShipExpInfoFromAssets(AssetManager am) {
//     try {
//         AssetManager.AssetInputStream ais = (AssetManager.AssetInputStream) am.open("exp_ship.json");
//         byte[] bytes = ByteStreams.toByteArray(ais);
//         JsonElement expShipData = new JsonParser().parse(new String(bytes));
//         if (expShipData.isJsonObject()) {
//             helper.putValue(DB_KEY_EXPSHIP, expShipData.toString());
//             return 1;
//         } else {
//             return -1;
//         }
//     } catch (IOException e) {
//         return 0;
//     }
// }
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static void loadTranslationData(Context context) {
//     loadTranslationData(context, false);
// }
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final String DB_KEY_DECKPORT = "key_deckport";
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final String DB_KEY_SHIPIFNO = "key_shipinfo";
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final int KCANOTIFY_DB_VERSION = 5;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final String PREF_KCA_LANGUAGE = "kca_language";
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final String PREF_SHIPINFO_FILTCOND = "shipinfo_filtcond";
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final String PREF_SHIPINFO_SHIPSTAT = "shipinfo_shipstat";
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final String PREF_SHIPINFO_SORTKEY = "shipinfo_sortkey";
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaConstants.java
// public static final String PREF_SHIPINFO_SPEQUIPS = "shipinfo_spequips";
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaUtils.java
// public static void doVibrate(Vibrator v, int time) {
//     if (Build.VERSION.SDK_INT >= 26) {
//         v.vibrate(VibrationEffect.createOneShot(time, VibrationEffect.DEFAULT_AMPLITUDE));
//     } else {
//         v.vibrate(time);
//     }
// }
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaUtils.java
// public static String getStringPreferences(Context ctx, String key) {
//     SharedPreferences pref = ctx.getSharedPreferences("pref", Context.MODE_PRIVATE);
//     try {
//         return String.valueOf(pref.getInt(key, 0));
//     } catch (Exception e) {
//         // Nothing to do
//     }
//     return pref.getString(key, "");
// }


// Path: app/src/main/java/com/antest1/kcanotify/ShipInfoActivity.java
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.AssetManager;
import android.content.res.Configuration;
import android.graphics.PorterDuff;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Vibrator;
import androidx.core.content.ContextCompat;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import java.util.Locale;
import static android.widget.Toast.makeText;
import static com.antest1.kcanotify.KcaApiData.loadShipExpInfoFromAssets;
import static com.antest1.kcanotify.KcaApiData.loadTranslationData;
import static com.antest1.kcanotify.KcaConstants.DB_KEY_DECKPORT;
import static com.antest1.kcanotify.KcaConstants.DB_KEY_SHIPIFNO;
import static com.antest1.kcanotify.KcaConstants.KCANOTIFY_DB_VERSION;
import static com.antest1.kcanotify.KcaConstants.PREF_KCA_LANGUAGE;
import static com.antest1.kcanotify.KcaConstants.PREF_SHIPINFO_FILTCOND;
import static com.antest1.kcanotify.KcaConstants.PREF_SHIPINFO_SHIPSTAT;
import static com.antest1.kcanotify.KcaConstants.PREF_SHIPINFO_SORTKEY;
import static com.antest1.kcanotify.KcaConstants.PREF_SHIPINFO_SPEQUIPS;
import static com.antest1.kcanotify.KcaUtils.doVibrate;
import static com.antest1.kcanotify.KcaUtils.getStringPreferences;

            }
        });

        searchButton.setOnClickListener(view -> {
            is_search_on = !is_search_on;
            setButtonStyle(searchButton, is_search_on);
            if (is_search_on) {
                findViewById(R.id.shipinfo_search_area).setVisibility(View.VISIBLE);
            } else {
                findViewById(R.id.shipinfo_search_area).setVisibility(View.GONE);
            }
        });

        searchEditText.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {
                setSearchResult(s.toString());
            }

            @Override
            public void afterTextChanged(Editable s) {

            }
        });

        JsonArray data = dbHelper.getJsonArrayValue(DB_KEY_SHIPIFNO);