-
Notifications
You must be signed in to change notification settings - Fork 319
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
Fixed unit type bug #769
Fixed unit type bug #769
Changes from 1 commit
8448171
495ae4b
2df3634
e8b288b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,10 +28,8 @@ public class InstructionListAdapter extends RecyclerView.Adapter<InstructionView | |
private LegStep currentStep; | ||
private DistanceUtils distanceUtils; | ||
|
||
public InstructionListAdapter(Context context, | ||
Locale locale, @NavigationUnitType.UnitType int unitType) { | ||
public InstructionListAdapter() { | ||
stepList = new ArrayList<>(); | ||
distanceUtils = new DistanceUtils(context, locale, unitType); | ||
} | ||
|
||
@Override | ||
|
@@ -70,7 +68,11 @@ public void onViewDetachedFromWindow(InstructionViewHolder holder) { | |
holder.itemView.clearAnimation(); | ||
} | ||
|
||
public void updateSteps(RouteProgress routeProgress) { | ||
public void updateSteps(Context context, RouteProgress routeProgress, | ||
Locale locale, @NavigationUnitType.UnitType int unitType) { | ||
if (distanceUtils == null) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it make sense to store There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @danesfeder I agree, we should probably add something like that to |
||
distanceUtils = new DistanceUtils(context, locale, unitType); | ||
} | ||
addLegSteps(routeProgress); | ||
updateStepList(routeProgress); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was the
locale
andunitType
moved here so they can be updated on the fly and the list will reflect the latest changes?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danesfeder yes because otherwise, the locale was being set in the adapter when it was initialized, which was before the locale was actually set in
InstructionView