一些代码细节调整

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) { public View inflate(Node node, @Nullable ViewGroup parent, boolean attachToParent) {
View view = doInflation(node, parent, attachToParent); View view = doInflation(node, parent, attachToParent);
if (view != null && view instanceof ShouldCallOnFinishInflate) { if (view != null && view instanceof ShouldCallOnFinishInflate) {

View File

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