How to check if my custom keyboard has been enabled in settings

Turned out I just had to do this:

 InputMethodManager im = (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);
   String list = im.getEnabledInputMethodList().toString();
   if(list.contains(<MY KEYBOARD ID>)){
   //Do something
   }

Check below code :-

    String packageLocal = getPackageName();
    boolean isInputDeviceEnabled = false;
    InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
    List<InputMethodInfo> list = inputMethodManager.getEnabledInputMethodList();

    // check if our keyboard is enabled as input method
    for (InputMethodInfo inputMethod : list) {
        String packageName = inputMethod.getPackageName();
        if (packageName.equals(packageLocal)) {
            Toast.makeText(getApplicationContext(),"Your Keyboard Enable",Toast.LENGTH_SHORT).show();
        }
    }