forked from bumptech/glide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sabari
committed
May 31, 2018
1 parent
c441d83
commit 7c2ad93
Showing
7 changed files
with
124 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
samples/giphy/src/main/java/com/bumptech/glide/samples/giphy/GifDrawableImageViewTarget.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.bumptech.glide.samples.giphy; | ||
|
||
import android.graphics.drawable.Drawable; | ||
import android.support.annotation.Nullable; | ||
import android.widget.ImageView; | ||
import com.bumptech.glide.load.resource.gif.GifDrawable; | ||
import com.bumptech.glide.request.target.ImageViewTarget; | ||
|
||
/** | ||
* Created by sabari on 30/3/18. | ||
*/ | ||
|
||
public class GifDrawableImageViewTarget extends ImageViewTarget<Drawable> { | ||
|
||
private int mLoopCount = GifDrawable.LOOP_FOREVER; | ||
|
||
GifDrawableImageViewTarget(ImageView view, int loopCount) { | ||
super(view); | ||
mLoopCount = loopCount; | ||
} | ||
|
||
@Override | ||
protected void setResource(@Nullable Drawable resource) { | ||
if (resource instanceof GifDrawable) { | ||
((GifDrawable) resource).setLoopCount(mLoopCount); | ||
} | ||
view.setImageDrawable(resource); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:height="30dp" | ||
android:viewportHeight="30.0" | ||
android:viewportWidth="50.0" | ||
android:width="50dp"> | ||
<path | ||
android:fillAlpha="0.6" | ||
android:fillColor="@android:color/transparent" | ||
android:pathData="M5.846,1L43.15,1C44.487,1 44.972,1.139 45.461,1.401C45.95,1.662 46.333,2.046 46.595,2.535C46.856,3.024 46.996,3.509 46.996,4.846L46.996,24.424C46.996,25.761 46.856,26.246 46.595,26.735C46.333,27.224 45.95,27.608 45.461,27.869C44.972,28.131 44.487,28.27 43.15,28.27L5.846,28.27C4.509,28.27 4.024,28.131 3.535,27.869C3.046,27.608 2.662,27.224 2.401,26.735C2.139,26.246 2,25.761 2,24.424L2,4.846C2,3.509 2.139,3.024 2.401,2.535C2.662,2.046 3.046,1.662 3.535,1.401C4.024,1.139 4.509,1 5.846,1ZM21.942,18.586L21.942,14.675L18.162,14.675L18.162,15.811L20.499,15.811L20.499,18.235C20.333,18.44 20.057,18.623 19.671,18.784C19.285,18.945 18.79,19.026 18.184,19.026C17.325,19.026 16.617,18.719 16.06,18.107C15.504,17.494 15.225,16.714 15.225,15.767L15.225,13.555C15.225,12.617 15.474,11.843 15.972,11.233C16.47,10.623 17.127,10.317 17.943,10.317C18.748,10.317 19.365,10.518 19.792,10.918C20.219,11.318 20.455,11.829 20.499,12.449L21.876,12.449L21.89,12.405C21.876,11.458 21.519,10.684 20.821,10.083C20.123,9.482 19.163,9.182 17.943,9.182C16.717,9.182 15.716,9.59 14.94,10.405C14.163,11.221 13.775,12.275 13.775,13.569L13.775,15.767C13.775,17.061 14.191,18.115 15.024,18.931C15.856,19.746 16.91,20.154 18.184,20.154C19.18,20.154 19.992,19.99 20.62,19.663C21.247,19.336 21.688,18.977 21.942,18.586ZM25.963,20L25.963,9.336L24.512,9.336L24.512,20L25.963,20ZM34.986,15.283L34.986,14.148L30.123,14.148L30.123,10.471L35.733,10.471L35.733,9.336L28.68,9.336L28.68,20L30.123,20L30.123,15.283L34.986,15.283Z" | ||
android:strokeAlpha="0.6" | ||
android:strokeColor="#F5F5F5" | ||
android:strokeWidth="1"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<ImageView | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:id="@+id/fullscreen_gif" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:contentDescription="@string/fullscreen_description" | ||
/> | ||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:id="@+id/gif_panel" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:padding="6dp" | ||
android:gravity="center" | ||
android:orientation="vertical"> | ||
|
||
<ImageView | ||
android:id="@+id/gif_preview" | ||
android:layout_width="200dp" | ||
android:layout_height="200dp" | ||
android:layout_gravity="center"/> | ||
|
||
<ImageButton | ||
android:id="@+id/gif_play" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center" | ||
android:background="@null" | ||
android:visibility="visible"/> | ||
</FrameLayout> |