diff options
author | Mert Tumer <merttumer@outlook.com> | 2018-08-03 07:20:14 -0700 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-08-07 14:28:20 +0200 |
commit | e4c9d68b23a9a58ee040bf748bb3d492350b0ee0 (patch) | |
tree | d1949cbf80d387c50de51ce993610e50d8fbe253 /android | |
parent | 27326e0f587c20d8dcf1595829233de1bd3fbe9e (diff) |
Fix floating action button disappears after closing a document
Change-Id: I6afc278908d2afadbf531010ab7e466b9224b9af
Signed-off-by: Mert Tumer <merttumer@outlook.com>
Reviewed-on: https://gerrit.libreoffice.org/58564
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'android')
-rw-r--r-- | android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java index e8809973777f..fd1e2a217b14 100644 --- a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java +++ b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java @@ -166,15 +166,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED); registerReceiver(mUSBReceiver, filter); // init UI and populate with contents from the provider - if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { - Log.i(LOGTAG, "no permission to read external storage - asking for permission"); - ActivityCompat.requestPermissions(this, - new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, - PERMISSION_READ_EXTERNAL_STORAGE); - } else { - switchToDocumentProvider(documentProviderFactory.getDefaultProvider()); - setEditFABVisibility(View.VISIBLE); - } + createUI(); fabOpenAnimation = AnimationUtils.loadAnimation(this, R.anim.fab_open); @@ -946,6 +938,15 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings @Override protected void onStart() { super.onStart(); + if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { + Log.i(LOGTAG, "no permission to read external storage - asking for permission"); + ActivityCompat.requestPermissions(this, + new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, + PERMISSION_READ_EXTERNAL_STORAGE); + } else { + switchToDocumentProvider(documentProviderFactory.getDefaultProvider()); + setEditFABVisibility(View.VISIBLE); + } Log.d(LOGTAG, "onStart"); } |