mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-11-04 09:13:00 +00:00 
			
		
		
		
	Fixed search not accepting key input after closing player overlay (#7607)
* Fixed search not accepting key input after closing player overlay * Made comments easier to understand * More comments
This commit is contained in:
		@@ -2208,12 +2208,20 @@ public final class VideoDetailFragment
 | 
				
			|||||||
            mainFragment.setDescendantFocusability(afterDescendants);
 | 
					            mainFragment.setDescendantFocusability(afterDescendants);
 | 
				
			||||||
            toolbar.setDescendantFocusability(afterDescendants);
 | 
					            toolbar.setDescendantFocusability(afterDescendants);
 | 
				
			||||||
            ((ViewGroup) requireView()).setDescendantFocusability(blockDescendants);
 | 
					            ((ViewGroup) requireView()).setDescendantFocusability(blockDescendants);
 | 
				
			||||||
            mainFragment.requestFocus();
 | 
					            // Only focus the mainFragment if the mainFragment (e.g. search-results)
 | 
				
			||||||
 | 
					            // or the toolbar (e.g. Textfield for search) don't have focus.
 | 
				
			||||||
 | 
					            // This was done to fix problems with the keyboard input, see also #7490
 | 
				
			||||||
 | 
					            if (!mainFragment.hasFocus() && !toolbar.hasFocus()) {
 | 
				
			||||||
 | 
					                mainFragment.requestFocus();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            mainFragment.setDescendantFocusability(blockDescendants);
 | 
					            mainFragment.setDescendantFocusability(blockDescendants);
 | 
				
			||||||
            toolbar.setDescendantFocusability(blockDescendants);
 | 
					            toolbar.setDescendantFocusability(blockDescendants);
 | 
				
			||||||
            ((ViewGroup) requireView()).setDescendantFocusability(afterDescendants);
 | 
					            ((ViewGroup) requireView()).setDescendantFocusability(afterDescendants);
 | 
				
			||||||
            binding.detailThumbnailRootLayout.requestFocus();
 | 
					            // Only focus the player if it not already has focus
 | 
				
			||||||
 | 
					            if (!binding.getRoot().hasFocus()) {
 | 
				
			||||||
 | 
					                binding.detailThumbnailRootLayout.requestFocus();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user