Android Movie - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Movie class.

This code example shows how to use the following methods: draw, duration, height, setTime, width
	protected void onDraw(final Canvas canvas) {
		canvas.drawColor(Color.TRANSPARENT);
		super.onDraw(canvas);
		long now = SystemClock.uptimeMillis();
 
		final float scale = Math.min((float)getWidth() / mMovie.width(), (float)getHeight() / mMovie.height());
 
		canvas.scale(scale, scale);
		canvas.translate(((float)getWidth() / scale - (float)mMovie.width())/2f,
				((float)getHeight() / scale - (float)mMovie.height())/2f);
 
 
		if(movieStart == 0) movieStart = (int)now;
 
		mMovie.setTime((int)((now - movieStart) % mMovie.duration()));
		mMovie.draw(canvas, 0, 0, paint);
 
		this.invalidate();
	} 
 
	private static byte[] streamToBytes(final InputStream is) {
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: draw, duration, setTime
            } 
            long now = android.os.SystemClock.uptimeMillis();
            if (movieStart == 0) {
                movieStart = now;
            } 
            int relTime = (int) ((now - movieStart) % movie.duration());
            movie.setTime(relTime);
            movie.draw(canvas, 0, 0);
            this.invalidate();
        } 
    } 
} 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: draw, duration, height, setTime, width
        if (mMovie == null)
        	return; 
         
        canvas.translate(getWidth() / 2, getHeight() / 2);
       	float s;
       	s = (float)getWidth() / (float)mMovie.width();
       	if ((float)getHeight() / (float)mMovie.height() < s)
           	s =  (float)getHeight() / (float)mMovie.height();
       	if (s < 1.0f)
       		canvas.scale(s, s);
         
        final long now = SystemClock.uptimeMillis();
 
        if (mMoviestart == 0) { 
            mMoviestart = now;
        } 
 
        int relTime = 0;
        if (mMovie.duration() > 0) 
        	relTime = (int)((now - mMoviestart) % mMovie.duration());

6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: draw, duration, height, setTime, width
	   long now = android.os.SystemClock.uptimeMillis();
	         if (lStartTime == 0) {
	          lStartTime = now;
	         } 
	         if (gifMovie != null) {
	             int dur = gifMovie.duration();
	             if (dur == 0) {
	                 dur = 1000;
	             } 
	             int relTime = (int)((now - lStartTime) % dur);
	             gifMovie.setTime(relTime);
	             gifMovie.draw(canvas, getWidth() - gifMovie.width(),
	                         getHeight() - gifMovie.height());
	             invalidate();
	         } 
 
	} 
 
 
} 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: draw, duration, height, setTime, width
            long now = android.os.SystemClock.uptimeMillis();
            if (mMovieStart == 0) {
                mMovieStart = now;
            } 
            if (mMovie != null) {
                int dur = mMovie.duration();
                if (dur == 0) {
                    dur = 1000;
                } 
                int relTime = (int)((now - mMovieStart) % dur);
                mMovie.setTime(relTime);
                mMovie.draw(canvas, getWidth() - mMovie.width(), getHeight() - mMovie.height());
                invalidate();
            } 
        } 
    } 
} 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android Movie Questions & Answers:

See Code Examples for Android Movie Methods: