forked from organicmaps/organicmaps
One more fix for 2.3
This commit is contained in:
parent
b0ab3dca24
commit
db96b041a4
3 changed files with 21 additions and 18 deletions
|
@ -753,14 +753,7 @@ public class MWMActivity extends BaseMwmFragmentActivity
|
|||
{
|
||||
UiUtils.hide(mLlBookmarks, mLlDownloader, mLlSettings, mLlShare, mLlSearch);
|
||||
// IMPORTANT views after alpha animations with 'setFillAfter' on 2.3 can't become GONE, until clearAnimation is called.
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB)
|
||||
{
|
||||
mLlSearch.clearAnimation();
|
||||
mLlBookmarks.clearAnimation();
|
||||
mLlDownloader.clearAnimation();
|
||||
mLlShare.clearAnimation();
|
||||
mLlSettings.clearAnimation();
|
||||
}
|
||||
UiUtils.hideAfterAlphaAnimation(mLlSearch, mLlBookmarks, mLlDownloader, mLlSettings, mLlShare);
|
||||
if (mButtonsAnimation != null && mButtonsAnimation.isRunning())
|
||||
mButtonsAnimation.end();
|
||||
mBtnMenu.setVisibility(View.VISIBLE);
|
||||
|
@ -1446,21 +1439,21 @@ public class MWMActivity extends BaseMwmFragmentActivity
|
|||
AlohaHelper.logClick(AlohaHelper.MENU_SHARE);
|
||||
shareMyLocation();
|
||||
hideBottomButtons();
|
||||
mFadeView.setVisibility(View.GONE);
|
||||
UiUtils.hideAfterAlphaAnimation(mFadeView);
|
||||
break;
|
||||
case R.id.btn__settings:
|
||||
case R.id.ll__settings:
|
||||
AlohaHelper.logClick(AlohaHelper.MENU_SETTINGS);
|
||||
startActivity(new Intent(this, SettingsActivity.class));
|
||||
hideBottomButtons();
|
||||
mFadeView.setVisibility(View.GONE);
|
||||
UiUtils.hideAfterAlphaAnimation(mFadeView);
|
||||
break;
|
||||
case R.id.btn__download_maps:
|
||||
case R.id.ll__download_maps:
|
||||
AlohaHelper.logClick(AlohaHelper.MENU_DOWNLOADER);
|
||||
showDownloader(false);
|
||||
hideBottomButtons();
|
||||
mFadeView.setVisibility(View.GONE);
|
||||
UiUtils.hideAfterAlphaAnimation(mFadeView);
|
||||
break;
|
||||
case R.id.rl__route:
|
||||
AlohaHelper.logClick(AlohaHelper.PP_ROUTE);
|
||||
|
@ -1496,14 +1489,14 @@ public class MWMActivity extends BaseMwmFragmentActivity
|
|||
AlohaHelper.logClick(AlohaHelper.TOOLBAR_SEARCH);
|
||||
showSearchIfUpdated();
|
||||
hideBottomButtons();
|
||||
mFadeView.setVisibility(View.GONE);
|
||||
UiUtils.hideAfterAlphaAnimation(mFadeView);
|
||||
break;
|
||||
case R.id.btn__bookmarks:
|
||||
case R.id.ll__bookmarks:
|
||||
AlohaHelper.logClick(AlohaHelper.TOOLBAR_BOOKMARKS);
|
||||
showBookmarks();
|
||||
hideBottomButtons();
|
||||
mFadeView.setVisibility(View.GONE);
|
||||
UiUtils.hideAfterAlphaAnimation(mFadeView);
|
||||
break;
|
||||
case R.id.btn__myposition:
|
||||
switchNextLocationState();
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.mapswithme.maps.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
|
@ -25,10 +24,7 @@ public class FadeView extends FrameLayout
|
|||
@Override
|
||||
public void onAnimationEnd(Animator animation)
|
||||
{
|
||||
setVisibility(View.GONE);
|
||||
// IMPORTANT views after alpha animations with 'setFillAfter' on 2.3 can't become GONE, until clearAnimation is called.
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB)
|
||||
clearAnimation();
|
||||
UiUtils.hideAfterAlphaAnimation(FadeView.this);
|
||||
if (mFadeListener != null && mDoNotify)
|
||||
mFadeListener.onFadeOut();
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import android.graphics.Rect;
|
|||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.provider.Settings;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
|
@ -61,6 +62,19 @@ public final class UiUtils
|
|||
hide(views);
|
||||
}
|
||||
|
||||
/*
|
||||
Views after alpha animations with 'setFillAfter' on 2.3 can't become GONE, until clearAnimation is called.
|
||||
*/
|
||||
public static void hideAfterAlphaAnimation(View... views)
|
||||
{
|
||||
for (final View view : views)
|
||||
{
|
||||
hide(view);
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB)
|
||||
view.clearAnimation();
|
||||
}
|
||||
}
|
||||
|
||||
public static Drawable drawCircle(int color, int sizeResId, Resources res)
|
||||
{
|
||||
final int size = res.getDimensionPixelSize(sizeResId);
|
||||
|
|
Loading…
Add table
Reference in a new issue