Created
January 7, 2020 20:40
-
-
Save ZieIony/af890540cba643379307b15f66c7770b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ImageView extends android.widget.ImageView { | |
| public ImageView(Context context) { | |
| super(context, null, R.attr.carbon_imageViewStyle); | |
| initImageView(null, R.attr.carbon_imageViewStyle); | |
| } | |
| public ImageView(Context context, AttributeSet attrs) { | |
| super(context, attrs, R.attr.carbon_imageViewStyle); | |
| initImageView(attrs, R.attr.carbon_imageViewStyle); | |
| } | |
| private void initImageView(AttributeSet attrs, int defStyleAttr) { | |
| TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.ImageView, defStyleAttr, R.style.carbon_ImageView); | |
| setRippleColor(a.getColorStateList(R.styleable.ImageView_carbon_rippleColor)); | |
| setRippleHotspot(a.Boolean(R.styleable.ImageView_carbon_rippleHotspot, false)); | |
| setMenu(a.getResourceId(R.styleable.ImageView_android_menu, 0); | |
| a.recycle(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment