public static <T> ViewGroup createHorizontallyDistributedViews(final Context ctx, final LinearLayout root, final List<T> items, final Func2<Integer, T, View> viewCreator, final Func2<Integer, T, Float> weightCreator) {

        final LinearLayout viewGroup = root == null ? new LinearLayout(ctx) : root;
        viewGroup.setOrientation(LinearLayout.HORIZONTAL);

        int idx = 0;
        for (T item : items) {
            final LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.MATCH_PARENT);
            lp.weight = weightCreator == null ? 1 : weightCreator.call(idx, item);

            View itemView = viewCreator.call(idx, item);
            if (itemView == null) {
                itemView = new View(ctx);
            }
            if (itemView instanceof TextView) {
                ((TextView) itemView).setGravity(Gravity.CENTER_HORIZONTAL);
            }
            viewGroup.addView(itemView, lp);

            idx++;
        }
        return viewGroup;
    }
creates a column layout and returns it. Provides the option to specify individual layouts per column.

@param ctx               context to use for creating views
@param root              optional. If given, then the column layout will be created IN the given view instead of returning a new one.
@param columnCount       number of columns the layout shall have
@param withSeparator     if true, a vertical separator line will be drawn between columns
@param columnViewCreator will be called for each column index (0 - "columnCount-1") and shall return the columns content view.
                         May return null for some columns, in which case those are empty
@return new ViewGroup holding the column layout. If "root" was not null, then "root" is returned.
main/src/main/java/cgeo/geocaching/ui/ViewUtils.java