[android] Review fixes.

This commit is contained in:
Dmitry Yunitsky 2016-08-05 09:39:02 +03:00 committed by Vladimir Byko-Ianko
parent 0995e350a7
commit e1c0ae74e8
5 changed files with 29 additions and 33 deletions

View file

@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="UnusedAttribute">
<item android:drawable="@drawable/bg_circle_pressed"
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="@drawable/bg_circle_pressed"
android:state_pressed="true"/>
<item android:drawable="@drawable/bg_circle"/>
<item
android:drawable="@drawable/bg_circle"/>
</selector>

View file

@ -33,8 +33,6 @@
android:paddingStart="@dimen/margin_base"
android:text="@string/placepage_edit_bookmark_button"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?dividerHorizontal"/>
<include
layout="@layout/divider_horizontal"/>
</LinearLayout>

View file

@ -46,7 +46,6 @@ public class EditBookmarkFragment extends BaseMwmDialogFragment implements View.
final EditBookmarkFragment fragment = (EditBookmarkFragment) Fragment.instantiate(context, name, args);
fragment.setArguments(args);
fragment.show(manager, name);
}
public EditBookmarkFragment() {}

View file

@ -111,7 +111,7 @@ class PlacePageBottomAnimationController extends BasePlacePageAnimationControlle
private boolean isDetailsScrollable()
{
return mDetailsFrame.getHeight() != mDetailsContent.getHeight();
return mDetailsFrame.getHeight() < mDetailsContent.getHeight();
}
private boolean canScroll(float delta)
@ -241,10 +241,6 @@ class PlacePageBottomAnimationController extends BasePlacePageAnimationControlle
/**
* Prepares widgets for animating, places them vertically accordingly to their supposed positions.
*
* @param currentState
* @param newState
* @param type
*/
private void prepareYTranslations(State currentState, State newState, @MapObject.MapObjectType int type)
{
@ -404,6 +400,7 @@ class PlacePageBottomAnimationController extends BasePlacePageAnimationControlle
mCurrentAnimator.removeAllUpdateListeners();
mCurrentAnimator.removeAllListeners();
mCurrentAnimator.end();
mCurrentAnimator = null;
}
}

View file

@ -76,9 +76,9 @@ import com.mapswithme.util.statistics.Statistics;
public class PlacePageView extends RelativeLayout
implements View.OnClickListener,
View.OnLongClickListener,
SponsoredHotel.OnPriceReceivedListener
implements View.OnClickListener,
View.OnLongClickListener,
SponsoredHotel.OnPriceReceivedListener
{
private static final String PREF_USE_DMS = "use_dms";
@ -368,7 +368,8 @@ public class PlacePageView extends RelativeLayout
public void run()
{
Statistics.INSTANCE.trackEvent(Statistics.EventName.DOWNLOADER_ACTION,
Statistics.params().add(Statistics.EventParam.ACTION, "download")
Statistics.params()
.add(Statistics.EventParam.ACTION, "download")
.add(Statistics.EventParam.FROM, "placepage")
.add("is_auto", "false")
.add("scenario", (mCurrentCountry.isExpandable() ? "download_group"
@ -377,15 +378,15 @@ public class PlacePageView extends RelativeLayout
});
}
}).setOnCancelClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
MapManager.nativeCancel(mCurrentCountry.id);
Statistics.INSTANCE.trackEvent(Statistics.EventName.DOWNLOADER_CANCEL,
Statistics.params().add(Statistics.EventParam.FROM, "placepage"));
}
});
{
@Override
public void onClick(View v)
{
MapManager.nativeCancel(mCurrentCountry.id);
Statistics.INSTANCE.trackEvent(Statistics.EventName.DOWNLOADER_CANCEL,
Statistics.params().add(Statistics.EventParam.FROM, "placepage"));
}
});
mDownloaderInfo = (TextView) mPreview.findViewById(R.id.tv__downloader_details);
@ -537,7 +538,7 @@ public class PlacePageView extends RelativeLayout
/**
* @param mapObject new MapObject
* @param force if true, new object'll be set without comparison with the old one
* @param force if true, new object'll be set without comparison with the old one
*/
public void setMapObject(MapObject mapObject, boolean force)
{
@ -1083,10 +1084,10 @@ public class PlacePageView extends RelativeLayout
private static boolean isInvalidDownloaderStatus(int status)
{
return (status != CountryItem.STATUS_DOWNLOADABLE &&
status != CountryItem.STATUS_ENQUEUED &&
status != CountryItem.STATUS_FAILED &&
status != CountryItem.STATUS_PARTLY &&
status != CountryItem.STATUS_PROGRESS);
status != CountryItem.STATUS_ENQUEUED &&
status != CountryItem.STATUS_FAILED &&
status != CountryItem.STATUS_PARTLY &&
status != CountryItem.STATUS_PROGRESS);
}
private void updateDownloader(CountryItem country)