Skip to content

Instantly share code, notes, and snippets.

View amglhit's full-sized avatar

amugulang amglhit

View GitHub Profile
@amglhit
amglhit / AspectRatioImageView.java
Created March 7, 2017 06:20 — 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 {