Commit 07b303c6 authored by Varun Patil's avatar Varun Patil

fix(map): Zoom to location on search

parent d151d91d
......@@ -120,7 +120,8 @@ public class MapFragment extends Fragment implements TextWatcher,
private final int MSG_ANIMATE = 1;
private final int MSG_PLAY_SOUND = 2;
private final int MSG_DISPLAY_MAP = 3;
private final long DELAY_ANIMATE = 50;
private final long DELAY_ANIMATE = 300;
private final long DELAY_ANIMATE_SHORT = 50;
private final long DELAY_INIT_LAYOUT = 50;
public LinearLayout newSmallCard;
public ImageView placeColor;
......@@ -587,8 +588,9 @@ public class MapFragment extends Fragment implements TextWatcher,
// display and zoom to marker if exists
if (marker != null) {
showCard(marker);
Message msg = mHandler.obtainMessage(MSG_ANIMATE, key);
mHandler.sendMessageDelayed(msg, DELAY_ANIMATE);
mHandler.sendMessageDelayed(msg, cardSlideListener.isPanelOpen() ? DELAY_ANIMATE_SHORT : DELAY_ANIMATE);
} else {
campusMapView.setResultMarker(null);
this.dismissCard();
......@@ -615,7 +617,6 @@ public class MapFragment extends Fragment implements TextWatcher,
getActivity().findViewById(R.id.place_group_color).setBackgroundColor(
marker.getColor());
getActivity().findViewById(R.id.dragView).setVisibility(View.VISIBLE);
reCenterMarker(marker);
cardSlideListener.showCard();
}
......
......@@ -109,6 +109,10 @@ public class CardSlideListener implements PanelSlideListener,
animator.start();
}
public boolean isPanelOpen() {
return slidingLayout.getPanelHeight() > 10;
}
@Override
public void onAnimationUpdate(ValueAnimator animator) {
int panelHeight = (Integer) animator.getAnimatedValue();
......
......@@ -309,9 +309,7 @@ public class CampusMapView extends SubsamplingScaleImageView {
public void showResultMarker() {
if (resultMarker != null) {
boolean noDelay = false;
if (isInView(getResultMarker().getPoint()))
noDelay = true;
boolean noDelay = isInView(getResultMarker().getPoint());
AnimationBuilder anim = animateScaleAndCenter(getShowTextScale(),
resultMarker.getPoint());
anim.withDuration(750).start();
......
......@@ -21,7 +21,10 @@
android:paddingRight="6dp"
android:paddingTop="3dp"
android:textColor="@color/primaryTextColor"
android:textColorHint="@color/primaryTextColor" />
android:textColorHint="@color/primaryTextColor"
android:maxLines="1"
android:inputType="text"
android:imeOptions="actionSearch" />
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment