PDF viewer: a single tap while reading exits the document to a full-screen single-page view

Aberta
#17,531 3 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
72/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
android, kotlin
Domínio
mobile-dev

Direção de pesquisa

Comece rastreando o fluxo de clique em PreviewPdfAdapter.kt, PreviewPdfFragment.kt e PreviewPdfViewModel.kt, começando pelo OnClickListener da página inteira no adapter. Use as etapas de reprodução para comparar o comportamento dos gestos e a navegação antes e depois da alteração. Considera-se concluído quando um único toque durante a leitura não abre inesperadamente a visualização separada da página em tela cheia e a posição de leitura é preservada.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

0. Needs triage
⚠️ Before posting ⚠️
  • This is a bug, not a question or an enhancement.
  • I've searched for similar issues and didn't find a duplicate.
  • I've written a clear and descriptive title for this issue.
  • I agree to follow Nextcloud's Code of Conduct.
Steps to reproduce
  1. Open a multi-page PDF from the Files list (native in-app viewer, not "open with" / browser).
  2. Scroll down a few pages.
  3. While reading, tap once anywhere on the page (no drag).
  4. The app opens a separate full-screen view showing only that single page.
  5. Press back → you return to the document but the reading/scroll position is lost (back near the top).
Expected behaviour

A single tap on the page while reading should not leave the scrollable document, and the reading position must be preserved. Accidental taps are very frequent when reading a long PDF one-handed.

Actual behaviour

PreviewPdfAdapter registers an OnClickListener on the whole page view. Any click on a page calls PreviewPdfViewModel.onClickPage(), which writes the page bitmap to a temp file and launches PreviewBitmapActivity — a separate full-screen activity showing only the tapped page, outside the scrollable RecyclerView. Coming back from it drops the reading position.

Source (current master)
  • app/src/main/java/com/owncloud/android/ui/preview/pdf/PreviewPdfAdapter.kt L33-35 — binding.root.setOnClickListener { onClickListener(bitmap) }: whole-page click target, no gesture discrimination.
  • app/src/main/java/com/owncloud/android/ui/preview/pdf/PreviewPdfFragment.kt L79-92 — click → viewModel.onClickPage(page) → observer on previewImagePath starts PreviewBitmapActivity.
  • app/src/main/java/com/owncloud/android/ui/preview/pdf/PreviewPdfViewModel.kt L55-61 — onClickPage() saves the bitmap to cache and sets _previewImagePath.
Android version

16

Device brand and model

Xiaomi Poco X7 Pro 5G

Stock or custom OS?

Stock (Xiaomi HyperOS)

Nextcloud android app version

34.1.1

Nextcloud server version

34.0.3

Using a reverse proxy?

Yes (Traefik) — not relevant, PDF rendering is fully client-side.

Additional information

The full-screen single-page view appears intended as a "tap to zoom" feature, but bound to a plain click on the entire page it fires on every accidental tap during reading. Possible directions: require a double-tap for the zoom view, shrink the tap target, or at least preserve/restore the RecyclerView scroll position when returning from PreviewBitmapActivity.

Linguagem predominante
Kotlin
Estrelas
5.7k
Forks
2.1k
Merge médio
1d 22h
PRs com merge (30d)
135

Preparar o ambiente

Abrir no Codespaces

Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de nextcloud/android

Todas as issues de nextcloud/android

Issues semelhantes

Mais issues de Kotlin

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.