Fixed crashes with PP on API levels 9-10.

This commit is contained in:
Dmitry Yunitsky 2015-03-05 14:03:15 +03:00 committed by Alex Zolotarev
parent 7619a3d9ca
commit d1f8631ba2
5 changed files with 12 additions and 12 deletions

View file

@ -243,7 +243,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?android:selectableItemBackground"
android:background="?attr/clickableBackground"
android:drawableRight="@drawable/ic_arrow_down"
android:lineSpacingMultiplier="1.43"
android:paddingTop="@dimen/margin_small"
@ -258,7 +258,7 @@
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_small"
android:padding="@dimen/margin_small"
android:background="?android:selectableItemBackground"
android:background="?attr/clickableBackground"
android:src="@drawable/color_picker_red_on"/>
</LinearLayout>

View file

@ -29,7 +29,7 @@ public class BottomPlacePageAnimationController extends BasePlacePageAnimationCo
mDownCoord = event.getRawY();
break;
case MotionEvent.ACTION_MOVE:
if (mDownCoord < mPreview.getY() || mDownCoord > mButtons.getY())
if (mDownCoord < ViewHelper.getY(mPreview) || mDownCoord > ViewHelper.getY(mButtons))
return false;
if (Math.abs(mDownCoord - event.getRawY()) > mTouchSlop)
return true;
@ -42,7 +42,7 @@ public class BottomPlacePageAnimationController extends BasePlacePageAnimationCo
@Override
protected boolean onTouchEvent(@NonNull MotionEvent event)
{
if (mDownCoord < mPreview.getY() || mDownCoord > mButtons.getY())
if (mDownCoord < ViewHelper.getY(mPreview) || mDownCoord > ViewHelper.getY(mButtons))
return false;
super.onTouchEvent(event);
@ -93,7 +93,7 @@ public class BottomPlacePageAnimationController extends BasePlacePageAnimationCo
@Override
public boolean onSingleTapConfirmed(MotionEvent e)
{
if (mDownCoord < mPreview.getY() && mDownCoord < mDetails.getY())
if (mDownCoord < ViewHelper.getY(mPreview) && mDownCoord < ViewHelper.getY(mDetails))
return false;
if (mPlacePage.getState() == State.PREVIEW)

View file

@ -29,7 +29,7 @@ public class LeftFloatPlacePageAnimationController extends BasePlacePageAnimatio
mDownCoord = event.getRawY();
break;
case MotionEvent.ACTION_MOVE:
if (mDownCoord < mPreview.getY() || mDownCoord > mButtons.getY())
if (mDownCoord < ViewHelper.getY(mPreview) || mDownCoord > ViewHelper.getY(mButtons))
return false;
if (Math.abs(mDownCoord - event.getRawY()) > mTouchSlop)
return true;
@ -42,7 +42,7 @@ public class LeftFloatPlacePageAnimationController extends BasePlacePageAnimatio
@Override
protected boolean onTouchEvent(@NonNull MotionEvent event)
{
if (mDownCoord < mPreview.getY() || mDownCoord > mButtons.getY())
if (mDownCoord < ViewHelper.getY(mPreview) || mDownCoord > ViewHelper.getY(mButtons))
return false;
super.onTouchEvent(event);

View file

@ -11,9 +11,9 @@ import com.mapswithme.maps.widget.placepage.PlacePageView.State;
import com.nineoldandroids.animation.ValueAnimator;
import com.nineoldandroids.view.ViewHelper;
public class LeftFullAnimationController extends BasePlacePageAnimationController
public class LeftFullPlacePageAnimationController extends BasePlacePageAnimationController
{
public LeftFullAnimationController(@NonNull PlacePageView placePage)
public LeftFullPlacePageAnimationController(@NonNull PlacePageView placePage)
{
super(placePage);
}

View file

@ -49,7 +49,7 @@ import com.mapswithme.util.Utils;
import com.mapswithme.util.statistics.Statistics;
public class PlacePageView extends LinearLayout implements View.OnClickListener, View.OnLongClickListener, TextView.OnEditorActionListener
public class PlacePageView extends RelativeLayout implements View.OnClickListener, View.OnLongClickListener, TextView.OnEditorActionListener
{
private LayoutInflater mInflater;
// Preview
@ -109,7 +109,7 @@ public class PlacePageView extends LinearLayout implements View.OnClickListener,
public PlacePageView(Context context, AttributeSet attrs, int defStyleAttr)
{
super(context, attrs, defStyleAttr);
super(context, attrs);
mIsLatLonDms = context.getSharedPreferences(context.getString(R.string.pref_file_name),
Context.MODE_PRIVATE).getBoolean(PREF_USE_DMS, false);
@ -185,7 +185,7 @@ public class PlacePageView extends LinearLayout implements View.OnClickListener,
mAnimationController = new LeftFloatPlacePageAnimationController(this);
break;
case 3:
mAnimationController = new LeftFullAnimationController(this);
mAnimationController = new LeftFullPlacePageAnimationController(this);
break;
}
}