A cheap attempt at a native Bluesky client for Android

Fix: Render text after last annotation

When rendering annotated text, the portion of the text that came after the final annotation was being dropped.

This is fixed by adding a check to see if the current facet is the last one in the list. If it is, the remaining text from the end of the facet to the end of the content is appended.

+16 -1
+16 -1
app/src/main/java/industries/geesawra/monarch/datalayer/Models.kt
··· 352 352 353 353 var lastIdx: Long = 0 354 354 val content = mutableListOf<AnnotatedData>() 355 - this.facets.forEach { f -> 355 + this.facets.forEachIndexed { idx, f -> 356 356 content.add( 357 357 AnnotatedData.NoAnnotation( 358 358 c.slice( ··· 369 369 ).toByteArray().toString(Charsets.UTF_8) 370 370 ) 371 371 ) 372 + 372 373 lastIdx = f.index.byteEnd 374 + 375 + if (this.facets.lastIndex == idx) { 376 + content.add( 377 + AnnotatedData.NoAnnotation( 378 + c.slice( 379 + lastIdx.toInt()..c.size - 1 380 + ).toByteArray().toString(Charsets.UTF_8) 381 + ) 382 + ) 383 + } 373 384 } 385 + 386 + 387 + 388 + 374 389 375 390 return buildAnnotatedString { 376 391 content.forEach { content ->