Added the ability to set a url on LottieAnimationView

Fixes #888
diff --git a/LottieSample/src/main/res/layout/activity_bullseye.xml b/LottieSample/src/main/res/layout/activity_bullseye.xml
index 331b01b..fb3d062 100644
--- a/LottieSample/src/main/res/layout/activity_bullseye.xml
+++ b/LottieSample/src/main/res/layout/activity_bullseye.xml
@@ -9,7 +9,7 @@
         android:id="@+id/animationView"
         android:layout_width="256dp"
         android:layout_height="256dp"
-        app:lottie_rawRes="@raw/bullseye"
+        app:lottie_url="https://raw.githubusercontent.com/airbnb/lottie-android/master/LottieSample/src/main/res/raw/bullseye.json"
         app:lottie_autoPlay="true"
         app:lottie_loop="true"
         android:layout_gravity="center"/>
diff --git a/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java b/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java
index 5115f03..13a2093 100644
--- a/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java
+++ b/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java
@@ -114,6 +114,7 @@
     if (!isInEditMode()) {
       boolean hasRawRes = ta.hasValue(R.styleable.LottieAnimationView_lottie_rawRes);
       boolean hasFileName = ta.hasValue(R.styleable.LottieAnimationView_lottie_fileName);
+      boolean hasUrl = ta.hasValue(R.styleable.LottieAnimationView_lottie_url);
       if (hasRawRes && hasFileName) {
         throw new IllegalArgumentException("lottie_rawRes and lottie_fileName cannot be used at " +
             "the same time. Please use use only one at once.");
@@ -127,6 +128,11 @@
         if (fileName != null) {
           setAnimation(fileName);
         }
+      } else if (hasUrl) {
+        String url = ta.getString(R.styleable.LottieAnimationView_lottie_url);
+        if (url != null) {
+          setAnimationFromUrl(url);
+        }
       }
     }
     if (ta.getBoolean(R.styleable.LottieAnimationView_lottie_autoPlay, false)) {
@@ -446,6 +452,22 @@
         .addFailureListener(failureListener);
   }
 
+  /**
+   * Load a lottie animation from a url. The url can be a json file or a zip file. Use a zip file if you have images. Simply zip them togethre and lottie
+   * will unzip and link the images automatically.
+   *
+   * Under the hood, Lottie uses Java HttpURLConnection because it doesn't require any transitive networking dependencies. It will download the file
+   * to the application cache under a temporary name. If the file successfully parses to a composition, it will rename the temporary file to one that
+   * can be accessed immediately for subsequent requests. If the file does not parse to a composition, the temporary file will be deleted.
+   */
+  public void setAnimationFromUrl(String url) {
+    clearComposition();
+    cancelLoaderTask();
+    compositionTask = LottieCompositionFactory.fromUrl(getContext(), url)
+        .addListener(loadedListener)
+        .addFailureListener(failureListener);
+  }
+
   private void cancelLoaderTask() {
     if (compositionTask != null) {
       compositionTask.removeListener(loadedListener);
diff --git a/lottie/src/main/res/values/attrs.xml b/lottie/src/main/res/values/attrs.xml
index c38fc3e..b4f431a 100644
--- a/lottie/src/main/res/values/attrs.xml
+++ b/lottie/src/main/res/values/attrs.xml
@@ -3,6 +3,7 @@
     <declare-styleable name="LottieAnimationView">
         <attr name="lottie_fileName" format="string" />
         <attr name="lottie_rawRes" format="reference" />
+        <attr name="lottie_url" format="string" />
         <attr name="lottie_autoPlay" format="boolean" />
         <attr name="lottie_loop" format="boolean" />
         <attr name="lottie_repeatMode" format="enum">