package com.yutou.jianr_mg.Fragments;

import android.app.Activity;
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.appcompat.widget.PopupMenu;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.yutou.jianr_mg.services.DownloadService;

/**
 * Created by 58381 on 2018/1/21.
 */

public class Test extends Fragment {
    private static Test test;
    private DownloadService service;
    private Activity activity;

    public static Test init(Activity activity){
        if(test==null){
            test=new Test();
        }
        return test;
    }

    private void setActivity(Activity activity) {
        this.activity = activity;
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        ViewGroup.LayoutParams params=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        TextView textView=new TextView(getContext());
       textView.setLayoutParams(params);
       textView.setGravity(Gravity.CENTER);
        textView.setText("Hello World");
        return textView;
    }
}
