diff options
Diffstat (limited to 'android')
3 files changed, 3 insertions, 14 deletions
diff --git a/android/source/src/java/org/libreoffice/FormattingController.java b/android/source/src/java/org/libreoffice/FormattingController.java index a729e357bfe9..9259b2ea6cae 100644 --- a/android/source/src/java/org/libreoffice/FormattingController.java +++ b/android/source/src/java/org/libreoffice/FormattingController.java @@ -421,15 +421,14 @@ class FormattingController implements View.OnClickListener { void handleActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == TAKE_PHOTO && resultCode == Activity.RESULT_OK) { - mContext.pendingInsertGraphic = true; + compressAndInsertImage(); } else if (requestCode == SELECT_PHOTO && resultCode == Activity.RESULT_OK) { getFileFromURI(data.getData()); - mContext.pendingInsertGraphic = true; + compressAndInsertImage(); } } - // Called by LOKitTileProvider when activity is resumed from photo/gallery/camera/cloud apps - void popCompressImageGradeSelection() { + void compressAndInsertImage() { AlertDialog.Builder builder = new AlertDialog.Builder(mContext); String[] options = {mContext.getResources().getString(R.string.compress_photo_smallest_size), mContext.getResources().getString(R.string.compress_photo_medium_size), @@ -493,7 +492,6 @@ class FormattingController implements View.OnClickListener { LOKitShell.sendEvent(new LOEvent(LOEvent.UNO_COMMAND, ".uno:InsertGraphic", rootJson.toString())); LOKitShell.sendEvent(new LOEvent(LOEvent.REFRESH)); mContext.setDocumentChanged(true); - mContext.pendingInsertGraphic = false; } private void compressImage(int grade) { diff --git a/android/source/src/java/org/libreoffice/LOKitTileProvider.java b/android/source/src/java/org/libreoffice/LOKitTileProvider.java index 1c04fbe5a43a..579162931d3a 100644 --- a/android/source/src/java/org/libreoffice/LOKitTileProvider.java +++ b/android/source/src/java/org/libreoffice/LOKitTileProvider.java @@ -160,14 +160,6 @@ class LOKitTileProvider implements TileProvider { mContext.getDocumentPartViewListAdapter().notifyDataSetChanged(); } }); - mContext.runOnUiThread(new Runnable() { - @Override - public void run() { - if (mContext.pendingInsertGraphic) { - mContext.getFormattingController().popCompressImageGradeSelection(); - } - } - }); } public void addPart(){ diff --git a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java index 3927cc744eb4..5ce176716d66 100644 --- a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java +++ b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java @@ -101,7 +101,6 @@ public class LibreOfficeMainActivity extends AppCompatActivity implements Settin private String mPassword; private boolean mPasswordProtected; private boolean mbSkipNextRefresh; - public boolean pendingInsertGraphic; // boolean indicating a pending insert graphic action, used in LOKitTileProvider.postLoad() public GeckoLayerClient getLayerClient() { return mLayerClient; |