package com.shaojun.myapp.controller.fragment;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.view.View;
import android.widget.GridView;

import com.shaojun.myapp.R;
import com.shaojun.myapp.base.BaseFragment;
import com.shaojun.myapp.widget.TitleBarView;


public class FragmentSample extends BaseFragment implements SwipeRefreshLayout.OnRefreshListener {
    private Context mContext;
    public TitleBarView titleBarView;
    public GridView gridview;

    public static FragmentSample newInstance(String title) {
        FragmentSample f = new FragmentSample();
        Bundle b = new Bundle();
        b.putString("title", title);
        f.setArguments(b);
        return f;
    }


    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        this.mContext = context;
    }

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_tab_sample;
    }


    @Override
    protected void initWidget(View rootView) {
        title = getArguments().getString("title");
        titleBarView = (TitleBarView) rootView.findViewById(R.id.home_title_layout);
        titleBarView.initCenterTitle(title);


    }

    @Override
    protected void setView() {
        randomBgColor(rootView);
    }

    @Override
    public void onRefresh() {

    }
}
