Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

MapboxManeuverView width is fixed in landscape mode

Đang mở
#174 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
android, kotlin
Lĩnh vực
mobile-dev

Hướng nghiên cứu

Bắt đầu bằng cách so sánh các định nghĩa ConstraintLayout ở chế độ dọc và ngang được hiển thị trong issue, đặc biệt là các constraint của MapboxManeuverView và content_box_frame_container. Xác minh cách layout ngang xác định chiều rộng của maneuver view, sau đó xác nhận rằng việc thay đổi chiều rộng của container cũng thay đổi maneuver view như mong đợi ở cả hai hướng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I'm not able to change MapboxManeuverView component width in landscape mode.
it works in portrait mode but not working on landscape mode.
Portrait layout :
`
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true"
android:id="@+id/mapboxView"
tools:context=".Screens.MapBoxScreen.MapBoxActivity">

<com.mapbox.maps.MapView
    android:id="@+id/mapView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintBottom_toBottomOf="parent"
    app:mapbox_cameraTargetLat="40.7128"
    app:mapbox_cameraTargetLng="-74.0060"
    app:mapbox_logoEnabled="false"
    app:mapbox_attributionEnabled="false"
    app:mapbox_cameraZoom="14.0"/>


<include
    android:id="@+id/where_to_sound_home"
    layout="@layout/where_to_home_sound_item"
    android:layout_width="match_parent"
    android:layout_height="90dp"
    android:layout_marginTop="10dp"
    android:layout_marginEnd="10dp"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    tools:ignore="RtlSymmetry" />

<com.mapbox.navigation.ui.maneuver.view.MapboxManeuverView
    android:id="@+id/maneuverView"
    android:layout_width="0dp"
    android:visibility="gone"
    android:layout_height="wrap_content"
    android:layout_margin="4dp"
    android:layout_marginTop="23dp"
    style="@style/MapboxCustomManeuverStyle"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintStart_toStartOf="@id/content_box_frame_container"
    app:layout_constraintEnd_toEndOf="@id/content_box_frame_container"
    />

<include
    android:id="@+id/content_box_frame_container"
    layout="@layout/mappo_player"
    android:layout_width="436dp"
    android:layout_height="wrap_content"
    android:layout_marginStart="24dp"
    android:layout_marginBottom="12dp"
    android:layout_marginTop="23dp"
    app:layout_constraintTop_toBottomOf="@id/maneuverView"
    app:layout_constraintStart_toStartOf="parent"

    />
<include
    android:id="@+id/route_overview_container"
    layout="@layout/route_overview_layout"
    android:layout_width="493dp"
    android:layout_height="wrap_content"
    android:layout_marginStart="24dp"
    android:layout_marginBottom="12dp"
    android:layout_marginTop="23dp"
    android:visibility="gone"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    />

<include
    android:id="@+id/direction_component"
    layout="@layout/direction_layout"
    android:visibility="gone"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

<include
    android:id="@+id/map_controlss"
    layout="@layout/map_controls"
    android:visibility="visible"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginBottom="14dp"
    android:layout_marginEnd="19dp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    tools:ignore="RtlSymmetry" />



<!-- Framelayout to display Fragments -->

</androidx.constraintlayout.widget.ConstraintLayout>
`

Landscape code :

`
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true"
android:id="@+id/mapboxView"
tools:context=".Screens.MapBoxScreen.MapBoxActivity">

<com.mapbox.maps.MapView
    android:id="@+id/mapView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintBottom_toBottomOf="parent"
    app:mapbox_cameraTargetLat="40.7128"
    app:mapbox_cameraTargetLng="-74.0060"
    app:mapbox_logoEnabled="false"
    app:mapbox_attributionEnabled="false"
    app:mapbox_cameraZoom="14.0"/>


<include
    android:id="@+id/where_to_sound_home"
    layout="@layout/where_to_home_sound_item"
    android:layout_width="wrap_content"
    android:layout_height="90dp"
    android:layout_marginTop="10dp"
    android:layout_marginEnd="10dp"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    tools:ignore="RtlSymmetry" />

<include
    android:id="@+id/direction_component"
    layout="@layout/direction_layout"
    android:visibility="gone"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

<com.mapbox.navigation.ui.maneuver.view.MapboxManeuverView
    android:id="@+id/maneuverView"
    android:layout_width="0dp"
    android:visibility="gone"
    android:layout_height="wrap_content"
    android:layout_margin="4dp"
    style="@style/MapboxCustomManeuverStyle"
    app:layout_constraintEnd_toEndOf="@id/content_box_frame_container"
    app:layout_constraintStart_toStartOf="@id/content_box_frame_container"
    app:layout_constraintBottom_toTopOf="@id/content_box_frame_container"
    />
<include
    android:id="@+id/content_box_frame_container"
    layout="@layout/mappo_player"
    android:layout_width="436dp"
    android:layout_height="wrap_content"
    android:layout_marginStart="24dp"
    android:layout_marginBottom="12dp"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintBottom_toBottomOf="parent"
    />
<include
    android:id="@+id/route_overview_container"
    layout="@layout/route_overview_layout"
    android:layout_width="493dp"
    android:layout_height="wrap_content"
    android:layout_marginStart="24dp"
    android:layout_marginBottom="12dp"
    android:layout_marginTop="23dp"
    android:visibility="gone"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintBottom_toBottomOf="parent"
    />

<include
    android:id="@+id/map_controlss"
    layout="@layout/map_controls"
    android:visibility="visible"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginBottom="0dp"
    android:layout_marginEnd="24dp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    tools:ignore="RtlSymmetry" />

</androidx.constraintlayout.widget.ConstraintLayout>
`
Navigation SDK: "com.mapbox.navigation:android:2.9.4"

Screenshots :
Landscape:
lndscape

Portraite :
portrait

Ngôn ngữ chính
Kotlin
Star
65
Fork
56
Merge trung bình
1 ngày 4 giờ
Pull request đã merge (30 ngày)
2

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của mapbox/mapbox-navigation-android-examples

Tất cả issue của mapbox/mapbox-navigation-android-examples

Issue tương tự

Thêm issue về Kotlin

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.