react-native-readium icon indicating copy to clipboard operation
react-native-readium copied to clipboard

[Feature Request] Footnote popup

Open amalStorilabs opened this issue 10 months ago • 6 comments

Was trying to add some customisations to footnote_popup.xml in android , but was not able to find this inside the test app.

From the readium app the refered file is defined in src/main/res/layout/popup_footnote.xml . Is there anything we can do.

This is the feature i am refering to when clicked on a number link these popup appears.

my react-native-readium version is : "version": "1.2.1"

Image

Please reply if you need anymore details

@jspizziri

amalStorilabs avatar Feb 20 '25 06:02 amalStorilabs

Hello @amalStorilabs , thanks for reaching out.

It would appear that what you're asking for simply is not a feature that is supported yet in react-native-readium. You're welcome to submit a PR or we can have a conversation about sponsoring the feature if it's something you need. Thanks!

jspizziri avatar Feb 20 '25 13:02 jspizziri

Thanks for your reply, @jspizziri I have a small doubt—if this isn't a feature supported by react-native-readium, how does the popup appear when clicking on the links in the book? I've been trying to locate the part of the code that triggers this popup, but so far, I haven't had any luck. Any guidance would be greatly appreciated!

Image

amalStorilabs avatar Feb 20 '25 14:02 amalStorilabs

@amalStorilabs ahh, sorry I didn't realize the screenshots were actually from our lib!

Because we're built ontop of readium, then this must be something that we've just gotten "for free" from the underlying readium libs. I'd have to take a deeper look to be certain.

jspizziri avatar Feb 20 '25 15:02 jspizziri

Oh okay, Would you mind looking into it. In the readium test app for android a UI for footnote is defined here : src/main/res/layout/popup_footnote.xml

` <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/rl_custom_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:background="?attr/colorSurface" android:padding="2dp">

<ImageButton
    android:id="@+id/ib_close"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentEnd="true"
    android:background="@null"
    android:src="@android:drawable/ic_menu_close_clear_cancel"
    android:contentDescription="TODO" />

<TextView
    android:id="@+id/footnote"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    android:padding="25sp" />

</RelativeLayout>`

Link to the repo : https://github.com/readium/kotlin-toolkit/blob/develop/test-app/src/main/res/layout/popup_footnote.xml

i couldn't find something like this in react-native-readium package

amalStorilabs avatar Feb 20 '25 15:02 amalStorilabs

@amalStorilabs this isn't a high priority for me at the moment, but I recommend you keep digging!

jspizziri avatar Feb 20 '25 16:02 jspizziri

By the way in 3.0 there's a new API to customize entirely the footnote pop-up, see https://github.com/readium/kotlin-toolkit/blob/develop/CHANGELOG.md#navigator-8

But I don't think react-native-readium is ready for Readium 3.0 yet.

mickael-menu avatar Feb 20 '25 16:02 mickael-menu