-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
PSPDFKit
committed
May 6, 2024
1 parent
dc6971a
commit 34697d8
Showing
55 changed files
with
5,092 additions
and
4,720 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
connection.project.dir=../../../android | ||
arguments=--init-script /var/folders/3v/qy3ssjxs2m7d97yc60nrl2l00000gn/T/d146c9752a26f79b52047fb6dc6ed385d064e120494f96f08ca63a317c41f94c.gradle --init-script /var/folders/3v/qy3ssjxs2m7d97yc60nrl2l00000gn/T/52cde0cfcf3e28b8b7510e992210d9614505e0911af0c190bd590d7158574963.gradle | ||
auto.sync=false | ||
build.scans.enabled=false | ||
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(8.1.1)) | ||
connection.project.dir= | ||
eclipse.preferences.version=1 | ||
gradle.user.home= | ||
java.home=/Library/Java/JavaVirtualMachines/microsoft-17.jdk/Contents/Home | ||
jvm.arguments= | ||
offline.mode=false | ||
override.workspace.settings=true | ||
show.console.view=true | ||
show.executions.view=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
.../src/main/java/com/pspdfkit/react/events/CustomAnnotationContextualMenuItemTappedEvent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.pspdfkit.react.events | ||
|
||
import androidx.annotation.IdRes | ||
import com.facebook.react.bridge.Arguments | ||
import com.facebook.react.uimanager.events.Event | ||
import com.facebook.react.uimanager.events.RCTEventEmitter | ||
|
||
class CustomAnnotationContextualMenuItemTappedEvent: Event<CustomAnnotationContextualMenuItemTappedEvent> { | ||
private var buttonId: String? = null | ||
|
||
constructor(@IdRes viewId: Int, buttonId: String) : super(viewId) { | ||
|
||
this.buttonId = buttonId | ||
} | ||
|
||
override fun getEventName(): String? { | ||
return EVENT_NAME | ||
} | ||
|
||
override fun dispatch(rctEventEmitter: RCTEventEmitter) { | ||
val eventData = Arguments.createMap() | ||
eventData.putString("id", buttonId) | ||
rctEventEmitter.receiveEvent(viewTag, eventName, eventData) | ||
} | ||
|
||
companion object { | ||
@kotlin.jvm.JvmField | ||
var EVENT_NAME = "customAnnotationContextualMenuItemTapped" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
android/src/main/java/com/pspdfkit/react/menu/AnnotationContextualToolbarGroupingRule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.pspdfkit.react.menu; | ||
|
||
import android.content.Context; | ||
import androidx.annotation.NonNull; | ||
|
||
import com.pspdfkit.ui.toolbar.ContextualToolbarMenuItem; | ||
import com.pspdfkit.ui.toolbar.grouping.presets.AnnotationEditingToolbarGroupingRule; | ||
import com.pspdfkit.ui.toolbar.grouping.presets.MenuItem; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
public class AnnotationContextualToolbarGroupingRule extends AnnotationEditingToolbarGroupingRule { | ||
|
||
List<ContextualToolbarMenuItem> menuItems; | ||
|
||
public AnnotationContextualToolbarGroupingRule(@NonNull Context context, @NonNull List menuItems) { | ||
super(context); | ||
this.menuItems = menuItems; | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public List<MenuItem> getGroupPreset(int capacity, int itemsCount) { | ||
List<com.pspdfkit.ui.toolbar.grouping.presets.MenuItem> groupPreset = | ||
new ArrayList<>(super.getGroupPreset(capacity - 1, itemsCount - 1)); | ||
for (ContextualToolbarMenuItem menuItem : menuItems) { | ||
groupPreset.add(new MenuItem(menuItem.getId())); | ||
} | ||
return groupPreset; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
android/src/main/java/com/pspdfkit/react/menu/ContextualToolbarMenuItemConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.pspdfkit.react.menu | ||
|
||
import com.pspdfkit.ui.toolbar.ContextualToolbarMenuItem | ||
import com.pspdfkit.views.ToolbarMenuItemListener | ||
|
||
class ContextualToolbarMenuItemConfig(menuItems: List<ContextualToolbarMenuItem>, retain: Boolean = true, listener: ToolbarMenuItemListener) { | ||
val annotationSelectionMenuItems: List<ContextualToolbarMenuItem> | ||
val retainSuggestedMenuItems: Boolean | ||
val toolbarMenuItemListener: ToolbarMenuItemListener | ||
|
||
init { | ||
annotationSelectionMenuItems = menuItems | ||
retainSuggestedMenuItems = retain | ||
toolbarMenuItemListener = listener | ||
} | ||
} |
Oops, something went wrong.