forked from organicmaps/organicmaps
[android] Scale turn lane assistance by device height
The Android UI scales the turn lane assistance proportionally to the height of the device, depending on the device's orientation. This allows for a better fit on large and small devices by adapting to their size. Needed for: #1404 Signed-off-by: Nathan Varner <nathanmvarner@protonmail.com>
This commit is contained in:
parent
05d73706a1
commit
c998e4bb83
6 changed files with 18 additions and 7 deletions
|
@ -108,8 +108,10 @@
|
|||
<FrameLayout
|
||||
android:id="@+id/lanes_frame"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="@dimen/margin_half"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintHeight_percent="@fraction/nav_lane_height"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/nav_next_turn_container"
|
||||
app:layout_constraintTop_toBottomOf="@+id/street_frame"
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
app:cardBackgroundColor="?navLanesCardBackgroundColor"
|
||||
tools:showIn="@layout/layout_nav_top">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/lanes"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="@dimen/margin_quarter"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
android:orientation="horizontal"
|
||||
|
|
|
@ -4,8 +4,10 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/lane_image"
|
||||
android:layout_width="@dimen/nav_lane"
|
||||
android:layout_height="@dimen/nav_lane"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:theme="?navigationTheme"
|
||||
app:tint="?iconTint"
|
||||
app:srcCompat="@drawable/ic_then_right"
|
||||
|
|
4
android/res/values-land/fractions.xml
Normal file
4
android/res/values-land/fractions.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<fraction name="nav_lane_height">0.15</fraction>
|
||||
</resources>
|
|
@ -114,7 +114,6 @@
|
|||
<dimen name="nav_menu_height">70sp</dimen>
|
||||
<dimen name="nav_menu_content_height">64dp</dimen>
|
||||
<dimen name="nav_menu_landscape_width">360dp</dimen>
|
||||
<dimen name="nav_lane">48dp</dimen>
|
||||
|
||||
<dimen name="nav_frame_padding">@dimen/margin_half</dimen>
|
||||
<dimen name="zoom_buttons_margin">64dp</dimen>
|
||||
|
|
4
android/res/values/fractions.xml
Normal file
4
android/res/values/fractions.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<fraction name="nav_lane_height">0.08</fraction>
|
||||
</resources>
|
Loading…
Add table
Reference in a new issue