Fullscreen working great, but splitscreen not resizing to it's visible bounds.

オープン
#12 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
android, kotlin
領域
mobile-dev

調査の方向性

まずサンプルアプリを全画面モードと分割画面モードで再現し、次に onSurfaceAvailable、onStableAreaChanged、および MapRenderer の mapContainer.setSurfaceSize の呼び出しを追跡します。両方の遷移で、安定領域の寸法と表示されている MapView の境界を比較します。分割画面への移行時と分割画面からの復帰時に、全画面を壊すことなくマップのサイズが変更され、中央に配置されたままになることが完了の条件です。

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

説明

Does your splitscreen automatically resize with this demo's codebase? If so, can someone point to what is causing the MapView to resize?

I don't see my map resizing when transitioning from splitscreen. I have the sample app working in fullscreen mode and in splitscreen the MapView doesn't resize and the map is therefore not centered in the split layout.

I see that nothing interesting happens in the onStableAreaChanged callback, and it seems mapContainer.setSurfaceSize is only ever called with w=800 and h=400 from the initial onSurfaceAvailable callback in MapRenderer. I would assume, and I have tried, that the setSurfaceSize would be called after the app receives a new layout size in onStableAreaChanged. But i'm reading the the width and height of the Rect in onStableAreaChanged excludes the system UI components like the zoom, hamburger menu, and Test button. But the map is behind those system UI components.

So now i'm confused and unsure if this demo actually accomplishes the resizing.

I've tried setting the mapContainer.setSurfaceSize to stableArea.width() + stableArea.right and stableArea.height() + stableArea.top in the onStableAreaChanged, and this works for splitscreen, but going back to fullscreen it causes issues with not receiving the proper dimensions. It's also seen in the screenshots that the mapView is outside the "stableArea" (the stablearea has a blue rect drawn)

I must be missing something here. Obviously I can store the initial width and height from onSurfaceAvailable surfaceContainer, and revert back when the layout size change, and leep track of what's the biggest layout size, But I don't like that.

Image Image
主要言語
Kotlin
スター
29
フォーク
10
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

maplibre/MapLibre-Android-Auto-Sample のほかの issue

maplibre/MapLibre-Android-Auto-Sample の issue をすべて見る

似ている issue

Kotlin の issue をもっと見る

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

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