| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -8,7 +8,7 @@ data class SearchResult( | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    val resultCountWithinChapter: Int = 0, | 
					 | 
					 | 
					 | 
					    val resultCountWithinChapter: Int = 0, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    val resultText: String = "", | 
					 | 
					 | 
					 | 
					    val resultText: String = "", | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    val chapterTitle: String = "", | 
					 | 
					 | 
					 | 
					    val chapterTitle: String = "", | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    val query: String, | 
					 | 
					 | 
					 | 
					    val query: String = "", | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    val pageSize: Int = 0, | 
					 | 
					 | 
					 | 
					    val pageSize: Int = 0, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    val chapterIndex: Int = 0, | 
					 | 
					 | 
					 | 
					    val chapterIndex: Int = 0, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    val pageIndex: Int = 0, | 
					 | 
					 | 
					 | 
					    val pageIndex: Int = 0, | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -17,14 +17,18 @@ data class SearchResult( | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					) { | 
					 | 
					 | 
					 | 
					) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    fun getHtmlCompat(textColor: String, accentColor: String): Spanned { | 
					 | 
					 | 
					 | 
					    fun getHtmlCompat(textColor: String, accentColor: String): Spanned { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        val queryIndexInSurrounding = resultText.indexOf(query) | 
					 | 
					 | 
					 | 
					        if (!query.isBlank()) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        val leftString = resultText.substring(0, queryIndexInSurrounding) | 
					 | 
					 | 
					 | 
					            val queryIndexInSurrounding = resultText.indexOf(query) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        val rightString = resultText.substring(queryIndexInSurrounding + query.length, resultText.length) | 
					 | 
					 | 
					 | 
					            val leftString = resultText.substring(0, queryIndexInSurrounding) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        val html = leftString.colorTextForHtml(textColor) + | 
					 | 
					 | 
					 | 
					            val rightString = resultText.substring(queryIndexInSurrounding + query.length, resultText.length) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                query.colorTextForHtml(accentColor) + | 
					 | 
					 | 
					 | 
					            val html = leftString.colorTextForHtml(textColor) + | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                rightString.colorTextForHtml(textColor) + | 
					 | 
					 | 
					 | 
					                    query.colorTextForHtml(accentColor) + | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                chapterTitle.colorTextForHtml(accentColor) | 
					 | 
					 | 
					 | 
					                    rightString.colorTextForHtml(textColor) + | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        return HtmlCompat.fromHtml(html, HtmlCompat.FROM_HTML_MODE_LEGACY) | 
					 | 
					 | 
					 | 
					                    chapterTitle.colorTextForHtml(accentColor) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            return HtmlCompat.fromHtml(html, HtmlCompat.FROM_HTML_MODE_LEGACY) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        } else { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                return HtmlCompat.fromHtml(resultText.colorTextForHtml(textColor), HtmlCompat.FROM_HTML_MODE_LEGACY) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private fun String.colorTextForHtml(textColor: String) = "<font color=#${textColor}>$this</font>" | 
					 | 
					 | 
					 | 
					    private fun String.colorTextForHtml(textColor: String) = "<font color=#${textColor}>$this</font>" | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |