/** @see jp.co.omronsoft.openwnn.InputViewManager#initView */
  public View initView(OpenWnn parent, int width, int height) {
    mWnn = parent;
    mDisplayMode =
        (parent.getResources().getConfiguration().orientation
                == Configuration.ORIENTATION_LANDSCAPE)
            ? LANDSCAPE
            : PORTRAIT;

    /*
     * create keyboards & the view.
     * To re-display the input view when the display mode is changed portrait <-> landscape,
     * create keyboards every time.
     */
    createKeyboards(parent);

    SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(parent);
    String skin =
        pref.getString(
            "keyboard_skin", mWnn.getResources().getString(R.string.keyboard_skin_id_default));
    int id = parent.getResources().getIdentifier(skin, "layout", "jp.co.omronsoft.openwnn");

    mKeyboardView = (KeyboardView) mWnn.getLayoutInflater().inflate(id, null);
    mKeyboardView.setOnKeyboardActionListener(this);
    mCurrentKeyboard = null;

    mMainView =
        (ViewGroup) parent.getLayoutInflater().inflate(R.layout.keyboard_default_main, null);
    mSubView = (ViewGroup) parent.getLayoutInflater().inflate(R.layout.keyboard_default_sub, null);
    if (mDisplayMode == LANDSCAPE && !mHardKeyboardHidden) {
      mMainView.addView(mSubView);
    }
    if (mKeyboardView != null) {
      mMainView.addView(mKeyboardView);
    }

    return mMainView;
  }