Deployed By
Change log 1.1 Refactor name Loader
Gradle
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the dependency
dependencies {
implementation 'com.github.raldeskrisnu:gifloader:1.1'
}
maven
Add the JitPack repository to your build file
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add the dependency
<dependency>
<groupId>com.github.raldeskrisnu</groupId>
<artifactId>gifloader</artifactId>
<version>1.1</version>
</dependency>
Create variable to call the library example
private GifLoader ourGif;
and then set at onCreate in activity or onCreateView in fragment.
ourGif = new ourGif(this);
if you want to show the preloader. you have to call with parameter
ourGif.showPreloader(theme,layout of preloader, imageview of gif, gif drawable);
and then if you want to hide the loader. you just call
ourGif.hidePreloader();
GifLoader test = new GifLoader(context);
test.showPreloader(R.style.Theme_CustomDialog R.layout.content_preloader, R.id.custom_loading_imageView,R.drawable.rocket_preloader);
//if you want to hide preloader
test.hidePreloader();
for the theme use this one.
<style name="Theme.CustomDialog" parent="@android:style/Theme.Translucent.NoTitleBar">
<item name="android:windowFrame">@null</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowTitleStyle">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="android:background">@android:color/transparent</item>
</style>