Skip to content

Instantly share code, notes, and snippets.

View veresvit's full-sized avatar

Vit Veres veresvit

View GitHub Profile
@veresvit
veresvit / AspectRatioImageView.java
Created January 8, 2016 10:05 — forked from JakeWharton/AspectRatioImageView.java
ImageView that respects an aspect ratio applied to a specific measurement.
// Copyright 2012 Square, Inc.
package com.squareup.widgets;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.widget.ImageView;
/** Maintains an aspect ratio based on either width or height. Disabled by default. */
public class AspectRatioImageView extends ImageView {