Flip horizontally, like flip bor with MuPDF

I implemented MuPDf in android in open , view , search , bookmark settings , etc. for pdf . Now I want the horizontal flip animation effect, for example, to be similar to using the horizontal FlipBoard application.

I also need to know how I can highlight search text. I am using Librelio code

I went through the Like links:

Link 1

Please, help.

+4
source share
1 answer
 I also need to know that how can i highlight the Search Text. 

PageView.java from MuPDF:

private static final int HIGHLIGHT_COLOR = 0x802572AC; //adjust the color

...//some code of PageView.java

public void setPage(int page, PointF size) {

 ...//code of PageView.setPage(int page, PointF size)

 // this is the part where the hightlighting happens
 if (!mIsBlank && mSearchBoxes != null) {
   paint.setColor(HIGHLIGHT_COLOR);
   for (RectF rect : mSearchBoxes)
   canvas.drawRect(rect.left*scale, rect.top*scale,
   rect.right*scale, rect.bottom*scale, paint);

   // you can customize it, e.g. 
   // int margin = 5
   //canvas.drawRect((rect.left - margin) * scale, (rect.top - margin) * scale,
   //(rect.right + margin) * scale, (rect.bottom + margin) * scale, paint);
 }
}

, :

new SearchTask(context, mupdfCore).go("searchText", 1, 0, -1);
0

Source: https://habr.com/ru/post/1537467/


All Articles