diff --git a/src/main/java/ru/touchin/roboswag/components/navigation/ViewController.java b/src/main/java/ru/touchin/roboswag/components/navigation/ViewController.java index 6177c77..f2c3e4e 100644 --- a/src/main/java/ru/touchin/roboswag/components/navigation/ViewController.java +++ b/src/main/java/ru/touchin/roboswag/components/navigation/ViewController.java @@ -119,6 +119,7 @@ public class ViewController, * * @param resId Resource id for the string */ + @NonNull public final String getString(@StringRes final int resId) { return getActivity().getString(resId); } @@ -130,6 +131,7 @@ public class ViewController, * @param resId Resource id for the format string * @param formatArgs The format arguments that will be used for substitution. */ + @NonNull public final String getString(@StringRes final int resId, @NonNull final Object... formatArgs) { return getActivity().getString(resId, formatArgs); } @@ -178,8 +180,9 @@ public class ViewController, * @return The view that has the given id in the hierarchy. */ @NonNull - public View findViewById(@IdRes final int id) { - final View viewById = getContainer().findViewById(id); + @SuppressWarnings("unchecked") + public T findViewById(@IdRes final int id) { + final T viewById = (T) getContainer().findViewById(id); if (viewById == null) { throw new ShouldNotHappenException("No view for id=" + getActivity().getResources().getResourceName(id)); }