| @ -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(); | |||||
| } | |||||
| @ -0,0 +1,30 @@ | |||||
| package com.qhclh.ytzh.index; | |||||
| import com.qhclh.ytzh.R; | |||||
| import com.qhclh.ytzh.base.BaseFragment; | |||||
| /** | |||||
| * Created by 青花瓷 on 2017/11/28. | |||||
| */ | |||||
| public class IndexFragment extends BaseFragment { | |||||
| @Override | |||||
| protected int setLayout() { | |||||
| return R.layout.fragment_index; | |||||
| } | |||||
| @Override | |||||
| protected void initView() { | |||||
| } | |||||
| @Override | |||||
| protected void initData() { | |||||
| } | |||||
| @Override | |||||
| protected void initOper() { | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,30 @@ | |||||
| package com.qhclh.ytzh.me; | |||||
| import com.qhclh.ytzh.R; | |||||
| import com.qhclh.ytzh.base.BaseFragment; | |||||
| /** | |||||
| * Created by 青花瓷 on 2017/11/28. | |||||
| */ | |||||
| public class MeFragment extends BaseFragment { | |||||
| @Override | |||||
| protected int setLayout() { | |||||
| return R.layout.fragment_me; | |||||
| } | |||||
| @Override | |||||
| protected void initView() { | |||||
| } | |||||
| @Override | |||||
| protected void initData() { | |||||
| } | |||||
| @Override | |||||
| protected void initOper() { | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,30 @@ | |||||
| package com.qhclh.ytzh.work; | |||||
| import com.qhclh.ytzh.R; | |||||
| import com.qhclh.ytzh.base.BaseFragment; | |||||
| /** | |||||
| * Created by 青花瓷 on 2017/11/28. | |||||
| */ | |||||
| public class WorkFragment extends BaseFragment{ | |||||
| @Override | |||||
| protected int setLayout() { | |||||
| return R.layout.fragment_work; | |||||
| } | |||||
| @Override | |||||
| protected void initView() { | |||||
| } | |||||
| @Override | |||||
| protected void initData() { | |||||
| } | |||||
| @Override | |||||
| protected void initOper() { | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,11 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| android:orientation="vertical" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="match_parent"> | |||||
| <TextView | |||||
| android:text="@string/index" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" /> | |||||
| </LinearLayout> | |||||
| @ -0,0 +1,9 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| android:orientation="vertical" android:layout_width="match_parent" | |||||
| android:layout_height="match_parent"> | |||||
| <TextView | |||||
| android:text="@string/me" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" /> | |||||
| </LinearLayout> | |||||
| @ -0,0 +1,10 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| android:orientation="vertical" android:layout_width="match_parent" | |||||
| android:layout_height="match_parent"> | |||||
| <TextView | |||||
| android:text="@string/work" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" /> | |||||
| </LinearLayout> | |||||