Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MapboxManeuverView width is fixed in landscape mode #174

Open
ghadeeraqraa1992 opened this issue Dec 15, 2022 · 0 comments
Open

MapboxManeuverView width is fixed in landscape mode #174

ghadeeraqraa1992 opened this issue Dec 15, 2022 · 0 comments

Comments

@ghadeeraqraa1992
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant