1、修复换肤SDK 在Fragment没有生效的问题,原因是使用的LayoutInflater不是hook后的需要替换为LayoutInflater.from(getContext())
This commit is contained in:
donghongyu-pc
2024-10-25 10:30:03 +08:00
parent 8794695c9d
commit 956d1652cc
10 changed files with 32 additions and 31 deletions

View File

@@ -28,7 +28,7 @@ public abstract class BaseFragment extends Fragment {
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
if (mRootView == null) {
mRootView = inflater.inflate(getLayoutId(), container, false);
mRootView = LayoutInflater.from(getContext()).inflate(getLayoutId(), container, false);
} else {
ViewGroup viewGroup = (ViewGroup) mRootView.getParent();
if (viewGroup != null) {

View File

@@ -33,7 +33,7 @@ public abstract class MvpDialogFragment< V extends IView, P extends Presenter< V
@Override
public View onCreateView( @NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState ) {
if ( mRootView == null ) {
mRootView = inflater.inflate( getLayoutId(), container, false );
mRootView = LayoutInflater.from(getContext()).inflate( getLayoutId(), container, false );
} else {
ViewGroup viewGroup = ( ViewGroup ) mRootView.getParent();
if ( viewGroup != null )