Don't lose cursor position on device rotation
This commit is contained in:
		| @@ -79,10 +79,14 @@ public class EditorView extends EditTextCompat { | |||||||
|         if (this.editor == editor) { |         if (this.editor == editor) { | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|         this.editor = editor; |  | ||||||
|         if (editor != null) { |         if (editor != null) { | ||||||
|  |             // avoid losing cursor position on focus restore. First request focus, then set cursor | ||||||
|  |             // position. Consequent requestFocus() should be no-op | ||||||
|  |             requestFocus(); | ||||||
|             setState(editor.getState()); |             setState(editor.getState()); | ||||||
|         } |         } | ||||||
|  |         // update editor at the end to avoid side-effects of #requestFocus() and #setState() | ||||||
|  |         this.editor = editor; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 serso
					serso