forked from upstream-mirrors/quik
Added special back navigation handling for blocked messages
This commit is contained in:
@@ -389,18 +389,19 @@ public class MainActivity extends QKActivity implements SlidingMenu.OnOpenListen
|
||||
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||
if (!mSlidingMenu.isMenuShowing()) {
|
||||
Fragment category = getFragmentManager()
|
||||
.findFragmentByTag(SettingsFragment.CATEGORY_TAG);
|
||||
Fragment category = getFragmentManager().findFragmentByTag(SettingsFragment.CATEGORY_TAG);
|
||||
if (category != null) {
|
||||
getFragmentManager().beginTransaction()
|
||||
.remove(category)
|
||||
.commit();
|
||||
getFragmentManager().beginTransaction().remove(category).commit();
|
||||
} else {
|
||||
mSlidingMenu.showMenu();
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
finish();
|
||||
if (menuFragment.isShowingBlocked()) {
|
||||
menuFragment.setShowingBlocked(false);
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+12
-4
@@ -161,10 +161,7 @@ public class ConversationListFragment extends QKFragment implements LoaderManage
|
||||
return true;
|
||||
|
||||
case R.id.menu_blocked:
|
||||
mShowBlocked = !mShowBlocked;
|
||||
mContext.setTitle(mShowBlocked ? R.string.title_blocked : R.string.title_conversation_list);
|
||||
BlockedConversationHelper.bindBlockedMenuItem(mContext, mPrefs, mBlockedItem, mShowBlocked);
|
||||
initLoaderManager();
|
||||
setShowingBlocked(!mShowBlocked);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -175,6 +172,17 @@ public class ConversationListFragment extends QKFragment implements LoaderManage
|
||||
return mShowBlocked ? R.string.title_blocked : R.string.title_conversation_list;
|
||||
}
|
||||
|
||||
public boolean isShowingBlocked() {
|
||||
return mShowBlocked;
|
||||
}
|
||||
|
||||
public void setShowingBlocked(boolean showBlocked) {
|
||||
mShowBlocked = showBlocked;
|
||||
mContext.setTitle(mShowBlocked ? R.string.title_blocked : R.string.title_conversation_list);
|
||||
BlockedConversationHelper.bindBlockedMenuItem(mContext, mPrefs, mBlockedItem, mShowBlocked);
|
||||
initLoaderManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(Conversation conversation, View view) {
|
||||
if (mAdapter.isInMultiSelectMode()) {
|
||||
|
||||
Reference in New Issue
Block a user