Merge remote-tracking branch 'origin/feature/v1.0.0' into feature/v1.0.0
@@ -76,6 +76,6 @@ dependencies {
|
||||
implementation project(':foudations:mogo-commons')
|
||||
implementation project(':modules:mogo-module-common')
|
||||
implementation project(':modules:mogo-module-tanlu')
|
||||
implementation project(':modules:mogo-module-navi')
|
||||
implementation project(':modules:mogo-module-search')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,15 @@ public class MogoModulePaths {
|
||||
public static final String PATH_MODULE_NAV_ACTIVITY= "/navi/search/ui/activity";
|
||||
|
||||
|
||||
/**
|
||||
* 管理 fragment
|
||||
*/
|
||||
@Keep
|
||||
public static final String PATH_FRAGMENT_SEARCH = "/navi/search";
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 添加卡片模块
|
||||
*
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.view.ViewGroup;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
@@ -20,9 +21,11 @@ import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.navi.IMogoNaviListener;
|
||||
import com.mogo.map.navi.MogoNaviInfo;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.module.extensions.R;
|
||||
import com.mogo.module.extensions.navi.NaviInfoView;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
|
||||
/**
|
||||
@@ -52,6 +55,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
private IMogoMapUIController mMApUIController;
|
||||
private IMogoLocationClient mMogoLocationClient;
|
||||
private IMogoNavi mMogoNavi;
|
||||
IMogoFragmentManager fragmentManager;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -60,15 +64,16 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
fragmentManager = (IMogoFragmentManager) ARouter.getInstance().build(MogoServicePaths.PATH_FRAGMENT_MANAGER).navigation();
|
||||
|
||||
mCommonAddress = findViewById( R.id.module_map_id_common_address );
|
||||
|
||||
mSearch = findViewById( R.id.module_map_id_search );
|
||||
mSearch.setOnClickListener( view -> {
|
||||
|
||||
ViewGroup group = ( ( Activity ) getContext() ).findViewById( android.R.id.content );
|
||||
final View child = new View(getContext());
|
||||
child.setBackground( new ColorDrawable( Color.RED ) );
|
||||
group.addView( child );
|
||||
Fragment fragment = (Fragment) ARouter.getInstance().build(MogoModulePaths.PATH_FRAGMENT_SEARCH).navigation();
|
||||
|
||||
mSearch.setOnClickListener( view -> {
|
||||
fragmentManager.push(fragment,MogoModulePaths.PATH_FRAGMENT_SEARCH);
|
||||
} );
|
||||
|
||||
mHome = findViewById( R.id.module_map_id_home );
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.module.main;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -23,6 +24,7 @@ import com.mogo.module.main.cards.OnPageChangeListenerAdapter;
|
||||
import com.mogo.module.main.cards.OrientedViewPager;
|
||||
import com.mogo.module.main.cards.VerticalStackTransformer;
|
||||
import com.mogo.module.main.fragmentmanager.FragmentStack;
|
||||
import com.mogo.module.main.fragmentmanager.FragmentStackTransactionListener;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
@@ -84,6 +86,16 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
} );
|
||||
|
||||
FragmentStack.getInstance().init( this, R.id.module_main_id_search_fragment );
|
||||
FragmentStack.getInstance().setFragmentStackTransactionListener( new FragmentStackTransactionListener() {
|
||||
@Override
|
||||
public void onTransaction() {
|
||||
if ( FragmentStack.getInstance().isEmpty() ) {
|
||||
// TODO: 2020-01-08 动画
|
||||
} else if ( FragmentStack.getInstance().getStackSize() == 1 ) {
|
||||
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -87,12 +87,17 @@ public class FragmentStack {
|
||||
mFragmentTransaction.commitAllowingStateLoss();
|
||||
mCurrentFragment = null;
|
||||
} else {
|
||||
Fragment fragment = mFragmentStack.pop();
|
||||
if ( fragment != null ) {
|
||||
mFragmentTransaction.show( fragment );
|
||||
mFragmentTransaction.commitAllowingStateLoss();
|
||||
mFragmentStack.pop();
|
||||
if ( !mFragmentStack.isEmpty() ) {
|
||||
Fragment fragment = mFragmentStack.peek();
|
||||
if ( fragment != null ) {
|
||||
mFragmentTransaction.show( fragment );
|
||||
mFragmentTransaction.commitAllowingStateLoss();
|
||||
}
|
||||
mCurrentFragment = fragment;
|
||||
} else {
|
||||
mCurrentFragment = null;
|
||||
}
|
||||
mCurrentFragment = fragment;
|
||||
}
|
||||
|
||||
if ( getFragmentStackTransactionListener() != null ) {
|
||||
@@ -104,6 +109,10 @@ public class FragmentStack {
|
||||
return mFragmentStack.isEmpty();
|
||||
}
|
||||
|
||||
public int getStackSize() {
|
||||
return mFragmentStack.size();
|
||||
}
|
||||
|
||||
public FragmentStackTransactionListener getFragmentStackTransactionListener() {
|
||||
return mFragmentStackTransactionListener;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,9 @@ 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;
|
||||
@@ -25,6 +27,8 @@ 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.service.MogoServicePaths;
|
||||
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import java.util.ArrayList;
|
||||
@@ -40,7 +44,7 @@ import java.util.List;
|
||||
* {@link SearchConstants#SEARCH_TYPE_MULTI_COMPANY}
|
||||
* {@link SearchConstants#SEARCH_TYPE_MULTI_HOME}
|
||||
*/
|
||||
@Route(path = "/navi/search")
|
||||
@Route(path = MogoModulePaths.PATH_FRAGMENT_SEARCH)
|
||||
public class SearchFragment extends BaseFragment implements SearchView {
|
||||
|
||||
public static final String TAG = "search";
|
||||
@@ -69,6 +73,7 @@ public class SearchFragment extends BaseFragment implements SearchView {
|
||||
private boolean mActionSuccess = false;
|
||||
private View rlHistory;
|
||||
private TextView tvEmpty;
|
||||
IMogoFragmentManager fragmentManager;
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
@@ -77,6 +82,12 @@ public class SearchFragment extends BaseFragment implements SearchView {
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
fragmentManager = (IMogoFragmentManager) ARouter.getInstance().build(MogoServicePaths.PATH_FRAGMENT_MANAGER).navigation();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_search;
|
||||
@@ -110,10 +121,9 @@ public class SearchFragment extends BaseFragment implements SearchView {
|
||||
|
||||
tvEmpty = findViewById(R.id.tv_navi_list_empty);
|
||||
|
||||
|
||||
findViewById(R.id.iv_navi_back).setOnClickListener(new View.OnClickListener() {
|
||||
@Override public void onClick(View v) {
|
||||
getActivity().finish();
|
||||
fragmentManager.pop();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.mogo.module.navi.ui.setting
|
||||
|
||||
import com.mogo.module.navi.R
|
||||
import com.mogo.module.navi.ui.base.BaseFragment
|
||||
|
||||
/**
|
||||
* @author zyz
|
||||
* 2020-01-07.
|
||||
*/
|
||||
class NaviSettingFragment : BaseFragment() {
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.fragment_navi_setting
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="@color/white" android:state_activated="true" />
|
||||
<item android:color="@color/white" android:state_selected="true" />
|
||||
<item android:color="@color/white" android:state_pressed="true" />
|
||||
<item android:color="@color/white" android:state_checked="true" />
|
||||
<item android:color="@color/white_80" />
|
||||
|
||||
</selector>
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="@dimen/fragment_left_margin"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/rl_navi_setting_title"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_gravity="center_horizontal">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_back"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@mipmap/icon_back" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:layout_toRightOf="@id/iv_back"
|
||||
android:text="@string/navi_setting"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/txt_title" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
app:layout_constraintTop_toBottomOf="@+id/rl_navi_setting_title"
|
||||
android:layout_width="400px"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_height="45px"
|
||||
android:id="@+id/tv_navi_prefer"
|
||||
android:text="@string/preference_navi"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/txt_normal"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
<RadioGroup android:layout_width="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_navi_prefer"
|
||||
android:layout_marginBottom="26dp"
|
||||
android:id="@+id/rg_time_mode"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_time_24"
|
||||
android:text="@string/navi_prefer_jam"
|
||||
android:checked="true"
|
||||
android:layout_marginRight="20dp"
|
||||
style="@style/rb_setting"/>
|
||||
|
||||
|
||||
<!-- <RadioButton-->
|
||||
<!-- android:id="@+id/rb_time_12"-->
|
||||
<!-- android:text="@string/time_mode_12"-->
|
||||
<!-- android:layout_marginRight="20dp"-->
|
||||
<!-- style="@style/rb_energy"/>-->
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
Before Width: | Height: | Size: 703 B After Width: | Height: | Size: 703 B |
|
Before Width: | Height: | Size: 703 B After Width: | Height: | Size: 703 B |
|
Before Width: | Height: | Size: 1007 B After Width: | Height: | Size: 1007 B |
|
Before Width: | Height: | Size: 712 B After Width: | Height: | Size: 712 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
@@ -7,6 +7,7 @@
|
||||
<color name="white">#FFFFFF</color>
|
||||
<color name="white_10">#1AFFFFFF</color>
|
||||
<color name="white_60">#99FFFFFF</color>
|
||||
<color name="white_80">#CCFFFFFF</color>
|
||||
<color name="white_7f">#7FFFFFFF</color>
|
||||
<color name="arrow_color">#00BFFF</color>
|
||||
<color name="white_30">#4DFFFFFF</color>
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="txt_normal">@dimen/sp_32</dimen>
|
||||
<dimen name="fragment_left_margin">@dimen/dp_60</dimen>
|
||||
<dimen name="txt_title">@dimen/sp_40</dimen>
|
||||
</resources>
|
||||
@@ -9,8 +9,11 @@
|
||||
<string name="navi_toilet">卫生间</string>
|
||||
<string name="navi_park">停车场</string>
|
||||
<string name="navi_wash">洗车</string>
|
||||
<string name="navi_setting">更多设置</string>
|
||||
<string name="navi_setting">导航设置</string>
|
||||
<string name="more_setting">更多设置</string>
|
||||
<string name="history_clear">清空历史</string>
|
||||
<string name="history_empty">暂无历史结果</string>
|
||||
<string name="search_empty">暂无搜索结果</string>
|
||||
<string name="preference_navi">路线偏好</string>
|
||||
<string name="navi_prefer_jam">躲避拥堵</string>
|
||||
</resources>
|
||||
@@ -26,4 +26,14 @@
|
||||
<item name="android:paddingTop">@dimen/dp_44</item>
|
||||
</style>
|
||||
|
||||
<style name="rb_setting">
|
||||
|
||||
<item name="android:layout_width">180dp</item>
|
||||
<item name="android:button">@null</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:textSize">@dimen/sp_40</item>
|
||||
<item name="android:textColor">@color/selector_white_gray</item>
|
||||
<item name="android:layout_height">@dimen/dp_120</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@@ -70,4 +70,8 @@ public class MogoServicePaths {
|
||||
* 管理 fragment
|
||||
*/
|
||||
public static final String PATH_FRAGMENT_MANAGER = "/fragmentmanager/api";
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ include ':foudations:mogo-commons'
|
||||
include ':modules:mogo-module-map'
|
||||
include ':modules:mogo-module-common'
|
||||
include ':modules:mogo-module-main'
|
||||
include ':modules:mogo-module-navi'
|
||||
include ':modules:mogo-module-search'
|
||||
include ':modules:mogo-module-tanlu'
|
||||
include ':modules:mogo-module-service'
|
||||
include ':libraries:map-amap'
|
||||
|
||||