content: package com.jennifer.andy.nestedscrollingdemo.ui;
  
  import android.os.Bundle;
  import android.support.annotation.NonNull;
  import android.support.annotation.Nullable;
  import android.support.v4.app.Fragment;
  import android.support.v7.widget.DividerItemDecoration;
  import android.support.v7.widget.LinearLayoutManager;
  import android.support.v7.widget.RecyclerView;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  
  import com.jennifer.andy.nestedscrollingdemo.R;
  import com.jennifer.andy.nestedscrollingdemo.adapter.SimpleStringAdapter;
  
  import java.util.ArrayList;
  import java.util.List;
  
  /**
   * Author:  andy.xwt
   * Date:    2018/8/8 15:29
   * Description:
   */
  
  public class TabFragment extends Fragment {
  
  
      private RecyclerView mRecyclerView;
      private String mText;
  
      public static TabFragment newInstance(String text) {
          Bundle args = new Bundle();
          TabFragment fragment = new TabFragment();
          args.putString("text", text);
          fragment.setArguments(args);
          return fragment;
      }
  
      @Nullable
      @Override
      public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
          return inflater.inflate(R.layout.fragment_tab, container, false);
      }
  
      @Override
      public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
          super.onViewCreated(view, savedInstanceState);
          mText = getArguments().getString("text");
          initView(view);
      }
  
      private void initView(View view) {
          mRecyclerView = view.findViewById(R.id.recycler_view);
          mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
          mRecyclerView.setAdapter(new SimpleStringAdapter(initStrings(), getContext()));
          mRecyclerView.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));
      }
  
      private List<String> initStrings() {
          List<String> list = new ArrayList<>();
          for (int i = 0; i < 100; i++) {
              list.add(mText);
          }
          return list;
      }
  }
  