|
@@ -17,6 +17,7 @@ import android.widget.RelativeLayout;
|
|
|
import com.compdfkit.core.edit.CPDFEditManager;
|
|
|
import com.compdfkit.core.edit.OnEditStatusChangeListener;
|
|
|
import com.compdfkit.tools.R;
|
|
|
+import com.compdfkit.tools.common.utils.threadpools.CThreadPoolUtils;
|
|
|
import com.compdfkit.tools.common.utils.viewutils.CViewUtils;
|
|
|
import com.compdfkit.tools.common.views.pdfview.CPDFViewCtrl;
|
|
|
import com.compdfkit.ui.contextmenu.IContextMenuShowListener;
|
|
@@ -164,20 +165,22 @@ public class CEditToolbar extends RelativeLayout implements View.OnClickListener
|
|
|
editManager.addEditStatusChangeListener(new OnEditStatusChangeListener() {
|
|
|
@Override
|
|
|
public void onBegin(int i) {
|
|
|
- if (pdfView == null || pdfView.getCPdfReaderView() == null || pdfView.getCPdfReaderView().getEditManager() == null) {
|
|
|
- return;
|
|
|
- }
|
|
|
- int type = pdfView.getCPdfReaderView().getLoadType();
|
|
|
- if (type == CPDFEditPage.LoadText) {
|
|
|
- ivEditText.setSelected(true);
|
|
|
- ivEditImage.setSelected(false);
|
|
|
- } else if (type == CPDFEditPage.LoadImage) {
|
|
|
- ivEditText.setSelected(false);
|
|
|
- ivEditImage.setSelected(true);
|
|
|
- } else if (type == CPDFEditPage.LoadTextImage) {
|
|
|
- ivEditText.setSelected(false);
|
|
|
- ivEditImage.setSelected(false);
|
|
|
- }
|
|
|
+ CThreadPoolUtils.getInstance().executeMain(()->{
|
|
|
+ if (pdfView == null || pdfView.getCPdfReaderView() == null || pdfView.getCPdfReaderView().getEditManager() == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ int type = pdfView.getCPdfReaderView().getLoadType();
|
|
|
+ if (type == CPDFEditPage.LoadText) {
|
|
|
+ ivEditText.setSelected(true);
|
|
|
+ ivEditImage.setSelected(false);
|
|
|
+ } else if (type == CPDFEditPage.LoadImage) {
|
|
|
+ ivEditText.setSelected(false);
|
|
|
+ ivEditImage.setSelected(true);
|
|
|
+ } else if (type == CPDFEditPage.LoadTextImage) {
|
|
|
+ ivEditText.setSelected(false);
|
|
|
+ ivEditImage.setSelected(false);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -186,8 +189,10 @@ public class CEditToolbar extends RelativeLayout implements View.OnClickListener
|
|
|
return;
|
|
|
}
|
|
|
if (i == pdfView.getCPdfReaderView().getPageNum()) {
|
|
|
- updateUndo(b);
|
|
|
- updateRedo(b1);
|
|
|
+ CThreadPoolUtils.getInstance().executeMain(()->{
|
|
|
+ updateUndo(b);
|
|
|
+ updateRedo(b1);
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
|