Merge branch 'feature/v1.0.0' of gitlab.zhidaoauto.com:ecos/yycp-service/Launcher into feature/v1.0.0
This commit is contained in:
@@ -45,7 +45,7 @@ public abstract class BaseSearchFragment extends BaseFragment implements SearchV
|
||||
protected SearchPresenter mSearchPresenter;
|
||||
|
||||
private View mClose;
|
||||
private EditText mSearchBox;
|
||||
protected EditText mSearchBox;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -62,7 +62,9 @@ public class CategoryPresenter extends Presenter<CategoryView> {
|
||||
}
|
||||
|
||||
public void startSearchLocalPoiByInput(String keyword) {
|
||||
MogoPoiSearchQuery mogoInputtipsQuery = new MogoPoiSearchQuery("", keyword);
|
||||
MogoPoiSearchQuery mogoInputtipsQuery = new MogoPoiSearchQuery(keyword, keyword);
|
||||
mogoInputtipsQuery.setPageSize(10);
|
||||
mogoInputtipsQuery.getCity();
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 显示我的位置,并且可设置为家
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.module.navi.ui.setting
|
||||
|
||||
import android.content.Context
|
||||
import android.media.AudioManager
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.CompoundButton
|
||||
@@ -8,6 +10,9 @@ 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
|
||||
import com.mogo.module.navi.R
|
||||
import com.mogo.module.navi.constants.SearchServiceHolder
|
||||
@@ -32,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
|
||||
@@ -40,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
|
||||
@@ -47,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 {
|
||||
@@ -108,6 +127,10 @@ class NaviSettingFragment : BaseFragment(), OnCheckedChangeListener {
|
||||
rb_navi_no_high_way.setOnCheckedChangeListener(this)
|
||||
rb_navi_fee.setOnCheckedChangeListener(this)
|
||||
|
||||
var audioManager = activity?.getSystemService(Context.AUDIO_SERVICE) as AudioManager
|
||||
sb_navi_volume_progress.max = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC)
|
||||
sb_navi_volume_progress.progress = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC)
|
||||
|
||||
|
||||
sb_navi_volume_progress.setOnSeekBarChangeListener(object : OnSeekBarChangeListener {
|
||||
override fun onProgressChanged(
|
||||
@@ -115,9 +138,9 @@ class NaviSettingFragment : BaseFragment(), OnCheckedChangeListener {
|
||||
progress: Int,
|
||||
fromUser: Boolean
|
||||
) {
|
||||
if (fromUser) {
|
||||
SettingManager.volume = progress
|
||||
}
|
||||
audioManager.setStreamVolume(
|
||||
AudioManager.STREAM_MUSIC, progress, AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE
|
||||
)
|
||||
}
|
||||
|
||||
override fun onStartTrackingTouch(seekBar: SeekBar?) {
|
||||
@@ -131,9 +154,35 @@ class NaviSettingFragment : BaseFragment(), OnCheckedChangeListener {
|
||||
|
||||
rg_navi_day_night.setOnCheckedChangeListener { group, checkedId ->
|
||||
SettingManager.mapType = checkedId
|
||||
|
||||
when (checkedId) {
|
||||
R.id.rb_navi_day -> {
|
||||
SearchServiceHolder.getMapUIController()
|
||||
.changeMapMode(EnumMapUI.Type_Night)
|
||||
}
|
||||
R.id.rb_navi_night -> {
|
||||
SearchServiceHolder.getMapUIController()
|
||||
.changeMapMode(EnumMapUI.Type_Light)
|
||||
}
|
||||
R.id.rb_navi_auto -> {
|
||||
SearchServiceHolder.getMapUIController()
|
||||
.changeMapMode(EnumMapUI.Type_AUTO_LIGHT_Night)
|
||||
}
|
||||
}
|
||||
}
|
||||
rg_navi_sound_type.setOnCheckedChangeListener { group, checkedId ->
|
||||
SettingManager.voiceStyle = checkedId
|
||||
SearchServiceHolder.getNavi()
|
||||
.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))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user