You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
744 B
24 lines
744 B
package com.keylesspalace.tusky.view
|
|
|
|
import android.content.Context
|
|
import android.support.v7.widget.AppCompatImageView
|
|
import android.util.AttributeSet
|
|
|
|
/**
|
|
* Created by charlag on 26/10/2017.
|
|
*/
|
|
|
|
class SquareImageView : AppCompatImageView {
|
|
constructor(context: Context) : super(context)
|
|
|
|
constructor(context: Context, attributes: AttributeSet) : super(context, attributes)
|
|
|
|
constructor(context: Context, attributes: AttributeSet, defStyleAttr: Int)
|
|
: super(context, attributes, defStyleAttr)
|
|
|
|
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
|
|
super.onMeasure(widthMeasureSpec, heightMeasureSpec)
|
|
val width = measuredWidth
|
|
setMeasuredDimension(width, width)
|
|
}
|
|
} |