forked from upstream-mirrors/quik
Updated method of setting menu items based on master
This commit is contained in:
@@ -263,8 +263,7 @@ public class MainActivity extends QKActivity implements SlidingMenu.OnOpenListen
|
|||||||
|
|
||||||
if (mSlidingMenu.isMenuShowing() || mContent == null) {
|
if (mSlidingMenu.isMenuShowing() || mContent == null) {
|
||||||
showBackButton(false);
|
showBackButton(false);
|
||||||
setTitle(mConversationList.getTitleId());
|
mConversationList.inflateToolbar(menu, inflater, this);
|
||||||
inflater.inflate(R.menu.coversation_list, menu);
|
|
||||||
} else {
|
} else {
|
||||||
showBackButton(true);
|
showBackButton(true);
|
||||||
mContent.inflateToolbar(menu, inflater, this);
|
mContent.inflateToolbar(menu, inflater, this);
|
||||||
|
|||||||
+6
-7
@@ -2,6 +2,7 @@ package com.moez.QKSMS.ui.conversationlist;
|
|||||||
|
|
||||||
import android.app.Fragment;
|
import android.app.Fragment;
|
||||||
import android.app.LoaderManager;
|
import android.app.LoaderManager;
|
||||||
|
import android.content.Context;
|
||||||
import android.content.CursorLoader;
|
import android.content.CursorLoader;
|
||||||
import android.content.Loader;
|
import android.content.Loader;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
@@ -121,9 +122,9 @@ public class ConversationListFragment extends QKFragment implements LoaderManage
|
|||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void inflateToolbar(Menu menu, MenuInflater inflater, Context context) {
|
||||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
inflater.inflate(R.menu.coversation_list, menu);
|
||||||
super.onCreateOptionsMenu(menu, inflater);
|
mContext.setTitle(mShowBlocked ? R.string.title_blocked : R.string.title_conversation_list);
|
||||||
|
|
||||||
// Make sure we're only touching the conversation menu
|
// Make sure we're only touching the conversation menu
|
||||||
if (menu.findItem(R.id.menu_search) != null) {
|
if (menu.findItem(R.id.menu_search) != null) {
|
||||||
@@ -142,6 +143,8 @@ public class ConversationListFragment extends QKFragment implements LoaderManage
|
|||||||
|
|
||||||
mBlockedItem = menu.findItem(R.id.menu_blocked);
|
mBlockedItem = menu.findItem(R.id.menu_blocked);
|
||||||
BlockedConversationHelper.bindBlockedMenuItem(mContext, mPrefs, mBlockedItem, mShowBlocked);
|
BlockedConversationHelper.bindBlockedMenuItem(mContext, mPrefs, mBlockedItem, mShowBlocked);
|
||||||
|
|
||||||
|
super.onCreateOptionsMenu(menu, inflater);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -166,10 +169,6 @@ public class ConversationListFragment extends QKFragment implements LoaderManage
|
|||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTitleId() {
|
|
||||||
return mShowBlocked ? R.string.title_blocked : R.string.title_conversation_list;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isShowingBlocked() {
|
public boolean isShowingBlocked() {
|
||||||
return mShowBlocked;
|
return mShowBlocked;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user