Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Espresso ViewActions.swipeRight doesn't work for ViewPager2 on device with API 32+

オープン
#2,196 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
java

調査の方向性

リンクされたサンプルプロジェクトの MainActivity と MainActivityTest から始め、API 31 および API 32+ のデバイス上の ViewPager2 で ViewActions.swipeRight を再現します。ジェスチャーの挙動を swipeLeft と比較し、関連する Espresso のエントリポイントを追跡します。API 32 以降で swipeRight によって戻る操作が発生するのではなく、ViewPager2 のページが切り替われば完了です。

索引モデルが issue の本文から書いたものです。

説明

Description

As the title says, ViewActions.swipeRight doesn't work on devices with API >= 32 when called on ViewPager2.

Calling a swipeRight on a ViewPager2 triggers a back instead of a swiping on the ViewPager2 itself.

Steps to Reproduce

In the sample project linked below you can find a simple activity MainActivity with a ViewPager2, and a MainActivityTest.

The test just swipes on the view pager using Espresso ViewActions: swipeLeft/swipeRight.
Launching the test on a device with API <= 31 passes, but fails on devices with API 32 and above.

swipeLeft instead, works in any case.

Expected Results

Performing swiping actions on the view pager.

Demo on emulator device with API 31

https://github.com/android/android-test/assets/43886303/c1ffedd4-4b8d-42d7-9093-532f9a9f5655

Actual Results

Back press.

Demo on emulator device with API 32

https://github.com/android/android-test/assets/43886303/690e5456-5622-4ba3-82be-8170cdbb5e2a

AndroidX Test and Android OS Versions
  • agp = "8.3.2"
  • kotlin = "1.9.0"
  • activity = "1.8.2"
  • appcompat = "1.6.1"
  • viewpager2 = "1.0.0"
  • espressoCore = "3.5.1"
  • testCore = "1.5.0"
  • testJunit = "1.1.5"
Link to a public git repo demonstrating the problem:

https://github.com/alecarnevale/EspressoSwipeRightIssue/tree/master

主要言語
Java
スター
1.2k
フォーク
342
平均マージ
2日 22時間
マージ済み PR(30日)
7

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

android/android-test のほかの issue

android/android-test の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。