add hook to detect taps on an existing annotation
This commit is contained in:
@ -1,10 +1,12 @@
|
||||
package app.omnivore.omnivore.ui.reader
|
||||
|
||||
import android.graphics.PointF
|
||||
import android.graphics.RectF
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.activity.viewModels
|
||||
@ -252,6 +254,21 @@ class PDFReaderActivity: AppCompatActivity(), DocumentListener {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onPageClick(
|
||||
document: PdfDocument,
|
||||
pageIndex: Int,
|
||||
event: MotionEvent?,
|
||||
pagePosition: PointF?,
|
||||
clickedAnnotation: Annotation?
|
||||
): Boolean {
|
||||
if (clickedAnnotation != null) {
|
||||
// TODO: show menu with delete and add note buttons
|
||||
Log.d("pdf", "clicked annotation: $clickedAnnotation")
|
||||
}
|
||||
|
||||
return super.onPageClick(document, pageIndex, event, pagePosition, clickedAnnotation)
|
||||
}
|
||||
|
||||
private fun tintDrawable(drawable: Drawable, tint: Int): Drawable {
|
||||
val tintedDrawable = DrawableCompat.wrap(drawable)
|
||||
DrawableCompat.setTint(tintedDrawable, tint)
|
||||
|
||||
Reference in New Issue
Block a user