Preselect the new document textbox on creation

This way it is easier to delete the text
and enter a new one

Change-Id: I98c28ed8782f8546ceca464e0dae6b8a637db198
Reviewed-on: https://gerrit.libreoffice.org/85295
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
This commit is contained in:
mert 2019-12-17 11:38:28 +00:00 committed by Michael Meeks
parent 8e8f081e48
commit 638b2c7eda

View file

@ -28,7 +28,6 @@ import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.text.Editable;
@ -47,6 +46,7 @@ import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.OvershootInterpolator;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
@ -593,6 +593,10 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings
// file name input
final EditText input = (EditText)view.findViewById(R.id.fileName);
input.setText(defaultFileName);
input.setSelection(0, input.getText().toString().lastIndexOf('.'));
input.requestFocus();
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);
// warning text to notify the user that such a file already exists
final TextView warningText = (TextView)view.findViewById(R.id.overwriteWarning);