GIF View


Source link: https://github.com/Gavras/GIFView

GIFView

GIFView is a library for showing GIFs in applications.

Setup

In your project's build.gradle file:

allprojects {

  repositories {

...

maven {

  url "https://jitpack.io"

}

...
  
}
 
}
 

In your Application's or Module's build.gradle file:

dependencies {

  ...
  compile 'com.github.Gavras:GIFView:v1.1'
  ... 
}
 

XML Attributes:

starting_on_init: A boolean that represents if the view starts the gif when its initialization finishes or not. Default is true.

on_click_start_or_pause: If sets to true, every click toggles the state of the gif. If the gif is showing stops the gif, and if the gif is not showing starts it. If sets to false clicking the gif does nothing. Default is false.

delay_in_millis: A positive integer that represents how many milliseconds should pass between every calculation of the next frame to be set. Default is 33.

gif_src: A string that represents the gif's source.

  • If you want to get the gif from a url concatenate the string "url:" with the full url.

  • if you want to get the gif from the assets directory concatenate the string "asset:" with the full path of the gif within the assets directory. You can exclude the .gif extension.

for example if you have a gif in the path "assets/ex_dir/ex_gif.gif" the string should be: "asset:ex_dir/ex_gif"

Code Example

From XML:

<com.whygraphics.gifview.gif.GIFView xmlns:gif_view="http://schemas.android.com/apk/res-auto"

android:id="@+id/main_activity_gif_vie"

android:layout_width="200dp"

android:layout_height="200dp"

android:scaleType="center"

gif_view:gif_src="url:http://pop.h-cdn.co/assets/16/33/480x264/gallery-1471381857-gif-season-2.gif" />

In the activity:

GIFView mGifView = (GIFView) findViewById(R.id.main_activity_gif_vie);

 mGifView.setOnSettingGifListener(new GIFView.OnSettingGifListener() {

 @Override

 public void onSuccess(GIFView view, Exception e) {

  Toast.makeText(MainActivity.this, "onSuccess()", Toast.LENGTH_SHORT).show();

 
}

  @Override

 public void onFailure(GIFView view, Exception e) {

  
}
 
}
);

Setting the gif programmatically:

mGifView.setGifResource("asset:gif1");

Resources

advanced-textview is a companion app for Advanced Android TextView talk, demonstrating:

  • Animated CompoundDrawable
  • Text shadow
  • Custom font
  • Gradient text
  • Patterned text
  • HTML.fromHtml()
  • setFontFeatureSettings()
  • Styled string
  • AlignmentSpan
  • ClickableSpan
  • Rainbow span, animated
  • Lined paper
  • Emoji

Views and Drawable for animated GIFs in Android.

Bundled GIFLib via JNI is used to render frames. This way should be more efficient than WebView or Movie classes.
Animation starts automatically and run only if View with attached GifDrawable is visible.

Gradle plugin for Android which lets you use Java generics in your XML layouts.

droidicon provides over 1600 customizable icons, 25 ready-made social badges and more! droidicon makes it super easy to add icons and badges to your app. All of the social badges are already styled.

Just add them to your app! Or you can customize the icons however you want.

Helpstack provides mobile in-app support for your app users.

With HelpStack, you can:

  • Let users report issues within your app
  • Let users attach screenshots to their support requests
  • Receive Device and App Information automatically, along with the reported issue
  • Let users view your responses to their issues
  • Provide self-support by showing FAQ articles
  • Customise your HelpStack screen to blend with your app theme
  • Integrates with Zendesk, Desk.com and HappyFox. Even works with email if you don't have a help desk account.

Android Studio / Eclipse ADT template for including icon resources from Material Design icons by Google in your project.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes