mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
add hook to detect taps on an existing annotation
This commit is contained in:
parent
d0ceda4489
commit
5a96cad4a9
1 changed files with 17 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue