[android] fix: Smooth animations of navigation panels.

This commit is contained in:
a.marchuk 2015-07-30 15:53:07 +03:00 committed by Alex Zolotarev
parent 600ee9ab36
commit 48e86e9698
30 changed files with 27 additions and 56 deletions

View file

@ -2,9 +2,9 @@
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromYDelta="-100%"
android:toYDelta="0%"
android:duration="@integer/duration_slide_default"/>
android:duration="@integer/anim_duration_default"/>
<alpha android:fromAlpha="0.1"
android:toAlpha="1"
android:duration="@integer/duration_slide_default"/>
android:duration="@integer/anim_duration_default"/>
</set>

View file

@ -2,9 +2,9 @@
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromYDelta="0%"
android:toYDelta="-100%"
android:duration="@integer/duration_slide_default"/>
android:duration="@integer/anim_duration_default"/>
<alpha android:fromAlpha="1"
android:toAlpha="0.1"
android:duration="@integer/duration_slide_default"/>
android:duration="@integer/anim_duration_default"/>
</set>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 594 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 621 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 744 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 726 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 852 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 876 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 852 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -22,6 +22,7 @@
<FrameLayout
android:id="@+id/fl__routing"
style="@style/MwmWidget.Floating.Panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/toolbar_search">
@ -32,11 +33,10 @@
<com.mapswithme.maps.widget.placepage.PlacePageView
android:id="@+id/info_box"
style="@style/MwmWidget.Floating.PlacePage"
style="@style/MwmWidget.Floating.Panel"
android:layout_width="360dp"
android:layout_height="match_parent"
android:layout_below="@+id/fl__routing"
android:background="@color/bg_top_panels"
placePage:animationType="leftFull"/>
<com.mapswithme.maps.widget.FadeView

View file

@ -12,10 +12,12 @@
<FrameLayout
android:id="@+id/fl__routing"
style="@style/MwmWidget.Floating.Panel"
android:layout_width="@dimen/panel_width"
android:layout_height="@dimen/routing_pp_height"
android:layout_below="@+id/toolbar_search"
android:layout_margin="@dimen/margin_base">
android:layout_marginTop="@dimen/margin_base"
android:layout_marginLeft="@dimen/margin_base">
<include layout="@layout/map_routing_full"/>
@ -27,7 +29,7 @@
<com.mapswithme.maps.widget.placepage.PlacePageView
android:id="@+id/info_box"
style="@style/MwmWidget.Floating.PlacePage"
style="@style/MwmWidget.Floating.Panel"
android:layout_width="@dimen/panel_width"
android:layout_height="wrap_content"
android:layout_below="@id/fl__routing"

View file

@ -19,10 +19,12 @@
<FrameLayout
android:id="@+id/fl__routing"
style="@style/MwmWidget.Floating.Panel"
android:layout_width="@dimen/panel_width"
android:layout_height="@dimen/routing_pp_height"
android:layout_below="@+id/toolbar_search"
android:layout_margin="@dimen/margin_base">
android:layout_marginTop="@dimen/margin_base"
android:layout_marginLeft="@dimen/margin_base">
<include layout="@layout/map_routing_full"/>

View file

@ -3,7 +3,6 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/navigation_buttons"
style="@style/MwmWidget.Shadow.Panel"
android:layout_width="match_parent"
android:layout_height="@dimen/routing_pp_height">
@ -51,8 +50,7 @@
<ImageView
android:id="@+id/btn__close"
android:layout_width="@dimen/routing_button_height"
android:layout_height="@dimen/routing_button_height"
android:layout_alignParentBottom="true"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:background="?attr/clickableBackground"
android:scaleType="center"

View file

@ -11,10 +11,12 @@
<FrameLayout
android:id="@+id/fl__routing"
style="@style/MwmWidget.Floating.Panel"
android:layout_width="@dimen/panel_width"
android:layout_height="@dimen/routing_pp_height"
android:layout_below="@+id/toolbar_search"
android:layout_margin="@dimen/margin_base">
android:layout_marginTop="@dimen/margin_base"
android:layout_marginLeft="@dimen/margin_base">
<include layout="@layout/map_routing_full"/>
@ -26,7 +28,7 @@
<com.mapswithme.maps.widget.placepage.PlacePageView
android:id="@+id/info_box"
style="@style/MwmWidget.Floating.PlacePage"
style="@style/MwmWidget.Floating.Panel"
android:layout_width="@dimen/panel_width"
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_base"

