增加埋点
This commit is contained in:
@@ -3,9 +3,11 @@ package com.mogo.commons.mvp;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
|
||||
import android.view.MotionEvent;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.mogo.utils.SoftKeyBoardJobber;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -53,6 +55,22 @@ public abstract class MvpActivity< V extends IView, P extends Presenter< V > >
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatchTouchEvent( MotionEvent ev ) {
|
||||
if ( ev.getAction() == MotionEvent.ACTION_DOWN && enableDispatchTouchEventToDismissSoftKeyBoard() ) {
|
||||
SoftKeyBoardJobber.hideIfNecessary( this, ev );
|
||||
return super.dispatchTouchEvent( ev );
|
||||
}
|
||||
// 必不可少,否则所有的组件都不会有TouchEvent了
|
||||
if ( getWindow().superDispatchTouchEvent( ev ) ) {
|
||||
return true;
|
||||
}
|
||||
return onTouchEvent( ev );
|
||||
}
|
||||
protected boolean enableDispatchTouchEventToDismissSoftKeyBoard() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
@@ -11,6 +11,7 @@ import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.analytics.AnalyticsUtils;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
@@ -40,6 +41,7 @@ import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
import com.mogo.service.windowview.IMogoWindowManager;
|
||||
import com.mogo.utils.TipToast;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -186,6 +188,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
mCommonAddress.setVisibility( View.GONE );
|
||||
mNaviInfo.setVisibility( View.VISIBLE );
|
||||
mExitNavi.setVisibility( View.VISIBLE );
|
||||
AnalyticsUtils.track("Navigation_guide_type", new HashMap<>());
|
||||
|
||||
mMApUIController.setPointToCenter(0.675926, 0.77552);
|
||||
}
|
||||
@@ -195,6 +198,8 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
mCommonAddress.setVisibility( View.VISIBLE );
|
||||
mNaviInfo.setVisibility( View.GONE );
|
||||
mExitNavi.setVisibility( View.GONE );
|
||||
AnalyticsUtils.track("Navigation_guide_type", new HashMap<>());
|
||||
|
||||
mMApUIController.setPointToCenter(0.66145, 0.590688);
|
||||
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public abstract class BaseSearchFragment extends BaseFragment implements SearchV
|
||||
protected SearchPresenter mSearchPresenter;
|
||||
|
||||
private View mClose;
|
||||
private EditText mSearchBox;
|
||||
protected EditText mSearchBox;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ public class CategoryPresenter extends Presenter<CategoryView> {
|
||||
|
||||
public void startSearchLocalPoiByInput(String keyword) {
|
||||
MogoPoiSearchQuery mogoInputtipsQuery = new MogoPoiSearchQuery("", keyword);
|
||||
mogoInputtipsQuery.setPageSize(10);
|
||||
mogoInputtipsQuery.setLocation(
|
||||
SearchServiceHolder.INSTANCE.getMapUIController().getWindowCenterLocation());
|
||||
IMogoPoiSearch inputtipsSearch =
|
||||
|
||||
@@ -57,9 +57,11 @@ class CategorySearchFragment : BaseFragment(), CategoryView {
|
||||
}
|
||||
addMarkers = SearchServiceHolder.getMarkerManger()
|
||||
.addMarkers(TAG, arrayList, true)
|
||||
|
||||
moveMapToRight()
|
||||
}
|
||||
|
||||
|
||||
|
||||
private lateinit var mAdapter: SearchCategoryAdapter
|
||||
|
||||
private lateinit var mSearchPresenter: CategoryPresenter
|
||||
@@ -73,6 +75,7 @@ class CategorySearchFragment : BaseFragment(), CategoryView {
|
||||
mSearchPresenter = CategoryPresenter(this)
|
||||
lifecycle.addObserver(mSearchPresenter)
|
||||
|
||||
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
@@ -137,7 +140,6 @@ class CategorySearchFragment : BaseFragment(), CategoryView {
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
super.onActivityCreated(savedInstanceState)
|
||||
mSearchPresenter.startSearchLocalPoiByInput(category)
|
||||
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
@@ -146,6 +148,7 @@ class CategorySearchFragment : BaseFragment(), CategoryView {
|
||||
lifecycle.removeObserver(mSearchPresenter)
|
||||
SearchServiceHolder.getMarkerManger()
|
||||
.removeMarkers(TAG)
|
||||
moveMapToCenter()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
||||
@@ -10,6 +10,7 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.commons.analytics.AnalyticsUtils;
|
||||
import com.mogo.map.search.inputtips.MogoTip;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.module.navi.R;
|
||||
@@ -23,6 +24,7 @@ import com.mogo.module.navi.ui.base.UiController;
|
||||
import com.mogo.module.navi.ui.setting.NaviSettingFragment;
|
||||
import com.mogo.service.fragmentmanager.FragmentDescriptor;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -114,6 +116,7 @@ public class SearchFragment extends BaseSearchFragment implements SearchView, Vi
|
||||
|
||||
mHistoryAdapter.setOnClickListener(new View.OnClickListener() {
|
||||
@Override public void onClick(View v) {
|
||||
AnalyticsUtils.track("Navigation_History_destination", new HashMap<String,Object>());
|
||||
SearchPoi item = (SearchPoi) v.getTag(R.id.tag_item);
|
||||
MogoTip mogoTip = EntityConvertUtils.poi2MogoTip(item);
|
||||
SearchServiceHolder.INSTANCE.push(ChoosePathFragment.Companion.newInstance(mogoTip.getPoint()),
|
||||
@@ -139,6 +142,8 @@ public class SearchFragment extends BaseSearchFragment implements SearchView, Vi
|
||||
|
||||
findViewById(R.id.tv_navi_setting).setOnClickListener(new View.OnClickListener() {
|
||||
@Override public void onClick(View v) {
|
||||
AnalyticsUtils.track("Navigation_button_setting", new HashMap<String,Object>());
|
||||
|
||||
push(new NaviSettingFragment(), MogoModulePaths.PATH_FRAGMENT_SETTING);
|
||||
}
|
||||
});
|
||||
@@ -160,6 +165,14 @@ public class SearchFragment extends BaseSearchFragment implements SearchView, Vi
|
||||
findViewById(R.id.tv_navi_gas).setOnClickListener(this);
|
||||
findViewById(R.id.tv_navi_restaurant).setOnClickListener(this);
|
||||
findViewById(R.id.tv_navi_park).setOnClickListener(this);
|
||||
|
||||
findViewById(R.id.tv_navi_search).setOnClickListener(new View.OnClickListener() {
|
||||
@Override public void onClick(View v) {
|
||||
AnalyticsUtils.track("Navigation_button_search", new HashMap<String,Object>());
|
||||
|
||||
mSearchPresenter.startSearchPoiByInput(mSearchBox.getText().toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void push(Fragment fragment, String tag) {
|
||||
@@ -170,8 +183,6 @@ public class SearchFragment extends BaseSearchFragment implements SearchView, Vi
|
||||
SearchServiceHolder.INSTANCE.getFragmentManager().push(build);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 显示我的位置,并且可设置为家
|
||||
*/
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.widget.SeekBar
|
||||
import android.widget.SeekBar.OnSeekBarChangeListener
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.commons.analytics.AnalyticsUtils
|
||||
import com.mogo.map.constants.BroadcastMode
|
||||
import com.mogo.map.uicontroller.EnumMapUI
|
||||
import com.mogo.module.common.MogoModulePaths
|
||||
@@ -36,6 +37,7 @@ import kotlinx.android.synthetic.main.fragment_navi_setting.rb_navi_no_high_way
|
||||
import kotlinx.android.synthetic.main.fragment_navi_setting.rg_navi_day_night
|
||||
import kotlinx.android.synthetic.main.fragment_navi_setting.rg_navi_sound_type
|
||||
import kotlinx.android.synthetic.main.fragment_navi_setting.sb_navi_volume_progress
|
||||
import java.util.HashMap
|
||||
|
||||
/**
|
||||
* @author zyz
|
||||
@@ -44,6 +46,8 @@ import kotlinx.android.synthetic.main.fragment_navi_setting.sb_navi_volume_progr
|
||||
@Route(path = MogoModulePaths.PATH_FRAGMENT_SETTING)
|
||||
class NaviSettingFragment : BaseFragment(), OnCheckedChangeListener {
|
||||
|
||||
private var type: Int = 0
|
||||
|
||||
override fun onCheckedChanged(
|
||||
buttonView: CompoundButton?,
|
||||
isChecked: Boolean
|
||||
@@ -51,22 +55,33 @@ class NaviSettingFragment : BaseFragment(), OnCheckedChangeListener {
|
||||
if (buttonView?.id == R.id.rb_navi_fee) {
|
||||
SettingManager.cost(isChecked)
|
||||
if (isChecked) {
|
||||
type = 2
|
||||
rb_navi_high_way.isChecked = false
|
||||
}
|
||||
} else if (buttonView?.id == R.id.rb_navi_high_way) {
|
||||
SettingManager.highSpeed(isChecked)
|
||||
type = 4
|
||||
|
||||
if (isChecked) {
|
||||
rb_navi_no_high_way.isChecked = false
|
||||
rb_navi_fee.isChecked = false
|
||||
}
|
||||
} else if (buttonView?.id == R.id.rb_navi_no_high_way) {
|
||||
SettingManager.avoidSpeed(isChecked)
|
||||
type = 3
|
||||
|
||||
if (isChecked) {
|
||||
rb_navi_high_way.isChecked = false
|
||||
}
|
||||
} else if (buttonView?.id == R.id.rb_navi_jam) {
|
||||
SettingManager.congestion(isChecked)
|
||||
type = 1
|
||||
|
||||
}
|
||||
if (isChecked) {
|
||||
AnalyticsUtils.track("Navigation_preference", mapOf("type" to type))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
@@ -161,6 +176,13 @@ class NaviSettingFragment : BaseFragment(), OnCheckedChangeListener {
|
||||
.setBroadcastMode(
|
||||
if (checkedId == R.id.rb_navi_detail) BroadcastMode.DETAIL else BroadcastMode.CONCISE
|
||||
)
|
||||
|
||||
|
||||
if (checkedId == R.id.rb_navi_detail) {
|
||||
AnalyticsUtils.track("Navigation_guide_type", mapOf("type" to 1))
|
||||
} else {
|
||||
AnalyticsUtils.track("Navigation_guide_type", mapOf("type" to 2))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,20 @@
|
||||
<include layout="@layout/include_search_bar" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="@dimen/dp_266"
|
||||
android:text="@string/set_as_home_navi"
|
||||
android:layout_marginRight="@dimen/dp_8"
|
||||
android:gravity="center"
|
||||
android:id="@+id/tv_navi_search"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_40"
|
||||
android:background="@drawable/shape_round_blue_grident"
|
||||
app:layout_constraintRight_toRightOf="@+id/ll_navi_search"
|
||||
app:layout_constraintTop_toTopOf="@+id/ll_navi_search"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/ll_navi_search"
|
||||
android:layout_height="@dimen/dp_104"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_navi_home"
|
||||
android:layout_width="@dimen/dp_568"
|
||||
|
||||
Reference in New Issue
Block a user