使用MuPDF像翻板一样水平翻转



我已经在android中实现了MuPDf,以打开查看搜索以及PDF设置书签等。现在我想要水平翻转的动画效果,即类似于在FlipBoard应用程序中以水平方式使用的效果。

我还需要知道如何突出显示搜索文本。我正在使用Librelio的代码

我已经浏览了链接如:

链路1

请帮忙。

我还需要知道如何突出显示搜索文本

MuPDF:的PageView.java

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);

最新更新