<commit_before>package com.mapswithme.maps.widget.placepage;

import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.location.Location;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.*;
import android.view.inputmethod.EditorInfo;
import android.webkit.WebView;
import android.widget.*;
import com.mapswithme.maps.*;
import com.mapswithme.maps.api.ParsedMwmRequest;
import com.mapswithme.maps.bookmarks.ChooseBookmarkCategoryFragment;
import com.mapswithme.maps.bookmarks.data.*;
import com.mapswithme.maps.bookmarks.data.MapObject.MapObjectType;
import com.mapswithme.maps.bookmarks.data.MapObject.Poi;
import com.mapswithme.maps.location.LocationHelper;
import com.mapswithme.maps.routing.RoutingController;
import com.mapswithme.maps.widget.ArrowView;
import com.mapswithme.maps.widget.BaseShadowController;
import com.mapswithme.maps.widget.ObservableScrollView;
import com.mapswithme.maps.widget.ScrollViewShadowController;
import com.mapswithme.util.*;
import com.mapswithme.util.concurrency.UiThread;
import com.mapswithme.util.sharing.ShareOption;
import com.mapswithme.util.statistics.AlohaHelper;
import com.mapswithme.util.statistics.Statistics;

import java.util.ArrayList;
import java.util.List;


public class PlacePageView extends RelativeLayout implements View.OnClickListener, View.OnLongClickListener
{
  private static final String PREF_USE_DMS = "use_dms";

  private boolean mIsDocked;
  private boolean mIsFloating;

  // Preview
  private TextView mTvTitle;
  private Toolbar mToolbar;
  private TextView mTvSubtitle;
  private TextView mTvOpened;
  private ArrowView mAvDirection;
  private TextView mTvDistance;
  private RatingBar mRbStars;
  private TextView mTvElevation;
  // Place page details
  private ScrollView mPpDetails;
  private RelativeLayout mAddress;
  private TextView mTvAddress;
  private LinearLayout mPhone;
  private TextView mTvPhone;
  private LinearLayout mWebsite;
  private TextView mTvWebsite;
  private LinearLayout mLatlon;
  private TextView mTvLatlon;
  private LinearLayout mSchedule;
  private TextView mTvSchedule;
  private LinearLayout mWifi;
  private LinearLayout mEmail;
  private TextView mTvEmail;
  private LinearLayout mOperator;
  private TextView mTvOperator;
  private LinearLayout mCuisine;
  private TextView mTvCuisine;
  private LinearLayout mWiki;
  private TextView mTvWiki;
  private LinearLayout mEntrance;
  private TextView mTvEntrance;
  // Bookmark
  private ImageView mIvColor;
  private EditText mEtBookmarkName;
  private TextView mTvNotes;
  private WebView mWvDescription;
  private TextView mTvDescription;
  private Button mBtnEditHtmlDescription;
  private TextView mTvBookmarkGroup;
  // Place page buttons
  private View mGeneralButtonsFrame;
  private View mRouteButtonsFrame;
  private View mApiBack;
  private ImageView mIvBookmark;
  private View mRoutingButton;
  // Animations
  private BaseShadowController mShadowController;
  private BasePlacePageAnimationController mAnimationController;
  private MwmActivity.LeftAnimationTrackListener mLeftAnimationTrackListener;
  // Data
  private MapObject mMapObject;

  private MapObject mBookmarkedMapObject;
  private boolean mIsLatLonDms;


  public enum State
  {
    HIDDEN,
    PREVIEW,
    BOOKMARK,
    DETAILS
  }

  public PlacePageView(Context context)
  {
    this(context, null, 0);
  }

  public PlacePageView(Context context, AttributeSet attrs)
  {
    this(context, attrs, 0);
  }

  public PlacePageView(Context context, AttributeSet attrs, int defStyleAttr)
  {
    super(context, attrs);

    mIsLatLonDms = MwmApplication.prefs().getBoolean(PREF_USE_DMS, false);

    init(attrs, defStyleAttr);
  }

