Question: I have a custom view:

```
public class Loading extends View {

    private long movieStart;
    private Movie movie;

    public Loading(Context context, InputStream inputStream) {
        super(context);
        movie = Movie.decodeStream(inputStream);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        canvas.drawColor(Color.WHITE);
        super.onDraw(canvas);
        final long now = SystemClock.uptimeMillis();
        if(movieStart == 0)
            movieStart = now;
        final int relTime = (int)((now - movieStart) % movie.duration());
        movie.setTime(relTime);
        movie.draw(canvas, 0, 0);
        this.invalidate();
    }

}

```

How can I use this view in XML layout? How can I pass the parameters (Context, InputStream) in XML layout?

Answer: 
You can use the [`:visible`](http://api.jquery.com/visible-selector/) selector, and the [`is`](http://api.jquery.com/is/) method:

```
if($("#hello").is(":visible")) {
    //It's visible!
}

```

The `is` method returns a boolean value indicating whether or not *any* of the matched elements match that selector.
use the [.is() function](http://api.jquery.com/is/) along with the [:hidden](http://api.jquery.com/hidden-selector/) or [:visible](http://api.jquery.com/visible-selector/) psuedoselectors:

<http://jsfiddle.net/jbabey/ucSVx/>

```
$('#hello').is(':hidden')

```