Change layout for progress
This commit is contained in:
parent
ee207c7598
commit
29fc632a7c
3 changed files with 33 additions and 28 deletions
|
@ -21,25 +21,25 @@ public class RouteCalculationProgress {
|
|||
public boolean isCancelled;
|
||||
public boolean requestPrivateAccessRouting;
|
||||
|
||||
private static final float INITIAL_PROGRSS = 0.05f;
|
||||
private static final float INITIAL_PROGRESS = 0.05f;
|
||||
private static final float FIRST_ITERATION = 0.72f;
|
||||
|
||||
public float getLinearProgress() {
|
||||
float p = Math.max(distanceFromBegin, distanceFromEnd);
|
||||
float all = totalEstimatedDistance * 1.25f;
|
||||
float all = totalEstimatedDistance * 1.35f;
|
||||
float pr = 0;
|
||||
if (all > 0) {
|
||||
pr = p * p / (all * all);
|
||||
pr = Math.min(p * p / (all * all), 1);
|
||||
}
|
||||
float progress = INITIAL_PROGRSS;
|
||||
float progress = INITIAL_PROGRESS;
|
||||
if (totalIterations > 1) {
|
||||
if (iteration <= 0) {
|
||||
progress = pr * FIRST_ITERATION + INITIAL_PROGRSS;
|
||||
if (iteration < 1) {
|
||||
progress = pr * FIRST_ITERATION + INITIAL_PROGRESS;
|
||||
} else {
|
||||
progress = (INITIAL_PROGRSS + FIRST_ITERATION) + pr * (1 - FIRST_ITERATION - INITIAL_PROGRSS);
|
||||
progress = (INITIAL_PROGRESS + FIRST_ITERATION) + pr * (1 - FIRST_ITERATION - INITIAL_PROGRESS);
|
||||
}
|
||||
} else {
|
||||
progress = INITIAL_PROGRSS + pr * (1 - INITIAL_PROGRSS);
|
||||
progress = INITIAL_PROGRESS + pr * (1 - INITIAL_PROGRESS);
|
||||
}
|
||||
return Math.min(progress * 100f, 99);
|
||||
}
|
||||
|
|
|
@ -193,6 +193,19 @@
|
|||
android:src="@drawable/headliner_close"/>
|
||||
</LinearLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/map_horizontal_progress"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_height="wrap_content"
|
||||
android:max="100"
|
||||
android:minHeight="0dp"
|
||||
android:visibility="gone"
|
||||
tools:progress="60"
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<!-- RIGHT BUTTONS -->
|
||||
|
@ -242,16 +255,6 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/map_horizontal_progress"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:max="100"
|
||||
android:minHeight="0dp"
|
||||
android:visibility="gone"
|
||||
tools:progress="60"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<include
|
||||
layout="@layout/move_marker_bottom_sheet"
|
||||
|
|
|
@ -231,18 +231,20 @@
|
|||
tools:src="@drawable/ic_action_test_light"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/map_horizontal_progress"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:max="100"
|
||||
android:minHeight="0dp"
|
||||
android:visibility="gone"
|
||||
tools:progress="60"
|
||||
tools:visibility="visible" />
|
||||
</FrameLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/map_horizontal_progress"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:max="100"
|
||||
android:minHeight="0dp"
|
||||
android:visibility="gone"
|
||||
tools:progress="60"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
Loading…
Reference in a new issue