管理searchFragment
This commit is contained in:
@@ -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 );
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -70,11 +70,11 @@
|
||||
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"/>
|
||||
<!-- <RadioButton-->
|
||||
<!-- android:id="@+id/rb_time_12"-->
|
||||
<!-- android:text="@string/time_mode_12"-->
|
||||
<!-- android:layout_marginRight="20dp"-->
|
||||
<!-- style="@style/rb_energy"/>-->
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
|
||||
@@ -70,4 +70,8 @@ public class MogoServicePaths {
|
||||
* 管理 fragment
|
||||
*/
|
||||
public static final String PATH_FRAGMENT_MANAGER = "/fragmentmanager/api";
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user