forked from organicmaps/organicmaps
Search result place page. Removed animation.
This commit is contained in:
parent
e3701856d1
commit
dba39e5273
2 changed files with 55 additions and 16 deletions
23
android/res/layout/info_box_additional_layer.xml
Normal file
23
android/res/layout/info_box_additional_layer.xml
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?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="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/info_box_address"
|
||||
style="@style/Holo.TextAppearance.Medium.Light"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:fontFamily="@string/robotoLight" />
|
||||
|
||||
|
||||
<include
|
||||
android:id="@+id/info_box_geo_ref"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
layout="@layout/info_box_geo" />
|
||||
|
||||
</LinearLayout>
|
|
@ -297,28 +297,37 @@ public class MapInfoView extends LinearLayout
|
|||
|
||||
private void setTextAndShow(final CharSequence title, final CharSequence subtitle)
|
||||
{
|
||||
// We need 2 animations: hide, show, and one listener
|
||||
final long duration = 300;
|
||||
final Animation fadeOut = new AlphaAnimation(1, 0);
|
||||
fadeOut.setDuration(duration);
|
||||
final Animation fadeIn = new AlphaAnimation(0, 1);
|
||||
fadeIn.setDuration(duration);
|
||||
final boolean animate = false;
|
||||
|
||||
fadeOut.setAnimationListener(new UiUtils.SimpleAnimationListener()
|
||||
if (animate)
|
||||
{
|
||||
@Override
|
||||
public void onAnimationEnd(Animation animation)
|
||||
// We need 2 animations: hide, show, and one listener
|
||||
final long duration = 300;
|
||||
final Animation fadeOut = new AlphaAnimation(1, 0);
|
||||
fadeOut.setDuration(duration);
|
||||
final Animation fadeIn = new AlphaAnimation(0, 1);
|
||||
fadeIn.setDuration(duration);
|
||||
|
||||
fadeOut.setAnimationListener(new UiUtils.SimpleAnimationListener()
|
||||
{
|
||||
mTitle.setText(title);
|
||||
mSubtitle.setText(subtitle);
|
||||
mHeaderGroup.startAnimation(fadeIn);
|
||||
};
|
||||
});
|
||||
@Override
|
||||
public void onAnimationEnd(Animation animation)
|
||||
{
|
||||
mTitle.setText(title);
|
||||
mSubtitle.setText(subtitle);
|
||||
mHeaderGroup.startAnimation(fadeIn);
|
||||
};
|
||||
});
|
||||
mHeaderGroup.startAnimation(fadeOut);
|
||||
}
|
||||
else
|
||||
{
|
||||
mTitle.setText(title);
|
||||
mSubtitle.setText(subtitle);
|
||||
}
|
||||
|
||||
show(true);
|
||||
showHeader(true);
|
||||
|
||||
mHeaderGroup.startAnimation(fadeOut);
|
||||
}
|
||||
|
||||
public boolean hasThatObject(MapObject mo)
|
||||
|
@ -422,6 +431,13 @@ public class MapInfoView extends LinearLayout
|
|||
private void setBodyForAdditionalLayer(SearchResult sr)
|
||||
{
|
||||
mBodyContainer.removeAllViews();
|
||||
|
||||
final View addLayerView = mInflater.inflate(R.layout.info_box_additional_layer, null);
|
||||
|
||||
final TextView addressText = (TextView) addLayerView.findViewById(R.id.info_box_address);
|
||||
addressText.setText(Framework.getNameAndAddress4Point(sr.getLat(), sr.getLon()));
|
||||
|
||||
mBodyContainer.addView(addLayerView);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue