yy1717
2020-01-06 f94146b3af6cf8a83c8c0ba62f7f86bae500dec2
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
package safeluck.drive.evaluation.fragment;
 
import android.os.Bundle;
 
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
 
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
 
import me.yokeyword.fragmentation.SupportFragment;
 
/**
 * MyApplication2
 * Created by lzw on 2019/3/19. 16:55:04
 * 邮箱:632393724@qq.com
 * All Rights Saved! Chongqing AnYun Tech co. LTD
 */
public class VPFragment extends SupportFragment {
 
    public static SupportFragment newInstance(String s){
        VPFragment vpFragment = new VPFragment();
        Bundle bundle = new Bundle();
        bundle.putString("argu",s);
        vpFragment.setArguments(bundle);
        return vpFragment;
    }
 
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        TextView textView = new TextView(_mActivity);
        ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
        textView.setGravity(Gravity.CENTER);
        textView.setLayoutParams(layoutParams);
        Bundle bundle = getArguments();
        if (bundle != null){
 
        textView.setText(bundle.getString("argu"));
        }else
        textView.setText("kong");
        return textView;
    }
}