title: How to display recyclerview in Tab layout using kotlin?
body: <p>I am new to Android, i have a app its developed by kotlin language.One of my activity contains tab layout with fragments (two tabs).each tab have a list out the recyclerview with data.i struck with displaying my recyclerview with data in the tab view.This is what i tried.</p>
  
  <p>main.kt</p>
  
  <pre><code>private fun setupViewPager(viewPager: ViewPager) {
          val adapter = ViewPagerAdapter(supportFragmentManager)
          adapter.addFragment(OneFragment(), "RECEIVE LIST")
          adapter.addFragment(TwoFragment(), "SEND LIST")
          viewPager.adapter = adapter
      }
  
      internal inner class ViewPagerAdapter(manager: FragmentManager) : FragmentPagerAdapter(manager) {
          private val mFragmentList = ArrayList&lt;Fragment&gt;()
          private val mFragmentTitleList = ArrayList&lt;String&gt;()
  
          override fun getItem(position: Int): Fragment {
              return mFragmentList[position]
          }
  
          override fun getCount(): Int {
              return mFragmentList.size
          }
  
          fun addFragment(fragment: Fragment, title: String) {
              mFragmentList.add(fragment)
              mFragmentTitleList.add(title)
          }
  
          override fun getPageTitle(position: Int): CharSequence {
              return mFragmentTitleList[position]
          }
      }
  </code></pre>
  
  <p>TransactionRecyclerAdapter.kt</p>
  
  <pre><code>enum class TransactionAdapterDirection {
      INCOMING, OUTGOING
  }
  
  class TransactionRecyclerAdapter(private val transactionList: List&lt;TransactionEntity&gt;,
                                   val appDatabase: AppDatabase,
                                   private val direction: TransactionAdapterDirection,
                                   val networkDefinitionProvider: NetworkDefinitionProvider) : RecyclerView.Adapter&lt;TransactionViewHolder&gt;() {
  
      override fun getItemCount() = transactionList.size
  
      override fun onBindViewHolder(holder: TransactionViewHolder, position: Int) = holder.bind(transactionList[position], appDatabase)
  
      override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TransactionViewHolder {
          val itemView = LayoutInflater.from(parent.context).inflate(R.layout.transaction_item, parent,false)
          return TransactionViewHolder(itemView,direction,networkDefinitionProvider)
  </code></pre>
  
  <p>OneFragment.kt</p>
  
  <pre><code>class OneFragment : Fragment() {
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
  
      }
  
      override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
          // Inflate the layout for this fragment
          //return inflater!!.inflate(R.layout.frag_one, container, false)
  
          val rootView = inflater!!.inflate(R.layout.frag_one, container, false)
          val recyclerView = rootView.findViewById&lt;RecyclerView&gt;(R.id.transaction_recycler_in) as RecyclerView
          recyclerView.setHasFixedSize(true);
          recyclerView
                  .setLayoutManager(LinearLayoutManager(getActivity()));//Linear Items
  
          recyclerView.adapter = TransactionRecyclerAdapter()// struck with here 
          recyclerView.layoutManager = LinearLayoutManager(context)
          return rootView
      }
  }
  </code></pre>