react / react/react-native

Window dimensions doesn't change for android split screen

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

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

API: Dimensions Needs: Triage :mag: Never gets stale Platform: Android
主要言語
C++
スター
127k
フォーク
25.3k
平均マージ
1日 23時間
マージ済み PR(30日)
4

説明

Description

After upgrading react-native from 0.62.2 to 0.63.3 I've met an issue that when I use split screen on my physical android device the dimensions for window doesn't change. It remains the same if I open the app in fullscreen, or split it with other app so it takes 1/2 or 2/3 or 1/3 of the screen space. I cannot tell exactly what react-native version got this broken, but I did test it both on 0.62.2 and 0.63.3 versions once again, so I am confident about this being an issue on latest react-native version

React Native version:

System:
OS: Windows 10 10.0.19041
CPU: (4) x64 Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz
Memory: 2.51 GB / 9.98 GB
Binaries:
Node: 14.5.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.14.5 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
API Levels: 28, 29
Build Tools: 28.0.3, 29.0.2, 29.0.3
System Images: android-21 | Google APIs ARM EABI v7a, android-21 | Google APIs Intel x86 Atom_64, android-27 | Google APIs Intel x86 Atom, android-28 | Intel x86 Atom_64
Android NDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: Not Found
Visual Studio: Not Found
Languages:
Java: Not Found
Python: Not Found
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.3 => 0.63.3
react-native-windows: Not Found

Steps To Reproduce

I've left the code example down here, copy it and paste in App component of newly initializated react-native project on 0.63.3 version and try to open the app in fullscreen and split-screen, see the window height being the same(vertical split-screen).

Expected Results

Dimensions.get('window').height AND useWindowDimensions hook must return different results for app being resized by using split-screen, but it returns the same value on & on, but it works as expected in 0.62.2

Snack, code example, screenshot, or link to a repository:

  console.log('manual get height:', Dimensions.get('window').height);
  const {height} = useWindowDimensions();
  console.log('useWindowDimensions hook height:', height);

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

提供されている Dimensions.get('window') と useWindowDimensions の例を使用して Android デバイス上で問題を再現し、React Native 0.63.3 と 0.62.2 の分割画面での動作を比較します。Dimensions と useWindowDimensions のエントリポイントを追跡して、ウィンドウサイズの更新が異なる箇所を特定します。完了条件は、両方の API がサイズ変更後の分割画面の高さを報告することです。

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

評価

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

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

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