chinwag-android/app/src/main/java/com/keylesspalace/tusky/components/account/media/SquareImageView.kt
Konrad Pozniak c8fc2418b8
AccountMediaFragment improvements (#2684)
* initial setup

* add spacing between images

* use blurhash

* handle hidden state and show video indicator

* handle item clicks

* small cleanup

* move SquareImageView into account.media package

* fix build

* improve AccountMediaGridAdapter

* handle loadstate, errors and refreshing

* remove commented out code

* log error

* show audio attachments with icon

* fix glitchy transition animation

* set image Description on imageview

* show toast with media description on long press
2022-09-02 16:52:47 +02:00

25 lines
761 B
Kotlin

package com.keylesspalace.tusky.components.account.media
import android.content.Context
import android.util.AttributeSet
import androidx.appcompat.widget.AppCompatImageView
/**
* 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)
}
}