mirror of
				https://codeberg.org/tom79/Fedilab.git
				synced 2025-10-20 11:20:16 +03:00 
			
		
		
		
	Fix a crash when forwarding tags
This commit is contained in:
		
							parent
							
								
									3858220937
								
							
						
					
					
						commit
						88da62b8e8
					
				
					 1 changed files with 9 additions and 7 deletions
				
			
		|  | @ -1646,14 +1646,16 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder | ||||||
|                 } |                 } | ||||||
|             } else if (forwardTag && position > 0 && statusDraft.text != null && statusDraft.text.contains("#") && !statusList.get(position).tagAdded) { |             } else if (forwardTag && position > 0 && statusDraft.text != null && statusDraft.text.contains("#") && !statusList.get(position).tagAdded) { | ||||||
|                 Status status = statusList.get(position - 1).reblog == null ? statusList.get(position - 1) : statusList.get(position - 1).reblog; |                 Status status = statusList.get(position - 1).reblog == null ? statusList.get(position - 1) : statusList.get(position - 1).reblog; | ||||||
|                 statusList.get(position).tagAdded = true; |                 if (status.tags != null && status.tags.size() > 0) { | ||||||
|                 int lenght = 0; |                     statusList.get(position).tagAdded = true; | ||||||
|                 for (Tag tag : status.tags) { |                     int lenght = 0; | ||||||
|                     lenght += ("#" + tag.name + " ").length(); |                     for (Tag tag : status.tags) { | ||||||
|  |                         lenght += ("#" + tag.name + " ").length(); | ||||||
|  |                     } | ||||||
|  |                     statusDraft.cursorPosition = statusDraft.text.length() - lenght - 3; | ||||||
|  |                     statusDraft.setCursorToEnd = false; | ||||||
|  |                     holder.binding.content.setSelection(statusDraft.text.length() - lenght - 3); | ||||||
|                 } |                 } | ||||||
|                 statusDraft.cursorPosition = statusDraft.text.length() - lenght - 3; |  | ||||||
|                 statusDraft.setCursorToEnd = false; |  | ||||||
|                 holder.binding.content.setSelection(statusDraft.text.length() - lenght - 3); |  | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             if (statusDraft.spoiler_text != null) { |             if (statusDraft.spoiler_text != null) { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue