|
@@ -2,6 +2,7 @@ package com.sheishuo.app.main.fragment;
|
|
|
|
|
|
import android.content.Intent;
|
|
|
import android.os.Bundle;
|
|
|
+import android.support.annotation.Nullable;
|
|
|
import android.support.v7.widget.Toolbar;
|
|
|
import android.util.Log;
|
|
|
import android.view.Menu;
|
|
@@ -71,6 +72,7 @@ public class SessionListFragment extends MainTabFragment {
|
|
|
this.setContainerId(MainTab.RECENT_CONTACTS.fragmentId);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
public void onActivityCreated(Bundle savedInstanceState) {
|
|
|
super.onActivityCreated(savedInstanceState);
|
|
@@ -102,8 +104,6 @@ public class SessionListFragment extends MainTabFragment {
|
|
|
parent = (MainActivity) getActivity();
|
|
|
toolbar = (BaseToolbar) parent.getToolBar();
|
|
|
|
|
|
- //fragment需调用此函数来申明有菜单项
|
|
|
- setHasOptionsMenu(true);
|
|
|
|
|
|
notifyBar = getView().findViewById(R.id.status_notify_bar);
|
|
|
notifyBarText = (TextView) getView().findViewById(R.id.status_desc_label);
|
|
@@ -123,9 +123,9 @@ public class SessionListFragment extends MainTabFragment {
|
|
|
//初始化toolbar
|
|
|
public void initToolbar(){
|
|
|
Log.e(TAG,"init toolbar");
|
|
|
- toolbar.init();
|
|
|
- toolbar.setTitle("朋友");
|
|
|
if (toolbar != null){
|
|
|
+ toolbar.init();
|
|
|
+ toolbar.setTitle("朋友");
|
|
|
toolbar = new BaseToolbar.Builder()
|
|
|
.create(getActivity(),toolbar)
|
|
|
.addIcoButton(R.drawable.friends_contacts)
|
|
@@ -146,28 +146,7 @@ public class SessionListFragment extends MainTabFragment {
|
|
|
if (isVisibleToUser && toolbar != null) initToolbar();
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
|
|
- Log.e(TAG,"Create Menu");
|
|
|
- inflater.inflate(R.menu.main_friends_menu,menu);
|
|
|
- super.onCreateOptionsMenu(menu,inflater);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
- @Override
|
|
|
- public boolean onOptionsItemSelected(MenuItem item) {
|
|
|
- switch (item.getItemId()){
|
|
|
- case R.id.main_friends_menu_contacts:
|
|
|
- Log.e(TAG,"打开联系人列表");
|
|
|
- return true;
|
|
|
- case R.id.main_friends_menu_add:
|
|
|
- Log.e(TAG,"添加朋友");
|
|
|
- return true;
|
|
|
- default:
|
|
|
- return super.onOptionsItemSelected(item);
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
* 用户状态变化
|