Mistři v programování na #hovnokod

Java #4651

Bud alebo.

    enum Type {
        ITEM_IMAGE,
        ITEM_NO_IMAGE
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        if (viewType == Type.ITEM_IMAGE.ordinal() || viewType == Type.ITEM_NO_IMAGE.ordinal()) {
            return new ItemViewHolder();
        }
        return null;
    }

Anonymous,