GridFragment.java
1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package com.cnlive.goldenline.ui.fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.cnlive.goldenline.R;
import com.cnlive.goldenline.util.LogUtils;
/**
* Description: 滑动的viewpager
* Created on 2017/3/6
* Author : 郭
*/
public class GridFragment extends android.support.v4.app.Fragment {
private int key = 0;
public GridFragment() {
super();
}
public static GridFragment newInstance(int key) {
Bundle args = new Bundle();
args.putInt("key", key);
GridFragment fragment = new GridFragment();
fragment.setArguments(args);
return fragment;
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
Bundle bundle = getArguments();
if (bundle != null)
{
key = bundle.getInt("key");
}
if (key == 1) {
LogUtils.LOGE("111111111111111111");
return inflater.inflate(R.layout.layout_vip_vp, null);
} else {
LogUtils.LOGE("222222222222222");
return inflater.inflate(R.layout.layout_vip_vp2, null);
}
}
}