fixed media status size crash
This commit is contained in:
parent
29f9fb9084
commit
89b70936bd
|
@ -40,7 +40,7 @@ subprojects {
|
||||||
ObjectCursor : '0.9.16',
|
ObjectCursor : '0.9.16',
|
||||||
PlayServices : '10.2.0',
|
PlayServices : '10.2.0',
|
||||||
MapsUtils : '0.4.4',
|
MapsUtils : '0.4.4',
|
||||||
Crashlyrics : '2.6.6',
|
Crashlyrics : '2.6.7',
|
||||||
FabricPlugin : '1.22.1',
|
FabricPlugin : '1.22.1',
|
||||||
DropboxCoreSdk : '2.1.2',
|
DropboxCoreSdk : '2.1.2',
|
||||||
GoogleDriveApi : 'v3-rev61-1.22.0',
|
GoogleDriveApi : 'v3-rev61-1.22.0',
|
||||||
|
|
|
@ -43,9 +43,7 @@ class MediaStatusViewHolder(private val adapter: IStatusesAdapter<*>, itemView:
|
||||||
private val mediaImageView = itemView.mediaImage
|
private val mediaImageView = itemView.mediaImage
|
||||||
private val mediaTextView = itemView.mediaText
|
private val mediaTextView = itemView.mediaText
|
||||||
|
|
||||||
private val aspectRatioSource = SimpleAspectRatioSource().apply {
|
private val aspectRatioSource = SimpleAspectRatioSource()
|
||||||
setSize(100, 100)
|
|
||||||
}
|
|
||||||
|
|
||||||
private var listener: IStatusViewHolder.StatusClickListener? = null
|
private var listener: IStatusViewHolder.StatusClickListener? = null
|
||||||
|
|
||||||
|
@ -74,11 +72,7 @@ class MediaStatusViewHolder(private val adapter: IStatusesAdapter<*>, itemView:
|
||||||
mediaTextView.text = status.text_unescaped
|
mediaTextView.text = status.text_unescaped
|
||||||
}
|
}
|
||||||
|
|
||||||
if (firstMedia.width > 0 && firstMedia.height > 0) {
|
aspectRatioSource.setSize(firstMedia.width, firstMedia.height)
|
||||||
aspectRatioSource.setSize(firstMedia.width, firstMedia.height)
|
|
||||||
} else {
|
|
||||||
aspectRatioSource.setSize(100, 100)
|
|
||||||
}
|
|
||||||
mediaImageContainer.tag = firstMedia
|
mediaImageContainer.tag = firstMedia
|
||||||
mediaImageContainer.requestLayout()
|
mediaImageContainer.requestLayout()
|
||||||
|
|
||||||
|
@ -133,10 +127,12 @@ class MediaStatusViewHolder(private val adapter: IStatusesAdapter<*>, itemView:
|
||||||
private var height: Int = 0
|
private var height: Int = 0
|
||||||
|
|
||||||
override fun getWidth(): Int {
|
override fun getWidth(): Int {
|
||||||
|
if (width <= 0 || height <= 0) return 100
|
||||||
return width
|
return width
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getHeight(): Int {
|
override fun getHeight(): Int {
|
||||||
|
if (width <= 0 || height <= 0) return 100
|
||||||
return height
|
return height
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue