From c41beb91927987856472820668de42d561212625 Mon Sep 17 00:00:00 2001 From: zhangyuanzhen Date: Wed, 8 Jan 2020 20:44:15 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=AE=B6=E5=92=8C?= =?UTF-8?q?=E5=85=AC=E5=8F=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/commons/AbsMogoApplication.java | 1 - .../mogo/module/common/MogoModulePaths.java | 16 +- .../extensions/entrance/EntranceFragment.java | 2 +- .../navi/constants/SearchServiceHolder.kt | 19 ++ .../navi/ui/search/BaseSearchFragment.java | 280 ++++++++++++++++++ .../module/navi/ui/search/SearchFragment.java | 37 +-- .../navi/ui/setting/NaviSettingFragment.kt | 19 ++ .../navi/ui/setting/SettingAddressFragment.kt | 33 +++ .../main/res/drawable/selector_setting_bg.xml | 6 + .../res/drawable/shape_round_blue_margin.xml | 7 + .../src/main/res/drawable/shape_seek_bar.xml | 26 ++ .../main/res/layout/fragment_navi_setting.xml | 272 +++++++++++++++-- .../src/main/res/layout/fragment_search.xml | 36 +-- .../res/layout/fragment_setting_address.xml | 10 + .../main/res/layout/include_search_bar.xml | 36 +++ .../res/mipmap-xhdpi/icon_navi_position.png | Bin 1847 -> 2791 bytes .../res/mipmap-xhdpi/icon_navi_sound_low.png | Bin 0 -> 296 bytes .../res/mipmap-xhdpi/icon_navi_sound_plus.png | Bin 0 -> 506 bytes .../main/res/mipmap-xhdpi/icon_pb_thumb.png | Bin 0 -> 3687 bytes .../main/res/mipmap-xhdpi/icon_sound_high.png | Bin 0 -> 1760 bytes .../main/res/mipmap-xhdpi/icon_sound_low.png | Bin 0 -> 1220 bytes .../src/main/res/values/strings.xml | 10 + .../src/main/res/values/styles.xml | 1 + 23 files changed, 725 insertions(+), 86 deletions(-) create mode 100644 modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/SearchServiceHolder.kt create mode 100644 modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/BaseSearchFragment.java create mode 100644 modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/setting/SettingAddressFragment.kt create mode 100644 modules/mogo-module-search/src/main/res/drawable/selector_setting_bg.xml create mode 100644 modules/mogo-module-search/src/main/res/drawable/shape_round_blue_margin.xml create mode 100644 modules/mogo-module-search/src/main/res/drawable/shape_seek_bar.xml create mode 100644 modules/mogo-module-search/src/main/res/layout/fragment_setting_address.xml create mode 100644 modules/mogo-module-search/src/main/res/layout/include_search_bar.xml create mode 100755 modules/mogo-module-search/src/main/res/mipmap-xhdpi/icon_navi_sound_low.png create mode 100755 modules/mogo-module-search/src/main/res/mipmap-xhdpi/icon_navi_sound_plus.png create mode 100755 modules/mogo-module-search/src/main/res/mipmap-xhdpi/icon_pb_thumb.png create mode 100755 modules/mogo-module-search/src/main/res/mipmap-xhdpi/icon_sound_high.png create mode 100755 modules/mogo-module-search/src/main/res/mipmap-xhdpi/icon_sound_low.png diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/AbsMogoApplication.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/AbsMogoApplication.java index ba34b7889d..50493f61fa 100644 --- a/foudations/mogo-commons/src/main/java/com/mogo/commons/AbsMogoApplication.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/AbsMogoApplication.java @@ -14,7 +14,6 @@ import com.mogo.commons.network.ParamsUtil; import com.mogo.commons.network.X509TrustManagerImpl; import com.mogo.commons.storage.SpStorage; import com.mogo.utils.TipToast; -import com.mogo.utils.glide.GlideApp; import com.mogo.utils.logger.Logger; import com.mogo.utils.network.NetConfig; import com.zhidao.account.sdk.AccountClientManager; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModulePaths.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModulePaths.java index 0f6bce5c93..65e430a6b3 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModulePaths.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModulePaths.java @@ -52,13 +52,27 @@ public class MogoModulePaths { /** - * 管理 fragment + * 搜索 fragment */ @Keep public static final String PATH_FRAGMENT_SEARCH = "/navi/search"; + /** + * 设置 fragment + */ + @Keep + public static final String PATH_FRAGMENT_SETTING = "/navi/setting"; + + + /** + * 设置家和公司 fragment + */ + @Keep + public static final String PATH_FRAGMENT_SETTING_HOME = "/navi/setting/home"; + + /** * 添加卡片模块 diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java index ead25df897..d516520fcc 100644 --- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java @@ -66,9 +66,9 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent mSearch = findViewById( R.id.module_entrance_id_search ); - Fragment fragment = ( Fragment ) ARouter.getInstance().build( MogoModulePaths.PATH_FRAGMENT_SEARCH ).navigation(); mSearch.setOnClickListener( view -> { + Fragment fragment = ( Fragment ) ARouter.getInstance().build( MogoModulePaths.PATH_FRAGMENT_SEARCH ).navigation(); mMogoFragmentManager.push( new FragmentDescriptor.Builder().fragment( fragment ).tag( MogoModulePaths.PATH_FRAGMENT_SEARCH ).notifyMainModule( true ).build() ); } ); diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/SearchServiceHolder.kt b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/SearchServiceHolder.kt new file mode 100644 index 0000000000..e0465d19a6 --- /dev/null +++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/SearchServiceHolder.kt @@ -0,0 +1,19 @@ +package com.mogo.module.navi.constants + +import com.alibaba.android.arouter.launcher.ARouter +import com.mogo.service.MogoServicePaths +import com.mogo.service.fragmentmanager.IMogoFragmentManager + +/** + *@author zyz + * 2020-01-08. + */ +object SearchServiceHolder { + + val fragmentManager:IMogoFragmentManager = ARouter.getInstance().build( + MogoServicePaths.PATH_FRAGMENT_MANAGER + ).navigation() as IMogoFragmentManager + + + +} \ No newline at end of file diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/BaseSearchFragment.java b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/BaseSearchFragment.java new file mode 100644 index 0000000000..9b0edd0b1f --- /dev/null +++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/BaseSearchFragment.java @@ -0,0 +1,280 @@ +package com.mogo.module.navi.ui.search; + +import android.content.Context; +import android.os.Bundle; +import android.view.View; +import android.widget.EditText; +import android.widget.TextView; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import com.alibaba.android.arouter.facade.annotation.Route; +import com.alibaba.android.arouter.launcher.ARouter; +import com.mogo.map.search.inputtips.MogoTip; +import com.mogo.module.common.MogoModulePaths; +import com.mogo.module.navi.R; +import com.mogo.module.navi.bean.EntityConvertUtils; +import com.mogo.module.navi.bean.SearchPoi; +import com.mogo.module.navi.ui.adapter.HistoryPoiAdapter; +import com.mogo.module.navi.ui.adapter.SearchPoiAdapter; +import com.mogo.module.navi.ui.base.BaseFragment; +import com.mogo.module.navi.ui.base.UiController; +import com.mogo.module.navi.ui.setting.NaviSettingFragment; +import com.mogo.service.MogoServicePaths; +import com.mogo.service.fragmentmanager.FragmentDescriptor; +import com.mogo.service.fragmentmanager.IMogoFragmentManager; +import java.util.ArrayList; +import java.util.List; + +/** + * 搜索页面 + *

+ * 普通搜索:从首页点击搜索按钮进入:包含:仅输入搜索(列表不包含设置按钮) + * {@link SearchConstants#SEARCH_TYPE_COMMON} + *

+ * 地址设置搜索:设置家、公司、其他的地址:包含当前位置、选点、搜索列表(列表包含设置按钮)、普通页面 + * {@link SearchConstants#SEARCH_TYPE_MULTI_COMPANY} + * {@link SearchConstants#SEARCH_TYPE_MULTI_HOME} + */ +public abstract class BaseSearchFragment extends BaseFragment implements SearchView { + + + public int mSearchType; + + protected SearchPresenter mSearchPresenter; + + private View mClose; + private EditText mSearchBox; + + + + /** + * 设置常用地址(我的位置、选点)时的设置按钮 + */ + private TextView mActionButton; + + /** + * 地址设置是否完成 + */ + private boolean mActionSuccess = false; + + @Override + public void onAttach(Context context) { + super.onAttach(context); + if (context instanceof UiController) { + } + } + + @Override public void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + } + + @Override + protected int getLayoutId() { + return R.layout.fragment_search; + } + + @Override + public void onActivityCreated(@Nullable Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + getLifecycle().addObserver(mSearchPresenter = new SearchPresenter(this)); + } + + @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + mSearchBox = view.findViewById(R.id.et_navi_search); + } + + /** + * 显示我的位置,并且可设置为家 + */ + //private void multiSearchMyLocationUI() { + // mUiMode = SearchConstants.UI_MODE_MULTI_MY_LOCATION; + // mSearchBox.setEnabled( false ); + // mMyLocation.setVisibility( View.GONE ); + // mChoicePoint.setVisibility( View.GONE ); + // mCurrentLocation.setVisibility( View.GONE ); + // mSearchResult.setVisibility( View.GONE ); + // mActionButton.setVisibility( View.VISIBLE ); + // mActionButton.setText( SearchUtils.getSearchTypeActionName( mSearchType ) ); + // mSearchBox.setCompoundDrawables( null, null, null, null ); + // //removeChoicePointMarker(); + // mSearchBox.setTag( null ); + // if ( mSearchBox.getLayoutParams() instanceof RelativeLayout.LayoutParams ) { + // final RelativeLayout.LayoutParams params = ( ( RelativeLayout.LayoutParams ) mSearchBox.getLayoutParams() ); + // params.addRule( RelativeLayout.LEFT_OF, R.id.amap_search_action_setting ); + // mSearchBox.setPadding( 0, 0, WindowUtils.dip2px( mContext, 15 ), 0 ); + // mSearchBox.setLayoutParams( params ); + // } + //} + + /** + * 显示我的位置,并且可设置为家 + */ + //private void multiSearchChoicePointUI() { + // mUiMode = SearchConstants.UI_MODE_MULTI_CHOICE_POINT; + // mSearchBox.setEnabled( false ); + // mMyLocation.setVisibility( View.GONE ); + // mChoicePoint.setVisibility( View.GONE ); + // mCurrentLocation.setVisibility( View.GONE ); + // mSearchResult.setVisibility( View.GONE ); + // mActionButton.setVisibility( View.VISIBLE ); + // mActionButton.setText( SearchUtils.getSearchTypeActionName( mSearchType ) ); + // mSearchBox.setCompoundDrawables( null, null, null, null ); + // mSearchBox.setTag( null ); + // if ( mSearchBox.getLayoutParams() instanceof RelativeLayout.LayoutParams ) { + // final RelativeLayout.LayoutParams params = ( ( RelativeLayout.LayoutParams ) mSearchBox.getLayoutParams() ); + // params.addRule( RelativeLayout.LEFT_OF, R.id.amap_search_action_setting ); + // mSearchBox.setPadding( 0, 0, WindowUtils.dip2px( mContext, 15 ), 0 ); + // mSearchBox.setLayoutParams( params ); + // } + //} + private void saveCurrentLocationAsCommonAddress() { + //if ( mLastAMapLocation == null ) { + // shortToast( "定位失败,请重试" ); + // return; + //} + //final Disposable disposable = mSearchPresenter.cacheCommonAddressPoi( mLastAMapLocation ).subscribe( output -> { + // Toast.makeText( mContext, "设置成功!", Toast.LENGTH_SHORT ).show(); + // mActionSuccess = true; + //}, error -> { + // if ( error instanceof Exception) { + // Toast.makeText( mContext, ( (Exception) error ).getMessage(), Toast.LENGTH_SHORT ).show(); + // mActionSuccess = false; + // } + //} ); + //mSearchPresenter.addDisposable( disposable ); + } + + private void saveRegeoAddressAsCommonAddress() { + //if ( mSearchBox.getTag() instanceof RegeocodeAddress ) { + // final Disposable disposable = mSearchPresenter.cacheCommonAddressPoi( ( ( RegeocodeAddress ) mSearchBox.getTag() ) ).subscribe( output -> { + // Toast.makeText( mContext, "设置成功!", Toast.LENGTH_SHORT ).show(); + // mActionSuccess = true; + // }, error -> { + // if ( error instanceof Exception) { + // Toast.makeText( mContext, ( (Exception) error ).getMessage(), Toast.LENGTH_SHORT ).show(); + // mActionSuccess = false; + // } + // } ); + // mSearchPresenter.addDisposable( disposable ); + //} else { + // Toast.makeText( mContext, "请选择位置", Toast.LENGTH_SHORT ).show(); + //} + } + + // view interface + + @Override + public EditText getSearchBox() { + return mSearchBox; + } + + + @Override + public int getSearchType() { + return mSearchType; + } + + @Override public void startJumpAnimation() { + + } + + //@Override + //public void renderChoicePointResult( RegeocodeAddress address ) { + // if ( address == null ) { + // mSearchBox.setTag( null ); + // mSearchBox.setText( "" ); + // return; + // } + // mSearchBox.setTag( address ); + // mSearchBox.setText( address.getFormatAddress() ); + //} + // + //@Override + //public void renderErrorView() { + // + //} + // + //@Override + //public void renderContentView() { + // + //} + + // view interface end + + ///** + // * 屏幕中心marker 跳动 + // */ + //@Override + //public void startJumpAnimation() { + // + // final AMap aMap = mUiController.getAMapServiceVisitor().getMap(); + // + // if ( mChoicePointMaker != null ) { + // //根据屏幕距离计算需要移动的目标点 + // final LatLng latLng = mChoicePointMaker.getPosition(); + // Point point = aMap.getProjection().toScreenLocation( latLng ); + // point.y -= WindowUtils.dip2px( mContext, 125 ); + // LatLng target = aMap.getProjection() + // .fromScreenLocation( point ); + // //使用TranslateAnimation,填写一个需要移动的目标点 + // Animation animation = new TranslateAnimation( target ); + // animation.setInterpolator( new Interpolator() { + // @Override + // public float getInterpolation( float input ) { + // // 模拟重加速度的interpolator + // if ( input <= 0.5 ) { + // return ( float ) ( 0.5f - 2 * ( 0.5 - input ) * ( 0.5 - input ) ); + // } else { + // return ( float ) ( 0.5f - Math.sqrt( ( input - 0.5f ) * ( 1.5f - input ) ) ); + // } + // } + // } ); + // //整个移动所需要的时间 + // animation.setDuration( 600 ); + // //设置动画 + // mChoicePointMaker.setAnimation( animation ); + // //开始动画 + // mChoicePointMaker.startAnimation(); + // + // } + //} + + + private void navi2Location(SearchPoi searchPoi) { + + + } + + /** + * 退出搜索,进行清理 + */ + private void exitSearch() { + + switch (mSearchType) { + case SearchConstants.SEARCH_TYPE_COMMON: + try { + } catch (Exception e) { + e.printStackTrace(); + } + break; + case SearchConstants.SEARCH_TYPE_MULTI_HOME: + break; + } + } + + @Override + public void onDestroyView() { + super.onDestroyView(); + if (mSearchPresenter != null) { + mSearchPresenter.onDestroy(getViewLifecycleOwner()); + getLifecycle().removeObserver(mSearchPresenter); + mSearchPresenter = null; + } + mSearchBox.setTag(null); + //removeChoicePointMarker(); + } +} diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/SearchFragment.java b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/SearchFragment.java index 98d63bbf4f..c1cdbcc1d6 100644 --- a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/SearchFragment.java +++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/SearchFragment.java @@ -27,7 +27,9 @@ import com.mogo.module.navi.ui.adapter.HistoryPoiAdapter; import com.mogo.module.navi.ui.adapter.SearchPoiAdapter; import com.mogo.module.navi.ui.base.BaseFragment; import com.mogo.module.navi.ui.base.UiController; +import com.mogo.module.navi.ui.setting.NaviSettingFragment; import com.mogo.service.MogoServicePaths; +import com.mogo.service.fragmentmanager.FragmentDescriptor; import com.mogo.service.fragmentmanager.IMogoFragmentManager; import com.mogo.utils.WindowUtils; import io.reactivex.disposables.Disposable; @@ -45,16 +47,14 @@ import java.util.List; * {@link SearchConstants#SEARCH_TYPE_MULTI_HOME} */ @Route(path = MogoModulePaths.PATH_FRAGMENT_SEARCH) -public class SearchFragment extends BaseFragment implements SearchView { +public class SearchFragment extends BaseSearchFragment implements SearchView { public static final String TAG = "search"; public int mSearchType; - private SearchPresenter mSearchPresenter; private View mClose; - private EditText mSearchBox; private RecyclerView mSearchResult; private RecyclerView rvHistory; @@ -96,12 +96,10 @@ public class SearchFragment extends BaseFragment implements SearchView { @Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); - getLifecycle().addObserver(mSearchPresenter = new SearchPresenter(this)); } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); - mSearchBox = view.findViewById(R.id.et_navi_search); mSearchResult = view.findViewById(R.id.rv_navi_search); rvHistory = view.findViewById(R.id.rv_navi_history); rlHistory = view.findViewById(R.id.rl_navi_history); @@ -148,6 +146,16 @@ public class SearchFragment extends BaseFragment implements SearchView { } }); + findViewById(R.id.tv_navi_setting).setOnClickListener(new View.OnClickListener() { + @Override public void onClick(View v) { + FragmentDescriptor.Builder builder = new FragmentDescriptor.Builder(); + builder.fragment(new NaviSettingFragment()); + FragmentDescriptor build = + builder.tag(MogoModulePaths.PATH_FRAGMENT_SETTING).build(); + fragmentManager.push(build); + } + }); + } /** @@ -228,12 +236,6 @@ public class SearchFragment extends BaseFragment implements SearchView { //} } - // view interface - - @Override - public EditText getSearchBox() { - return mSearchBox; - } @Override public void renderSearchPoiResult(List datums, boolean showDelete) { @@ -348,19 +350,6 @@ public class SearchFragment extends BaseFragment implements SearchView { } } - @Override - public void onDestroyView() { - super.onDestroyView(); - if (mSearchPresenter != null) { - mSearchPresenter.onDestroy(getViewLifecycleOwner()); - getLifecycle().removeObserver(mSearchPresenter); - mSearchPresenter = null; - } - mSearchBox.setTag(null); - - mPoiAdapter = null; - //removeChoicePointMarker(); - } private void showResult() { rlHistory.setVisibility(View.GONE); diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/setting/NaviSettingFragment.kt b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/setting/NaviSettingFragment.kt index 78b40c88c0..924422e0a9 100644 --- a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/setting/NaviSettingFragment.kt +++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/setting/NaviSettingFragment.kt @@ -1,14 +1,33 @@ package com.mogo.module.navi.ui.setting +import android.os.Bundle +import android.view.View +import com.alibaba.android.arouter.facade.annotation.Route +import com.mogo.module.common.MogoModulePaths import com.mogo.module.navi.R +import com.mogo.module.navi.constants.SearchServiceHolder import com.mogo.module.navi.ui.base.BaseFragment +import kotlinx.android.synthetic.main.fragment_navi_setting.iv_back +import kotlinx.android.synthetic.main.fragment_navi_setting.tv_navi_sound_type /** * @author zyz * 2020-01-07. */ +@Route(path= MogoModulePaths.PATH_FRAGMENT_SETTING) class NaviSettingFragment : BaseFragment() { override fun getLayoutId(): Int { return R.layout.fragment_navi_setting } + + override fun onViewCreated( + view: View, + savedInstanceState: Bundle? + ) { + super.onViewCreated(view, savedInstanceState) + + iv_back.setOnClickListener { + SearchServiceHolder.fragmentManager.pop() + } + } } diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/setting/SettingAddressFragment.kt b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/setting/SettingAddressFragment.kt new file mode 100644 index 0000000000..0883b064b4 --- /dev/null +++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/setting/SettingAddressFragment.kt @@ -0,0 +1,33 @@ +package com.mogo.module.navi.ui.setting + +import android.os.Bundle +import android.view.View +import com.alibaba.android.arouter.facade.annotation.Route +import com.mogo.module.common.MogoModulePaths +import com.mogo.module.navi.R +import com.mogo.module.navi.constants.SearchServiceHolder +import com.mogo.module.navi.ui.base.BaseFragment +import kotlinx.android.synthetic.main.fragment_navi_setting.iv_back +import kotlinx.android.synthetic.main.fragment_navi_setting.tv_navi_sound_type + +/** + * @author zyz + * 2020-01-07. + */ +@Route(path= MogoModulePaths.PATH_FRAGMENT_SETTING) +class SettingAddressFragment : BaseFragment() { + override fun getLayoutId(): Int { + return R.layout.fragment_setting_address + } + + override fun onViewCreated( + view: View, + savedInstanceState: Bundle? + ) { + super.onViewCreated(view, savedInstanceState) + + iv_back.setOnClickListener { + SearchServiceHolder.fragmentManager.pop() + } + } +} diff --git a/modules/mogo-module-search/src/main/res/drawable/selector_setting_bg.xml b/modules/mogo-module-search/src/main/res/drawable/selector_setting_bg.xml new file mode 100644 index 0000000000..d39295d19f --- /dev/null +++ b/modules/mogo-module-search/src/main/res/drawable/selector_setting_bg.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-search/src/main/res/drawable/shape_round_blue_margin.xml b/modules/mogo-module-search/src/main/res/drawable/shape_round_blue_margin.xml new file mode 100644 index 0000000000..e5dda25219 --- /dev/null +++ b/modules/mogo-module-search/src/main/res/drawable/shape_round_blue_margin.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/modules/mogo-module-search/src/main/res/drawable/shape_seek_bar.xml b/modules/mogo-module-search/src/main/res/drawable/shape_seek_bar.xml new file mode 100644 index 0000000000..ceedde01ce --- /dev/null +++ b/modules/mogo-module-search/src/main/res/drawable/shape_seek_bar.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-search/src/main/res/layout/fragment_navi_setting.xml b/modules/mogo-module-search/src/main/res/layout/fragment_navi_setting.xml index b44181631a..b4d8ad924a 100644 --- a/modules/mogo-module-search/src/main/res/layout/fragment_navi_setting.xml +++ b/modules/mogo-module-search/src/main/res/layout/fragment_navi_setting.xml @@ -1,21 +1,153 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + > + android:src="@mipmap/icon_back" + /> + android:textSize="@dimen/txt_title" + /> + + + - + + + + + + app:layout_constraintTop_toBottomOf="@+id/tv_navi_sound_type" + > + android:checked="true" + android:text="@string/navi_prefer_detail" + style="@style/rb_setting" + /> - - - - - + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-search/src/main/res/layout/fragment_search.xml b/modules/mogo-module-search/src/main/res/layout/fragment_search.xml index 955c6f79e8..0b0cf11af2 100644 --- a/modules/mogo-module-search/src/main/res/layout/fragment_search.xml +++ b/modules/mogo-module-search/src/main/res/layout/fragment_search.xml @@ -8,43 +8,12 @@ android:paddingLeft="@dimen/dp_60" android:paddingRight="@dimen/dp_60" android:paddingTop="@dimen/dp_40" + android:clickable="true" tools:context=".ui.search.SearchFragment" style="@style/amap_fragment_container_padding_style" > - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-search/src/main/res/layout/include_search_bar.xml b/modules/mogo-module-search/src/main/res/layout/include_search_bar.xml new file mode 100644 index 0000000000..4081e7d128 --- /dev/null +++ b/modules/mogo-module-search/src/main/res/layout/include_search_bar.xml @@ -0,0 +1,36 @@ + + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-search/src/main/res/mipmap-xhdpi/icon_navi_position.png b/modules/mogo-module-search/src/main/res/mipmap-xhdpi/icon_navi_position.png index be529a46a397d88b8fab3b413c75b686d6b7afee..029ae98fb2bd2d01a28da9430d06d198b4a661bb 100755 GIT binary patch delta 2771 zcmV;^3M}=v4(An+Fn?+BwxOD)A5e@?F`-b2RMAL_v0_4{YBhc( zP%T@Q-S@`d@4Pve*}L!UzPCH??V8+4?mK7BoH=vO@BU`)eSeQdq-X^K1p);E1p);E z1p);E1p);E1p);E1p@zP2)NOb@28LWxusrN;zi~nsdpi-%f-ty@1zU;GtkdKf6X~L z+}3*% zpGTjSz{j=8OJgQT$IctvKl3il=(hyGwhk3MiEtFo^<2nrYAq-UavBi z)YNnUmmly~;OTnUm+@o`EU8+7jaf!{#x*#O?fkbf?Q+u(7P?ofu9wJY=_U%-H_RPB z@zc+Hfahg)-;w^k!SLxnqYjIcQ)4H~bwB)|J6(tOkX+h^G^@@@=gRUJm^Yhe6Q8gq zsl%=|m4DF7><6hjd`!l38AId1*QCXWrH++kX77LHaX!52Ou1pVrU7`%UjGGOl0^g| z2FHrD;wklF>eNG{ADj8dF$`FfdP6WbmNr%@$wzM6C+jNF(tkGP&V1r|KclBdev5P` zN0{`@o&&aTIbwRqDA!eN%~r*|-*{}md3bi>cz>C-b8-47b5j_2{=94e8zz$lS_s*Z z+j6v%$v&KsJUm&<^|eAqq=IgU1hW#3-ZC--4vl-dw?yvUpw;w zp&|v8>;Xa<>o(4VUiGqkyHW56^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S)f z(tHW|xk1rl+*uCX7>6YVR2NKp{ew0Ok9xPa3^ z+;-Im;E@7_8Q@{N!w@rrBYzVCQ3)qdh20tCGaUl4rebCgFcSeOkNPW}=ON-3#&bf9 zsaVDXO$W$Kz_)MZJ}#@&R6=O1jijcoXADo2mfhL%ynhy6tlp zkP^b(b0@~Kj=0H@Er0pMwKr*36#`O%5M%(tMD8EL<{7dzDT)eq)d)BvVkZRZnJWS6 zgLqHO)t^UuZqt~sWbuwn8~#=HMNDyAvV(9wh_;tJ_vJ9ZJo>6qKoSD;MErB1*iGkn zBzZTUs*TXOJ*)y&0jq#jz$#!BunJfOtO8a6tAJI&Dv(lv{}lk0PZ9Ky?jWB40000< KMNUMnLSTYyW@qmJ diff --git a/modules/mogo-module-search/src/main/res/mipmap-xhdpi/icon_navi_sound_low.png b/modules/mogo-module-search/src/main/res/mipmap-xhdpi/icon_navi_sound_low.png new file mode 100755 index 0000000000000000000000000000000000000000..3d277f6c1427dc90edf62228948e7d2ceb918f1b GIT binary patch literal 296 zcmeAS@N?(olHy`uVBq!ia0vp^0U*r51|<6gKdl8)jKx9jP7LeL$-D$|9(lSrhEy=V zy|9s&$&rWUfPGTN!_|#m8k6-K>J%EEY}~A$Fi}s!`Rj6dW2D7>Q>j zI5pPZzkbX8?eel?FXQg!`+n>V33y(zvufSRGxn*u$vx3Z*1SJf1wD7!XrI1^`@^Ik zkEd{0rr7X*Ka;*DUFt(zR`lEQpuO*|{@t})ku{l(nV}tibSI0wb&B@cneuck^*mR@R?vR@5t)zpk z3``sf4LFD`+$FKwCswO}Us!*4OZx1@lzuh+?b+teZQnGxZ@+Xa|M~37yxbipo))Yu zo_Y05TEwZ;-^cRmdt(pmwwFKf#2RR@XJd+mw!ncU4n}iCITC^tB+qfN7-&x5NoQr6 zA>z@tnTgSdOXYB6V=&Vc-94|(_T1&!o72g*&u&(@!k?P~YrXq9PxY~TnQLsdnEB)T z;*@;!LCP=SNAjj*XpWr?Av6unsK|)&%Jm4>pNsr zwp?5KHFK_N_)GU4OBUI6{uABs(;{S(lKh2r|2XOyJaf1hj_tXV!656ohWWsZ>C(Il zlsiiqBt91{W-L+J$j6WzmuJ$@r*e%k;mqk?whI%FSTXce?!3rgH7SCQqBn z@U?AsQ;xluVf0`<FVdQ&MBb@0NWwP@&Et; literal 0 HcmV?d00001 diff --git a/modules/mogo-module-search/src/main/res/mipmap-xhdpi/icon_pb_thumb.png b/modules/mogo-module-search/src/main/res/mipmap-xhdpi/icon_pb_thumb.png new file mode 100755 index 0000000000000000000000000000000000000000..0230dca906a40d61494057eeb878a885d2555751 GIT binary patch literal 3687 zcma)9_g52G6Ad6;N~ntTAjl#jN)eP!Ac%^qD7{9IrYs9mOsES=6%c_4u1FQ7gx*OM zAqhxtp_xcWLLec95{MuBAACQ|n=|LUnKS3U^XAS?xqHW2NI*sa000QtKrHW__(%U4 zAJ578*HW(iiQ@>pXKfCs9hUtC00=ADSen^Ka**G-r9W_x#J=^q;32STDl)B$xV0K$-tS!6iyCTaE zS@%89^7rjhjDrJzBkZ8sAG$~88Pk5%J{_e#*ZcHSHq*~@zDI4<%DOB&YiKGbYq>zn zHyzDcAa^d`+uN+soGby2fRX1puKxfr?UnazvS zR*vU<$f461$4>m*z7dQ$XcWsnsu&&~*6-}>6xzGw-XXOAnc1T7n9U&JiI0pzk{wcP z;Y=?RrcdmyqQdH$7SAp^P$e_n>!Fe&00#*yt$C0#(-lQ?&~odbSI7T|B2Cw%1N`|m z0eSCM)LOu^0D|*+Qh1lQv z7BfAACu%B#Bfh(Ze$=txaadok3Au55rsc^z9_iM})Q8lqn_BT0P9MnzW7jb7lZ-8w z*`gabEKyxkt$eWY&w6nBlyfwMwGQz`A8uCdjTD*0wi;Eo{|!qq5_!?o+$>}UY8Zof zV4a}Ynb{LakNw64LZv!Kpg&j{>{0nSot$wNMXc?7?dOPHU85iMPnJp2(D`Us#q; zW5`&EC74r2dD1=zJ6+>~rsF`FU7il=BKWUwUVXa%@lwN{KDx1#W|D{d(7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KG^v`(S7R0QRzpJUNi(&1x&ta}1^-3Llu;<5c?j~i+ z-c19siL6|p5B94zE0xa6BR`UN%iMG|p9z41#t9fTbeNt&B>x`tk})iT{Y%{L29>sq z&5RAOwFEe;>|cLhnIvkaSXK$LwJD~_Bs~Im?+$3>XUbh~`F?mdGH$U5G~)%mgkq=S z%&;;c)EwypC%kx;Lk_YN{b{ONBQ>kwL+&drbB71HZ<+(~?6n*_V*@dlGc;XJol^!X z2*mr*%kt0@n$(-hDPD*+s+SO?NQ9!$7(hKJnh!{M%fmZ+6*lTtEvvg3>aPJRzgbZzypm#cd`AjE=h zIq9_?8u#%AVTM78duOd*$sRCDGmSe|Yg!2%-t~$W*16lMl*(~h56O3YgC-k4v7Yoy z>Ouv;n&jc&cZsur&_@$SIW#KJ(}`^%%b6eTicme#v$R>vhj}l+HA+tjEiy5 z(Mnf_HNlN^9$wv`V!q+ECNM{fcv`qTxOx1i%J{Tl{>qtJ%j#9iW2PRI4VIHhy!D7Ze~ zv+E737f8-UlZK4KWHL>E{V~NC|S9y3ap~ zl|;K1{0u7P6r7-1z2*f2*6lxfnTXqIUW3Wa(QPGD1DX?IpZ`+^Add|7h{HGy;3(Z^ z-G7KGbB?MFyKx?U59evq)_Uj;Wf`}>ICf-nUa0_|CiR5$z4kcH^OwXo2>p}c&HAo3 zBsNmJg63b3nGF8)FkbVAPJ`1$ksVq~9u_W>7QY!ysBN`^YECdx1DwRZ zS~33qtS^=LDIEGUu#SLOYqH<__$5!(ake`7#?CbgFBh)q@&75f*doAvEkw|Tg6a^* RgA?TlumRt(tTp#c_#Xr5U623( literal 0 HcmV?d00001 diff --git a/modules/mogo-module-search/src/main/res/mipmap-xhdpi/icon_sound_high.png b/modules/mogo-module-search/src/main/res/mipmap-xhdpi/icon_sound_high.png new file mode 100755 index 0000000000000000000000000000000000000000..3b79814139bf7821fa27bd56b757aff3fd1617d5 GIT binary patch literal 1760 zcmV<61|Ru}P)Px*nn^@KRCodHoNI_xRTRf()U13oNi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*wi-fvf=S<7#W*2)wJ7mQxG7-4Wj) zK>U{>-N*){+4il;S_X(*LwrTx?TQYZb|OIRtB@avEzh}F6OBtY?GkkG#p(D9X$RP4Mg?zxr zR|MYnxB+1c0bGsGurILD-KTDii(fH4Nv%MBnIwy?1m3o!L10e=D1Gr+jyy%;%B`f= zsECbB55{GiQZMkghLXo82vB0+HyJsKj3U0$9eS+^wUgl?UzRC#0sLxWsg%xT==+%%UF>U|DMPG+5X8NWa({uLpnpjl-mEc!7yifht<8MPgFU~KOSf&AFe6g?0fHw&;gzb06n8msursH>~ za|`WGN0+%do&Yl^GhQ9IQE!Re=ZU}0qsyeK3xI~mNe`KoJjP8PeQH(R0Av=vfXaJ^ z%yioAjxJNPZU7o8FFkbTdUUB(^#<^Zhs-RGF14!O0M7J~k2B4y1NPaO`M4Yecy#q2g@fsHmA)L-%P79HZJ{+doq!wu7%d8*t*h>uzZB*V<26{ z4j|Nz*jw=Nt^W-$`-ejPC&W&Yxmr-QgC?)Fh;LCLI~c0+aQ#2#3}C#rH9LtN-B@=aK1MO; zUn13f!9e6xLfJOfi6w{7_Jy20&iX@}QtqIE*dLgNIs=m+8;IuNt4KnW-TC7=Y9 ifD%vwN暂无搜索结果 路线偏好 躲避拥堵 + 躲避收费 + 高速优先 + 不走高速 + 播报音量 + 播报偏好 + 详细播报 + 简洁播报 + 白天 + 夜间 + 自动 diff --git a/modules/mogo-module-search/src/main/res/values/styles.xml b/modules/mogo-module-search/src/main/res/values/styles.xml index 3f9614df4d..41aa1c444c 100644 --- a/modules/mogo-module-search/src/main/res/values/styles.xml +++ b/modules/mogo-module-search/src/main/res/values/styles.xml @@ -34,6 +34,7 @@ @dimen/sp_40 @color/selector_white_gray @dimen/dp_120 + @drawable/selector_setting_bg From 8bb0865b629e009b6396eca7d5dadb015db631c0 Mon Sep 17 00:00:00 2001 From: zhangyuanzhen Date: Thu, 9 Jan 2020 15:11:04 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E7=B1=BB=E5=88=AB?= =?UTF-8?q?=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/.name | 1 - .idea/codeStyles/Project.xml | 116 ------------------ .idea/gradle.xml | 39 ------ .idea/misc.xml | 14 --- .idea/runConfigurations.xml | 12 -- .idea/vcs.xml | 6 - config.gradle | 1 + .../mogo/module/common/MogoModulePaths.java | 6 + modules/mogo-module-search/build.gradle | 1 + .../module/navi/constants/AMapConstants.java | 7 ++ .../ui/adapter/SearchCategoryAdapter.java | 64 ++++++++++ .../ui/adapter/base/RecycleBaseAdapter.java | 6 + .../navi/ui/search/CategorySearchFragment.kt | 91 ++++++++++++++ .../module/navi/ui/search/SearchFragment.java | 90 ++++++++------ .../navi/ui/search/SearchPresenter.java | 2 +- .../navi/ui/setting/SettingAddressFragment.kt | 105 +++++++++++++++- .../selector_item_category_background.xml | 12 ++ .../selector_item_category_result.xml | 6 + .../res/drawable/shape_round_blue_grident.xml | 11 ++ .../main/res/drawable/shape_round_gray.xml | 2 +- .../src/main/res/layout/fragment_search.xml | 3 +- .../res/layout/fragment_search_category.xml | 43 +++++++ .../res/layout/fragment_setting_address.xml | 86 ++++++++++++- .../main/res/layout/item_search_category.xml | 66 ++++++++++ .../icon_search_category_checked.png | Bin 0 -> 3751 bytes .../icon_search_category_unchecked.png | Bin 0 -> 2264 bytes .../src/main/res/values/colors.xml | 1 + .../src/main/res/values/strings.xml | 5 + .../src/main/res/values/styles.xml | 7 ++ 29 files changed, 568 insertions(+), 235 deletions(-) delete mode 100644 .idea/.name delete mode 100644 .idea/codeStyles/Project.xml delete mode 100644 .idea/gradle.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/runConfigurations.xml delete mode 100644 .idea/vcs.xml create mode 100644 modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/adapter/SearchCategoryAdapter.java create mode 100644 modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/CategorySearchFragment.kt create mode 100644 modules/mogo-module-search/src/main/res/drawable/selector_item_category_background.xml create mode 100644 modules/mogo-module-search/src/main/res/drawable/selector_item_category_result.xml create mode 100644 modules/mogo-module-search/src/main/res/drawable/shape_round_blue_grident.xml create mode 100644 modules/mogo-module-search/src/main/res/layout/fragment_search_category.xml create mode 100644 modules/mogo-module-search/src/main/res/layout/item_search_category.xml create mode 100755 modules/mogo-module-search/src/main/res/mipmap-xhdpi/icon_search_category_checked.png create mode 100755 modules/mogo-module-search/src/main/res/mipmap-xhdpi/icon_search_category_unchecked.png diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index 2e92d39135..0000000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -MogoLauncher \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml deleted file mode 100644 index 681f41ae2a..0000000000 --- a/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - -

