This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.graphics.Paint; | |
import android.graphics.Rect; | |
import android.graphics.drawable.Drawable; | |
import android.text.style.ImageSpan; | |
import java.lang.ref.WeakReference; | |
/** | |
* Subclass of ImageSpan that resizes images automatically to fit the container's width, and then | |
* re-calculate the size of the image to let TextView know how much space it needs to display |