chinwag-android/app/src/main/java/com/keylesspalace/tusky/view/SquareImageView.kt
Konrad Pozniak a445c12094
Upgrade to AndroidX, move to MaterialComponents theme (#953)
* upgrade to AndroidX, upgrade libraries

* move to MaterialComponents theme

* make sure the compose button looks good everywhere

* fix tollbar title/button alignment on tablet

* move to new material color theming, consolidate colors and themes

* fix build, fix imports

* set error on TextInputLayout instead of EditText

* fix imports, TootButton when

* improve snackbar style

* fix task description color
2018-12-17 15:25:35 +01:00

24 lines
744 B
Kotlin

package com.keylesspalace.tusky.view
import android.content.Context
import androidx.appcompat.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)
}
}