Skip to content
This repository has been archived by the owner on Jul 29, 2020. It is now read-only.

Commit

Permalink
Merge pull request #4 from oliveiradev/hot-fix/#3
Browse files Browse the repository at this point in the history
get real activity context
  • Loading branch information
oliveiradev authored Jul 19, 2016
2 parents 096cba3 + 78f11cc commit 469847c
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.Log;
import android.view.ContextThemeWrapper;
import android.widget.ImageButton;

import com.github.oliveiradev.image_zoom.lib.animation.ZoomAnimation;
Expand Down Expand Up @@ -76,8 +78,15 @@ protected void onSizeChanged(int w, int h, int oldw, int oldh) {

@Override
public boolean performClick() {
Activity activity = (Activity) context;
ZoomAnimation.zoom(this,activity);
if (context instanceof ContextThemeWrapper)
performZoom(((ContextThemeWrapper)context).getBaseContext());
else
performZoom(context);
return super.performClick();
}


private void performZoom(Context context){
ZoomAnimation.zoom(this,(Activity) context);
}
}

0 comments on commit 469847c

Please sign in to comment.