Skip to content

Commit

Permalink
Fix annotationMenu not being correctly set (#664)
Browse files Browse the repository at this point in the history
* Fix annotationMenu not being correctly set

* Updating package version

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
ama-pdftron and github-actions[bot] authored Aug 1, 2023
1 parent be84f05 commit 497646b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
import com.pdftron.pdf.model.AnnotStyle;
import com.pdftron.pdf.model.UserBookmarkItem;
import com.pdftron.pdf.tools.AdvancedShapeCreate;
import com.pdftron.pdf.tools.AnnotEditTextMarkup;
import com.pdftron.pdf.tools.AnnotManager;
import com.pdftron.pdf.tools.Eraser;
import com.pdftron.pdf.tools.FreehandCreate;
Expand Down Expand Up @@ -2501,7 +2502,8 @@ public boolean onShowQuickMenu(QuickMenu quickMenu, Annot annot) {

// remove unwanted items
ToolManager.Tool currentTool = getToolManager() != null ? getToolManager().getTool() : null;
if (mAnnotMenuItems != null && !(currentTool instanceof Pan) && !(currentTool instanceof TextSelect)) {
boolean isPanOrTextSelect = (currentTool instanceof Pan || (currentTool instanceof TextSelect && !(currentTool instanceof AnnotEditTextMarkup)));
if (mAnnotMenuItems != null && !isPanOrTextSelect) {
List<QuickMenuItem> removeList = new ArrayList<>();
checkQuickMenu(quickMenu.getFirstRowMenuItems(), mAnnotMenuItems, removeList);
checkQuickMenu(quickMenu.getSecondRowMenuItems(), mAnnotMenuItems, removeList);
Expand All @@ -2512,7 +2514,7 @@ public boolean onShowQuickMenu(QuickMenu quickMenu, Annot annot) {
quickMenu.setDividerVisibility(View.GONE);
}
}
if (mLongPressMenuItems != null && (currentTool instanceof Pan || currentTool instanceof TextSelect)) {
if (mLongPressMenuItems != null && isPanOrTextSelect) {
List<QuickMenuItem> removeList = new ArrayList<>();
checkQuickMenu(quickMenu.getFirstRowMenuItems(), mLongPressMenuItems, removeList);
checkQuickMenu(quickMenu.getSecondRowMenuItems(), mLongPressMenuItems, removeList);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react-native-pdftron",
"title": "React Native Pdftron",
"version": "3.0.3-23",
"version": "3.0.3-24",
"description": "React Native Pdftron",
"main": "./lib/index.js",
"typings": "index.ts",
Expand Down

0 comments on commit 497646b

Please sign in to comment.