一些代码细节调整

This commit is contained in:
hyb1996 2018-09-07 08:59:34 +08:00
parent 31922af8f2
commit 2cd9394ca4
2 changed files with 5 additions and 9 deletions

View File

@ -175,7 +175,6 @@ public class DynamicLayoutInflater {
}
}
@SuppressWarnings("unchecked")
public View inflate(Node node, @Nullable ViewGroup parent, boolean attachToParent) {
View view = doInflation(node, parent, attachToParent);
if (view != null && view instanceof ShouldCallOnFinishInflate) {

View File

@ -73,15 +73,12 @@ public class SpinnerInflater extends BaseViewInflater<Spinner> {
@Nullable
@Override
public ViewCreator<Spinner> getCreator() {
return new ViewCreator<Spinner>() {
@Override
public Spinner create(Context context, Map<String, String> attrs) {
String mode = attrs.remove("android:spinnerMode");
if (mode == null) {
return new Spinner(context);
}
return new Spinner(context, SPINNER_MODES.get(mode));
return (context, attrs) -> {
String mode = attrs.remove("android:spinnerMode");
if (mode == null) {
return new Spinner(context);
}
return new Spinner(context, SPINNER_MODES.get(mode));
};
}