|
|
|
@ -0,0 +1,35 @@ |
|
|
|
package com.qhclh.ytzh.base; |
|
|
|
|
|
|
|
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; |
|
|
|
|
|
|
|
/** |
|
|
|
* Created by 青花瓷 on 2017/7/19. |
|
|
|
*/ |
|
|
|
|
|
|
|
public abstract class BaseFragment extends Fragment { |
|
|
|
|
|
|
|
@Nullable |
|
|
|
@Override |
|
|
|
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
|
|
|
View view = inflater.inflate(setLayout(), container, false); |
|
|
|
return view; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { |
|
|
|
super.onViewCreated(view, savedInstanceState); |
|
|
|
initView(); |
|
|
|
initData(); |
|
|
|
initOper(); |
|
|
|
} |
|
|
|
|
|
|
|
protected abstract int setLayout(); |
|
|
|
protected abstract void initView(); |
|
|
|
protected abstract void initData(); |
|
|
|
protected abstract void initOper(); |
|
|
|
} |