您已被CSDN问答禁言
问了个问题就这样了:
您已被CSDN问答禁言
怎么办?
如下图所示:

我的代码:
这是二级界面给一级界面传递的数据:
/**
* date: 2017/4/21 14:39
* autour: HelenChen
* description: 点击 确定
*/
private void sureNext(MapSearchMindBean mapSearchMindBean) {
/**给一级发送事件*/
String message_tip = "comeon";
EventBus.getDefault().post(new MessageEvent<String>(message_tip));
/**将实体类传递给一级界面*/
EventBus.getDefault().post(mapSearchMindBean);
List<List<String>> mType = mapSearchMindBean.getListByType("1");
/**将实体类传递给一级悬浮框*/
EventBus.getDefault().postSticky(mType);
LogUtils.i("发送 " + mapSearchMindBean + "\n" + message_tip+"\n"+mType);
view.close();
}
```
```
这是一级界面接收到信息:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
try {
instance = getActivity();
if (view == null) {
view = inflater.inflate(R.layout.fragment_map_all, container, false);
if (!EventBus.getDefault().isRegistered(this)) {
EventBus.getDefault().register(this);
}
binder = ButterKnife.bind(this, view);
//在这里做一些初始化处理
mapPresenterimpl = new MapPresenterImpl();
mapPresenterimpl.attach(this);
isPrepared = true;
lazyLoad();
} else {
ViewGroup viewGroup = (ViewGroup) view.getParent();
if (viewGroup != null)
viewGroup.removeView(view);
}
} catch (Exception e) {
e.printStackTrace();
}
return view;
}
@Override
protected void lazyLoad() {
if (!isPrepared || !isVisible) {
return;
}
mapPresenterimpl.start();
initView();
initData();
}
/**
* date: 2017/4/18 16:47
* autour: HelenChen
* description: 订阅者-消息显示
*/
@Subscribe(threadMode = ThreadMode.MAIN)
public void onMessageEvent(MessageEvent<String> event) {
over_message = event.getMessage();
}
/**
* date: 2017/4/18 16:47
* autour: HelenChen
* description: 订阅者-实体传送
*/
@Subscribe(threadMode = ThreadMode.MAIN)
public void onEventMainThread(MapSearchMindBean mapSearchMindBean) {
MapSearchMindBean mapSearchBean = mapSearchMindBean;
scroll_down_layout.setVisibility(View.VISIBLE);
mapPresenterimpl.showFloat(mapSearchBean);
}
@Override
public void initView() {
}
@Override
public void initData() {
}
}
```
```
这是一级界面浮框AFragment接收到信息:PS此时mType为null,debug也没走接收信息的方法???
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
try {
instance = getActivity();
if (view == null) {
view = inflater.inflate(R.layout.map_float_company, container, false);
if (!EventBus.getDefault().isRegistered(this)) {
EventBus.getDefault().register(this);
}
binder = ButterKnife.bind(this, view);
isPrepared = true;
lazyLoad();
} else {
ViewGroup viewGroup = (ViewGroup) view.getParent();
if (viewGroup != null)
viewGroup.removeView(view);
}
} catch (Exception e) {
e.printStackTrace();
}
return view;
}
@Override
protected void lazyLoad() {
if (!isPrepared || !isVisible) {
return;
}
initView();
initData();
}
/**
* date: 2017/4/18 16:47
* autour: HelenChen
* description: 订阅者-实体传送
*/
@Subscribe(threadMode = ThreadMode.MAIN)
public void onEventMainThreadOn(List<List<String>> mType) {
this.mType=mType;
}
@Override
public void initView() {
}
@Override
public void initData() {
/**RecycleView适配器*/
List<String> mList=new ArrayList<String>();
for (int i = 0; i < 100; i++) {
mList.add("Item" + i);
}
mapFloatCompanyAdapter = new MapFloatCompanyAdapter(UIUtils.getContext(), mType, R.layout.item_search_mindall);
recycleview_float_company.getRefreshableView().setAdapter(mapFloatCompanyAdapter);
//设置布局管理器
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(UIUtils.getContext());
linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
recycleview_float_company.getRefreshableView().setLayoutManager(linearLayoutManager);
MytemDecoration item = new MytemDecoration(UIUtils.getContext(), MytemDecoration.VERTICAL_LIST);//分割线
item.setMarginLeftDP(10); //分割线左边距
item.setMarginRightDP(10); //分割线右边距
item.setColor(R.color.search_mind_line);
item.setSize(10);
recycleview_float_company.getRefreshableView().addItemDecoration(item); //添加分割线
recycleview_float_company.setRefreshing(false);
recycleview_float_company.setPullToRefreshOverScrollEnabled(false);
recycleview_float_company.setPullToRefreshEnabled(false);
//点击Item事件
mapFloatCompanyAdapter.setOnItemClickListener(new WanAdapter.OnItemClickListener() {
@Override
public void onItemClickListener(int posotion) {
Intent intent=new Intent(UIUtils.getContext(), DesActivity.class);
intent.putExtra("key","monitormore");
startActivity(intent);
}
});
}
}
```
```
这是一级界面的XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/rl_map_all"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--底部图层-->
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--底部图层-->
<include layout="@layout/fragment_map" />
<!--右侧侧滑栏-->
<include layout="@layout/map_slide_right" />
</android.support.v4.widget.DrawerLayout>
<!--悬浮框-->
<com.yinglan.scrolllayout.ScrollLayout
android:visibility="gone"
android:id="@+id/scroll_down_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00550033"
app:allowHorizontalScroll="true"
app:exitOffset="0dp"
app:isSupportExit="true"
app:maxOffset="300dp"
app:minOffset="50dp"
app:mode="open">
<!--多条记录悬浮-->
<com.yinglan.scrolllayout.content.ContentScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dimen1800"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical">
<com.example.administrator.im_demo.ui.view.navigationbar.indicators.MagicIndicator
android:id="@+id/magic_indicator"
android:layout_width="match_parent"
android:layout_height="@dimen/dimen120"
android:background="@color/tab_title" />
<android.support.v4.view.ViewPager
android:id="@+id/viewpager_search_result"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<TextView
android:id="@+id/tv_next"
android:layout_width="match_parent"
android:layout_height="@dimen/dimen110"
android:background="@color/white"
android:clickable="true"
android:gravity="center"
android:text="总共XX条记录"
android:textColor="@color/white"
android:textSize="@dimen/dimen32"
android:visibility="gone" />
</RelativeLayout>
</com.yinglan.scrolllayout.content.ContentScrollView>
</com.yinglan.scrolllayout.ScrollLayout>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar_mapall"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
android:titleTextColor="@android:color/white"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.ActionBar"
android:visibility="gone"/>
</RelativeLayout>
```
```