@Override
    protected View getLayoutView() {
        View wrapper;
        editText = new EditText(getContext());
        int padding = ViewKnife.dip2px(16);
        editText.setPadding(padding, padding, padding, padding);
        editText.setBackgroundColor(Color.WHITE);
        editText.setGravity(Gravity.START | Gravity.TOP);
        editText.setTextColor(ViewKnife.getColor(R.color.pd_label_dark));
        editText.setLineSpacing(0, 1.2f);

        String[] options = getArguments().getStringArray(PARAM3);
        if (options != null && options.length > 0) {
            LinearLayout layout = new LinearLayout(getContext());
            layout.setOrientation(LinearLayout.VERTICAL);
            wrapper = layout;
            RecyclerView recyclerView = new RecyclerView(getContext());
            recyclerView.setBackgroundColor(Color.WHITE);
            LinearLayoutManager manager = new LinearLayoutManager(getContext());
            manager.setOrientation(LinearLayoutManager.HORIZONTAL);
            recyclerView.setLayoutManager(manager);
            UniversalAdapter adapter = new UniversalAdapter();
            recyclerView.setAdapter(adapter);
            adapter.setListener(new UniversalAdapter.OnItemClickListener() {
                @Override
                public void onItemClick(int position, BaseItem item) {
                    notifyResult(((OptionItem)item).data);
                }
            });
            List<BaseItem> items = new ArrayList<>(options.length);
            for (String option : options) {
                items.add(new OptionItem(option));
            }
            adapter.setItems(items);

            LinearLayout.LayoutParams recyclerParam = new LinearLayout.LayoutParams(
                    ViewGroup.LayoutParams.MATCH_PARENT, ViewKnife.dip2px(50)
            );
            layout.addView(recyclerView, recyclerParam);
            LinearLayout.LayoutParams editParam = new LinearLayout.LayoutParams(
                    ViewGroup.LayoutParams.MATCH_PARENT,
                    ViewGroup.LayoutParams.MATCH_PARENT
            );
            layout.addView(editText, editParam);
        } else {
            wrapper = editText;
        }
        return wrapper;
    }
Created by linjiang on 03/06/2018.

PARAM1: Default content
PARAM2: only allow number or not
PARAM3: Quick input options
PARAM4: if can edit
pandora-core/src/main/java/tech/linjiang/pandora/ui/fragment/EditFragment.java