  private void initViews()
  {
    LayoutInflater.from(getContext()).inflate(R.layout.place_page, this);

    ViewGroup ppPreview = (ViewGroup) findViewById(R.id.pp__preview);
    mTvTitle = (TextView) ppPreview.findViewById(R.id.tv__title);
    mToolbar = (Toolbar) findViewById(R.id.toolbar);
    mTvSubtitle = (TextView) ppPreview.findViewById(R.id.tv__subtitle);
    mTvOpened = (TextView) ppPreview.findViewById(R.id.tv__opened_till);
    mTvDistance = (TextView) ppPreview.findViewById(R.id.tv__straight_distance);
    mAvDirection = (ArrowView) ppPreview.findViewById(R.id.av__direction);
    mAvDirection.setOnClickListener(this);
    mAvDirection.setImageResource(R.drawable.selector_direction);
    mRbStars = (RatingBar) ppPreview.findViewById(R.id.rb__stars);
    mTvElevation = (TextView) ppPreview.findViewById(R.id.tv__peak_elevation);

    mPpDetails = (ScrollView) findViewById(R.id.pp__details);
    mAddress = (RelativeLayout) mPpDetails.findViewById(R.id.ll__place_name);
    mTvAddress = (TextView) mPpDetails.findViewById(R.id.tv__place_address);
    mPhone = (LinearLayout) mPpDetails.findViewById(R.id.ll__place_phone);
    mPhone.setOnClickListener(this);
    mTvPhone = (TextView) mPpDetails.findViewById(R.id.tv__place_phone);
    mWebsite = (LinearLayout) mPpDetails.findViewById(R.id.ll__place_website);
    mWebsite.setOnClickListener(this);
    mTvWebsite = (TextView) mPpDetails.findViewById(R.id.tv__place_website);
    mLatlon = (LinearLayout) mPpDetails.findViewById(R.id.ll__place_latlon);
    mTvLatlon = (TextView) mPpDetails.findViewById(R.id.tv__place_latlon);
    mSchedule = (LinearLayout) mPpDetails.findViewById(R.id.ll__place_schedule);
    mTvSchedule = (TextView) mPpDetails.findViewById(R.id.tv__place_schedule);
    mWifi = (LinearLayout) mPpDetails.findViewById(R.id.ll__place_wifi);
    mIvColor = (ImageView) mPpDetails.findViewById(R.id.iv__bookmark_color);
    mIvColor.setOnClickListener(this);
    mEmail = (LinearLayout) mPpDetails.findViewById(R.id.ll__place_email);
    mEmail.setOnClickListener(this);
    mTvEmail = (TextView) mEmail.findViewById(R.id.tv__place_email);
    mOperator = (LinearLayout) mPpDetails.findViewById(R.id.ll__place_operator);
    mOperator.setOnClickListener(this);
    mTvOperator = (TextView) mOperator.findViewById(R.id.tv__place_operator);
    mCuisine = (LinearLayout) mPpDetails.findViewById(R.id.ll__place_cuisine);
    mTvCuisine = (TextView) mCuisine.findViewById(R.id.tv__place_cuisine);
    mWiki = (LinearLayout) mPpDetails.findViewById(R.id.ll__place_wiki);
    mWiki.setOnClickListener(this);
    mEntrance = (LinearLayout) mPpDetails.findViewById(R.id.ll__place_entrance);
    mTvEntrance = (TextView) mEntrance.findViewById(R.id.tv__place_entrance);
    mLatlon.setOnLongClickListener(this);
    mAddress.setOnLongClickListener(this);
    mPhone.setOnLongClickListener(this);
    mWebsite.setOnLongClickListener(this);
    mSchedule.setOnLongClickListener(this);<commit_msg>[android] fix: PlacePage click on LatLon did nothing.<commit_after>package com.mapswithme.maps.widget.placepage;

import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.location.Location;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.*;
import android.view.inputmethod.EditorInfo;
import android.webkit.WebView;
import android.widget.*;
import com.mapswithme.maps.*;
import com.mapswithme.maps.api.ParsedMwmRequest;
import com.mapswithme.maps.bookmarks.ChooseBookmarkCategoryFragment;
import com.mapswithme.maps.bookmarks.data.*;
import com.mapswithme.maps.bookmarks.data.MapObject.MapObjectType;
import com.mapswithme.maps.bookmarks.data.MapObject.Poi;
import com.mapswithme.maps.location.LocationHelper;
import com.mapswithme.maps.routing.RoutingController;
import com.mapswithme.maps.widget.ArrowView;
import com.mapswithme.maps.widget.BaseShadowController;
import com.mapswithme.maps.widget.ObservableScrollView;
import com.mapswithme.maps.widget.ScrollViewShadowController;
import com.mapswithme.util.*;
import com.mapswithme.util.concurrency.UiThread;
import com.mapswithme.util.sharing.ShareOption;
import com.mapswithme.util.statistics.AlohaHelper;
import com.mapswithme.util.statistics.Statistics;

import java.util.ArrayList;
import java.util.List;


public class PlacePageView extends RelativeLayout implements View.OnClickListener, View.OnLongClickListener
{
  private static final String PREF_USE_DMS = "use_dms";

  private boolean mIsDocked;
  private boolean mIsFloating;

  // Preview
  private TextView mTvTitle;
  private Toolbar mToolbar;
  private TextView mTvSubtitle;
  private TextView mTvOpened;
  private ArrowView mAvDirection;
  private TextView mTvDistance;
  private RatingBar mRbStars;
  private TextView mTvElevation;
  // Place page details
  private ScrollView mPpDetails;
  private RelativeLayout mAddress;
  private TextView mTvAddress;
  private LinearLayout mPhone;
  private TextView mTvPhone;
  private LinearLayout mWebsite;
  private TextView mTvWebsite;
  private LinearLayout mLatlon;
  private TextView mTvLatlon;
  private LinearLayout mSchedule;
  private TextView mTvSchedule;
  private LinearLayout mWifi;
  private LinearLayout mEmail;
  private TextView mTvEmail;
  private LinearLayout mOperator;
  private TextView mTvOperator;
  private LinearLayout mCuisine;
  private TextView mTvCuisine;
  private LinearLayout mWiki;
  private TextView mTvWiki;
  private LinearLayout mEntrance;
  private TextView mTvEntrance;
  // Bookmark
  private ImageView mIvColor;
  private EditText mEtBookmarkName;
  private TextView mTvNotes;
  private WebView mWvDescription;
  private TextView mTvDescription;
  private Button mBtnEditHtmlDescription;
  private TextView mTvBookmarkGroup;
  // Place page buttons
  private View mGeneralButtonsFrame;
  private View mRouteButtonsFrame;
  private View mApiBack;
  private ImageView mIvBookmark;
  private View mRoutingButton;
  // Animations
  private BaseShadowController mShadowController;
  private BasePlacePageAnimationController mAnimationController;
  private MwmActivity.LeftAnimationTrackListener mLeftAnimationTrackListener;
  // Data
  private MapObject mMapObject;

  private MapObject mBookmarkedMapObject;
  private boolean mIsLatLonDms;


  public enum State
  {
    HIDDEN,
    PREVIEW,
    BOOKMARK,
    DETAILS
  }

  public PlacePageView(Context context)
  {
    this(context, null, 0);
  }

  public PlacePageView(Context context, AttributeSet attrs)
  {
    this(context, attrs, 0);
  }

  public PlacePageView(Context context, AttributeSet attrs, int defStyleAttr)
  {
    super(context, attrs);

    mIsLatLonDms = MwmApplication.prefs().getBoolean(PREF_USE_DMS, false);

    init(attrs, defStyleAttr);
  }

  private void initViews()
  {
    LayoutInflater.from(getContext()).inflate(R.layout.place_page, this);

    ViewGroup ppPreview = (ViewGroup) findViewById(R.id.pp__preview);
    mTvTitle = (TextView) ppPreview.findViewById(R.id.tv__title);
    mToolbar = (Toolbar) findViewById(R.id.toolbar);
    mTvSubtitle = (TextView) ppPreview.findViewById(R.id.tv__subtitle);
    mTvOpened = (TextView) ppPreview.findViewById(R.id.tv__opened_till);
    mTvDistance = (TextView) ppPreview.findViewById(R.id.tv__straight_distance);
    mAvDirection = (ArrowView) ppPreview.findViewById(R.id.av__direction);
    mAvDirection.setOnClickListener(this);
    mAvDirection.setImageResource(R.drawable.selector_direction);
    mRbStars = (RatingBar) ppPreview.findViewById(R.id.rb__stars);
    mTvElevation = (TextView) ppPreview.findViewById(R.id.tv__peak_elevation);

    mPpDetails = (ScrollView) findViewById(R.id.pp__details);
    mAddress = (RelativeLayout) mPpDetails.findViewById(R.id.ll__place_name);
    mTvAddress = (TextView) mPpDetails.findViewById(R.id.tv__place_address);
    mPhone = (LinearLayout) mPpDetails.findViewById(R.id.ll__place_phone);
    mPhone.setOnClickListener(this);
    mTvPhone = (TextView) mPpDetails.findViewById(R.id.tv__place_phone);
    mWebsite = (LinearLayout) mPpDetails.findViewById(R.id.ll__place_website);
    mWebsite.setOnClickListener(this);
    mTvWebsite = (TextView) mPpDetails.findViewById(R.id.tv__place_website);
    mLatlon = (LinearLayout) mPpDetails.findViewById(R.id.ll__place_latlon);
    mLatlon.setOnClickListener(this);
    mTvLatlon = (TextView) mPpDetails.findViewById(R.id.tv__place_latlon);
    mSchedule = (LinearLayout) mPpDetails.findViewById(R.id.ll__place_schedule);
    mTvSchedule = (TextView) mPpDetails.findViewById(R.id.tv__place_schedule);
    mWifi = (LinearLayout) mPpDetails.findViewById(R.id.ll__place_wifi);
    mIvColor = (ImageView) mPpDetails.findViewById(R.id.iv__bookmark_color);
    mIvColor.setOnClickListener(this);
    mEmail = (LinearLayout) mPpDetails.findViewById(R.id.ll__place_email);
    mEmail.setOnClickListener(this);
    mTvEmail = (TextView) mEmail.findViewById(R.id.tv__place_email);
    mOperator = (LinearLayout) mPpDetails.findViewById(R.id.ll__place_operator);
    mOperator.setOnClickListener(this);
    mTvOperator = (TextView) mOperator.findViewById(R.id.tv__place_operator);
    mCuisine = (LinearLayout) mPpDetails.findViewById(R.id.ll__place_cuisine);
    mTvCuisine = (TextView) mCuisine.findViewById(R.id.tv__place_cuisine);
    mWiki = (LinearLayout) mPpDetails.findViewById(R.id.ll__place_wiki);
    mWiki.setOnClickListener(this);
    mEntrance = (LinearLayout) mPpDetails.findViewById(R.id.ll__place_entrance);
    mTvEntrance = (TextView) mEntrance.findViewById(R.id.tv__place_entrance);
    mLatlon.setOnLongClickListener(this);
    mAddress.setOnLongClickListener(this);
    mPhone.setOnLongClickListener(this);
    mWebsite.setOnLongClickListener(this);
    mSchedule.setOnLongClickListener(this);
{'fraction_non_alphanumeric': 0.09019337016574586, 'fraction_numerical': 0.0008287292817679558, 'mean_word_length': 5.597266514806378, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4940347', 'n_tokens_mistral': 4760, 'n_tokens_neox': 4533, 'n_words': 817}