Anasayfa » Mobil Programlama » Android - Java » Android GifView Player Java
sseniorandroidgelistiricilogoyan

Android GifView Player Java

Android GifView Player Java

Library for playing gifs on Android. Simple android view to display gifs efficiently. You can start, pause and stop gifView. Example usages can be found in example project.

Screen

Usage

Step 1. Add it in your root build.gradle at the end of repositories:

allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

Step 2. Add the dependency

dependencies {
	        implementation 'com.github.harunkor:AndroidGifViewPlayerJava:1.0.1'   
	}

Layout :

 <tr.com.harunkor.gifviewplayer.GifMovieView
        android:id="@+id/gifViewPlayer"
        android:layout_width="400dp"
        android:layout_height="400dp"/>

Code :

      //gif player layout variable.
            GifMovieView gifViewPlayer =(GifMovieView) findViewById(R.id.gifViewPlayer);  
      //gif animation file set  in drawable folder.
            gifViewPlayer.setMovieResource(R.drawable.carkifelek);  
      //gif animation Movie callback and set 
            gifViewPlayer.setMovie(gifViewPlayer.getMovie());  
      // gif animation hide.        
            gifViewPlayer.setVisibility(View.INVISIBLE); 
      // gif animation  visible    
            gifViewPlayer.setVisibility(View.VISIBLE);  
      // gif animation file set  in assets folder.      
            gifViewPlayer.setMovieAssets("colorballprogress.gif"); 
            String path = Environment.getExternalStorageDirectory()+"/Download/danc.gif";
      // gif animation file set in Android device.   
            gifViewPlayer.setMovieFile(path);
      // gif animation (URL stream) show link.   
            gifViewPlayer.setMovieUrl
            ("https://scdn.androidcommunity.com/wp-content/uploads/2014/10/androidify2.gif");

Manifest

Permission : (dependent on use)

  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"></uses-permission>
  <uses-permission android:name="android.permission.INTERNET"></uses-permission>

Necessary :

  <application
        android:hardwareAccelerated="false"
	.....
	....
	........
	...
    </application>

WARNING! : compile sdk version should be 28.

SOURCE CODE – KAYNAK KOD 

 

 

Hakkında harunkor

Diğer Önemli Makale

sseniorandroidgelistiricilogoyan

Android Google Map Örneği – Android Java Google Map Sample

Merhaba Arkadaşlar, bu örnek kodumuzda google harita açmayı ve üzerinde bir takım ayarları yapmayı sağladık. ...

Bir Cevap Yazın

E-posta hesabınız yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir


*

Şu HTML etiketlerini ve özelliklerini kullanabilirsiniz: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>