Skip to content

Instantly share code, notes, and snippets.

@lannyf77
lannyf77 / TextViewIconGetter.kt
Created March 26, 2020 19:18
iconImageGetter for TextView
package com.oath.doubleplay.utils
import android.content.res.Resources
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.Drawable
import android.text.Html.ImageGetter
import android.util.Log
import android.widget.TextView
fun testNCPStreamItemParcel(list: List<ParcelableStreamItem>?) {
list?.let {
for ((i, parceableStreamItem) in list.withIndex()) {
Log.i("+++", "+++ org instagram($i): ${parceableStreamItem?.social?.instagram?.data?.id}, ${parceableStreamItem?.social?.instagram?.data?.caption}\n" +
"tweet: ${parceableStreamItem?.social?.twitter?.data?.id}, ${parceableStreamItem?.social?.twitter?.data?.text}")
try {
val parcel = obtain()
parceableStreamItem.writeToParcel(parcel, 0)
parcel.setDataPosition(0)