mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-30 21:30:04 +00:00 
			
		
		
		
	android: Close soft keyboard on panel close in cheats activity (#6234)
This prevents the keyboard from being stuck in an open state if the user slides the panel while focused on a text box. Now it closes gracefully. Co-authored-by: Charles Lombardo <clombardo169@gmail.com>
This commit is contained in:
		
							parent
							
								
									b588d6181b
								
							
						
					
					
						commit
						f18437e59f
					
				
					 1 changed files with 9 additions and 0 deletions
				
			
		|  | @ -1,6 +1,8 @@ | ||||||
| package org.citra.citra_emu.ui; | package org.citra.citra_emu.ui; | ||||||
| 
 | 
 | ||||||
|  | import android.content.Context; | ||||||
| import android.view.View; | import android.view.View; | ||||||
|  | import android.view.inputmethod.InputMethodManager; | ||||||
| 
 | 
 | ||||||
| import androidx.activity.OnBackPressedCallback; | import androidx.activity.OnBackPressedCallback; | ||||||
| import androidx.annotation.NonNull; | import androidx.annotation.NonNull; | ||||||
|  | @ -32,6 +34,13 @@ public class TwoPaneOnBackPressedCallback extends OnBackPressedCallback | ||||||
| 
 | 
 | ||||||
|     @Override |     @Override | ||||||
|     public void onPanelClosed(@NonNull View panel) { |     public void onPanelClosed(@NonNull View panel) { | ||||||
|  |         closeKeyboard(); | ||||||
|         setEnabled(false); |         setEnabled(false); | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  |     private void closeKeyboard() { | ||||||
|  |         InputMethodManager manager = (InputMethodManager) mSlidingPaneLayout.getContext() | ||||||
|  |                 .getSystemService(Context.INPUT_METHOD_SERVICE); | ||||||
|  |         manager.hideSoftInputFromWindow(mSlidingPaneLayout.getRootView().getWindowToken(), 0); | ||||||
|  |     } | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue