Fix raw use of generics warnings

This commit is contained in:
tonymanou 2017-01-26 20:42:32 +01:00 committed by topjohnwu
parent b4d95977d0
commit 651547ef20

View File

@ -25,7 +25,8 @@ import java.util.List;
* Remember to use the correct namespace for the fab:
* xmlns:app="http://schemas.android.com/apk/res-auto"
*/
public class FABBehavior extends CoordinatorLayout.Behavior {
public class FABBehavior extends CoordinatorLayout.Behavior<View> {
private float mTranslationY;
public FABBehavior(Context context, AttributeSet attrs) {
@ -74,11 +75,11 @@ public class FABBehavior extends CoordinatorLayout.Behavior {
private float getTranslationY(CoordinatorLayout parent, View child) {
float minOffset = 0.0F;
List dependencies = parent.getDependencies(child);
List<View> dependencies = parent.getDependencies(child);
int i = 0;
for (int z = dependencies.size(); i < z; ++i) {
View view = (View) dependencies.get(i);
View view = dependencies.get(i);
if (view instanceof Snackbar.SnackbarLayout && parent.doViewsOverlap(child, view)) {
minOffset = Math.min(minOffset, ViewCompat.getTranslationY(view) - (float) view.getHeight());
}