recent-images


Source link: https://github.com/amirarcane/recent-images

Recent Images

Do you noticed the new feature of Telegram or Instagram?! They show your latest images when you try to attach or post a picture. So I developed this library the same with lots of customization.

Simple way to get all images of device based on date taken, name, id and other customization.

Watching this repository will allow GitHub to email you whenever I publish a release.


Gradle Dependency

Add this line to your build.gradle project

compile 'com.amirarcane.recent-images:recentimages:2.0.1'

Usage

Just add these lines to your class, that's it.

RecentImages recentImages = new RecentImages();
 ImageAdapter adapter = recentImages.getAdapter(MainActivity.this);

recentImages.getAdapter() method returns an adapter that you can easily set it as your gridView adapter. By default it returns device pictures based on Date_Taken and Descending order, for changing them see Customization

Use recentImages.cleanupCache() to clean the cache. It removes all the callbacks from the drawables stored in the memory cache. This method must be called from the onDestroy() method of any activity using the cached drawables. Failure to do so will result in the entire activity being leaked.

You can use regular gridView but if you want to use it exactly like above picture you need horizontal gridView. I used jess-anders/two-way-gridView in this library. All you have to do is set below code in your xml instead of regular gridView:

<com.jess.ui.TwoWayGridView
  android:id="@+id/gridView"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="#E8E8E8"
  app:columnWidth="70dp"
  app:rowHeight="70dp"
  app:numColumns="auto_fit"
  app:numRows="auto_fit"
  app:verticalSpacing="16dp"
  app:horizontalSpacing="16dp"
  app:gravity="center"/> 

Customization

RecentImages class contains some methods for customization:

getAdapter(Context context) default method to get adapter

getAdapter(Context context, String columns, String sort) parameter columns filters device images base on date, name, id and etc. parameter sort will sort them based on Desecnding or Ascending order

setDrawable(int drawable) to use an image from you drawable folder before loading of images

setHeight(int height) to set images height (in dp)

setWidth(int width) to set images width (in dp)

setPadding(int padding) to set images padding (in dp)

setSize(int size) to set quality of thumbnail images (values are 1, 2, 3, 4. 1 means best quality and high resolution and 4 means least quality an low resolution)

Here is an example:

RecentImages recentImages = new RecentImages();
 ri.setHeight(70);
 ri.setWidth(70);
 ImageAdapter adapter = recentImages.getAdapter(MainActivity.this, ri.LATITUDE, ri.ASCENDING);
 gridView.setAdapter(adapter);

Resources

Common Utils library is developed to reduce efforts to achieve common features of the android apps.

OpenPlayer is an Android library developed by AudioNow Digital, for playing audio in your mobile applications. You can use it for:

  • Music
  • Radio streaming

It delivers support for the following codecs:

  • OPUS
  • VORBIS
  • MP3

A Material Drawer implementation (Like gMail App). Based on MaterialNavigationDrawer

Features:

  • Unlimit Head-Items (Accounts)
  • Every Head-Item can has his own menu
  • Add and remove Head-Items at runtime.
  • Theming
  • Labels
  • Sections at the bottom

A VideoView based on the official Android 4.4.2_r3 sources using a TextureView instead of a SurfaceView.

Just interesting HorizontalScrollView.

This Android library allows to draw z-depth shadows of Material Design specification.

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