- - - - xmlns:android - - ^$ - - - -
-
- - - - xmlns:.* - - ^$ - - - BY_NAME - -
-
- - - - .*:id - - http://schemas.android.com/apk/res/android - - - -
-
- - - - .*:name - - http://schemas.android.com/apk/res/android - - - -
-
- - - - name - - ^$ - - - -
-
- - - - style - - ^$ - - - -
-
- - - - .* - - ^$ - - - BY_NAME - -
-
- - - - .* - - http://schemas.android.com/apk/res/android - - - ANDROID_ATTRIBUTE_ORDER - -
-
- - - - .* - - .* - - - BY_NAME - -
- - - - - \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index 1a786d501e..0000000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 8a8f75bfe2..0000000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 7f68460d8b..0000000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7f4c..0000000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/config.gradle b/config.gradle index 909fd6986b..d9fd8f8953 100644 --- a/config.gradle +++ b/config.gradle @@ -16,6 +16,7 @@ ext { androidxmultidex : "androidx.multidex:multidex:2.0.1", androidxviewpager2 : "androidx.viewpager2:viewpager2:1.0.0", androidxrecyclerview : "androidx.recyclerview:recyclerview:1.1.0", + androidxcardview : "androidx.cardview:cardview:1.0.0", // 测试 junit : "junit:junit:4.12", androidxjunit : "androidx.test.ext:junit:1.1.0", diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModulePaths.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModulePaths.java index 65e430a6b3..adfffc5401 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModulePaths.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModulePaths.java @@ -58,6 +58,12 @@ public class MogoModulePaths { public static final String PATH_FRAGMENT_SEARCH = "/navi/search"; + /** + * 按类别搜索 fragment + */ + @Keep + public static final String PATH_FRAGMENT_SEARCH_CATEGORY = "/navi/search/category"; + /** * 设置 fragment diff --git a/modules/mogo-module-search/build.gradle b/modules/mogo-module-search/build.gradle index a3ebb14896..42f83bdf90 100644 --- a/modules/mogo-module-search/build.gradle +++ b/modules/mogo-module-search/build.gradle @@ -50,6 +50,7 @@ dependencies { kapt rootProject.ext.dependencies.roomAnnotationProcessor implementation rootProject.ext.dependencies.roomRxjava implementation rootProject.ext.dependencies.androidxrecyclerview + implementation rootProject.ext.dependencies.androidxcardview kapt rootProject.ext.dependencies.aroutercompiler // implementation rootProject.ext.dependencies.jetbrainsannotationsjava5 implementation rootProject.ext.dependencies.rxandroid diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/AMapConstants.java b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/AMapConstants.java index 6500e2c255..5429dfb3b5 100644 --- a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/AMapConstants.java +++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/AMapConstants.java @@ -14,6 +14,13 @@ public class AMapConstants { */ public static final float AMAP_ZOOM_COMMON_LEVEL = 15.0f; + + /** + * 设置家和公司的Key + */ + public static final String KEY_SET_HOME_COMPONY = "key_home"; + + /** * 点击当前位置按钮的地图缩放级别 */ diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/adapter/SearchCategoryAdapter.java b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/adapter/SearchCategoryAdapter.java new file mode 100644 index 0000000000..711a84c13d --- /dev/null +++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/adapter/SearchCategoryAdapter.java @@ -0,0 +1,64 @@ +package com.mogo.module.navi.ui.adapter; + +import android.content.Context; +import android.view.View; +import com.mogo.map.search.inputtips.MogoTip; +import com.mogo.module.navi.R; +import com.mogo.module.navi.ui.adapter.base.RecycleBaseAdapter; +import com.mogo.module.navi.ui.adapter.base.RecycleViewHolder; +import java.util.List; + +/** + * @author zyz + * 2019-08-13. + */ +public class SearchCategoryAdapter extends RecycleBaseAdapter { + + private int current = 0; + private int lastPosition = 0; + + /** + * + */ + public SearchCategoryAdapter(Context context, List list) { + super(context, list, R.layout.item_search_category); + } + + private boolean mShowDelete = false; + + private View.OnClickListener onClickListener; + + @Override + public void onBindViewHolder(RecycleViewHolder holder, MogoTip tip) { + + holder.setText(R.id.tv_position, tip.getName()); + holder.setText(R.id.tv_position_des, tip.getAddress()); + + holder.setText(R.id.iv_position,String.valueOf(holder.getLayoutPosition()+1)); + holder.itemView.setTag(R.id.tag_position, holder.getLayoutPosition()); + holder.itemView.setOnClickListener(onClickListener); + holder.itemView.setSelected(current == holder.getLayoutPosition()); + } + + public void setOnClickListener(View.OnClickListener onClickListener) { + this.onClickListener = onClickListener; + } + + public void setShowDelete(boolean showDelete) { + this.mShowDelete = showDelete; + } + + public void refresh(List datums, boolean showDelete) { + //this.da = datums; + setShowDelete(showDelete); + setDatas(datums); + //notifyDataSetChanged(); + } + + public void setCurrent(int current) { + this.current = current; + notifyItemChanged(lastPosition); + notifyItemChanged(current); + lastPosition = current; + } +} diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/adapter/base/RecycleBaseAdapter.java b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/adapter/base/RecycleBaseAdapter.java index 5817c1457d..7b495a2e06 100644 --- a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/adapter/base/RecycleBaseAdapter.java +++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/adapter/base/RecycleBaseAdapter.java @@ -92,6 +92,12 @@ public abstract class RecycleBaseAdapter extends } notifyDataSetChanged(); } + public void clear(){ + if (list != null) { + list.clear(); + notifyDataSetChanged(); + } + } public void messageShow(String mes) { if (toast==null){ diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/CategorySearchFragment.kt b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/CategorySearchFragment.kt new file mode 100644 index 0000000000..ca8db07eb7 --- /dev/null +++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/CategorySearchFragment.kt @@ -0,0 +1,91 @@ +package com.mogo.module.navi.ui.search + +import android.os.Bundle +import android.view.View +import androidx.fragment.app.Fragment +import androidx.recyclerview.widget.LinearLayoutManager +import com.mogo.map.search.inputtips.MogoTip +import com.mogo.module.navi.R +import com.mogo.module.navi.bean.SearchPoi +import com.mogo.module.navi.constants.SearchServiceHolder +import com.mogo.module.navi.ui.adapter.SearchCategoryAdapter +import kotlinx.android.synthetic.main.fragment_search_category.cv_search_result +import kotlinx.android.synthetic.main.fragment_search_category.tv_navi_navi +import kotlinx.android.synthetic.main.fragment_setting_address.rv_search_result +import kotlinx.android.synthetic.main.include_search_bar.et_navi_search +import kotlinx.android.synthetic.main.include_search_bar.iv_navi_back + +/** + * @author zyz + * 2020-01-09. + */ +class CategorySearchFragment : BaseSearchFragment() { + + private lateinit var mAdapter: SearchCategoryAdapter + + private var category:String?=null + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + category=arguments?.getString("category") + } + override fun getLayoutId(): Int { + return R.layout.fragment_search_category + } + + override fun onViewCreated( + view: View, + savedInstanceState: Bundle? + ) { + super.onViewCreated(view, savedInstanceState) + mAdapter = SearchCategoryAdapter(activity, ArrayList()) + + rv_search_result.layoutManager = + LinearLayoutManager(activity, LinearLayoutManager.VERTICAL, false) + + rv_search_result.adapter = mAdapter + + et_navi_search.setText(category) + + + iv_navi_back.setOnClickListener { + SearchServiceHolder.fragmentManager.pop() + } + + tv_navi_navi.setOnClickListener { + + } + mAdapter.setOnClickListener { + var position = it.getTag(R.id.tag_position) as Int + mAdapter.setCurrent(position) + } + } + + override fun onActivityCreated(savedInstanceState: Bundle?) { + super.onActivityCreated(savedInstanceState) + mSearchPresenter.startSearchPoiByInput(category) + + } + override fun renderSearchPoiResult( + datums: List, + showDelete: Boolean + ) { + + mAdapter.setDatas(datums) + cv_search_result.visibility=View.VISIBLE + + } + + override fun showHistory(datums: List) { + + } + + companion object{ + fun newInstance( category:String):Fragment{ + var bundle = Bundle() + bundle.putString("category",category) + var categorySerachFragment = CategorySearchFragment() + categorySerachFragment.arguments=bundle + return categorySerachFragment + } + } +} diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/SearchFragment.java b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/SearchFragment.java index c1cdbcc1d6..8d716d88ae 100644 --- a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/SearchFragment.java +++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/SearchFragment.java @@ -1,38 +1,27 @@ package com.mogo.module.navi.ui.search; import android.content.Context; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.graphics.drawable.BitmapDrawable; -import android.graphics.drawable.Drawable; import android.os.Bundle; import android.view.View; -import android.widget.EditText; -import android.widget.RelativeLayout; import android.widget.TextView; -import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +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.alibaba.android.arouter.launcher.ARouter; import com.mogo.map.search.inputtips.MogoTip; import com.mogo.module.common.MogoModulePaths; import com.mogo.module.navi.R; import com.mogo.module.navi.bean.EntityConvertUtils; import com.mogo.module.navi.bean.SearchPoi; -import com.mogo.module.navi.database.AppDataBase; +import com.mogo.module.navi.constants.SearchServiceHolder; import com.mogo.module.navi.ui.adapter.HistoryPoiAdapter; import com.mogo.module.navi.ui.adapter.SearchPoiAdapter; -import com.mogo.module.navi.ui.base.BaseFragment; import com.mogo.module.navi.ui.base.UiController; import com.mogo.module.navi.ui.setting.NaviSettingFragment; -import com.mogo.service.MogoServicePaths; +import com.mogo.module.navi.ui.setting.SettingAddressFragment; import com.mogo.service.fragmentmanager.FragmentDescriptor; -import com.mogo.service.fragmentmanager.IMogoFragmentManager; -import com.mogo.utils.WindowUtils; -import io.reactivex.disposables.Disposable; import java.util.ArrayList; import java.util.List; @@ -47,13 +36,12 @@ import java.util.List; * {@link SearchConstants#SEARCH_TYPE_MULTI_HOME} */ @Route(path = MogoModulePaths.PATH_FRAGMENT_SEARCH) -public class SearchFragment extends BaseSearchFragment implements SearchView { +public class SearchFragment extends BaseSearchFragment implements SearchView, View.OnClickListener { public static final String TAG = "search"; public int mSearchType; - private View mClose; private RecyclerView mSearchResult; @@ -61,7 +49,6 @@ public class SearchFragment extends BaseSearchFragment implements SearchView { private SearchPoiAdapter mPoiAdapter; private HistoryPoiAdapter mHistoryAdapter; - /** * 设置常用地址(我的位置、选点)时的设置按钮 */ @@ -73,7 +60,6 @@ public class SearchFragment extends BaseSearchFragment implements SearchView { private boolean mActionSuccess = false; private View rlHistory; private TextView tvEmpty; - IMogoFragmentManager fragmentManager; @Override public void onAttach(Context context) { @@ -84,7 +70,6 @@ public class SearchFragment extends BaseSearchFragment implements SearchView { @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); - fragmentManager = (IMogoFragmentManager) ARouter.getInstance().build(MogoServicePaths.PATH_FRAGMENT_MANAGER).navigation(); } @@ -111,17 +96,17 @@ public class SearchFragment extends BaseSearchFragment implements SearchView { new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false); mSearchResult.setLayoutManager(linearLayoutManager); - mPoiAdapter= new SearchPoiAdapter(getActivity(),new ArrayList<>()); + mPoiAdapter = new SearchPoiAdapter(getActivity(), new ArrayList<>()); mSearchResult.setAdapter(mPoiAdapter); - mHistoryAdapter= new HistoryPoiAdapter(getActivity(),new ArrayList<>()); + mHistoryAdapter = new HistoryPoiAdapter(getActivity(), new ArrayList<>()); rvHistory.setAdapter(mHistoryAdapter); tvEmpty = findViewById(R.id.tv_navi_list_empty); findViewById(R.id.iv_navi_back).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - fragmentManager.pop(); + SearchServiceHolder.INSTANCE.getFragmentManager().pop(); } }); @@ -139,7 +124,6 @@ public class SearchFragment extends BaseSearchFragment implements SearchView { } }); - findViewById(R.id.tv_navi_history_clear).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mSearchPresenter.deleteAllCachedPoi(); @@ -148,14 +132,44 @@ public class SearchFragment extends BaseSearchFragment implements SearchView { findViewById(R.id.tv_navi_setting).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - FragmentDescriptor.Builder builder = new FragmentDescriptor.Builder(); - builder.fragment(new NaviSettingFragment()); - FragmentDescriptor build = - builder.tag(MogoModulePaths.PATH_FRAGMENT_SETTING).build(); - fragmentManager.push(build); + push(new NaviSettingFragment(),MogoModulePaths.PATH_FRAGMENT_SETTING); } }); + findViewById(R.id.tv_navi_company).setOnClickListener(new View.OnClickListener() { + @Override public void onClick(View v) { + pupSettingAddress(1); + } + }); + + findViewById(R.id.tv_navi_home).setOnClickListener(new View.OnClickListener() { + @Override public void onClick(View v) { + pupSettingAddress(0); + } + }); + + findViewById(R.id.tv_navi_wash).setOnClickListener(this); + findViewById(R.id.tv_navi_toilet).setOnClickListener(this); + findViewById(R.id.tv_navi_gas).setOnClickListener(this); + findViewById(R.id.tv_navi_restaurant).setOnClickListener(this); + findViewById(R.id.tv_navi_park).setOnClickListener(this); + } + + private void push(Fragment fragment,String tag) { + FragmentDescriptor.Builder builder = new FragmentDescriptor.Builder(); + builder.fragment(fragment); + FragmentDescriptor build = + builder.tag(tag).build(); + SearchServiceHolder.INSTANCE.getFragmentManager().push(build); + } + + private void pupSettingAddress(int type) { + + FragmentDescriptor.Builder builder = new FragmentDescriptor.Builder(); + builder.fragment(SettingAddressFragment.Companion.newInstance(type)); + FragmentDescriptor build = + builder.tag(MogoModulePaths.PATH_FRAGMENT_SETTING_HOME).build(); + SearchServiceHolder.INSTANCE.getFragmentManager().push(build); } /** @@ -236,10 +250,9 @@ public class SearchFragment extends BaseSearchFragment implements SearchView { //} } - @Override public void renderSearchPoiResult(List datums, boolean showDelete) { - if (datums==null||datums.isEmpty()) { + if (datums == null || datums.isEmpty()) { showEmpty(getString(R.string.search_empty)); return; } @@ -249,7 +262,7 @@ public class SearchFragment extends BaseSearchFragment implements SearchView { @Override public void showHistory(List datums) { - if (datums==null||datums.isEmpty()) { + if (datums == null || datums.isEmpty()) { showEmpty(getString(R.string.history_empty)); return; } @@ -327,10 +340,8 @@ public class SearchFragment extends BaseSearchFragment implements SearchView { // } //} - private void navi2Location(SearchPoi searchPoi) { - } /** @@ -350,7 +361,6 @@ public class SearchFragment extends BaseSearchFragment implements SearchView { } } - private void showResult() { rlHistory.setVisibility(View.GONE); mSearchResult.setVisibility(View.VISIBLE); @@ -363,10 +373,20 @@ public class SearchFragment extends BaseSearchFragment implements SearchView { tvEmpty.setVisibility(View.GONE); } - private void showEmpty(String str){ + private void showEmpty(String str) { rlHistory.setVisibility(View.GONE); tvEmpty.setText(str); mSearchResult.setVisibility(View.GONE); tvEmpty.setVisibility(View.VISIBLE); } + + /** + * 类别 + */ + @Override public void onClick(View v) { + TextView category = (TextView) v; + String text = category.getText().toString(); + push(CategorySearchFragment.Companion.newInstance(text),MogoModulePaths.PATH_FRAGMENT_SEARCH_CATEGORY); + + } } diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/SearchPresenter.java b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/SearchPresenter.java index cddd739670..d5dabb31c8 100644 --- a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/SearchPresenter.java +++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/SearchPresenter.java @@ -91,7 +91,7 @@ public class SearchPresenter extends Presenter< SearchView > } }; - private void startSearchPoiByInput( String keyword ) { + public void startSearchPoiByInput( String keyword ) { MogoInputtipsQuery mogoInputtipsQuery = new MogoInputtipsQuery(); mogoInputtipsQuery.setKeyword(keyword); IMogoInputtipsSearch inputtipsSearch = diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/setting/SettingAddressFragment.kt b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/setting/SettingAddressFragment.kt index 0883b064b4..e406299042 100644 --- a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/setting/SettingAddressFragment.kt +++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/setting/SettingAddressFragment.kt @@ -2,32 +2,127 @@ package com.mogo.module.navi.ui.setting import android.os.Bundle import android.view.View +import androidx.fragment.app.Fragment +import androidx.recyclerview.widget.LinearLayoutManager import com.alibaba.android.arouter.facade.annotation.Route +import com.mogo.map.search.inputtips.MogoTip import com.mogo.module.common.MogoModulePaths import com.mogo.module.navi.R +import com.mogo.module.navi.bean.SearchPoi +import com.mogo.module.navi.constants.AMapConstants import com.mogo.module.navi.constants.SearchServiceHolder +import com.mogo.module.navi.ui.adapter.SearchPoiAdapter import com.mogo.module.navi.ui.base.BaseFragment +import com.mogo.module.navi.ui.search.BaseSearchFragment import kotlinx.android.synthetic.main.fragment_navi_setting.iv_back -import kotlinx.android.synthetic.main.fragment_navi_setting.tv_navi_sound_type +import kotlinx.android.synthetic.main.include_search_bar.iv_navi_back +import kotlinx.android.synthetic.main.fragment_setting_address.group_set_address +import kotlinx.android.synthetic.main.fragment_setting_address.rv_search_result +import kotlinx.android.synthetic.main.fragment_setting_address.tv_navi_choose_point +import kotlinx.android.synthetic.main.fragment_setting_address.tv_navi_my_location +import kotlinx.android.synthetic.main.fragment_setting_address.tv_set_as_home +import kotlinx.android.synthetic.main.include_search_bar.et_navi_search /** * @author zyz * 2020-01-07. */ -@Route(path= MogoModulePaths.PATH_FRAGMENT_SETTING) -class SettingAddressFragment : BaseFragment() { +@Route(path = MogoModulePaths.PATH_FRAGMENT_SETTING_HOME) +class SettingAddressFragment : BaseSearchFragment() { + override fun renderSearchPoiResult( + datums: MutableList?, + showDelete: Boolean + ) { + mAdapter.setDatas(datums) + group_set_address.visibility = View.GONE + rv_search_result.visibility = View.VISIBLE + + } + + override fun showHistory(datums: MutableList?) { + } + + private var style: Int = 0 + private lateinit var mAdapter: SearchPoiAdapter + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + style = arguments?.getInt(AMapConstants.KEY_SET_HOME_COMPONY) ?: 0 + } + override fun getLayoutId(): Int { return R.layout.fragment_setting_address } + fun isHome(): Boolean { + return style == 0 + } + + fun isCompony(): Boolean { + return style == 1 + } + + fun isSearch(): Boolean { + return group_set_address.visibility == View.GONE + } + override fun onViewCreated( view: View, savedInstanceState: Bundle? ) { super.onViewCreated(view, savedInstanceState) - iv_back.setOnClickListener { - SearchServiceHolder.fragmentManager.pop() + + if (isHome()) { + tv_set_as_home.text = resources.getString(R.string.set_as_home_navi) + } else { + tv_set_as_home.text = resources.getString(R.string.set_as_compony_navi) + } + + mAdapter = SearchPoiAdapter(activity, ArrayList()) + + rv_search_result.layoutManager = + LinearLayoutManager(activity, LinearLayoutManager.VERTICAL, false) + + rv_search_result.adapter = mAdapter + + + iv_navi_back.setOnClickListener { + if (group_set_address.visibility == View.VISIBLE) { + SearchServiceHolder.fragmentManager.pop() + } else { + reset() + } + } + + + tv_navi_choose_point.setOnClickListener { + group_set_address.visibility = View.GONE + tv_set_as_home.visibility = View.VISIBLE + } + + tv_navi_my_location.setOnClickListener { + group_set_address.visibility = View.GONE + tv_set_as_home.visibility = View.VISIBLE + } + + } + + private fun reset() { + group_set_address.visibility = View.VISIBLE + rv_search_result.visibility = View.GONE + mAdapter.clear() + et_navi_search.setText("") + tv_set_as_home.visibility = View.GONE + } + + companion object { + fun newInstance(type: Int = 0): Fragment { + + var settingAddressFragment = SettingAddressFragment() + val bundle = Bundle() + bundle.putInt(AMapConstants.KEY_SET_HOME_COMPONY, type) + settingAddressFragment.setArguments(bundle) + return settingAddressFragment } } } diff --git a/modules/mogo-module-search/src/main/res/drawable/selector_item_category_background.xml b/modules/mogo-module-search/src/main/res/drawable/selector_item_category_background.xml new file mode 100644 index 0000000000..cff42dd83b --- /dev/null +++ b/modules/mogo-module-search/src/main/res/drawable/selector_item_category_background.xml @@ -0,0 +1,12 @@ + + + + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-search/src/main/res/drawable/selector_item_category_result.xml b/modules/mogo-module-search/src/main/res/drawable/selector_item_category_result.xml new file mode 100644 index 0000000000..e131861fdf --- /dev/null +++ b/modules/mogo-module-search/src/main/res/drawable/selector_item_category_result.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-search/src/main/res/drawable/shape_round_blue_grident.xml b/modules/mogo-module-search/src/main/res/drawable/shape_round_blue_grident.xml new file mode 100644 index 0000000000..cc53c2d4d8 --- /dev/null +++ b/modules/mogo-module-search/src/main/res/drawable/shape_round_blue_grident.xml @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/modules/mogo-module-search/src/main/res/drawable/shape_round_gray.xml b/modules/mogo-module-search/src/main/res/drawable/shape_round_gray.xml index 4e5fb46c4f..8d4cf110f3 100644 --- a/modules/mogo-module-search/src/main/res/drawable/shape_round_gray.xml +++ b/modules/mogo-module-search/src/main/res/drawable/shape_round_gray.xml @@ -1,6 +1,6 @@ - + diff --git a/modules/mogo-module-search/src/main/res/layout/fragment_search.xml b/modules/mogo-module-search/src/main/res/layout/fragment_search.xml index 0b0cf11af2..75cdaf87f6 100644 --- a/modules/mogo-module-search/src/main/res/layout/fragment_search.xml +++ b/modules/mogo-module-search/src/main/res/layout/fragment_search.xml @@ -34,6 +34,7 @@ android:layout_weight="1" android:textSize="@dimen/txt_normal" android:paddingLeft="@dimen/dp_75" + android:id="@+id/tv_navi_home" android:gravity="center_vertical" android:drawableLeft="@mipmap/icon_navi_home" android:text="@string/navi_home" @@ -51,7 +52,7 @@ android:textSize="@dimen/txt_normal" android:text="@string/navi_company" android:paddingLeft="@dimen/dp_75" - + android:id="@+id/tv_navi_company" android:gravity="center_vertical" android:drawableLeft="@mipmap/icon_navi_company" android:layout_height="match_parent" diff --git a/modules/mogo-module-search/src/main/res/layout/fragment_search_category.xml b/modules/mogo-module-search/src/main/res/layout/fragment_search_category.xml new file mode 100644 index 0000000000..6048efb724 --- /dev/null +++ b/modules/mogo-module-search/src/main/res/layout/fragment_search_category.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-search/src/main/res/layout/fragment_setting_address.xml b/modules/mogo-module-search/src/main/res/layout/fragment_setting_address.xml index 642582667e..cf04d068c7 100644 --- a/modules/mogo-module-search/src/main/res/layout/fragment_setting_address.xml +++ b/modules/mogo-module-search/src/main/res/layout/fragment_setting_address.xml @@ -1,10 +1,88 @@ - + - + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-search/src/main/res/layout/item_search_category.xml b/modules/mogo-module-search/src/main/res/layout/item_search_category.xml new file mode 100644 index 0000000000..b804455410 --- /dev/null +++ b/modules/mogo-module-search/src/main/res/layout/item_search_category.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-search/src/main/res/mipmap-xhdpi/icon_search_category_checked.png b/modules/mogo-module-search/src/main/res/mipmap-xhdpi/icon_search_category_checked.png new file mode 100755 index 0000000000000000000000000000000000000000..a89d92e306dfae4ff20724d87842686385be967a GIT binary patch literal 3751 zcmV;Y4p{MtP)Px@VM#<|DWHkZ0h}fSv(84SF0p$HD(8yZY)QosAnmA7>3?0Wg2=xg`K%Er5Ci z#eWkJb*n&Nf|$>gsCZ9%0P@c`4&m6}dHU%SRenY#S6-v?U--=r9GJ-7fB*Y=ulFMe zzn!zQFgl$Mu*{8`AUcJBMN@Ve0t{b&fTN#fx8MG1XZ7k!Dg9x~Mh;-UZ5zAmhX82{ zj$4LaK(qi{jBdC4A>!=7@ypJ(ZM|W~4E>E1!2H=~@9kZ@_zMJF#=KU)X{+5yWPpjCp*tP^NwW0rXv9mUH6qyj#(Aub_lw%q=ds4v@O}xZXN_&39clt^tT2 z#6AYO9x8zO)~)yB&i!kEcg-M4O=Vl^U?@wLveO(Xj!$tzUeVdU{YXl8Ix_kl%DA|7 z>q_xgrgD6DCfuU4~kIl9*~FQVorirF3D-7JkC`JxVIsbK_7*ni`suA&Xa6 znSQk8O8QWetdai)`cTOyCMWNkvtvi=Pb{hM-I-Jvvrvmc%28UN ziu|B`Z0`K|cenlQ+~N?SFw!3f-e2!zZN)@GrWJtpl~k5((Y=K+lz<9jk|y&BTOWWY<-s{o>4}=Hb85E$ zR~l?6)1Y4t@87P#lZJdTFFoq;;Js1QgKhOVy)C{*3(@4%3czzmk3NQAOTvOJ2!s1! zbK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H5kB$e$iD={!0-fcrFzSjC~cS0kY}E&{_VJ;ykR0yw9#AzP}l zxuw{Bb5QgKpL6s|&-wR*KBEANr9Wg4{`5E~*itB4^tj-;$Ws(R>odE?@At=()g56u^li}dLJ7SK+>=htF_cdQOP1#g%^=U$5)L<8L0)7S7G#)oX;*cWp{ap-QerS@)aJVM zLQnKYk7cx$0?5~=@Tl|akU;J7r7)!l9^i$Z=&kH4Vx<5w$(l3Vc3i1XaKoL@Nw=Bb zb@|9VzzaOlTUjrq0rCprrN6702s;zc!CMXIl}*}~`qWMj)I(2YTOZHEZ^+e-3w!-% z@M!WQOgrbDx9brFt+G?cH@wpwm^4q~{`dFYy@^Yzs4v|D^CWmJ^~V_U`Ghiw%eOE` z%u74)3C)>yc%YYxM`eJsJ^frXIUidgyqRBvt9f5V4I@8|TB(`Z=^=QjsG>4J=G!x+ zFJsl>Cw%hKDfE2KI>WDw#Ev3z2$;`a3+~P9f*_a(J`Tli9<-5QGe+1?D;^EN_XK z;1+b}?3U69Jo+AL3(P@&wIyPZc~QJCJ;Tpq)%rZB+YYnk<+>UH$lzm#I0AU|*%-jF zLL3pi#sQ86;t1i51YicyFgp7%IyZVx95K9+0UQa$1K_#Mv(q}XsS5QU?r8KLcyQ9S zGYz%GF~Ot1kpg7G10affLClx>4T3QaIMi*$PP89nljPC0yj;V`0W$H>AdVRxy^ICm zP$0Gd-dF+Fg4hyxV+U9XVvFFl0$?eKErZt@fKd=z2(MKD2SRKqyw(9cBt(2U&Uqd+ z4LZg)jTs~=%o7dI&fG1<13zToHPn$ko(QslaA>CO1>NWxF0F0tEpO(lOk mSp4$8mkBHrSSC=D!2bc+5DcctbmAod0000#D81B60 #ff080625 #FFFFFF + #00000000 #1AFFFFFF #99FFFFFF #CCFFFFFF diff --git a/modules/mogo-module-search/src/main/res/values/strings.xml b/modules/mogo-module-search/src/main/res/values/strings.xml index 2810111d64..6527ed6402 100644 --- a/modules/mogo-module-search/src/main/res/values/strings.xml +++ b/modules/mogo-module-search/src/main/res/values/strings.xml @@ -26,4 +26,9 @@ 白天 夜间 自动 + 我的位置 + 地图选点 + 设为家 + 设为公司 + 导航去这里 diff --git a/modules/mogo-module-search/src/main/res/values/styles.xml b/modules/mogo-module-search/src/main/res/values/styles.xml index 41aa1c444c..54581e1f8b 100644 --- a/modules/mogo-module-search/src/main/res/values/styles.xml +++ b/modules/mogo-module-search/src/main/res/values/styles.xml @@ -37,4 +37,11 @@ @drawable/selector_setting_bg + + From dda3ae9dd44635d61a163c516b5400c8cf966617 Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Thu, 9 Jan 2020 20:25:54 +0800 Subject: [PATCH 3/5] add interface --- modules/mogo-module-tanlu/build.gradle | 10 +- .../tanlu/callback/AlongTheWayCallback.java | 13 + .../tanlu/callback/RoadLineCallback.java | 13 + .../tanlu/callback/VoiceSearchCallback.java | 13 + .../mogo/module/tanlu/constant/HttpConst.java | 13 + .../module/tanlu/constant/TanluConstants.java | 2 +- .../tanlu/fragment/TanluCardViewFragment.java | 229 ++++++++++- .../tanlu/fragment/TanluCardViewProvider.java | 1 + .../com/mogo/module/tanlu/map/AMapUtil.java | 268 ------------ .../com/mogo/module/tanlu/map/ChString.java | 26 -- .../module/tanlu/map/DrivingRouteOverlay.java | 384 ------------------ .../mogo/module/tanlu/map/RouteOverlay.java | 236 ----------- .../java/com/mogo/module/tanlu/model/End.java | 16 + .../model/InformationAndLiveCarResult.java | 38 ++ .../model/InformationAndLiveCarResult.kt | 18 - .../tanlu/model/LocationCarsWithRadius.kt | 21 + .../mogo/module/tanlu/model/NaviLatLng.java | 17 + .../module/tanlu/model/NaviLatLngInfo.java | 55 +++ .../mogo/module/tanlu/model/NaviLatLngInfo.kt | 19 + .../module/tanlu/model/SearchOnlineInfo.kt | 10 + .../com/mogo/module/tanlu/model/Start.java | 16 + .../module/tanlu/model/TanluModelData.java | 175 ++++++++ .../module/tanlu/net/TanluApiService.java | 8 +- .../module/tanlu/util/ActivityStatusUtil.java | 46 +++ .../com/mogo/module/tanlu/util/StringUitl.kt | 5 + .../com/mogo/module/tanlu/util/Utils.java | 8 + .../module/tanlu/voice/VoiceController.kt | 57 +++ 27 files changed, 773 insertions(+), 944 deletions(-) create mode 100644 modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/callback/AlongTheWayCallback.java create mode 100644 modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/callback/RoadLineCallback.java create mode 100644 modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/callback/VoiceSearchCallback.java create mode 100644 modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/constant/HttpConst.java delete mode 100755 modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/map/AMapUtil.java delete mode 100755 modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/map/ChString.java delete mode 100755 modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/map/DrivingRouteOverlay.java delete mode 100755 modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/map/RouteOverlay.java create mode 100644 modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/End.java create mode 100644 modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/InformationAndLiveCarResult.java delete mode 100644 modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/InformationAndLiveCarResult.kt create mode 100644 modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/LocationCarsWithRadius.kt create mode 100644 modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/NaviLatLng.java create mode 100644 modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/NaviLatLngInfo.java create mode 100644 modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/NaviLatLngInfo.kt create mode 100644 modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/SearchOnlineInfo.kt create mode 100644 modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/Start.java create mode 100644 modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/TanluModelData.java create mode 100644 modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/util/ActivityStatusUtil.java create mode 100644 modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/voice/VoiceController.kt diff --git a/modules/mogo-module-tanlu/build.gradle b/modules/mogo-module-tanlu/build.gradle index 620e6b9d36..a182478571 100644 --- a/modules/mogo-module-tanlu/build.gradle +++ b/modules/mogo-module-tanlu/build.gradle @@ -39,6 +39,12 @@ dependencies { testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation rootProject.ext.dependencies.androidxappcompat + implementation rootProject.ext.dependencies.androidxconstraintlayout + implementation rootProject.ext.dependencies.arouter + annotationProcessor rootProject.ext.dependencies.aroutercompiler + implementation rootProject.ext.dependencies.rxjava + implementation rootProject.ext.dependencies.rxandroid if (Boolean.valueOf(RELEASE)) { implementation rootProject.ext.dependencies.mogomap @@ -55,10 +61,6 @@ dependencies { implementation project(':modules:mogo-module-common') implementation project(':modules:mogo-module-service') } - implementation rootProject.ext.dependencies.androidxappcompat - implementation rootProject.ext.dependencies.androidxconstraintlayout - implementation rootProject.ext.dependencies.arouter - annotationProcessor rootProject.ext.dependencies.aroutercompiler implementation 'com.shuyu:gsyVideoPlayer-armv7a:7.1.1' implementation 'com.shuyu:gsyVideoPlayer-arm64:7.1.1' diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/callback/AlongTheWayCallback.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/callback/AlongTheWayCallback.java new file mode 100644 index 0000000000..de8c420fc6 --- /dev/null +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/callback/AlongTheWayCallback.java @@ -0,0 +1,13 @@ +package com.mogo.module.tanlu.callback; + +import com.mogo.module.tanlu.model.InformationAndLiveCarResult; + +/** + * @author lixiaopeng + * @description 导航沿途搜索 + * @since 2020-01-09 + */ +public interface AlongTheWayCallback { + void onSuccess(InformationAndLiveCarResult data); + void onFail(String message, int code); +} diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/callback/RoadLineCallback.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/callback/RoadLineCallback.java new file mode 100644 index 0000000000..53e81c13dc --- /dev/null +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/callback/RoadLineCallback.java @@ -0,0 +1,13 @@ +package com.mogo.module.tanlu.callback; + +import com.mogo.module.tanlu.model.PathLineResult; + +/** + * @author lixiaopeng + * @description 通勤族回调 + * @since 2020-01-09 + */ +public interface RoadLineCallback { + void onSuccess(PathLineResult data); + void onFail(String message, int code); +} diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/callback/VoiceSearchCallback.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/callback/VoiceSearchCallback.java new file mode 100644 index 0000000000..6b0913e7fb --- /dev/null +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/callback/VoiceSearchCallback.java @@ -0,0 +1,13 @@ +package com.mogo.module.tanlu.callback; + +import com.mogo.module.tanlu.model.VoiceSearchResult; + +/** + * @author lixiaopeng + * @description 声音控制搜索回调 + * @since 2020-01-09 + */ +public interface VoiceSearchCallback { + void onSuccess(VoiceSearchResult data); + void onFail(String message, int code); +} diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/constant/HttpConst.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/constant/HttpConst.java new file mode 100644 index 0000000000..130956b35d --- /dev/null +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/constant/HttpConst.java @@ -0,0 +1,13 @@ +package com.mogo.module.tanlu.constant; + +/** + * @author lixiaopeng + * @description + * @since 2020-01-09 + */ +public class HttpConst { + public static final String HOST_DEV = "http://dzt-test.zhidaohulian.com"; + public static final String HOST_TEST = "http://dzt-test.zhidaohulian.com"; + public static final String HOST_PRODUCT = "https://dzt.zhidaohulian.com"; + +} diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/constant/TanluConstants.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/constant/TanluConstants.java index 80edcce397..fdfdef1e17 100644 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/constant/TanluConstants.java +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/constant/TanluConstants.java @@ -9,5 +9,5 @@ package com.mogo.module.tanlu.constant; public class TanluConstants { public static final String TAG = "/tanlu/ui"; - + public static final String NAVI_INFO = "navi_info"; } diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewFragment.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewFragment.java index 0883f4181d..23bd26197b 100644 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewFragment.java +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewFragment.java @@ -4,6 +4,7 @@ import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Bundle; import android.text.Html; +import android.text.TextUtils; import android.view.MotionEvent; import android.view.View; import android.widget.RelativeLayout; @@ -13,11 +14,24 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.alibaba.android.arouter.launcher.ARouter; +import com.amap.api.services.core.LatLonPoint; +import com.amap.api.services.route.BusRouteResult; +import com.amap.api.services.route.DrivePath; +import com.amap.api.services.route.DriveRouteResult; +import com.amap.api.services.route.RideRouteResult; +import com.amap.api.services.route.RouteSearch; +import com.amap.api.services.route.WalkRouteResult; +import com.mogo.commons.data.BaseData; +import com.mogo.commons.debug.DebugConfig; import com.mogo.commons.mvp.IView; import com.mogo.commons.mvp.MvpFragment; import com.mogo.commons.mvp.Presenter; +import com.mogo.commons.network.ParamsProvider; +import com.mogo.commons.network.SubscribeImpl; import com.mogo.map.MogoLatLng; +import com.mogo.map.impl.amap.overlay.DrivingRouteOverlay; import com.mogo.map.listener.IMogoMapListener; +import com.mogo.map.location.IMogoLocationClient; import com.mogo.map.location.IMogoLocationListener; import com.mogo.map.location.MogoLocation; import com.mogo.map.marker.IMogoMarker; @@ -30,19 +44,40 @@ import com.mogo.map.search.poisearch.IMogoPoiSearchListener; import com.mogo.map.search.poisearch.MogoPoiResult; import com.mogo.map.uicontroller.EnumMapUI; import com.mogo.module.service.entity.MarkerExploreWay; +import com.mogo.module.service.entity.MarkerResponse; +import com.mogo.module.service.network.RefreshApiService; +import com.mogo.module.service.network.RefreshBody; +import com.mogo.module.service.network.RefreshModel; +import com.mogo.module.tanlu.callback.AlongTheWayCallback; +import com.mogo.module.tanlu.callback.RoadLineCallback; +import com.mogo.module.tanlu.callback.VoiceSearchCallback; +import com.mogo.module.tanlu.constant.HttpConst; +import com.mogo.module.tanlu.model.Information; +import com.mogo.module.tanlu.model.InformationAndLiveCarResult; +import com.mogo.module.tanlu.model.PathLineResult; +import com.mogo.module.tanlu.model.TanluModelData; +import com.mogo.module.tanlu.model.VoiceSearchResult; +import com.mogo.module.tanlu.net.TanluApiService; +import com.mogo.module.tanlu.util.ActivityStatusUtil; +import com.mogo.module.tanlu.util.Utils; +import com.mogo.module.tanlu.voice.VoiceController; import com.mogo.service.MogoServicePaths; +import com.mogo.service.connection.IMogoOnMessageListener; +import com.mogo.service.connection.IMogoSocketManager; import com.mogo.service.imageloader.IMogoImageLoaderListener; import com.mogo.service.imageloader.IMogoImageloader; import com.mogo.service.map.IMogoMapService; import com.mogo.service.module.IMogoModuleLifecycle; import com.mogo.module.tanlu.R; import com.mogo.module.tanlu.model.event.MarkerInfo; -import com.mogo.module.tanlu.util.Utils; import com.mogo.module.tanlu.video.FullMediaActivity; import com.mogo.module.tanlu.video.SimpleCoverVideoPlayer; import com.mogo.module.tanlu.view.AutoZoomInImageView; +import com.mogo.service.network.IMogoNetwork; import com.mogo.utils.TipToast; import com.mogo.utils.logger.Logger; +import com.mogo.utils.network.RequestOptions; +import com.mogo.utils.network.utils.GsonUtil; import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder; import org.greenrobot.eventbus.EventBus; @@ -50,8 +85,14 @@ import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +import static com.mogo.commons.network.Utils.getSn; import static com.mogo.module.tanlu.util.StringUitlKt.formatDate; import static com.mogo.module.tanlu.util.Utils.handleDistance; import static com.mogo.module.tanlu.video.VideoInitKt.initVideo; @@ -77,6 +118,14 @@ public class TanluCardViewFragment extends MvpFragment> private IMogoMarker mPoiMarker; private IMogoMarkerManager mMarkerManager; private IMogoMapService mMogoMapService; + private IMogoSocketManager mMogoSocketManager; + private IMogoLocationClient mLocationClient; + + //声音控制文字 + private String voiceGetInfoMationTts; + private String[] searchingVoiceStrings; + private String[] searchfaileVoiceStrings; + //media private GSYVideoOptionBuilder gsyVideoOptionBuilder = new GSYVideoOptionBuilder(); private String mVideoUrl = "http://ivi.bupt.edu.cn/hls/cctv1hd.m3u8"; @@ -94,6 +143,8 @@ public class TanluCardViewFragment extends MvpFragment> private List markerExploreWayList = new ArrayList<>(); private int currentPosition = 0; //卡片媒体当前位置 private Bitmap mMarkerIcon; + private TanluModelData mTanluModelData; + private List passedByPoints; @Override @@ -145,6 +196,27 @@ public class TanluCardViewFragment extends MvpFragment> super.onActivityCreated(savedInstanceState); getViewLifecycleOwner().getLifecycle().addObserver(mPresenter); EventBus.getDefault().register(this); + mTanluModelData = new TanluModelData(getContext()); + handleRoadLineMessage(); + } + + /** + * 处理路线数据信息 TODO + */ + private void handleRoadLineMessage() { + mMogoSocketManager = (IMogoSocketManager) ARouter.getInstance().build(MogoServicePaths.PATH_SOCKET_MANAGER).navigation(); + mMogoSocketManager.registerOnMessageListener(401001, new IMogoOnMessageListener() { + @Override + public Class target() { + return MarkerResponse.class; + } + + @Override + public void onMsgReceived(MarkerResponse obj) { + Logger.e(TAG, "onMsgReceived obj= " + obj); + getRoadLineData(); + } + }); } /** @@ -422,7 +494,7 @@ public class TanluCardViewFragment extends MvpFragment> } /** - * 接收到对应数据打点 + * 接收到分享对应数据打点 * * @param event */ @@ -456,6 +528,159 @@ public class TanluCardViewFragment extends MvpFragment> }); } + /** + * 导航路线数据事件 + */ + public void getNavigationLineData() { + Double lat = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLatitude(); + Double lon = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLongitude(); + mTanluModelData.getNavigationLineData(lon, lat, new AlongTheWayCallback() { + @Override + public void onSuccess(InformationAndLiveCarResult data) { + + } + + @Override + public void onFail(String message, int code) { + + } + }); + } + + /** + * 通勤族 事件,监听消息自己请求路线数据 + */ + public void getRoadLineData() { + mTanluModelData.getRoadLineData(new RoadLineCallback() { + @Override + public void onSuccess(PathLineResult o) { + //绘制线路线 + if (o != null && o.getPointList() != null && o.getPointList().size() > 0) { + int intervalNum = Utils.getIntervalValue(o.getPointList().size()); + Logger.d(TAG, "intervalNum = $intervalNum -- pointList.size = ${pointList.size}"); + int listSize = o.getPointList().size(); + + //沿途最多15个点 + for (int i = 0; i < listSize; i += intervalNum) { + passedByPoints.add(new MogoLatLng(o.getPointList().get(i).getLat(), (o.getPointList().get(i).getLon()))); + } + + Logger.d(TAG, "passedByPoints.size() ----> " + passedByPoints.size()); + MogoLatLng startLatLng = new MogoLatLng(o.getPointList().get(0).getLat(), o.getPointList().get(0).getLon()); + MogoLatLng endLatLng = new MogoLatLng(o.getPointList().get(listSize - 1).getLat(), o.getPointList().get(listSize - 1).getLon()); + + mMarkerManager.addRouteWay(getContext(), startLatLng, endLatLng, passedByPoints); + } + } + + @Override + public void onFail(String message, int code) { + + } + }); + } + + + /** + * 声音控制道理数据 + */ + public void getVoiceControlRoadData(String keywords) { + Double lat = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLatitude(); + Double lon = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLongitude(); + String cityCode = TanluServiceHandler.getLocationClient().getLastKnowLocation().getCityCode(); + String adCode = TanluServiceHandler.getLocationClient().getLastKnowLocation().getAdCode(); + mTanluModelData.getVoiceControlRoadData(keywords, cityCode, lon, lat, adCode, new VoiceSearchCallback() { + @Override + public void onSuccess(VoiceSearchResult o) { + String discription = o.getDescription(); + Logger.d(TAG, "discription = " + discription); + if (o.getInformations() != null && o.getInformations().size() > 0) { + speakSuccessVoice(o.getInformations(), discription == null ? "" : discription); + } else { + if (!TextUtils.isEmpty(discription)) { +// VoiceController.speakVoice(discription); + } else { +// VoiceController.speakVoice("未找到其他车主分享的路况信息"); + } + } + } + + @Override + public void onFail(String message, int code) { + + } + }); + + } + + private void speakSuccessVoice(List informations, String trafficStatus) { +// switch (informations.size()) { +// case 0: +// speakFailVoice(); +// break; +// +// case 1: +// trackVoiceSearch(1); +// VoiceController.speakVoice( +// String.format( +// voiceGetInfoMationTts, +// "1" +// ) + trafficStatus +// ); +// +// case 2: +// trackVoiceSearch(1); +// VoiceController.speakVoice( +// String.format( +// voiceGetInfoMationTts, +// "2" +// ) + trafficStatus +// ); +// +// +// case 3: +// trackVoiceSearch(1); +// VoiceController.speakVoice( +// String.format( +// voiceGetInfoMationTts, +// "3" +// ) + trafficStatus +// ); +// +// default: +// trackVoiceSearch(1); +// VoiceController.speakVoice( +// String.format( +// voiceGetInfoMationTts, +// "多" +// ) + trafficStatus); +// } + } + + + private void initStrings() { + voiceGetInfoMationTts = + getContext().getResources().getString(R.string.voice_get_informations_tts); + searchingVoiceStrings = + getContext().getResources().getStringArray(R.array.searching_voice_string_array); + searchfaileVoiceStrings = + getContext().getResources().getStringArray(R.array.search_fail_voice_array); + } + + private void speakFailVoice(String string) { +// VoiceController.speakVoice(string); + trackVoiceSearch(2); + } + + //上报语音搜索 + private void trackVoiceSearch(int type) { +// trackNormalEvent( +// CarNet_Voice_Search, mutableMapOf("type" to type, "searchtext" to keywords, "inputlon" to inputLon, +// "inputlat" to inputLat, "datalon" to dataLon, "datalat" to dataLat), +// BaseApplication.getAppContext() +// ) + } + } diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewProvider.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewProvider.java index 21f29c8c4d..882fdf0f15 100644 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewProvider.java +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewProvider.java @@ -40,6 +40,7 @@ public class TanluCardViewProvider implements IMogoModuleProvider { @Override public void init( Context context ) { TanluServiceHandler.init( context ); + Logger.d(TAG, "init ----------> "); } @Override diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/map/AMapUtil.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/map/AMapUtil.java deleted file mode 100755 index 427a20d0a8..0000000000 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/map/AMapUtil.java +++ /dev/null @@ -1,268 +0,0 @@ -package com.mogo.module.tanlu.map; - -import android.text.Html; -import android.text.Spanned; -import android.widget.EditText; - -import com.amap.api.maps.model.LatLng; -import com.amap.api.services.core.LatLonPoint; -import com.amap.api.services.route.BusPath; -import com.amap.api.services.route.BusStep; -import com.amap.api.services.route.RouteBusLineItem; -import com.amap.api.services.route.RouteRailwayItem; -import com.mogo.module.tanlu.R; - -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class AMapUtil { - /** - * 判断edittext是否null - */ - public static String checkEditText(EditText editText) { - if (editText != null && editText.getText() != null - && !(editText.getText().toString().trim().equals(""))) { - return editText.getText().toString().trim(); - } else { - return ""; - } - } - - public static Spanned stringToSpan(String src) { - return src == null ? null : Html.fromHtml(src.replace("\n", "
")); - } - - public static String colorFont(String src, String color) { - StringBuffer strBuf = new StringBuffer(); - - strBuf.append("").append(src) - .append(""); - return strBuf.toString(); - } - - public static String makeHtmlNewLine() { - return "
"; - } - - public static String makeHtmlSpace(int number) { - final String space = " "; - StringBuilder result = new StringBuilder(); - for (int i = 0; i < number; i++) { - result.append(space); - } - return result.toString(); - } - - public static String getFriendlyLength(int lenMeter) { - if (lenMeter > 10000) // 10 km - { - int dis = lenMeter / 1000; - return dis + ChString.Kilometer; - } - - if (lenMeter > 1000) { - float dis = (float) lenMeter / 1000; - DecimalFormat fnum = new DecimalFormat("##0.0"); - String dstr = fnum.format(dis); - return dstr + ChString.Kilometer; - } - - if (lenMeter > 100) { - int dis = lenMeter / 50 * 50; - return dis + ChString.Meter; - } - - int dis = lenMeter / 10 * 10; - if (dis == 0) { - dis = 10; - } - - return dis + ChString.Meter; - } - - public static boolean IsEmptyOrNullString(String s) { - return (s == null) || (s.trim().length() == 0); - } - - /** - * 把LatLng对象转化为LatLonPoint对象 - */ - public static LatLonPoint convertToLatLonPoint(LatLng latlon) { - return new LatLonPoint(latlon.latitude, latlon.longitude); - } - - /** - * 把LatLonPoint对象转化为LatLon对象 - */ - public static LatLng convertToLatLng(LatLonPoint latLonPoint) { - return new LatLng(latLonPoint.getLatitude(), latLonPoint.getLongitude()); - } - - /** - * 把集合体的LatLonPoint转化为集合体的LatLng - */ - public static ArrayList convertArrList(List shapes) { - ArrayList lineShapes = new ArrayList(); - for (LatLonPoint point : shapes) { - LatLng latLngTemp = AMapUtil.convertToLatLng(point); - lineShapes.add(latLngTemp); - } - return lineShapes; - } - - /** - * long类型时间格式化 - */ - public static String convertToTime(long time) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Date date = new Date(time); - return df.format(date); - } - - public static final String HtmlBlack = "#000000"; - public static final String HtmlGray = "#808080"; - - public static String getFriendlyTime(int second) { - if (second > 3600) { - int hour = second / 3600; - int miniate = (second % 3600) / 60; - return hour + "小时" + miniate + "分钟"; - } - if (second >= 60) { - int miniate = second / 60; - return miniate + "分钟"; - } - return second + "秒"; - } - - //路径规划方向指示和图片对应 - public static int getDriveActionID(String actionName) { - if (actionName == null || actionName.equals("")) { - return R.drawable.dir3; - } - if ("左转".equals(actionName)) { - return R.drawable.dir2; - } - if ("右转".equals(actionName)) { - return R.drawable.dir1; - } - if ("向左前方行驶".equals(actionName) || "靠左".equals(actionName)) { - return R.drawable.dir6; - } - if ("向右前方行驶".equals(actionName) || "靠右".equals(actionName)) { - return R.drawable.dir5; - } - if ("向左后方行驶".equals(actionName) || "左转调头".equals(actionName)) { - return R.drawable.dir7; - } - if ("向右后方行驶".equals(actionName)) { - return R.drawable.dir8; - } - if ("直行".equals(actionName)) { - return R.drawable.dir3; - } - if ("减速行驶".equals(actionName)) { - return R.drawable.dir4; - } - return R.drawable.dir3; - } - - public static int getWalkActionID(String actionName) { - if (actionName == null || actionName.equals("")) { - return R.drawable.dir13; - } - if ("左转".equals(actionName)) { - return R.drawable.dir2; - } - if ("右转".equals(actionName)) { - return R.drawable.dir1; - } - if ("向左前方".equals(actionName) || "靠左".equals(actionName) || actionName.contains("向左前方")) { - return R.drawable.dir6; - } - if ("向右前方".equals(actionName) || "靠右".equals(actionName) || actionName.contains("向右前方")) { - return R.drawable.dir5; - } - if ("向左后方".equals(actionName) || actionName.contains("向左后方")) { - return R.drawable.dir7; - } - if ("向右后方".equals(actionName) || actionName.contains("向右后方")) { - return R.drawable.dir8; - } - if ("直行".equals(actionName)) { - return R.drawable.dir3; - } - if ("通过人行横道".equals(actionName)) { - return R.drawable.dir9; - } - if ("通过过街天桥".equals(actionName)) { - return R.drawable.dir11; - } - if ("通过地下通道".equals(actionName)) { - return R.drawable.dir10; - } - - return R.drawable.dir13; - } - - public static String getBusPathTitle(BusPath busPath) { - if (busPath == null) { - return String.valueOf(""); - } - List busSetps = busPath.getSteps(); - if (busSetps == null) { - return String.valueOf(""); - } - StringBuffer sb = new StringBuffer(); - for (BusStep busStep : busSetps) { - StringBuffer title = new StringBuffer(); - if (busStep.getBusLines().size() > 0) { - for (RouteBusLineItem busline : busStep.getBusLines()) { - if (busline == null) { - continue; - } - - String buslineName = getSimpleBusLineName(busline.getBusLineName()); - title.append(buslineName); - title.append(" / "); - } -// RouteBusLineItem busline = busStep.getBusLines().get(0); - - sb.append(title.substring(0, title.length() - 3)); - sb.append(" > "); - } - if (busStep.getRailway() != null) { - RouteRailwayItem railway = busStep.getRailway(); - sb.append(railway.getTrip() + "(" + railway.getDeparturestop().getName() - + " - " + railway.getArrivalstop().getName() + ")"); - sb.append(" > "); - } - } - return sb.substring(0, sb.length() - 3); - } - - public static String getBusPathDes(BusPath busPath) { - if (busPath == null) { - return String.valueOf(""); - } - long second = busPath.getDuration(); - String time = getFriendlyTime((int) second); - float subDistance = busPath.getDistance(); - String subDis = getFriendlyLength((int) subDistance); - float walkDistance = busPath.getWalkDistance(); - String walkDis = getFriendlyLength((int) walkDistance); - return String.valueOf(time + " | " + subDis + " | 步行" + walkDis); - } - - public static String getSimpleBusLineName(String busLineName) { - if (busLineName == null) { - return String.valueOf(""); - } - return busLineName.replaceAll("\\(.*?\\)", ""); - } - - -} diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/map/ChString.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/map/ChString.java deleted file mode 100755 index 1f32432da7..0000000000 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/map/ChString.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.mogo.module.tanlu.map; - -public class ChString { - public static final String Kilometer = "\u516c\u91cc";// "公里"; - public static final String Meter = "\u7c73";// "米"; - public static final String ByFoot = "\u6b65\u884c";// "步行"; - public static final String To = "\u53bb\u5f80";// "去往"; - public static final String Station = "\u8f66\u7ad9";// "车站"; - public static final String TargetPlace = "\u76ee\u7684\u5730";// "目的地"; - public static final String StartPlace = "\u51fa\u53d1\u5730";// "出发地"; - public static final String About = "\u5927\u7ea6";// "大约"; - public static final String Direction = "\u65b9\u5411";// "方向"; - - public static final String GetOn = "\u4e0a\u8f66";// "上车"; - public static final String GetOff = "\u4e0b\u8f66";// "下车"; - public static final String Zhan = "\u7ad9";// "站"; - - public static final String cross = "\u4ea4\u53c9\u8def\u53e3"; // 交叉路口 - public static final String type = "\u7c7b\u522b"; // 类别 - public static final String address = "\u5730\u5740"; // 地址 - public static final String PrevStep = "\u4e0a\u4e00\u6b65"; - public static final String NextStep = "\u4e0b\u4e00\u6b65"; - public static final String Gong = "\u516c\u4ea4"; - public static final String ByBus = "\u4e58\u8f66"; - public static final String Arrive = "\u5230\u8FBE";// 到达 -} diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/map/DrivingRouteOverlay.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/map/DrivingRouteOverlay.java deleted file mode 100755 index 8e95c5fde3..0000000000 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/map/DrivingRouteOverlay.java +++ /dev/null @@ -1,384 +0,0 @@ -package com.mogo.module.tanlu.map; - -import android.content.Context; -import android.graphics.Color; - -import com.amap.api.maps.AMap; -import com.amap.api.maps.model.BitmapDescriptor; -import com.amap.api.maps.model.BitmapDescriptorFactory; -import com.amap.api.maps.model.LatLng; -import com.amap.api.maps.model.LatLngBounds; -import com.amap.api.maps.model.Marker; -import com.amap.api.maps.model.MarkerOptions; -import com.amap.api.maps.model.PolylineOptions; -import com.amap.api.services.core.LatLonPoint; -import com.amap.api.services.route.DrivePath; -import com.amap.api.services.route.DriveStep; -import com.amap.api.services.route.TMC; -import com.mogo.module.tanlu.R; - -import java.util.ArrayList; -import java.util.List; - - -/** - * 导航路线图层类 - */ -public class DrivingRouteOverlay extends RouteOverlay { - private DrivePath drivePath; - private List throughPointList; - private List throughPointMarkerList = new ArrayList(); - private boolean throughPointMarkerVisible = true; - private List tmcs; - private PolylineOptions mPolylineOptions; - private PolylineOptions mPolylineOptionscolor; - private Context mContext; - private boolean isColorfulline = true; - private float mWidth = 4; - private List mLatLngsOfPath; - - public void setIsColorfulline(boolean iscolorfulline) { - this.isColorfulline = iscolorfulline; - } - - /** - * 根据给定的参数,构造一个导航路线图层类对象。 - * - * @param amap 地图对象。 - * @param path 导航路线规划方案。 - * @param context 当前的activity对象。 - */ - public DrivingRouteOverlay(Context context, AMap amap, DrivePath path, - LatLonPoint start, LatLonPoint end, List throughPointList) { - super(context); - mContext = context; - mAMap = amap; - this.drivePath = path; - startPoint = AMapUtil.convertToLatLng(start); - endPoint = AMapUtil.convertToLatLng(end); - this.throughPointList = throughPointList; - - initBitmapDescriptor(); - } - - public float getRouteWidth() { - return mWidth; - } - - /** - * 设置路线宽度 - * - * @param mWidth 路线宽度,取值范围:大于0 - */ - public void setRouteWidth(float mWidth) { - this.mWidth = mWidth; - } - - /** - * 添加驾车路线添加到地图上显示。 - */ - public void addToMap() { - initPolylineOptions(); - try { - if (mAMap == null) { - return; - } - - if (mWidth == 0 || drivePath == null) { - return; - } - mLatLngsOfPath = new ArrayList(); - tmcs = new ArrayList(); - List drivePaths = drivePath.getSteps(); - mPolylineOptions.add(startPoint); - for (int i = 0; i < drivePaths.size(); i++) { - DriveStep step = drivePaths.get(i); - List latlonPoints = step.getPolyline(); - List tmclist = step.getTMCs(); - tmcs.addAll(tmclist); - addDrivingStationMarkers(step, convertToLatLng(latlonPoints.get(0))); - for (LatLonPoint latlonpoint : latlonPoints) { - mPolylineOptions.add(convertToLatLng(latlonpoint)); - mLatLngsOfPath.add(convertToLatLng(latlonpoint)); - } - } - mPolylineOptions.add(endPoint); - if (startMarker != null) { - startMarker.remove(); - startMarker = null; - } - - if (endMarker != null) { - endMarker.remove(); - endMarker = null; - } -// addStartAndEndMarker(); -// addThroughPointMarker(); - if (isColorfulline && tmcs.size() > 0) { - colorWayUpdate(tmcs); - showcolorPolyline(); - } else { - showPolyline(); - } - - } catch (Throwable e) { - e.printStackTrace(); - } - } - - /** - * 初始化线段属性 - */ - private void initPolylineOptions() { - mPolylineOptions = null; - mPolylineOptions = new PolylineOptions(); - mPolylineOptions.color(getDriveColor()).width(getRouteWidth()); - } - - private void showPolyline() { - addPolyLine(mPolylineOptions); - } - - private void showcolorPolyline() { - addPolyLine(mPolylineOptionscolor); - } - - /** - * 根据不同的路段拥堵情况展示不同的颜色 - * - * @param tmcSection - */ - private void colorWayUpdate(List tmcSection) { - if (mAMap == null) { - return; - } - if (tmcSection == null || tmcSection.size() <= 0) { - return; - } - TMC segmentTrafficStatus; - mPolylineOptionscolor = null; - mPolylineOptionscolor = new PolylineOptions(); - mPolylineOptionscolor.width(getRouteWidth()); - List colorList = new ArrayList(); - List bitmapDescriptors = new ArrayList(); - List points = new ArrayList<>(); - List texIndexList = new ArrayList(); -// mPolylineOptionscolor.add(startPoint); -// mPolylineOptionscolor.add(AMapUtil.convertToLatLng(tmcSection.get(0).getPolyline().get(0))); - - points.add(startPoint); - points.add(AMapUtil.convertToLatLng(tmcSection.get(0).getPolyline().get(0))); - colorList.add(getDriveColor()); - bitmapDescriptors.add(defaultRoute); - - BitmapDescriptor bitmapDescriptor = null; - int textIndex = 0; - texIndexList.add(textIndex); - texIndexList.add(++textIndex); - for (int i = 0; i < tmcSection.size(); i++) { - segmentTrafficStatus = tmcSection.get(i); - int color = getcolor(segmentTrafficStatus.getStatus()); - bitmapDescriptor = getTrafficBitmapDescriptor(segmentTrafficStatus.getStatus()); - List mployline = segmentTrafficStatus.getPolyline(); - for (int j = 0; j < mployline.size(); j++) { -// mPolylineOptionscolor.add(AMapUtil.convertToLatLng(mployline.get(j))); - points.add(AMapUtil.convertToLatLng(mployline.get(j))); - colorList.add(color); - - texIndexList.add(++textIndex); - bitmapDescriptors.add(bitmapDescriptor); - } - } - - points.add(endPoint); - colorList.add(getDriveColor()); - bitmapDescriptors.add(defaultRoute); - texIndexList.add(++textIndex); - mPolylineOptionscolor.addAll(points); - mPolylineOptionscolor.colorValues(colorList); - -// mPolylineOptionscolor.setCustomTextureIndex(texIndexList); -// mPolylineOptionscolor.setCustomTextureList(bitmapDescriptors); - } - - private BitmapDescriptor defaultRoute = null; - private BitmapDescriptor unknownTraffic = null; - private BitmapDescriptor smoothTraffic = null; - private BitmapDescriptor slowTraffic = null; - private BitmapDescriptor jamTraffic = null; - private BitmapDescriptor veryJamTraffic = null; - - private void initBitmapDescriptor() { - defaultRoute = BitmapDescriptorFactory.fromResource(R.drawable.amap_route_color_texture_6_arrow); - smoothTraffic = BitmapDescriptorFactory.fromResource(R.drawable.amap_route_color_texture_4_arrow); - unknownTraffic = BitmapDescriptorFactory.fromResource(R.drawable.amap_route_color_texture_0_arrow); - slowTraffic = BitmapDescriptorFactory.fromResource(R.drawable.amap_route_color_texture_3_arrow); - jamTraffic = BitmapDescriptorFactory.fromResource(R.drawable.amap_route_color_texture_2_arrow); - veryJamTraffic = BitmapDescriptorFactory.fromResource(R.drawable.amap_route_color_texture_9_arrow); - } - - private BitmapDescriptor getTrafficBitmapDescriptor(String status) { - if (status.equals("畅通")) { - return smoothTraffic; - } else if (status.equals("缓行")) { - return slowTraffic; - } else if (status.equals("拥堵")) { - return jamTraffic; - } else if (status.equals("严重拥堵")) { - return veryJamTraffic; - } else { - return defaultRoute; - } - } - - - private int getcolor(String status) { - if (status.equals("畅通")) { - return Color.GREEN; - } else if (status.equals("缓行")) { - return Color.YELLOW; - } else if (status.equals("拥堵")) { - return Color.RED; - } else if (status.equals("严重拥堵")) { - return Color.parseColor("#990033"); - } else { - return Color.GREEN; - } - } - - public LatLng convertToLatLng(LatLonPoint point) { - return new LatLng(point.getLatitude(), point.getLongitude()); - } - - /** - * @param driveStep - * @param latLng - */ - private void addDrivingStationMarkers(DriveStep driveStep, LatLng latLng) { - addStationMarker(new MarkerOptions() - .position(latLng) - .title("\u65B9\u5411:" + driveStep.getAction() - + "\n\u9053\u8DEF:" + driveStep.getRoad()) - .snippet(driveStep.getInstruction()).visible(nodeIconVisible) - .anchor(0.5f, 0.5f).icon(getDriveBitmapDescriptor())); - } - - @Override - protected LatLngBounds getLatLngBounds() { - LatLngBounds.Builder b = LatLngBounds.builder(); - b.include(new LatLng(startPoint.latitude, startPoint.longitude)); - b.include(new LatLng(endPoint.latitude, endPoint.longitude)); - if (this.throughPointList != null && this.throughPointList.size() > 0) { - for (int i = 0; i < this.throughPointList.size(); i++) { - b.include(new LatLng( - this.throughPointList.get(i).getLatitude(), - this.throughPointList.get(i).getLongitude())); - } - } - return b.build(); - } - - public void setThroughPointIconVisibility(boolean visible) { - try { - throughPointMarkerVisible = visible; - if (this.throughPointMarkerList != null - && this.throughPointMarkerList.size() > 0) { - for (int i = 0; i < this.throughPointMarkerList.size(); i++) { - this.throughPointMarkerList.get(i).setVisible(visible); - } - } - } catch (Throwable e) { - e.printStackTrace(); - } - } - - private void addThroughPointMarker() { - if (this.throughPointList != null && this.throughPointList.size() > 0) { - LatLonPoint latLonPoint = null; - for (int i = 0; i < this.throughPointList.size(); i++) { - latLonPoint = this.throughPointList.get(i); - if (latLonPoint != null) { - throughPointMarkerList.add(mAMap - .addMarker((new MarkerOptions()) - .position( - new LatLng(latLonPoint - .getLatitude(), latLonPoint - .getLongitude())) - .visible(throughPointMarkerVisible) - .icon(getThroughPointBitDes()) - .title("\u9014\u7ECF\u70B9"))); - } - } - } - } - - private BitmapDescriptor getThroughPointBitDes() { - return BitmapDescriptorFactory.fromResource(R.drawable.amap_through); - - } - - /** - * 获取两点间距离 - * - * @param start - * @param end - * @return - */ - public static int calculateDistance(LatLng start, LatLng end) { - double x1 = start.longitude; - double y1 = start.latitude; - double x2 = end.longitude; - double y2 = end.latitude; - return calculateDistance(x1, y1, x2, y2); - } - - public static int calculateDistance(double x1, double y1, double x2, double y2) { - final double NF_pi = 0.01745329251994329; // 弧度 PI/180 - x1 *= NF_pi; - y1 *= NF_pi; - x2 *= NF_pi; - y2 *= NF_pi; - double sinx1 = Math.sin(x1); - double siny1 = Math.sin(y1); - double cosx1 = Math.cos(x1); - double cosy1 = Math.cos(y1); - double sinx2 = Math.sin(x2); - double siny2 = Math.sin(y2); - double cosx2 = Math.cos(x2); - double cosy2 = Math.cos(y2); - double[] v1 = new double[3]; - v1[0] = cosy1 * cosx1 - cosy2 * cosx2; - v1[1] = cosy1 * sinx1 - cosy2 * sinx2; - v1[2] = siny1 - siny2; - double dist = Math.sqrt(v1[0] * v1[0] + v1[1] * v1[1] + v1[2] * v1[2]); - - return (int) (Math.asin(dist / 2) * 12742001.5798544); - } - - - //获取指定两点之间固定距离点 - public static LatLng getPointForDis(LatLng sPt, LatLng ePt, double dis) { - double lSegLength = calculateDistance(sPt, ePt); - double preResult = dis / lSegLength; - return new LatLng((ePt.latitude - sPt.latitude) * preResult + sPt.latitude, (ePt.longitude - sPt.longitude) * preResult + sPt.longitude); - } - - /** - * 去掉DriveLineOverlay上的线段和标记。 - */ - @Override - public void removeFromMap() { - try { - super.removeFromMap(); - if (this.throughPointMarkerList != null - && this.throughPointMarkerList.size() > 0) { - for (int i = 0; i < this.throughPointMarkerList.size(); i++) { - this.throughPointMarkerList.get(i).remove(); - } - this.throughPointMarkerList.clear(); - } - } catch (Throwable e) { - e.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/map/RouteOverlay.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/map/RouteOverlay.java deleted file mode 100755 index 47a63582b5..0000000000 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/map/RouteOverlay.java +++ /dev/null @@ -1,236 +0,0 @@ -package com.mogo.module.tanlu.map; - -import android.content.Context; -import android.graphics.Bitmap; -import android.graphics.Color; - -import com.amap.api.maps.AMap; -import com.amap.api.maps.CameraUpdateFactory; -import com.amap.api.maps.model.BitmapDescriptor; -import com.amap.api.maps.model.BitmapDescriptorFactory; -import com.amap.api.maps.model.LatLng; -import com.amap.api.maps.model.LatLngBounds; -import com.amap.api.maps.model.Marker; -import com.amap.api.maps.model.MarkerOptions; -import com.amap.api.maps.model.Polyline; -import com.amap.api.maps.model.PolylineOptions; -import com.mogo.module.tanlu.R; - -import java.util.ArrayList; -import java.util.List; - - -public class RouteOverlay { - protected List stationMarkers = new ArrayList(); - protected List allPolyLines = new ArrayList(); - protected Marker startMarker; - protected Marker endMarker; - protected LatLng startPoint; - protected LatLng endPoint; - protected AMap mAMap; - private Context mContext; - private Bitmap startBit, endBit, busBit, walkBit, driveBit; - protected boolean nodeIconVisible = true; - - public RouteOverlay(Context context) { - mContext = context; - } - - /** - * 去掉BusRouteOverlay上所有的Marker。 - * - * @since V2.1.0 - */ - public void removeFromMap() { - if (startMarker != null) { - startMarker.remove(); - - } - if (endMarker != null) { - endMarker.remove(); - } - for (Marker marker : stationMarkers) { - marker.remove(); - } - for (Polyline line : allPolyLines) { - line.remove(); - } - destroyBit(); - } - - private void destroyBit() { - if (startBit != null) { - startBit.recycle(); - startBit = null; - } - if (endBit != null) { - endBit.recycle(); - endBit = null; - } - if (busBit != null) { - busBit.recycle(); - busBit = null; - } - if (walkBit != null) { - walkBit.recycle(); - walkBit = null; - } - if (driveBit != null) { - driveBit.recycle(); - driveBit = null; - } - } - - /** - * 给起点Marker设置图标,并返回更换图标的图片。如不用默认图片,需要重写此方法。 - * - * @return 更换的Marker图片。 - * @since V2.1.0 - */ - protected BitmapDescriptor getStartBitmapDescriptor() { - return BitmapDescriptorFactory.fromResource(R.drawable.amap_start); - } - - /** - * 给终点Marker设置图标,并返回更换图标的图片。如不用默认图片,需要重写此方法。 - * - * @return 更换的Marker图片。 - * @since V2.1.0 - */ - protected BitmapDescriptor getEndBitmapDescriptor() { - return BitmapDescriptorFactory.fromResource(R.drawable.amap_end); - } - - /** - * 给公交Marker设置图标,并返回更换图标的图片。如不用默认图片,需要重写此方法。 - * - * @return 更换的Marker图片。 - * @since V2.1.0 - */ - protected BitmapDescriptor getBusBitmapDescriptor() { - return BitmapDescriptorFactory.fromResource(R.drawable.amap_bus); - } - - /** - * 给步行Marker设置图标,并返回更换图标的图片。如不用默认图片,需要重写此方法。 - * - * @return 更换的Marker图片。 - * @since V2.1.0 - */ - protected BitmapDescriptor getWalkBitmapDescriptor() { - return BitmapDescriptorFactory.fromResource(R.drawable.amap_man); - } - - protected BitmapDescriptor getDriveBitmapDescriptor() { - return BitmapDescriptorFactory.fromResource(R.drawable.amap_car); - } - - protected void addStartAndEndMarker() { - startMarker = mAMap.addMarker((new MarkerOptions()) - .position(startPoint).icon(getStartBitmapDescriptor()) - .title("\u8D77\u70B9")); - // startMarker.showInfoWindow(); - - endMarker = mAMap.addMarker((new MarkerOptions()).position(endPoint) - .icon(getEndBitmapDescriptor()).title("\u7EC8\u70B9")); - // mAMap.moveCamera(CameraUpdateFactory.newLatLngZoom(startPoint, - // getShowRouteZoom())); - } - - /** - * 移动镜头到当前的视角。 - * - * @since V2.1.0 - */ - public void zoomToSpan() { - if (startPoint != null) { - if (mAMap == null) - return; - try { - LatLngBounds bounds = getLatLngBounds(); - mAMap.animateCamera(CameraUpdateFactory - .newLatLngBounds(bounds, 50)); - } catch (Throwable e) { - e.printStackTrace(); - } - } - } - - protected LatLngBounds getLatLngBounds() { - LatLngBounds.Builder b = LatLngBounds.builder(); - b.include(new LatLng(startPoint.latitude, startPoint.longitude)); - b.include(new LatLng(endPoint.latitude, endPoint.longitude)); - for (Polyline polyline : allPolyLines) { - for (LatLng point : polyline.getPoints()) { - b.include(point); - } - } - return b.build(); - } - - /** - * 路段节点图标控制显示接口。 - * - * @param visible true为显示节点图标,false为不显示。 - * @since V2.3.1 - */ - public void setNodeIconVisibility(boolean visible) { - try { - nodeIconVisible = visible; - if (this.stationMarkers != null && this.stationMarkers.size() > 0) { - for (int i = 0; i < this.stationMarkers.size(); i++) { - this.stationMarkers.get(i).setVisible(visible); - } - } - } catch (Throwable e) { - e.printStackTrace(); - } - } - - protected void addStationMarker(MarkerOptions options) { - if (options == null) { - return; - } - Marker marker = mAMap.addMarker(options); - if (marker != null) { - stationMarkers.add(marker); - } - - } - - protected void addPolyLine(PolylineOptions options) { - if (options == null) { - return; - } - Polyline polyline = mAMap.addPolyline(options); - if (polyline != null) { - allPolyLines.add(polyline); - } - } - - protected float getRouteWidth() { - return 18f; - } - - protected int getWalkColor() { - return Color.parseColor("#6db74d"); - } - - /** - * 自定义路线颜色。 - * return 自定义路线颜色。 - * - * @since V2.2.1 - */ - protected int getBusColor() { - return Color.parseColor("#537edc"); - } - - protected int getDriveColor() { - return Color.parseColor("#537edc"); - } - - // protected int getShowRouteZoom() { - // return 15; - // } -} diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/End.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/End.java new file mode 100644 index 0000000000..4e937f983a --- /dev/null +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/End.java @@ -0,0 +1,16 @@ +package com.mogo.module.tanlu.model; + +/** + * @author lixiaopeng + * @description + * @since 2020-01-09 + */ +public class End { + public Double lat; + public Double lon; + + public End(Double lat, Double lon) { + this.lat = lat; + this.lon = lon; + } +} diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/InformationAndLiveCarResult.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/InformationAndLiveCarResult.java new file mode 100644 index 0000000000..d40d7ec8e9 --- /dev/null +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/InformationAndLiveCarResult.java @@ -0,0 +1,38 @@ +package com.mogo.module.tanlu.model; + +import com.mogo.commons.data.BaseData; + +/** + * @author lixiaopeng + * @description + * @since 2020-01-09 + */ +public class InformationAndLiveCarResult extends BaseData { + private Result onTheWayData; + private Result infoMationResult; + private Sns snResult; + + public Result getOnTheWayData() { + return onTheWayData; + } + + public void setOnTheWayData(Result onTheWayData) { + this.onTheWayData = onTheWayData; + } + + public Result getInfoMationResult() { + return infoMationResult; + } + + public void setInfoMationResult(Result infoMationResult) { + this.infoMationResult = infoMationResult; + } + + public Sns getSnResult() { + return snResult; + } + + public void setSnResult(Sns snResult) { + this.snResult = snResult; + } +} diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/InformationAndLiveCarResult.kt b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/InformationAndLiveCarResult.kt deleted file mode 100644 index 24bc41b302..0000000000 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/InformationAndLiveCarResult.kt +++ /dev/null @@ -1,18 +0,0 @@ -package com.mogo.module.tanlu.model - -/** - * @author congtaowang - * @since 2019-11-20 - * - * 根据范围请求情报+在线车机结果 - */ -data class InformationAndLiveCarResult( - var onTheWayData: Result, - var infoMationResult: Result, - var snResult: Sns -) { - fun getInformation(): Result = if (onTheWayData == null - || onTheWayData.informations == null - || onTheWayData.informations.isEmpty() - ) infoMationResult else onTheWayData -} \ No newline at end of file diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/LocationCarsWithRadius.kt b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/LocationCarsWithRadius.kt new file mode 100644 index 0000000000..f853fe51bb --- /dev/null +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/LocationCarsWithRadius.kt @@ -0,0 +1,21 @@ +package com.mogo.module.tanlu.model + +class LocationCarsWithRadius { + var coordinates: List + var radius: Int + var type: String + var keyWord: String? = null + + constructor(coordinates: List, radius: Int, type: String, keyWord: String) { + this.coordinates = coordinates + this.radius = radius + this.type = type + this.keyWord = keyWord + } + + constructor(coordinates: List, radius: Int, type: String) { + this.coordinates = coordinates + this.radius = radius + this.type = type + } +} \ No newline at end of file diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/NaviLatLng.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/NaviLatLng.java new file mode 100644 index 0000000000..a24ea22360 --- /dev/null +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/NaviLatLng.java @@ -0,0 +1,17 @@ +package com.mogo.module.tanlu.model; + +/** + * @author lixiaopeng + * @description + * @since 2020-01-09 + */ +public class NaviLatLng { + public Start start; + public End end; + + NaviLatLng(Start start, End end) { + this.start = start; + this.end = end; + } + +} diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/NaviLatLngInfo.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/NaviLatLngInfo.java new file mode 100644 index 0000000000..fc090e7876 --- /dev/null +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/NaviLatLngInfo.java @@ -0,0 +1,55 @@ +package com.mogo.module.tanlu.model; + +import java.io.Serializable; + +/** + * @author lixiaopeng + * @description + * @since 2020-01-09 + */ +public class NaviLatLngInfo implements Serializable { + public String FromPoiLatitude = ""; + public String FromPoiLongitude = ""; + public String ToPoiLatitude = ""; + public String ToPoiLongitude= ""; + +// public Start fromStart() { +// return Start(Double.parseDouble(FromPoiLatitude), Double.parseDouble(FromPoiLongitude)); +// } +// +// public End toEnd() { +// return End(ToPoiLatitude.toDouble(), ToPoiLongitude.toDouble()); +// } + + public String getFromPoiLatitude() { + return FromPoiLatitude; + } + + public void setFromPoiLatitude(String fromPoiLatitude) { + FromPoiLatitude = fromPoiLatitude; + } + + public String getFromPoiLongitude() { + return FromPoiLongitude; + } + + public void setFromPoiLongitude(String fromPoiLongitude) { + FromPoiLongitude = fromPoiLongitude; + } + + public String getToPoiLatitude() { + return ToPoiLatitude; + } + + public void setToPoiLatitude(String toPoiLatitude) { + ToPoiLatitude = toPoiLatitude; + } + + public String getToPoiLongitude() { + return ToPoiLongitude; + } + + public void setToPoiLongitude(String toPoiLongitude) { + ToPoiLongitude = toPoiLongitude; + } +} diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/NaviLatLngInfo.kt b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/NaviLatLngInfo.kt new file mode 100644 index 0000000000..b4d7c77b88 --- /dev/null +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/NaviLatLngInfo.kt @@ -0,0 +1,19 @@ +package com.mogo.module.tanlu.model + +import java.io.Serializable + +fun NaviLatLngInfo.fromStart(): Start { + return Start(FromPoiLatitude.toDouble(), FromPoiLongitude.toDouble()) +} + +fun NaviLatLngInfo.toEnd(): End { + return End(ToPoiLatitude.toDouble(), ToPoiLongitude.toDouble()) +} + +class NaviLatLngInfo1 : Serializable { + var FromPoiLatitude: String = "" + var FromPoiLongitude: String = "" + var ToPoiLatitude: String = "" + var ToPoiLongitude: String = "" + +} \ No newline at end of file diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/SearchOnlineInfo.kt b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/SearchOnlineInfo.kt new file mode 100644 index 0000000000..bd80487735 --- /dev/null +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/SearchOnlineInfo.kt @@ -0,0 +1,10 @@ +package com.mogo.module.tanlu.model + +data class SearchOnlineInfo( + val address: String, + val cityId: String, + val size: Int, +// val radius: Int, + val center: Center, + val adcode: String +) diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/Start.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/Start.java new file mode 100644 index 0000000000..1e43cb6883 --- /dev/null +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/Start.java @@ -0,0 +1,16 @@ +package com.mogo.module.tanlu.model; + +/** + * @author lixiaopeng + * @description + * @since 2020-01-09 + */ +public class Start { + public Double lat; + public Double lon; + + public Start(Double lat, Double lon) { + this.lat = lat; + this.lon = lon; + } +} diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/TanluModelData.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/TanluModelData.java new file mode 100644 index 0000000000..132f12e0da --- /dev/null +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/model/TanluModelData.java @@ -0,0 +1,175 @@ +package com.mogo.module.tanlu.model; + +import android.content.Context; +import android.util.Log; + +import com.alibaba.android.arouter.launcher.ARouter; +import com.google.gson.Gson; +import com.mogo.commons.debug.DebugConfig; +import com.mogo.commons.network.ParamsProvider; +import com.mogo.commons.network.SubscribeImpl; +import com.mogo.module.tanlu.callback.AlongTheWayCallback; +import com.mogo.module.tanlu.callback.RoadLineCallback; +import com.mogo.module.tanlu.callback.VoiceSearchCallback; +import com.mogo.module.tanlu.constant.HttpConst; +import com.mogo.module.tanlu.constant.TanluConstants; +import com.mogo.module.tanlu.net.TanluApiService; +import com.mogo.service.MogoServicePaths; +import com.mogo.service.network.IMogoNetwork; +import com.mogo.utils.logger.Logger; +import com.mogo.utils.network.RequestOptions; +import com.mogo.utils.storage.SharedPrefsMgr; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + +import static com.mogo.commons.network.Utils.getSn; + +/** + * @author lixiaopeng + * @description 探路接口数据处理 + * @since 2020-01-09 + */ +public class TanluModelData { + + private final Context mContext; + private TanluApiService mTanluApiService; + private static final String TAG = "TanluModelData"; + + public TanluModelData(Context context) { + this.mContext = context; + IMogoNetwork network = (IMogoNetwork) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICES_NETWORK).navigation(context); + mTanluApiService = network.create(TanluApiService.class, DebugConfig.getNetMode() == 3 ? HttpConst.HOST_PRODUCT : HttpConst.HOST_TEST); + } + + /** + * 声音控制道理数据 + */ + public void getVoiceControlRoadData(String keywords, String cityId, Double lon, Double lat, + String adCode, final VoiceSearchCallback callback) { + Gson gson = new Gson(); + SearchOnlineInfo searchOnlineInfo = new SearchOnlineInfo(keywords, cityId, 50, new Center(lat, lon), adCode); + String searchInformationStr = gson.toJson(searchOnlineInfo); + + List list = new ArrayList<>(); + list.add(lon); + list.add(lat); + LocationCarsWithRadius locCarsWithRadius = new LocationCarsWithRadius(list, 20000, "circle"); + String locCarsWithRadiusStr = gson.toJson(locCarsWithRadius); + + final Map params = new ParamsProvider.Builder(mContext) + .append("sn", getSn()) + .append("data", searchInformationStr) + .append("getSnData", locCarsWithRadiusStr) + .build(); + mTanluApiService.searchOnLineInformation(params) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new SubscribeImpl(RequestOptions.create(mContext)) { + @Override + public void onSuccess(VoiceSearchResult o) { + super.onSuccess(o); + callback.onSuccess(o); + Logger.d(TAG, "getVoiceControlRoadData onSuccess ------>"); + } + + @Override + public void onError(String message, int code) { + super.onError(message, code); + callback.onFail(message, code); + Logger.e(TAG, "getVoiceControlRoadData onError message= " + message + ">>code =" + code); + } + }); + } + + + /** + * 通勤族 事件,监听消息自己请求路线数据 + */ + public void getRoadLineData(final RoadLineCallback callback) { + if (mTanluApiService != null) { + final Map params = new ParamsProvider.Builder(mContext) + .append("sn", getSn()) + .build(); + mTanluApiService.getRoadLineInfo(params) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new SubscribeImpl(RequestOptions.create(mContext)) { + @Override + public void onSuccess(PathLineResult o) { + super.onSuccess(o); + callback.onSuccess(o); + Logger.d(TAG, "getRoadLineData onSuccess ------>"); + } + + @Override + public void onError(String message, int code) { + super.onError(message, code); + callback.onFail(message, code); + Logger.e(TAG, "getRoadLineData onError message= " + message + ">>code =" + code); + } + }); + } + } + + + /** + * 导航路线数据事件 + */ + public void getNavigationLineData(Double lon, Double lat, final AlongTheWayCallback callback) { + Gson gson = new Gson(); +// NaviLatLng coordinates = new NaviLatLng(getNaviInfo(lon, lat).fromStart(), getNaviInfo(lon, lat).toEnd()); + + List list = new ArrayList<>(); + list.add(lon); + list.add(lat); + LocationCarsWithRadius locCarsWithRadius = new LocationCarsWithRadius(list, 20000, "circle"); + String locCarsWithRadiusStr = gson.toJson(locCarsWithRadius); + + final Map params = new ParamsProvider.Builder(mContext) +// .append("onTheWayData", gson.toJson(coordinates)) + .append("getSnData", locCarsWithRadiusStr) + .build(); + + mTanluApiService.requestInformationAlongTheWay(getSn(), params) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new SubscribeImpl(RequestOptions.create(mContext)) { + @Override + public void onSuccess(InformationAndLiveCarResult data) { + super.onSuccess(data); + callback.onSuccess(data); + Logger.d(TAG, "getNavigationLineData onSuccess ------>"); + } + + @Override + public void onError(String message, int code) { + super.onError(message, code); + callback.onFail(message, code); + Logger.e(TAG, "getNavigationLineData onError message= " + message + ">>code =" + code); + } + }); + } + + + //获取Location,如果没有location数据为空,则使用首次或者上次定位点,并且更新SP,需要抽取公共方法 + public NaviLatLngInfo getNaviInfo(Double lon, Double lat) { + String naviInfo = SharedPrefsMgr.getInstance(mContext).getString(TanluConstants.NAVI_INFO); + Log.d(TAG, " getNaviInfo naviInfo =" + naviInfo); + NaviLatLngInfo naviLatLngInfo = new Gson().fromJson(naviInfo, NaviLatLngInfo.class); + Log.d(TAG, "getLocNaviInfo lat = $lat -----> lon = $lon"); + if (lon == 0.0 || lat == 0.0) { + return naviLatLngInfo; + } else { + naviLatLngInfo.setFromPoiLatitude(lat + ""); + naviLatLngInfo.setFromPoiLongitude(lon + ""); + SharedPrefsMgr.getInstance(mContext).putString(TanluConstants.NAVI_INFO, new Gson().toJson(naviLatLngInfo)); + return naviLatLngInfo; + } + } + +} diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/net/TanluApiService.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/net/TanluApiService.java index f2157fa456..d2400b7112 100644 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/net/TanluApiService.java +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/net/TanluApiService.java @@ -22,26 +22,24 @@ public interface TanluApiService { /** * 探路沿途数据 * - * @return */ @FormUrlEncoded @POST("deva/car/path/no/getOnTheWayDataAndSn/v1") - Observable requestInformationAlongTheWay(@Query("sn") String sn, @FieldMap Map parameters); + Observable requestInformationAlongTheWay(@Query("sn") String sn, @FieldMap Map parameters); /** * 获取上班族路线的坐标集 */ @FormUrlEncoded @POST("yycp-travel-condition/travelDetail/info/no/commuter/v1") - Observable getRoadLineInfo(@FieldMap Map infoBody); - + Observable getRoadLineInfo(@FieldMap Map infoBody); /** * 基于地理信息词缀的空间情报检索 */ @FormUrlEncoded @POST("deva/car/search/no/searchInforationByAddress/v1") - Observable searchOnLineInformation(@FieldMap Map infoBody); + Observable searchOnLineInformation(@FieldMap Map infoBody); } diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/util/ActivityStatusUtil.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/util/ActivityStatusUtil.java new file mode 100644 index 0000000000..fa9bb7614b --- /dev/null +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/util/ActivityStatusUtil.java @@ -0,0 +1,46 @@ +package com.mogo.module.tanlu.util; + +import android.app.ActivityManager; +import android.content.ComponentName; +import android.content.Context; +import android.text.TextUtils; + +import java.util.List; + +import static android.content.Context.ACTIVITY_SERVICE; + +/** + * @author lixiaopeng + * @description + * @since 2019-09-26 + */ +public class ActivityStatusUtil { + /** + * 判断某个activity是否在前台显示 + */ + public static boolean isForeground(Context activity) { + return isForeground(activity, "com.zhidao.roadcondition.main_module.MainActivity"); + } + + /** + * 判断某个界面是否在前台,返回true,为显示,否则不是 + */ + public static boolean isForeground(Context context, String className) { + if (context == null || TextUtils.isEmpty(className)) { + return false; + } + ActivityManager am = (ActivityManager) context.getSystemService(ACTIVITY_SERVICE); + List list = am.getRunningTasks(1); + if (list != null && list.size() > 0) { + ComponentName cpn = list.get(0).topActivity; + if (className.equals(cpn.getClassName())) { + return true; + } else { + + } + } + + return false; + } + +} diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/util/StringUitl.kt b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/util/StringUitl.kt index bc4ceace53..bf287acdb0 100644 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/util/StringUitl.kt +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/util/StringUitl.kt @@ -1,6 +1,7 @@ package com.mogo.module.tanlu.util import android.text.format.DateFormat +import com.google.gson.Gson import java.text.DecimalFormat const val format = "yy/MM/dd kk:mm:ss" @@ -29,3 +30,7 @@ fun handleDistances(distance: Int): String { } } + + + + diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/util/Utils.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/util/Utils.java index afb74a6fac..c88085e0f5 100644 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/util/Utils.java +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/util/Utils.java @@ -20,4 +20,12 @@ public class Utils { } } + //保留整数,四舍五入 + public static int getIntervalValue(int listSize){ +// var floatSize = listSize.toFloat(); + int transformSize = listSize / 15; + DecimalFormat df = new DecimalFormat("0"); + return Integer.parseInt((df.format(transformSize))); + } + } \ No newline at end of file diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/voice/VoiceController.kt b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/voice/VoiceController.kt new file mode 100644 index 0000000000..5b623fb41f --- /dev/null +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/voice/VoiceController.kt @@ -0,0 +1,57 @@ +package com.mogo.module.tanlu.voice + +import com.zhidao.auto.platform.voice.VoiceClient + +/** + * @description 声音控制类 + * + * @author lixiaopeng + * @since 2019-11-01 + */ +object VoiceController { + private lateinit var voiceClient: VoiceClient + +// fun initVoice() { +// voiceClient = VoiceClient.getInstance(BaseApplication.getAppContext()) +// } + + /** + * 设置语音命令回调接口 + * @param callBack + */ + fun setCallBack(callBack: VoiceClient.VoiceCmdCallBack) { + voiceClient.setCallBack(callBack) + } + + /** + * @param speakText 语音播报内容 + */ + fun speakVoice(speakText: String) { + voiceClient.speakDefault(speakText) + } + + /** + * 注册免唤醒命令 + * @param customType 命令 + * @param customWakeupCmd 命令对应的唤醒词集合 + */ + fun registerCustomWakeupCmd(customType: String, customWakeupCmd: Array) { + voiceClient.registerCustomWakeupCmd(customType, customWakeupCmd) + } + + /** + * 取消免唤醒命令 + * @param customType 命令 + */ + fun unRegisterCustomWakeupCmd(customType: String) { + voiceClient.unRegisterCustomWakeupCmd(customType) + } + + /** + * 释放资源(界面销毁的时候调用) + */ + fun release() { + voiceClient.release() + } + +} \ No newline at end of file From 22f49276a164511166906f189401a2e097ebd3e3 Mon Sep 17 00:00:00 2001 From: zhangyuanzhen Date: Thu, 9 Jan 2020 20:28:28 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E8=B7=AF=E5=BE=84=E8=A7=84=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/launcher/MogoApplication.java | 1 - .../com/mogo/map/navi/MogoCalculatePath.java | 18 +++ .../mogo/module/common/MogoModulePaths.java | 12 +- .../module/navi/constants/AMapConstants.java | 4 + .../navi/constants/SearchServiceHolder.kt | 27 +++++ .../navi/ui/adapter/CalculatePathAdapter.java | 73 ++++++++++++ .../navi/ui/adapter/HistoryPoiAdapter.java | 2 +- .../ui/adapter/SearchCategoryAdapter.java | 6 + .../navi/ui/search/CategorySearchFragment.kt | 4 + .../navi/ui/search/ChoosePathFragment.kt | 105 ++++++++++++++++++ .../module/navi/ui/search/SearchFragment.java | 17 ++- .../amap_calculate_navi_strategy1_bkg.xml | 9 ++ .../amap_calculate_navi_strategy2_bkg.xml | 9 ++ .../amap_calculate_navi_strategy3_bkg.xml | 9 ++ .../amap_calculate_navi_strategy_name_bkg.xml | 9 ++ .../res/layout/fragment_search_category.xml | 1 + .../res/layout/item_calculate_path_map.xml | 84 ++++++++++++++ .../src/main/res/values/ids.xml | 1 + .../src/main/res/values/strings.xml | 2 + 19 files changed, 384 insertions(+), 9 deletions(-) create mode 100644 modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/adapter/CalculatePathAdapter.java create mode 100644 modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/ChoosePathFragment.kt create mode 100644 modules/mogo-module-search/src/main/res/drawable/amap_calculate_navi_strategy1_bkg.xml create mode 100644 modules/mogo-module-search/src/main/res/drawable/amap_calculate_navi_strategy2_bkg.xml create mode 100644 modules/mogo-module-search/src/main/res/drawable/amap_calculate_navi_strategy3_bkg.xml create mode 100644 modules/mogo-module-search/src/main/res/drawable/amap_calculate_navi_strategy_name_bkg.xml create mode 100644 modules/mogo-module-search/src/main/res/layout/item_calculate_path_map.xml diff --git a/app/src/main/java/com/mogo/launcher/MogoApplication.java b/app/src/main/java/com/mogo/launcher/MogoApplication.java index f251be04c3..8ac0fd9188 100644 --- a/app/src/main/java/com/mogo/launcher/MogoApplication.java +++ b/app/src/main/java/com/mogo/launcher/MogoApplication.java @@ -6,7 +6,6 @@ import androidx.multidex.MultiDex; import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.debug.DebugConfig; -import com.mogo.module.carchatting.CallChatConstant; import com.mogo.module.common.MogoModule; import com.mogo.module.common.MogoModulePaths; import com.mogo.module.onlinecar.OnLineCarConstants; diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/navi/MogoCalculatePath.java b/libraries/mogo-map-api/src/main/java/com/mogo/map/navi/MogoCalculatePath.java index 6034fddefe..aca3259c58 100644 --- a/libraries/mogo-map-api/src/main/java/com/mogo/map/navi/MogoCalculatePath.java +++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/navi/MogoCalculatePath.java @@ -79,6 +79,24 @@ public class MogoCalculatePath { this.mTrafficLights = mTrafficLights; } + + + private StringBuilder mDescBuilder = null; + + public String getDesc() { + if ( mDescBuilder == null ) { + mDescBuilder = new StringBuilder(); + int lightsSize = getTrafficLights(); + if ( lightsSize > 0 ) { + mDescBuilder.append( "红绿灯" ).append( lightsSize ).append( "个" ); + } + //mDescBuilder.append( " " ); + //mDescBuilder.append( "收费" ).append( mPath.getTollCost() ).append( "元" ); + } + + return mDescBuilder.toString(); + } + public String getTagId() { return mTagId; } diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModulePaths.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModulePaths.java index adfffc5401..9a65d0cfe2 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModulePaths.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/MogoModulePaths.java @@ -42,7 +42,7 @@ public class MogoModulePaths { * 搜索页面模块实例化路径 */ @Keep - public static final String PATH_MODULE_SEARCH= "navi/search/ui"; + public static final String PATH_MODULE_SEARCH= "/navi/search/ui"; /** * 搜索页面Activity实例化路径 @@ -58,6 +58,16 @@ public class MogoModulePaths { public static final String PATH_FRAGMENT_SEARCH = "/navi/search"; + + /** + * 搜索 fragment + */ + @Keep + public static final String PATH_FRAGMENT_CHOOSE_PAHT = "/navi/search"; + + + + /** * 按类别搜索 fragment */ diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/AMapConstants.java b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/AMapConstants.java index 5429dfb3b5..5c75c27f04 100644 --- a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/AMapConstants.java +++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/AMapConstants.java @@ -20,6 +20,10 @@ public class AMapConstants { */ public static final String KEY_SET_HOME_COMPONY = "key_home"; + /** + * 序列号实体的Key + */ + public static final String KEY_PARCELABLE = "key_Parcelable"; /** * 点击当前位置按钮的地图缩放级别 diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/SearchServiceHolder.kt b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/SearchServiceHolder.kt index e0465d19a6..c6b92c006c 100644 --- a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/SearchServiceHolder.kt +++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/constants/SearchServiceHolder.kt @@ -1,8 +1,14 @@ package com.mogo.module.navi.constants +import android.content.Context +import androidx.fragment.app.Fragment import com.alibaba.android.arouter.launcher.ARouter +import com.mogo.map.navi.IMogoNavi import com.mogo.service.MogoServicePaths +import com.mogo.service.fragmentmanager.FragmentDescriptor import com.mogo.service.fragmentmanager.IMogoFragmentManager +import com.mogo.service.map.IMogoMapService +import com.mogo.service.module.IMogoRegisterCenter /** *@author zyz @@ -13,7 +19,28 @@ object SearchServiceHolder { val fragmentManager:IMogoFragmentManager = ARouter.getInstance().build( MogoServicePaths.PATH_FRAGMENT_MANAGER ).navigation() as IMogoFragmentManager + val mapService:IMogoMapService = ARouter.getInstance().build( + MogoServicePaths.PATH_SERVICES_MAP + ).navigation() as IMogoMapService + val listenerCenter:IMogoRegisterCenter = ARouter.getInstance().build( + MogoServicePaths.PATH_REGISTER_CENTER + ).navigation() as IMogoRegisterCenter + fun push( + fragment: Fragment, + tag: String + ) { + val builder = FragmentDescriptor.Builder() + builder.fragment(fragment) + val build = builder.tag(tag) + .build() + fragmentManager.push(build) + } + + + fun getNavi(context: Context):IMogoNavi{ + return mapService.getNavi(context) + } } \ No newline at end of file diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/adapter/CalculatePathAdapter.java b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/adapter/CalculatePathAdapter.java new file mode 100644 index 0000000000..fdb90204a2 --- /dev/null +++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/adapter/CalculatePathAdapter.java @@ -0,0 +1,73 @@ +package com.mogo.module.navi.ui.adapter; + +import android.content.Context; +import android.view.View; +import com.mogo.map.navi.MogoCalculatePath; +import com.mogo.map.search.inputtips.MogoTip; +import com.mogo.module.navi.R; +import com.mogo.module.navi.ui.adapter.base.RecycleBaseAdapter; +import com.mogo.module.navi.ui.adapter.base.RecycleViewHolder; +import java.util.List; + +/** + * @author zyz + * 2019-08-13. + */ +public class CalculatePathAdapter extends RecycleBaseAdapter { + + private int current = 0; + private int lastPosition = 0; + + /** + * + */ + public CalculatePathAdapter(Context context, List list) { + super(context, list, R.layout.item_calculate_path_map); + } + + private View.OnClickListener onClickListener; + + @Override + public void onBindViewHolder(RecycleViewHolder holder, MogoCalculatePath item) { + + //holder.setText(R.id.tv_position, tip.getName()); + //holder.setText(R.id.tv_position_des, tip.getAddress()); + + holder.itemView.setTag(R.id.tag_position, holder.getLayoutPosition()); + holder.itemView.setOnClickListener(onClickListener); + holder.itemView.setSelected(current == holder.getLayoutPosition()); + + View mName = holder.getView(R.id.amap_calculate_item_strategy_name); + holder.setText(R.id.amap_calculate_item_strategy_name, item.getStrategyName()); + mName.setBackgroundResource(getStrategyNameBkgResId(holder.getLayoutPosition())); + holder.setText(R.id.amap_calculate_item_strategy_time, item.getTime()); + holder.setText(R.id.amap_calculate_item_strategy_distance, item.getDistance()); + holder.setText(R.id.amap_calculate_item_strategy_desc, item.getDesc()); + } + + public void setOnClickListener(View.OnClickListener onClickListener) { + this.onClickListener = onClickListener; + } + + public void setCurrent(int current) { + this.current = current; + notifyItemChanged(lastPosition); + notifyItemChanged(current); + lastPosition = current; + } + + public MogoCalculatePath getCurrentItem() { + return list.get(current); + } + + private int getStrategyNameBkgResId(int position) { + switch (position) { + case 0: + return R.drawable.amap_calculate_navi_strategy1_bkg; + case 1: + return R.drawable.amap_calculate_navi_strategy2_bkg; + default: + return R.drawable.amap_calculate_navi_strategy3_bkg; + } + } +} diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/adapter/HistoryPoiAdapter.java b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/adapter/HistoryPoiAdapter.java index 824e6c6bcc..96c12aef52 100644 --- a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/adapter/HistoryPoiAdapter.java +++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/adapter/HistoryPoiAdapter.java @@ -32,7 +32,7 @@ public class HistoryPoiAdapter extends RecycleBaseAdapter { holder.setText(R.id.tv_position, tip.getName()); holder.setText(R.id.tv_position_des, tip.getAddress()); - holder.itemView.setTag(R.id.tag_position, tip); + holder.itemView.setTag(R.id.tag_item, tip); holder.itemView.setOnClickListener(onClickListener); } diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/adapter/SearchCategoryAdapter.java b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/adapter/SearchCategoryAdapter.java index 711a84c13d..6c4ade215f 100644 --- a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/adapter/SearchCategoryAdapter.java +++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/adapter/SearchCategoryAdapter.java @@ -4,6 +4,7 @@ import android.content.Context; import android.view.View; import com.mogo.map.search.inputtips.MogoTip; import com.mogo.module.navi.R; +import com.mogo.module.navi.bean.SearchPoi; import com.mogo.module.navi.ui.adapter.base.RecycleBaseAdapter; import com.mogo.module.navi.ui.adapter.base.RecycleViewHolder; import java.util.List; @@ -61,4 +62,9 @@ public class SearchCategoryAdapter extends RecycleBaseAdapter { notifyItemChanged(current); lastPosition = current; } + + + public MogoTip getCurrentItem(){ + return list.get(current); + } } diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/CategorySearchFragment.kt b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/CategorySearchFragment.kt index ca8db07eb7..e0727b9007 100644 --- a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/CategorySearchFragment.kt +++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/CategorySearchFragment.kt @@ -5,6 +5,7 @@ import android.view.View import androidx.fragment.app.Fragment import androidx.recyclerview.widget.LinearLayoutManager import com.mogo.map.search.inputtips.MogoTip +import com.mogo.module.common.MogoModulePaths import com.mogo.module.navi.R import com.mogo.module.navi.bean.SearchPoi import com.mogo.module.navi.constants.SearchServiceHolder @@ -53,6 +54,9 @@ class CategorySearchFragment : BaseSearchFragment() { tv_navi_navi.setOnClickListener { + var newInstance = ChoosePathFragment.newInstance(mAdapter.currentItem) + + SearchServiceHolder.push(newInstance, MogoModulePaths.PATH_FRAGMENT_CHOOSE_PAHT) } mAdapter.setOnClickListener { var position = it.getTag(R.id.tag_position) as Int diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/ChoosePathFragment.kt b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/ChoosePathFragment.kt new file mode 100644 index 0000000000..3548fb1c4c --- /dev/null +++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/ChoosePathFragment.kt @@ -0,0 +1,105 @@ +package com.mogo.module.navi.ui.search + +import android.os.Bundle +import android.view.View +import androidx.fragment.app.Fragment +import androidx.recyclerview.widget.LinearLayoutManager +import com.mogo.map.navi.IMogoNaviListener +import com.mogo.map.navi.MogoCalculatePath +import com.mogo.map.navi.MogoNaviInfo +import com.mogo.map.search.inputtips.MogoTip +import com.mogo.module.common.MogoModulePaths +import com.mogo.module.navi.R +import com.mogo.module.navi.bean.EntityConvertUtils +import com.mogo.module.navi.bean.SearchPoi +import com.mogo.module.navi.constants.AMapConstants +import com.mogo.module.navi.constants.SearchServiceHolder +import com.mogo.module.navi.ui.adapter.CalculatePathAdapter +import com.mogo.module.navi.ui.base.BaseFragment +import kotlinx.android.synthetic.main.fragment_search_category.rv_search_result +import kotlinx.android.synthetic.main.fragment_search_category.tv_navi_navi +import kotlinx.android.synthetic.main.include_search_bar.et_navi_search +import kotlinx.android.synthetic.main.include_search_bar.iv_navi_back + +/** + * @author zyz + * 2020-01-09. + */ +class ChoosePathFragment : BaseFragment(), IMogoNaviListener { + override fun onInitNaviFailure() { + } + + override fun onInitNaviSuccess() { + } + + override fun onNaviInfoUpdate(naviinfo: MogoNaviInfo?) { + } + + override fun onStartNavi() { + } + + override fun onStopNavi() { + } + + override fun onCalculateSuccess() { + mAdapter.setDatas(SearchServiceHolder.getNavi(activity!!).calculatedStrategies) + } + + override fun onoCalculateFailed() { + } + + private lateinit var mAdapter:CalculatePathAdapter + override fun getLayoutId(): Int { + return R.layout.fragment_search_category + } + var mogoTip: MogoTip?=null + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + mogoTip = arguments?.getParcelable(AMapConstants.KEY_PARCELABLE) + } + + override fun onViewCreated( + view: View, + savedInstanceState: Bundle? + ) { + super.onViewCreated(view, savedInstanceState) + iv_navi_back.setOnClickListener { + SearchServiceHolder.fragmentManager.pop() + } + + tv_navi_navi.text=getString(R.string.start_navi) + + et_navi_search.setText(getString(R.string.choose_path)) + et_navi_search.isEnabled=false + SearchServiceHolder.getNavi(context!!).naviTo(mogoTip?.point) + + SearchServiceHolder.listenerCenter.registerMogoNaviListener(MogoModulePaths.PATH_FRAGMENT_CHOOSE_PAHT,this) + + var arrayList = ArrayList() + mAdapter= CalculatePathAdapter(activity,arrayList) + rv_search_result.layoutManager=LinearLayoutManager(activity,LinearLayoutManager.VERTICAL,false) + + rv_search_result.adapter=mAdapter + tv_navi_navi.setOnClickListener { + SearchServiceHolder.getNavi(activity!!).startNavi(true) + } + + mAdapter.setOnClickListener { + var position = it.getTag(R.id.tag_position) as Int + mAdapter.setCurrent(position) + mAdapter.currentItem.onItemClickInteraction.onItemClicked(mAdapter.currentItem.mTagId) + + } + } + + + companion object{ + fun newInstance(searchPoi: MogoTip):Fragment{ + var bundle = Bundle() + bundle.putParcelable(AMapConstants.KEY_PARCELABLE, searchPoi) + var choosePathFragment = ChoosePathFragment() + choosePathFragment.arguments=bundle + return choosePathFragment + } + } +} diff --git a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/SearchFragment.java b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/SearchFragment.java index 8d716d88ae..fd430efb94 100644 --- a/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/SearchFragment.java +++ b/modules/mogo-module-search/src/main/java/com/mogo/module/navi/ui/search/SearchFragment.java @@ -15,6 +15,7 @@ import com.mogo.module.common.MogoModulePaths; import com.mogo.module.navi.R; import com.mogo.module.navi.bean.EntityConvertUtils; import com.mogo.module.navi.bean.SearchPoi; +import com.mogo.module.navi.constants.AMapConstants; import com.mogo.module.navi.constants.SearchServiceHolder; import com.mogo.module.navi.ui.adapter.HistoryPoiAdapter; import com.mogo.module.navi.ui.adapter.SearchPoiAdapter; @@ -70,7 +71,6 @@ public class SearchFragment extends BaseSearchFragment implements SearchView, Vi @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); - } @Override @@ -112,7 +112,10 @@ public class SearchFragment extends BaseSearchFragment implements SearchView, Vi mHistoryAdapter.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - + SearchPoi item = (SearchPoi) v.getTag(R.id.tag_item); + MogoTip mogoTip = EntityConvertUtils.poi2MogoTip(item); + SearchServiceHolder.INSTANCE.push(ChoosePathFragment.Companion.newInstance(mogoTip), + MogoModulePaths.PATH_FRAGMENT_CHOOSE_PAHT); } }); @@ -121,6 +124,8 @@ public class SearchFragment extends BaseSearchFragment implements SearchView, Vi MogoTip tag = (MogoTip) v.getTag(R.id.tag_position); SearchPoi searchPoi = EntityConvertUtils.tipToPoi(tag); mSearchPresenter.insert(searchPoi); + SearchServiceHolder.INSTANCE.push(ChoosePathFragment.Companion.newInstance(tag), + MogoModulePaths.PATH_FRAGMENT_CHOOSE_PAHT); } }); @@ -132,7 +137,7 @@ public class SearchFragment extends BaseSearchFragment implements SearchView, Vi findViewById(R.id.tv_navi_setting).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - push(new NaviSettingFragment(),MogoModulePaths.PATH_FRAGMENT_SETTING); + push(new NaviSettingFragment(), MogoModulePaths.PATH_FRAGMENT_SETTING); } }); @@ -155,7 +160,7 @@ public class SearchFragment extends BaseSearchFragment implements SearchView, Vi findViewById(R.id.tv_navi_park).setOnClickListener(this); } - private void push(Fragment fragment,String tag) { + private void push(Fragment fragment, String tag) { FragmentDescriptor.Builder builder = new FragmentDescriptor.Builder(); builder.fragment(fragment); FragmentDescriptor build = @@ -386,7 +391,7 @@ public class SearchFragment extends BaseSearchFragment implements SearchView, Vi @Override public void onClick(View v) { TextView category = (TextView) v; String text = category.getText().toString(); - push(CategorySearchFragment.Companion.newInstance(text),MogoModulePaths.PATH_FRAGMENT_SEARCH_CATEGORY); - + push(CategorySearchFragment.Companion.newInstance(text), + MogoModulePaths.PATH_FRAGMENT_SEARCH_CATEGORY); } } diff --git a/modules/mogo-module-search/src/main/res/drawable/amap_calculate_navi_strategy1_bkg.xml b/modules/mogo-module-search/src/main/res/drawable/amap_calculate_navi_strategy1_bkg.xml new file mode 100644 index 0000000000..a3c21b02d5 --- /dev/null +++ b/modules/mogo-module-search/src/main/res/drawable/amap_calculate_navi_strategy1_bkg.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-search/src/main/res/drawable/amap_calculate_navi_strategy2_bkg.xml b/modules/mogo-module-search/src/main/res/drawable/amap_calculate_navi_strategy2_bkg.xml new file mode 100644 index 0000000000..c0f20a1c86 --- /dev/null +++ b/modules/mogo-module-search/src/main/res/drawable/amap_calculate_navi_strategy2_bkg.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-search/src/main/res/drawable/amap_calculate_navi_strategy3_bkg.xml b/modules/mogo-module-search/src/main/res/drawable/amap_calculate_navi_strategy3_bkg.xml new file mode 100644 index 0000000000..eef0c4f374 --- /dev/null +++ b/modules/mogo-module-search/src/main/res/drawable/amap_calculate_navi_strategy3_bkg.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-search/src/main/res/drawable/amap_calculate_navi_strategy_name_bkg.xml b/modules/mogo-module-search/src/main/res/drawable/amap_calculate_navi_strategy_name_bkg.xml new file mode 100644 index 0000000000..a3c21b02d5 --- /dev/null +++ b/modules/mogo-module-search/src/main/res/drawable/amap_calculate_navi_strategy_name_bkg.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-search/src/main/res/layout/fragment_search_category.xml b/modules/mogo-module-search/src/main/res/layout/fragment_search_category.xml index 6048efb724..2530d46b8d 100644 --- a/modules/mogo-module-search/src/main/res/layout/fragment_search_category.xml +++ b/modules/mogo-module-search/src/main/res/layout/fragment_search_category.xml @@ -24,6 +24,7 @@ android:id="@+id/rv_search_result" android:layout_width="match_parent" android:layout_height="match_parent" + android:layout_marginBottom="@dimen/dp_100" /> diff --git a/modules/mogo-module-search/src/main/res/layout/item_calculate_path_map.xml b/modules/mogo-module-search/src/main/res/layout/item_calculate_path_map.xml new file mode 100644 index 0000000000..8b46cc02a9 --- /dev/null +++ b/modules/mogo-module-search/src/main/res/layout/item_calculate_path_map.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-search/src/main/res/values/ids.xml b/modules/mogo-module-search/src/main/res/values/ids.xml index ed4cc2c662..5f514a617e 100644 --- a/modules/mogo-module-search/src/main/res/values/ids.xml +++ b/modules/mogo-module-search/src/main/res/values/ids.xml @@ -1,4 +1,5 @@ + \ No newline at end of file diff --git a/modules/mogo-module-search/src/main/res/values/strings.xml b/modules/mogo-module-search/src/main/res/values/strings.xml index 6527ed6402..35f5830081 100644 --- a/modules/mogo-module-search/src/main/res/values/strings.xml +++ b/modules/mogo-module-search/src/main/res/values/strings.xml @@ -31,4 +31,6 @@ 设为家 设为公司 导航去这里 + 开始导航 + 路线选择 From 04093f2ca49239802e59082c6a17353892ee51b6 Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Thu, 9 Jan 2020 20:49:05 +0800 Subject: [PATCH 5/5] opt ui --- .../main_video_play_btn_normal.png | Bin 0 -> 3415 bytes .../main/res/drawable-xhdpi/media_next.png | Bin 0 -> 943 bytes .../res/drawable-xhdpi/media_previous.png | Bin 0 -> 1036 bytes .../layout/tanlu_item_main_media_recycler.xml | 18 +++++++++++------- 4 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 modules/mogo-module-tanlu/src/main/res/drawable-xhdpi/main_video_play_btn_normal.png create mode 100644 modules/mogo-module-tanlu/src/main/res/drawable-xhdpi/media_next.png create mode 100644 modules/mogo-module-tanlu/src/main/res/drawable-xhdpi/media_previous.png diff --git a/modules/mogo-module-tanlu/src/main/res/drawable-xhdpi/main_video_play_btn_normal.png b/modules/mogo-module-tanlu/src/main/res/drawable-xhdpi/main_video_play_btn_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..7db2e805eea93f99e7fefc9c84a4dc1312e39472 GIT binary patch literal 3415 zcmV-d4XE;oP)Px?5lKWrRCodHT@P$kR~e_!GNdWOfR(jXuql5AL0|)!fKW-7*f23s0)aq;5|qh? zh`3?HpKFG$;M9q*p+qzYNQV$b7@AIy29N@pl0lIIN(b#I&`?$wgVN&fcYWvOyz}n8 z@80|Fz3&zJC11}u-}%mWe)qfQo&WE(LkD9jg7{lTSt*K8Q_>>)>lb$WXSf$r(yq&lAd4ilUrG7+t|*g~TEp!x#0k ztiacQ`}XZ6vMdzuOywx*+O=!CL7Rzgm2ye7K&qT6#|_$w?q@>jD-;_V8s48YY0@7> zS`Hn#PAJoWCR?U9{*4$) zQQ4VmRtj>S(dSRjSK^Mk zWu>fTQe&>%6q)ABeSr~|#KEORlvRxjIm2RbXIWqo*NpP4jLZ5Ql%57Z2CfG02DgAs z$;$9jl(I8wYev?M3_k_MX-3KxvIrkjPc{5q$TBPp#LCiyg6K<_<`^B1QQFY>ha?;3 z1i%ZLNh89r=7q(OjXZ|Ju&G^kK< zJT>mfuqaI9OP4MkAks#mBUcz2h@J-PYOWBA3JMDg*NeCsvg3D5_d#iCX+N|o=-9B` zmO)qi%Bp6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{to+v>JQ(LcnrBnERG$rhbC6F*=I6*~TLu~HqaBA}@k-#HCw#_ny zO9ejJ6M>&Z1%B!{PTqg^+f)TUkPgFBhGA6vXTR0%2|p-X0JdH#n}Yxl+?{GXSpmR< zvakl?k|j~Bg50*;p4r(O-_+i8c9a0%qY&nP9a!fJ4S@AYOgtQ&+ zre`z}n<_%>ly=pc`kZ9Px&#z{m$R9FeMR?klpK@^_Zw!{=gkl;lF!C!v?8Zf~`6XV5;2kQY6;|Wh154&3o zk`0o;Zc!sKMowPDC}-o%X!JlL{Rs%3dggt5M=Zm^Zh zL(1?eBUsjhe!_~2yk+MTjs{|RQ`v}|kl=duN>i4=ip{Rq=Kh-46ueX8o=yi~O`07OROdDc0hBZedF%2F#5H)9>dnM<~|bW{qU z9T|y=>^OJU0q4s?OffTPfkLRyAaNs<&^hSwrpmb%7Ds0!?3CI9(D4uOInvNDu%j{4 zJ6Ry?3pk^>yWO}|=L7rZH9E^Qtq2_FecaD2UXBA1^qcsq$d5DrojK)A}auiHT_ zp5r_``r{er_vFe?GT$QMo5|g>`tA zmAL_lo&C1FzMu0I+x))-F=~2)0c9^BquqoBb&r>(1u-_3=`C!sd6>+BZR}Pt;;78+ zDG0}zZS(#7Q&>bph0W5>O;ks<@P>m}SXhWOx3)v3la zferG_sUm9iSc5b&G6KKGB#rOr=#$Q%=+D57+SS=b-~I)Q&}NiQl5^t#0000 @@ -107,11 +110,12 @@ android:layout_height="45dp" android:layout_alignParentRight="true" android:layout_centerVertical="true" - android:layout_marginRight="16dp" + android:layout_centerHorizontal="true" + android:paddingRight="40dp" + android:paddingLeft="35dp" android:background="@drawable/shape_bg_222533" - android:drawableRight="@drawable/default_image" - android:gravity="center_vertical|center_horizontal" - android:paddingRight="10dp" + android:drawableRight="@drawable/media_next" + android:gravity="center_vertical" android:text="@string/tanlu_next" android:textColor="@color/color_545362" android:textSize="13dp" />