mirror of
https://gitee.com/zhangsken/AndroidIDE.git
synced 2026-10-16 07:49:44 +08:00
Use Context constructor while inflating views
This commit is contained in:
+2
-2
@@ -254,8 +254,8 @@ class XMLLayoutInflater extends BaseLayoutInflater {
|
||||
// TODO Try to load classes directly from .class files
|
||||
try {
|
||||
final Class<? extends View> loaded = Class.forName(name).asSubclass(View.class);
|
||||
final Constructor<? extends View> constructor = loaded.getConstructor(Context.class, AttributeSet.class, int.class);
|
||||
final View created = constructor.newInstance(contextProvider.getContext(), null, style);
|
||||
final Constructor<? extends View> constructor = loaded.getConstructor(Context.class /*, AttributeSet.class, int.class*/);
|
||||
final View created = constructor.newInstance(contextProvider.getContext()/*, null, style*/);
|
||||
final BaseView view =
|
||||
created instanceof ViewGroup
|
||||
? new UiViewGroup (name, (ViewGroup) created)
|
||||
|
||||
@@ -19,7 +19,6 @@ package com.itsaky.androidide.ui.view.impl;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
import com.itsaky.androidide.ui.view.IView;
|
||||
import com.itsaky.androidide.ui.view.IViewGroup;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
Reference in New Issue
Block a user