Skip to content

Commit

Permalink
isInEditMode() checking added
Browse files Browse the repository at this point in the history
  • Loading branch information
koral-- committed Jan 29, 2014
1 parent 659fff0 commit a9fb3d4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/pl/droidsonroids/gif/GifImageButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void setBackgroundResource ( int resId )

void trySetGifDrawable ( AttributeSet attrs, Resources res )
{
if ( attrs != null && res != null )
if ( attrs != null && res != null && !isInEditMode() )
{
int resId = attrs.getAttributeResourceValue( GifImageView.ANDROID_NS, "src", -1 );
if ( resId > 0 && "drawable".equals( res.getResourceTypeName( resId ) ) )
Expand Down
2 changes: 1 addition & 1 deletion src/pl/droidsonroids/gif/GifImageView.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void setBackgroundResource ( int resId )

void trySetGifDrawable ( AttributeSet attrs, Resources res )
{
if ( attrs != null && res != null )
if ( attrs != null && res != null && !isInEditMode() )
{
int resId = attrs.getAttributeResourceValue( ANDROID_NS, "src", -1 );
if ( resId > 0 && "drawable".equals( res.getResourceTypeName( resId ) ) )
Expand Down
2 changes: 1 addition & 1 deletion src/pl/droidsonroids/gif/GifTextView.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private Drawable getGifOrDefaultDrawable ( int resId )
if ( resId == 0 )
return null;
final Resources resources = getResources();
if ( "drawable".equals( resources.getResourceTypeName( resId ) ) )
if ( !isInEditMode() && "drawable".equals( resources.getResourceTypeName( resId ) ) )
try
{
return new GifDrawable( resources, resId );
Expand Down

0 comments on commit a9fb3d4

Please sign in to comment.