DownloadProgress


Source link: http://ayz4sci.github.io/DownloadProgress

DownloadProgress

An android view showing a download progressBar, total size, downloadedSize, percentage downloaded and a cancel button of the android DownloadManager with just few lines of code. Just like Google Play downloading...

Version

1.0.1

Usage

To use this library in your android project, just simply add the following repositories and dependency into your build.gradle

repositories {

  maven {

url 'https://dl.bintray.com/ayz4sci/maven/'
  
}
 
}
  dependencies {

  compile 'com.ayz4sci.androidfactory:downloadprogress:1.0.2' 
}

Then place com.ayz4sci.androidfactory.DownloadProgressView wherever you want the downloadprogressview to show, for example:

 <com.ayz4sci.androidfactory.DownloadProgressView
  android:id="@+id/downloadProgressView"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:layout_marginBottom="10dp"
  android:layout_marginTop="10dp"
  android:orientation="horizontal" />

You could get a DownloadProgressView instance through findViewById method.

DownloadProgressView downloadProgressView = (DownloadProgressView) rootView.findViewById(R.id.downloadProgressView);

To show the downloadprogressview, call show method and pass the downloadID that you got from DownloadManager when you started the download and also set DownloadStatusListener to know when download is successful, failed or cancelled eg.

DownloadManager downloadManager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
 DownloadManager.Request request = new DownloadManager.Request(Uri.parse("YOUR_DOWNLOAD_URL"));
 request.setTitle("TITLE");
 request.setDescription("DESCRIPTION");
 request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
 request.setDestinationInExternalFilesDir(getApplicationContext(), null, "DOWNLOAD_FILE_NAME.mp4");
 request.allowScanningByMediaScanner();
 downloadID = downloadManager.enqueue(request);
  downloadProgressView.show(downloadID, new DownloadProgressView.DownloadStatusListener() {

@Override
public void downloadFailed(int reason) {

//Action to perform when download fails, reason as returned by DownloadManager.COLUMN_REASON

}

 @Override
public void downloadSuccessful() {

  //Action to perform on success

}

 @Override
public void downloadCancelled() {

  //Action to perform when user press the cancel button

}
 
}
);

That's all. DownloadProgressView will handle the rest!

Change Logs

v1.0.1

Initial version

License

Apache 2.0

Resources

This is simple watchface constructor demo. It offers customization of the following features:

  • Background colors and images
  • Watch hands
  • Placement of watch hands
  • Ambient mode

An interesting EditText with pretty animation.

React Native enables you to build world-class application experiences on native platforms using a consistent developer experience based on JavaScript and React. The focus of React Native is on developer efficiency across all the platforms you care about - learn once, write anywhere. Facebook uses React Native in multiple production apps and will continue investing in React Native.

AnimatedVectorMorphingTool is a command line tool which generates, for you, all the files needed to animate your VectorDrawable. You just drop your VectorDrawables and it generates all the files needed for your android project in a res folder. You just have to copy paste this folder into your own project and run your application.

Rich Text Editor for Android.

A powerful Recyclerview wrapper for working with Realm as your datastore. It supports the following features out of the box:

  • Custom adapter that automatically refreshes the list when the realm changes and animates the new items in.
  • Empty state
  • Pull-to-refresh
  • Infinite scrolling
  • Section headers

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