View file

@ -17,6 +17,7 @@
<FrameLayout
android:id="@+id/fl__routing"
style="@style/MwmWidget.Floating.Panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/toolbar_search">

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/rl__routing_box"
style="@style/MwmWidget.Shadow.Panel"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/routing_pp_height">

View file

@ -3,7 +3,6 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/navigation_buttons"
style="@style/MwmWidget.Shadow.Panel"
android:layout_width="match_parent"
android:layout_height="@dimen/routing_pp_height">
@ -51,8 +50,7 @@
<ImageView
android:id="@+id/btn__close"
android:layout_width="@dimen/routing_button_height"
android:layout_height="@dimen/routing_button_height"
android:layout_alignParentBottom="true"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:background="?attr/clickableBackground"
android:scaleType="center"

View file

@ -1,11 +0,0 @@
<resources>
<style name="MwmWidget.Shadow.Panel">
<item name="android:paddingLeft">4dp</item>
<item name="android:paddingRight">4dp</item>
<item name="android:paddingBottom">5dp</item>
<item name="android:paddingTop">3dp</item>
<item name="android:background">@drawable/ic_bg_pp</item>
</style>
</resources>

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<integer name="duration_slide_default">200</integer>
<integer name="anim_duration_default">200</integer>
</resources>

View file

@ -122,7 +122,7 @@
<style name="MwmWidget.Floating"/>
<style name="MwmWidget.Floating.PlacePage"
<style name="MwmWidget.Floating.Panel"
parent="MwmWidget.Floating">
<item name="android:background">@color/bg_top_panels</item>
</style>
@ -191,21 +191,6 @@
<item name="android:foreground">@drawable/shadow_top</item>
</style>
<style name="MwmWidget.Shadow">
<item name="android:paddingLeft">4dp</item>
<item name="android:paddingRight">4dp</item>
<item name="android:paddingTop">3dp</item>
</style>
<style name="MwmWidget.Shadow.Light">
<item name="android:paddingBottom">5dp</item>
<item name="android:background">@drawable/ic_bg_light</item>
</style>
<style name="MwmWidget.Shadow.Panel">
<item name="android:background">@color/bg_top_panels</item>
</style>
<style name="MwmWidget.RatingBar" parent="android:Widget.RatingBar">
<item name="android:progressDrawable">@drawable/rating_bar</item>
<item name="android:indeterminateDrawable">@drawable/rating_bar</item>

View file

@ -1382,8 +1382,8 @@ public class MWMActivity extends BaseMwmFragmentActivity
private void followRoute()
{
Framework.nativeFollowRoute();
UiUtils.show(mRoutingFrame);
UiUtils.exchangeViewsAnimatedDown(mRoutingBox, mTurnByTurnBox, null);
UiUtils.exchangeViewsAnimatedDown(mRoutingFrame, mRoutingFrame, null);
}
private void buildRoute()
@ -1452,19 +1452,13 @@ public class MWMActivity extends BaseMwmFragmentActivity
mPbRoutingProgress.setVisibility(View.GONE);
UiUtils.hide(mPbRoutingProgress);
UiUtils.disappearSlidingUp(mRoutingFrame, null);
UiUtils.exchangeViewsAnimatedDown(mRoutingBox, mRlStartRouting, new Runnable()
{
@Override
public void run()
{
UiUtils.disappearSlidingUp(mTurnByTurnBox, new Runnable()
{
@Override
public void run()
{
UiUtils.hide(mRoutingFrame);
}
});
UiUtils.disappearSlidingUp(mTurnByTurnBox, null);
}
});
@ -1530,8 +1524,9 @@ public class MWMActivity extends BaseMwmFragmentActivity
{
ViewCompat.setAlpha(mLayoutRoutingGo, 1);
UiUtils.show(mLayoutRoutingGo, mRoutingFrame);
UiUtils.show(mLayoutRoutingGo);
UiUtils.hide(mTurnByTurnBox);
UiUtils.appearSlidingDown(mRoutingFrame, null);
UiUtils.appearSlidingDown(mRoutingBox, null);
mRoutingBox.bringToFront();