package com.souptitlemobile;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;

import com.facebook.react.uimanager.events.EventDispatcher;

public class TableView extends RecyclerView {
    private List<View> mRecycleViews = null;
    private int mRowHeight;
    private int mHoldItems;
    private EventDispatcher mEventDiscpatcher;

    private final MyAdapter mMyAdapter;

    public TableView(Context context) {
        super(context);
        setLayoutManager(new LinearLayoutManager(getContext()));
        mMyAdapter = new MyAdapter(); // TODO: what is it Adapter???
        setAdapter(mMyAdapter);
    }

    protected void onMeasure(int widthSpec, int heightSpec) {
        final int w =
            MeasureSpec.getSize(
              MeasureSpec.makeMeasureSpec(widthSpec, MeasureSpec.AT_MOST)
            );
        final int h =
            MeasureSpec.getSize(
              MeasureSpec.makeMeasureSpec(heightSpec, MeasureSpec.AT_MOST)
            );
        setMeasuredDimension(w, h);
    }
}

@@ -325,16 +325,121 @@
 patcher;
+%0Aimport com.facebook.react.uimanager.PixelUtil;%0Aimport com.facebook.react.uimanager.DisplayMetricsHolder;
 %0A%0Apublic
@@ -826,51 +826,27 @@
 new 
-MyAdapter(); // TODO: what is it 
+TableView
 Adapter
-???
+();
 %0A   
@@ -1224,32 +1224,32 @@
 %0A            );%0A
-
         setMeasu
@@ -1273,11 +1273,2189 @@
 );%0A    %7D
+%0A%0A    void addNewView(View view) %7B%0A        final NativeListViewItem childView = (NativeListViewItem) view;%0A        if (mRecycleViews == null) %7B%0A            mRecycleViews = new ArrayList%3C%3E(mHoldItems);%0A        %7D%0A        if (mRecycleViews.size() %3C mHoldItems) %7B%0A            mRecycleViews.add(childView);%0A            childView.setHeight(mRowHeight);%0A        %7D%0A        mMyAdapter.notifyDataSetChanged();%0A    %7D%0A%0A    // Looks like destructor%0A    void removeAllViews() %7B%0A        if (mRecycleViews != null) %7B%0A            mRecycleViews.clear();%0A        %7D%0A        mEventDiscpatcher = null;%0A    %7D%0A%0A    void setNumRows(int dataSize) %7B%0A        mMyAdapter.setNumRows(dataSize);%0A    %7D%0A%0A    void setRowHeight(int rowHeight) %7B%0A        mRowHeight = (int) PixelUtil.toPixelFromDIP(rowHeight);%0A        final int height =%0A            Math.max(%0A              DisplayMetricsHolder.getScreenDiscplayMetrics().heightPixels,%0A              DisplayMetricsHolder.getScreenDiscplayMetrics().widthPixels%0A            );%0A        mHoldItems = Math.round(1.6f * height / this.mRowHeight);%0A        if (mHoldItems %3C 6) %7B%0A            mHoldItems = 6;%0A        %7D%0A    %7D%0A%0A    private class TableViewAdapter extends Adapter%3CViewHolder%3E %7B%0A        private int mDataSize = 0;%0A        private int mUPos = 0;%0A%0A        public void setNumRows(int mDataSize) %7B%0A            this.mDataSize = mDataSize;%0A            notifyDataSetChanged();%0A        %7D%0A%0A        @Override%0A        public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) %7B%0A            final int p = mUPos %3E= mRecycleViews.size() ? mUPos %25 mRecycleViews.size() : mUPos;%0A            View view = mRecycleViews.get(p);%0A            ++mUPos;%0A            return new ViewHolder(view);%0A        %7D%0A%0A        @Override%0A        public void onBindViewHolder(ViewHolder holder, int position) %7B%0A            if (holder.itemView instanceof NativeListViewItem) %7B%0A                final NativeListViewItem childView = (NativeListViewItem) holder.itemView;%0A                childView.setInnerRowID(position);%0A                childView.setHeight(mRowHeight);%0A            %7D%0A        %7D%0A%0A        @Override%0A        public int getItemCount() %7B%0A            return mDataSize;%0A        %7D%0A    %7D
 %0A%7D%0A

Create RecycleView