package com.marktony.zhihudaily.refactor.timeline; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.marktony.zhihudaily.R; /** * Created by lizhaotailang on 2017/5/21. */ public class TimelinePageFragment extends Fragment { public static final String ARG_PAGE = "ARG_PAGE"; private int mPage; public TimelinePageFragment() {} public static TimelinePageFragment newInstance(int page) { Bundle args = new Bundle(); args.putInt(ARG_PAGE, page); TimelinePageFragment fragment = new TimelinePageFragment(); fragment.setArguments(args); return fragment; } @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); mPage = getArguments().getInt(ARG_PAGE); } @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_timeline_page, container, false); return view; } }