Skip to content

Instantly share code, notes, and snippets.

@JulienDev
Created January 4, 2014 22:56
Show Gist options
  • Save JulienDev/8261903 to your computer and use it in GitHub Desktop.
Save JulienDev/8261903 to your computer and use it in GitHub Desktop.
package com.jumy.twitterclient.ui.component;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageButton;
import com.jumy.twitterclient.R;
public class ToolbarImageButton extends ImageButton {
private final int mWidth;
private final int mHeight;
public ToolbarImageButton(Context context, AttributeSet attrs) {
super(context, attrs);
mWidth = (int) getResources().getDimension(R.dimen.tweet_toolbar_button_width);
mHeight = (int) getResources().getDimension(R.dimen.tweet_toolbar_button_height);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
setMeasuredDimension(mWidth, mHeight);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment