forked from organicmaps/organicmaps
Buttons animations tweaks.
This commit is contained in:
parent
3b63e003ad
commit
5119575923
13 changed files with 88 additions and 329 deletions
|
@ -34,11 +34,8 @@
|
|||
</FrameLayout>
|
||||
|
||||
<include
|
||||
android:id="@+id/navigation_buttons_container_ref"
|
||||
layout="@layout/map_navigation_buttons"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/fl__routing"/>
|
||||
android:id="@+id/navigation_buttons"
|
||||
layout="@layout/map_navigation_buttons"/>
|
||||
|
||||
<com.mapswithme.maps.widget.FadeView
|
||||
android:id="@+id/fade_view"
|
||||
|
@ -49,15 +46,6 @@
|
|||
|
||||
<include
|
||||
android:id="@+id/map_bottom_buttons"
|
||||
layout="@layout/map_bottom_buttons"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bottom_panel_height"
|
||||
android:layout_alignParentBottom="true"/>
|
||||
layout="@layout/map_bottom_buttons"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/map_bottom_vertical_toolbar"
|
||||
layout="@layout/map_bottom_vertical_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"/>
|
||||
</RelativeLayout>
|
|
@ -29,10 +29,8 @@
|
|||
</FrameLayout>
|
||||
|
||||
<include
|
||||
android:id="@+id/navigation_buttons_container_ref"
|
||||
layout="@layout/map_navigation_buttons"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"/>
|
||||
android:id="@+id/navigation_buttons"
|
||||
layout="@layout/map_navigation_buttons"/>
|
||||
|
||||
<com.mapswithme.maps.widget.FadeView
|
||||
android:id="@+id/fade_view"
|
||||
|
@ -56,17 +54,6 @@
|
|||
|
||||
<include
|
||||
android:id="@+id/map_bottom_buttons"
|
||||
layout="@layout/map_bottom_buttons"
|
||||
android:layout_width="@dimen/bottom_panel_width"
|
||||
android:layout_height="280dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentRight="true"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/map_bottom_vertical_toolbar"
|
||||
layout="@layout/map_bottom_vertical_toolbar"
|
||||
android:layout_width="@dimen/panel_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/margin_medium"/>
|
||||
layout="@layout/map_bottom_buttons"/>
|
||||
|
||||
</RelativeLayout>
|
|
@ -29,10 +29,8 @@
|
|||
</FrameLayout>
|
||||
|
||||
<include
|
||||
android:id="@+id/navigation_buttons_container_ref"
|
||||
layout="@layout/map_navigation_buttons"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"/>
|
||||
android:id="@+id/navigation_buttons"
|
||||
layout="@layout/map_navigation_buttons"/>
|
||||
|
||||
<com.mapswithme.maps.widget.FadeView
|
||||
android:id="@+id/fade_view"
|
||||
|
@ -56,17 +54,6 @@
|
|||
|
||||
<include
|
||||
android:id="@+id/map_bottom_buttons"
|
||||
layout="@layout/map_bottom_buttons"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bottom_panel_height"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentRight="true"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/map_bottom_vertical_toolbar"
|
||||
layout="@layout/map_bottom_vertical_toolbar"
|
||||
android:layout_width="@dimen/panel_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/margin_medium"/>
|
||||
layout="@layout/map_bottom_buttons"/>
|
||||
|
||||
</RelativeLayout>
|
|
@ -1,110 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:theme="@style/MwmWidget.Toolbar"/>
|
||||
|
||||
<LinearLayout
|
||||
style="@style/MwmWidget.Shadow.Light"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bottom_item_height"
|
||||
android:background="@android:color/white">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="@dimen/margin_medium"
|
||||
android:background="@drawable/ic_menu_download"
|
||||
android:scaleType="center"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_download_maps"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bottom_item_height"
|
||||
android:background="?attr/clickableBackground"
|
||||
android:fontFamily="@string/robotoLight"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="@dimen/margin_large_and_half"
|
||||
android:text="@string/download_maps"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
|
||||
android:textColor="@color/text_dark"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
style="@style/MwmWidget.DividerMediumPadded"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bottom_item_height"
|
||||
android:background="@android:color/white">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="@dimen/margin_medium"
|
||||
android:background="@drawable/ic_menu_settings"
|
||||
android:scaleType="center"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_settings"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bottom_item_height"
|
||||
android:background="?attr/clickableBackground"
|
||||
android:fontFamily="@string/robotoLight"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="@dimen/margin_large_and_half"
|
||||
android:text="@string/settings_and_more"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
|
||||
android:textColor="@color/text_dark"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
style="@style/MwmWidget.DividerMediumPadded"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bottom_item_height"
|
||||
android:background="@android:color/white"
|
||||
android:minHeight="@dimen/search_item_height">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="@dimen/margin_medium"
|
||||
android:background="@drawable/ic_menu_send_my_location"
|
||||
android:scaleType="center"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_share"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bottom_item_height"
|
||||
android:background="?attr/clickableBackground"
|
||||
android:fontFamily="@string/robotoLight"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="@dimen/margin_large_and_half"
|
||||
android:text="@string/share_my_location"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
|
||||
android:textColor="@color/text_dark"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
|
@ -1,10 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="top"
|
||||
android:orientation="vertical">
|
||||
android:padding="@dimen/margin_small">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn__myposition"
|
||||
|
@ -14,30 +13,29 @@
|
|||
|
||||
<ImageButton
|
||||
android:id="@+id/yop_it"
|
||||
style="@style/MwmWidget.MapButton.White"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/MwmWidget.MapButton.Zoom"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="@dimen/margin_tiny"
|
||||
android:src="@drawable/ic_btn_yota_ptb"/>
|
||||
|
||||
<android.support.v4.widget.Space
|
||||
android:id="@+id/space_bottom"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="382dp"
|
||||
android:layout_alignParentBottom="true"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/map_button_minus"
|
||||
style="@style/MwmWidget.MapButton.Zoom"
|
||||
android:layout_above="@id/space_bottom"
|
||||
android:layout_alignParentRight="true"
|
||||
android:src="@drawable/ic_zoom_out"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/map_button_plus"
|
||||
style="@style/MwmWidget.MapButton.White"
|
||||
android:layout_width="@dimen/zoom_buttom_size"
|
||||
android:layout_height="@dimen/zoom_buttom_size"
|
||||
style="@style/MwmWidget.MapButton.Zoom"
|
||||
android:layout_above="@+id/map_button_minus"
|
||||
android:layout_alignParentRight="true"
|
||||
android:src="@drawable/ic_zoom_in"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/map_button_minus"
|
||||
style="@style/MwmWidget.MapButton.White"
|
||||
android:layout_width="@dimen/zoom_buttom_size"
|
||||
android:layout_height="@dimen/zoom_buttom_size"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginBottom="382dp"
|
||||
android:src="@drawable/ic_zoom_out"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -28,10 +28,8 @@
|
|||
</FrameLayout>
|
||||
|
||||
<include
|
||||
android:id="@+id/navigation_buttons_container_ref"
|
||||
layout="@layout/map_navigation_buttons"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"/>
|
||||
android:id="@+id/navigation_buttons"
|
||||
layout="@layout/map_navigation_buttons"/>
|
||||
|
||||
<com.mapswithme.maps.widget.FadeView
|
||||
android:id="@+id/fade_view"
|
||||
|
@ -55,17 +53,6 @@
|
|||
|
||||
<include
|
||||
android:id="@+id/map_bottom_buttons"
|
||||
layout="@layout/map_bottom_buttons"
|
||||
android:layout_width="@dimen/bottom_panel_width"
|
||||
android:layout_height="280dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentRight="true"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/map_bottom_vertical_toolbar"
|
||||
layout="@layout/map_bottom_vertical_toolbar"
|
||||
android:layout_width="@dimen/panel_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/margin_medium"/>
|
||||
layout="@layout/map_bottom_buttons"/>
|
||||
|
||||
</RelativeLayout>
|
|
@ -42,9 +42,7 @@
|
|||
|
||||
<include
|
||||
android:id="@+id/navigation_buttons"
|
||||
layout="@layout/map_navigation_buttons"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
layout="@layout/map_navigation_buttons"/>
|
||||
|
||||
<com.mapswithme.maps.widget.FadeView
|
||||
android:id="@+id/fade_view"
|
||||
|
@ -55,8 +53,5 @@
|
|||
|
||||
<include
|
||||
android:id="@+id/map_bottom_buttons"
|
||||
layout="@layout/map_bottom_buttons"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentBottom="true"/>
|
||||
layout="@layout/map_bottom_buttons"/>
|
||||
</RelativeLayout>
|
|
@ -1,89 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/bg_bottom_toolbar"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bottom_item_height">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/margin_medium"
|
||||
android:background="@drawable/ic_menu_download"
|
||||
android:scaleType="center"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_download_maps"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/clickableBackground"
|
||||
android:fontFamily="@string/robotoLight"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="@dimen/margin_large_and_half"
|
||||
android:text="@string/download_maps"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
|
||||
android:textColor="@color/text_dark"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
style="@style/MwmWidget.DividerMediumPadded"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bottom_item_height">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/margin_medium"
|
||||
android:background="@drawable/ic_menu_settings"
|
||||
android:scaleType="center"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_settings"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bottom_item_height"
|
||||
android:background="?attr/clickableBackground"
|
||||
android:fontFamily="@string/robotoLight"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="@dimen/margin_large_and_half"
|
||||
android:text="@string/settings_and_more"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
|
||||
android:textColor="@color/text_dark"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
style="@style/MwmWidget.DividerMediumPadded"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bottom_item_height">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/margin_medium"
|
||||
android:background="@drawable/ic_menu_send_my_location"
|
||||
android:scaleType="center"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_share"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bottom_item_height"
|
||||
android:background="?attr/clickableBackground"
|
||||
android:fontFamily="@string/robotoLight"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="@dimen/margin_large_and_half"
|
||||
android:text="@string/share_my_location"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
|
||||
android:textColor="@color/text_dark"/>
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="@dimen/margin_small">
|
||||
|
||||
|
@ -17,19 +17,24 @@
|
|||
android:layout_alignParentRight="true"
|
||||
android:src="@drawable/ic_btn_yota_ptb"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/map_button_plus"
|
||||
style="@style/MwmWidget.MapButton.White"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginBottom="250dp"
|
||||
android:src="@drawable/btn_white_zoom_in"/>
|
||||
<android.support.v4.widget.Space
|
||||
android:id="@+id/space_bottom"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="250dp"
|
||||
android:layout_alignParentBottom="true"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/map_button_minus"
|
||||
style="@style/MwmWidget.MapButton.White"
|
||||
style="@style/MwmWidget.MapButton.Zoom"
|
||||
android:layout_above="@id/space_bottom"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_below="@+id/map_button_plus"
|
||||
android:src="@drawable/btn_white_zoom_out"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/map_button_plus"
|
||||
style="@style/MwmWidget.MapButton.Zoom"
|
||||
android:layout_above="@id/map_button_minus"
|
||||
android:layout_alignParentRight="true"
|
||||
android:src="@drawable/btn_white_zoom_in"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="MwmWidget.MapButton.White" parent="android:Widget.ImageButton">
|
||||
<item name="android:background">@drawable/bg_toolbar_button_vert</item>
|
||||
</style>
|
||||
</resources>
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="MwmWidget.MapButton.White" parent="android:Widget.ImageButton">
|
||||
<item name="android:background">@drawable/bg_toolbar_button_vert</item>
|
||||
</style>
|
||||
</resources>
|
|
@ -29,6 +29,8 @@ import android.view.MotionEvent;
|
|||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.animation.AccelerateInterpolator;
|
||||
import android.view.animation.DecelerateInterpolator;
|
||||
import android.view.animation.OvershootInterpolator;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
|
@ -140,6 +142,7 @@ public class MWMActivity extends BaseMwmFragmentActivity
|
|||
private boolean mStorageWritable = true;
|
||||
// Buttons
|
||||
private static final long BUTTONS_ANIM_DURATION = 100;
|
||||
private static final long BUTTONS_ANIM_DURATION_LONG = 110;
|
||||
private static final long BUTTON_ANIM_DELAY = 50;
|
||||
private ViewGroup mBottomButtons;
|
||||
private ImageView mBtnBookmarks;
|
||||
|
@ -591,7 +594,8 @@ public class MWMActivity extends BaseMwmFragmentActivity
|
|||
@Override
|
||||
public void onFadeOut()
|
||||
{
|
||||
toggleMenuButtons();
|
||||
if (areBottomButtonsVisible())
|
||||
toggleMenuButtons();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -705,7 +709,7 @@ public class MWMActivity extends BaseMwmFragmentActivity
|
|||
outState.putBoolean(STATE_PP_OPENED, true);
|
||||
outState.putParcelable(STATE_MAP_OBJECT, mPlacePage.getMapObject());
|
||||
}
|
||||
else if (mBottomButtons.getVisibility() == View.VISIBLE)
|
||||
else if (areBottomButtonsVisible())
|
||||
outState.putBoolean(STATE_BUTTONS_OPENED, true);
|
||||
|
||||
super.onSaveInstanceState(outState);
|
||||
|
@ -721,7 +725,10 @@ public class MWMActivity extends BaseMwmFragmentActivity
|
|||
}
|
||||
|
||||
if (savedInstanceState.getBoolean(STATE_BUTTONS_OPENED))
|
||||
{
|
||||
mFadeView.fadeIn();
|
||||
showBottomButtons();
|
||||
}
|
||||
else
|
||||
hideBottomButtons();
|
||||
|
||||
|
@ -1095,10 +1102,13 @@ public class MWMActivity extends BaseMwmFragmentActivity
|
|||
hidePlacePage();
|
||||
Framework.deactivatePopup();
|
||||
}
|
||||
else if (mBtnMenu.getVisibility() == View.GONE)
|
||||
slideSlideButtonsOut();
|
||||
else if (areBottomButtonsVisible())
|
||||
{
|
||||
mFadeView.fadeOut();
|
||||
toggleMenuButtons();
|
||||
}
|
||||
else if (canFragmentInterceptBackPress())
|
||||
// TODO
|
||||
// TODO close menu & fragments accordingly
|
||||
return;
|
||||
else if (popFragment())
|
||||
{
|
||||
|
@ -1318,6 +1328,7 @@ public class MWMActivity extends BaseMwmFragmentActivity
|
|||
|
||||
private Animator generateMenuAnimator(@NonNull final View layout, @NonNull final View button, @NonNull final View textView, final float width)
|
||||
{
|
||||
final AnimatorSet result = new AnimatorSet();
|
||||
ValueAnimator animator = ObjectAnimator.ofFloat(button, "translationX", width, 0);
|
||||
animator.addListener(new UiUtils.SimpleNineoldAnimationListener()
|
||||
{
|
||||
|
@ -1325,15 +1336,24 @@ public class MWMActivity extends BaseMwmFragmentActivity
|
|||
public void onAnimationStart(Animator animation)
|
||||
{
|
||||
layout.setVisibility(View.VISIBLE);
|
||||
button.setAlpha(0);
|
||||
textView.setAlpha(0);
|
||||
}
|
||||
});
|
||||
animator.setInterpolator(new OvershootInterpolator());
|
||||
animator.setDuration(BUTTONS_ANIM_DURATION);
|
||||
final AnimatorSet result = new AnimatorSet();
|
||||
result.play(animator);
|
||||
|
||||
animator = ObjectAnimator.ofFloat(button, "alpha", 0, 1);
|
||||
animator.setDuration(BUTTONS_ANIM_DURATION_LONG);
|
||||
animator.setInterpolator(new AccelerateInterpolator());
|
||||
result.play(animator);
|
||||
|
||||
animator = ObjectAnimator.ofFloat(textView, "alpha", 0, 1);
|
||||
animator.setDuration(BUTTONS_ANIM_DURATION / 2);
|
||||
animator.setInterpolator(new DecelerateInterpolator());
|
||||
result.play(animator).after(BUTTONS_ANIM_DURATION / 2);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1444,18 +1464,23 @@ public class MWMActivity extends BaseMwmFragmentActivity
|
|||
|
||||
private void toggleMenuButtons()
|
||||
{
|
||||
if (mLlSearch.getVisibility() == View.GONE)
|
||||
{
|
||||
mBtnMenu.setImageDrawable(mAnimMenu);
|
||||
mAnimMenu.start();
|
||||
slideBottomButtonsIn();
|
||||
}
|
||||
else
|
||||
if (areBottomButtonsVisible())
|
||||
{
|
||||
mBtnMenu.setImageDrawable(mAnimMenuReversed);
|
||||
mAnimMenuReversed.start();
|
||||
slideSlideButtonsOut();
|
||||
}
|
||||
else
|
||||
{
|
||||
mBtnMenu.setImageDrawable(mAnimMenu);
|
||||
mAnimMenu.start();
|
||||
slideBottomButtonsIn();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean areBottomButtonsVisible()
|
||||
{
|
||||
return mLlSearch.getVisibility() == View.VISIBLE;
|
||||
}
|
||||
|
||||
private void followRoute()
|
||||
|
@ -1559,7 +1584,7 @@ public class MWMActivity extends BaseMwmFragmentActivity
|
|||
{
|
||||
if (keyCode == KeyEvent.KEYCODE_MENU)
|
||||
{
|
||||
// TODO toggle menu
|
||||
toggleMenuButtons();
|
||||
return true;
|
||||
}
|
||||
return super.onKeyUp(keyCode, event);
|
||||
|
|
|
@ -13,7 +13,7 @@ import com.nineoldandroids.animation.ObjectAnimator;
|
|||
|
||||
public class FadeView extends FrameLayout
|
||||
{
|
||||
private static final float ALPHA_VALUE = 0.5f;
|
||||
private static final float FADE_ALPHA_VALUE = 0.8f;
|
||||
private static final String PROPERTY_ALPHA = "alpha";
|
||||
|
||||
private ObjectAnimator mFadeInAnimation;
|
||||
|
@ -76,14 +76,14 @@ public class FadeView extends FrameLayout
|
|||
public void fadeIn()
|
||||
{
|
||||
setVisibility(View.VISIBLE);
|
||||
mFadeInAnimation = ObjectAnimator.ofFloat(this, PROPERTY_ALPHA, 0f, ALPHA_VALUE);
|
||||
mFadeInAnimation = ObjectAnimator.ofFloat(this, PROPERTY_ALPHA, 0f, FADE_ALPHA_VALUE);
|
||||
mFadeInAnimation.addListener(mFadeInListener);
|
||||
mFadeInAnimation.start();
|
||||
}
|
||||
|
||||
public void fadeOut()
|
||||
{
|
||||
mFadeOutAnimation = ObjectAnimator.ofFloat(this, PROPERTY_ALPHA, ALPHA_VALUE, 0f);
|
||||
mFadeOutAnimation = ObjectAnimator.ofFloat(this, PROPERTY_ALPHA, FADE_ALPHA_VALUE, 0f);
|
||||
mFadeOutAnimation.addListener(mFadeOutListener);
|
||||
mFadeOutAnimation.start();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue