diff --git a/android/res/layout/fragment_place_description.xml b/android/res/layout/fragment_place_description.xml index 4fa9360a9c..a631272554 100644 --- a/android/res/layout/fragment_place_description.xml +++ b/android/res/layout/fragment_place_description.xml @@ -4,7 +4,7 @@ android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> - diff --git a/android/src/com/mapswithme/maps/bookmarks/PlaceDescriptionFragment.java b/android/src/com/mapswithme/maps/bookmarks/PlaceDescriptionFragment.java index e5709b972f..883b6c865c 100644 --- a/android/src/com/mapswithme/maps/bookmarks/PlaceDescriptionFragment.java +++ b/android/src/com/mapswithme/maps/bookmarks/PlaceDescriptionFragment.java @@ -11,7 +11,6 @@ import android.webkit.WebViewClient; import com.mapswithme.maps.R; import com.mapswithme.maps.base.BaseMwmFragment; -import com.mapswithme.maps.widget.WebViewCompat; import com.mapswithme.util.Utils; import com.mapswithme.util.statistics.Statistics; @@ -38,11 +37,10 @@ public class PlaceDescriptionFragment extends BaseMwmFragment @Nullable Bundle savedInstanceState) { View root = inflater.inflate(R.layout.fragment_place_description, container, false); - WebViewCompat webView = root.findViewById(R.id.webview); + WebView webView = root.findViewById(R.id.webview); webView.loadData(mDescription, Utils.TEXT_HTML, Utils.UTF_8); webView.setVerticalScrollBarEnabled(true); webView.setWebViewClient(new PlaceDescriptionClient()); - webView.setOnScrollChangedListener(new ContentBottomBorderDetector()); return root; } @@ -51,23 +49,8 @@ public class PlaceDescriptionFragment extends BaseMwmFragment @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { - Statistics.INSTANCE.trackEvent(Statistics.EventName.PLACEPAGE_DESCRIPTION_OUTBOUND_CLICK); + Statistics.INSTANCE.trackEvent(Statistics.EventName.PLACEPAGE_DESCRIPTION_VIEW_ALL); return super.shouldOverrideUrlLoading(view, url); } } - - private static class ContentBottomBorderDetector implements WebViewCompat.OnScrollChangedListener - { - @Override - public void onScroll(@NonNull WebViewCompat webViewCompat, int l, int t, int oldl, int oldt) - { - int contentHeight = (int) Math.floor(webViewCompat.getContentHeight() * - webViewCompat.getScale()); - if (contentHeight - webViewCompat.getScrollY() == webViewCompat.getHeight()) - Statistics.INSTANCE.trackEvent(Statistics.EventName.PLACEPAGE_DESCRIPTION_VIEW_ALL, - new Statistics.ParameterBuilder().add( - Statistics.EventParam.SOURCE, - Statistics.ParamValue.WIKI)); - } - } } diff --git a/android/src/com/mapswithme/maps/widget/WebViewCompat.java b/android/src/com/mapswithme/maps/widget/WebViewCompat.java deleted file mode 100644 index ccf01f0856..0000000000 --- a/android/src/com/mapswithme/maps/widget/WebViewCompat.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.mapswithme.maps.widget; - -import android.content.Context; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.util.AttributeSet; -import android.webkit.WebView; - -public class WebViewCompat extends WebView -{ - @Nullable - private OnScrollChangedListener mOnScrollChangedListener; - - public WebViewCompat(final Context context) - { - super(context); - } - - public WebViewCompat(final Context context, final AttributeSet attrs) - { - super(context, attrs); - } - - public WebViewCompat(final Context context, final AttributeSet attrs, final int defStyle) - { - super(context, attrs, defStyle); - } - - public WebViewCompat(Context context, AttributeSet attrs, int defStyleAttr, - boolean privateBrowsing) - { - super(context, attrs, defStyleAttr, privateBrowsing); - } - - @Override - protected void onScrollChanged(final int l, final int t, final int oldl, final int oldt) - { - super.onScrollChanged(l, t, oldl, oldt); - if(mOnScrollChangedListener != null) - mOnScrollChangedListener.onScroll(WebViewCompat.this, l, t, oldl, oldt); - } - - public void setOnScrollChangedListener(@NonNull OnScrollChangedListener onScrollChangedListener) - { - mOnScrollChangedListener = onScrollChangedListener; - } - - public interface OnScrollChangedListener - { - void onScroll(@NonNull WebViewCompat webView, int l, int t, int oldl, int oldt); - } -} diff --git a/android/src/com/mapswithme/util/statistics/Statistics.java b/android/src/com/mapswithme/util/statistics/Statistics.java index eb12ccc4dd..b0f8eb0aae 100644 --- a/android/src/com/mapswithme/util/statistics/Statistics.java +++ b/android/src/com/mapswithme/util/statistics/Statistics.java @@ -248,7 +248,6 @@ public enum Statistics public static final String SETTINGS_TRACKING_TOGGLE = "Settings_Tracking_toggle"; public static final String PLACEPAGE_DESCRIPTION_VIEW_ALL = "Placepage_Description_View_all"; public static final String PLACEPAGE_DESCRIPTION_MORE = "Placepage_Description_more"; - public static final String PLACEPAGE_DESCRIPTION_OUTBOUND_CLICK = "Placepage_Description_Outbound_click"; public static final String SETTINGS_SPEED_CAMS = "Settings. Speed_cameras"; static final String DOWNLOADER_DIALOG_ERROR = "Downloader_OnStartScreen_error";