2017-11-06 08:32:36 +11:00
|
|
|
package com.keylesspalace.tusky.view
|
|
|
|
|
|
|
|
import android.content.Context
|
2017-11-08 01:31:44 +11:00
|
|
|
import android.support.v7.widget.AppCompatImageView
|
2017-11-06 08:32:36 +11:00
|
|
|
import android.util.AttributeSet
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Created by charlag on 26/10/2017.
|
|
|
|
*/
|
|
|
|
|
2017-11-08 01:31:44 +11:00
|
|
|
class SquareImageView : AppCompatImageView {
|
2017-11-06 08:32:36 +11:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|