Skip to content

Commit 21ae19b

Browse files
author
Devota Aabel
committed
Updated public API for InstructionLoader and fixed abbreviations so that primary text is wrapped and takes precendence over the secondary text
1 parent 4eec682 commit 21ae19b

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/instruction/InstructionLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class InstructionLoader {
3030
* @param textView to populate with instruction
3131
* @param bannerText containing components to populate into textView
3232
*/
33-
InstructionLoader(TextView textView, @NonNull BannerText bannerText) {
33+
public InstructionLoader(TextView textView, @NonNull BannerText bannerText) {
3434
this(textView, new BannerComponentTree(bannerText, new ExitSignCreator(),
3535
ImageCreator.getInstance(), new AbbreviationCreator(), new TextCreator()));
3636
}

libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/instruction/InstructionView.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,14 @@ private void loadPrimaryAndSecondary(BannerText primaryBannerText, BannerText se
766766
upcomingPrimaryText.setMaxLines(1);
767767
upcomingSecondaryText.setVisibility(VISIBLE);
768768
adjustBannerTextVerticalBias(0.65f);
769+
770+
upcomingPrimaryText.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
771+
LinearLayout.LayoutParams.WRAP_CONTENT));
769772
loadTextWith(primaryBannerText, upcomingPrimaryText);
773+
upcomingPrimaryText.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
774+
LinearLayout.LayoutParams.WRAP_CONTENT));
775+
776+
770777
loadTextWith(secondaryBannerText, upcomingSecondaryText);
771778
}
772779

libandroid-navigation-ui/src/main/res/layout-land/instruction_layout.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@
7373
android:layout_width="match_parent"
7474
android:layout_height="wrap_content"
7575
android:layout_weight="1"
76-
android:layout_marginEnd="8dp"
77-
android:layout_marginRight="8dp"
76+
android:layout_marginEnd="16dp"
77+
android:layout_marginRight="16dp"
7878
android:ellipsize="end"
7979
android:gravity="center_vertical"
8080
android:maxLines="1"
@@ -90,6 +90,8 @@
9090
android:layout_weight="1"
9191
android:visibility="gone"
9292
android:ellipsize="end"
93+
android:layout_marginStart="16dp"
94+
android:layout_marginLeft="16dp"
9395
android:includeFontPadding="false"
9496
android:maxLines="1"
9597
android:textColor="?attr/navigationViewBannerSecondaryText"

0 commit comments

Comments
 (0)