Android Open Source - AndroidRapidGsonParsing Height Matches Width Image View






From Project

Back to project page AndroidRapidGsonParsing.

License

The source code is released under:

Apache License

If you think the Android project AndroidRapidGsonParsing listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.wdonahue.rapidparsing.views;
//www. j  a  v a 2 s  . co m
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;

public class HeightMatchesWidthImageView extends ImageView {
  public HeightMatchesWidthImageView(final Context context) {
    super(context);
  }

  public HeightMatchesWidthImageView(final Context context,
      final AttributeSet attrs) {
    super(context, attrs);
  }

  public HeightMatchesWidthImageView(final Context context,
      final AttributeSet attrs, final int defStyle) {
    super(context, attrs, defStyle);
  }

  @Override
  protected void onMeasure(final int widthMeasureSpec,
      final int heightMeasureSpec) {
    int width = getDefaultSize(getSuggestedMinimumWidth(), widthMeasureSpec);
    setMeasuredDimension(width, width);
  }

  @Override
  protected void onSizeChanged(final int w, final int h, final int oldw,
      final int oldh) {
    super.onSizeChanged(w, w, oldw, oldh);
  }
}




Java Source Code List

com.wdonahue.rapidparsing.MainActivity.java
com.wdonahue.rapidparsing.adapters.JustinTvStreamAdapter.java
com.wdonahue.rapidparsing.model.JustinTvChannel.java
com.wdonahue.rapidparsing.model.JustinTvStreamData.java
com.wdonahue.rapidparsing.utils.Web.java
com.wdonahue.rapidparsing.views.HeightMatchesWidthImageView.java