Skip to content

Commit

Permalink
支持baseviewholder带泛型参数
Browse files Browse the repository at this point in the history
  • Loading branch information
CzwAthou committed Sep 25, 2017
1 parent d9135a1 commit 7dea83c
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,11 @@ private Class getInstancedGenericKClass(Class z) {
if (BaseViewHolder.class.isAssignableFrom(tempClass)) {
return tempClass;
}
} else if (temp instanceof ParameterizedType) {
Type rawType = ((ParameterizedType) temp).getRawType();
if (rawType instanceof Class && BaseViewHolder.class.isAssignableFrom((Class<?>) rawType)) {
return (Class<?>) rawType;
}
}
}
}
Expand Down

0 comments on commit 7dea83c

Please sign in to comment.