Code Monkey home page Code Monkey logo

Comments (9)

eschao avatar eschao commented on June 15, 2024

@acuna-pro No, you can't use TextView on it since pageflip only accepts a bitmap as a screen content to show. I'm not sure why you need that. Suppose you want to implement a pageflip animation when swap two views. I think android animation library should be responsible for it, but unfortunately, pageflip doesn't support android animation layer.

from android-pageflip.

acuna-public avatar acuna-public commented on June 15, 2024

Because I'm looking for the way to implement the text hightlight in books (e. g. like in learning manuals and synopsis). Any known bookreaders like MoonReader, eReader, etc have similar page flips, but with normal text which can be highlighted. Seems that they've found the way to implement it, and not so known readers are too, so seems that it's really, but don't know how...

from android-pageflip.

eschao avatar eschao commented on June 15, 2024

@acuna-pro Firstly, you need to understand the principle of the PageFlip lib. It is just aimed to implement a 3D style flipping effect with OpenGL. This is only what it is responsible for. Except that, all the functions what you need should be implemented by yourself or other 3rd library.
Given that your requirement, I think you can follow the below steps to reach:

  1. Draw normal text of one page on a bitmap, pass the bitmap to PageFlip to show.
  2. Intercept gesture before PageFlip handle them to turn page. For example: long click a word. you need to recognize the long click action and find out which word is chosen by (x, y) coordinate.
  3. Redraw the selected word with highlight style on a bitmap, normally, you need to redraw the whole page with the different style for choosing word. and then pass it to PageFlip to show it on screen.

As you see in the above steps, you have to be responsible for drawing text with different style. The PageFlip only help you to show a prepared bitmap on screen and play a flip animation when trigger a page turning.
Hope my answer can help address your problem.

from android-pageflip.

mahdimzf2015 avatar mahdimzf2015 commented on June 15, 2024

I want to write text in every page. please guide how I put to each page the text

from android-pageflip.

acuna-public avatar acuna-public commented on June 15, 2024

@eschao Wow, thanks a lot for your adviсes. Seems that I need to implement it by myself... But I still can't believe that all not most known readers have this implemented yet but there's no any open-source libraries for this...

from android-pageflip.

mahdimzf2015 avatar mahdimzf2015 commented on June 15, 2024

please help me.I want to write text in every page. please guide how I put to each page the text

from android-pageflip.

acuna-public avatar acuna-public commented on June 15, 2024

@mahdimzf2015 What is your problem? You can find the "First page" text in the code and edit it for your purposes, but it will be an image only, but with text.

from android-pageflip.

eschao avatar eschao commented on June 15, 2024

@acuna-pro I created a reader application on Android before(not open source project), that's why I know this responsibility is not in PageFlip's scope and that is also why I created PageFlip library. :)

from android-pageflip.

acuna-public avatar acuna-public commented on June 15, 2024

Ah, wait, I don't understand you) You've created a reader which is supported the plain text, but created a PageFlip in open-source which do not? Can't imagine where it can be useful to use images instead of plain text) But after that, I have some thoughts about its implementation (but now I making another project), but how do you think, can I put it to open-source afterwards? There's some... some... ethic moment in this all :/ Thanks.

from android-pageflip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.