All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.taig.android.compatibility.View Maven / Gradle / Ivy

The newest version!
package io.taig.android.compatibility;

import android.graphics.drawable.Drawable;

import static android.os.Build.VERSION.SDK_INT;
import static android.os.Build.VERSION_CODES.JELLY_BEAN;

public class View {
    @SuppressWarnings( "deprecation" )
    public static void setBackground( android.view.View view, Drawable background ) {
        if( SDK_INT >= JELLY_BEAN ) {
            view.setBackground( background );
        } else {
            view.setBackgroundDrawable( background );
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy