延迟加载我的光环 (部分问题后续处理

This commit is contained in:
juntao
2020-04-14 12:10:01 +08:00
parent e918b19e2e
commit fcd46cb2ea
6 changed files with 113 additions and 1268 deletions

View File

@ -9,14 +9,6 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;
import androidx.recyclerview.widget.RecyclerView;
import com.gh.base.OnListClickListener;
import com.gh.base.OnRequestCallBackListener;
import com.gh.common.constant.Constants;
@ -37,6 +29,13 @@ import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.ButterKnife;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
@ -145,7 +144,10 @@ public abstract class BaseFragment<T> extends Fragment implements OnRequestCallB
} else {
mCachedView = View.inflate(getContext(), getLayoutId(), null);
}
ButterKnife.bind(this, mCachedView);
if (useButterKnife()) {
ButterKnife.bind(this, mCachedView);
}
initView(mCachedView);
@ -309,4 +311,8 @@ public abstract class BaseFragment<T> extends Fragment implements OnRequestCallB
protected boolean addSyncPageObserver() {
return false;
}
protected boolean useButterKnife() {
return true;
}
}