mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-22 13:48:52 +01:00
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) {
|
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||||
if (!mSlidingMenu.isMenuShowing()) {
|
if (!mSlidingMenu.isMenuShowing()) {
|
||||||
Fragment category = getFragmentManager()
|
Fragment category = getFragmentManager().findFragmentByTag(SettingsFragment.CATEGORY_TAG);
|
||||||
.findFragmentByTag(SettingsFragment.CATEGORY_TAG);
|
|
||||||
if (category != null) {
|
if (category != null) {
|
||||||
getFragmentManager().beginTransaction()
|
getFragmentManager().beginTransaction().remove(category).commit();
|
||||||
.remove(category)
|
|
||||||
.commit();
|
|
||||||
} else {
|
} else {
|
||||||
mSlidingMenu.showMenu();
|
mSlidingMenu.showMenu();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} 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;
|
return true;
|
||||||
|
|
||||||
case R.id.menu_blocked:
|
case R.id.menu_blocked:
|
||||||
mShowBlocked = !mShowBlocked;
|
setShowingBlocked(!mShowBlocked);
|
||||||
mContext.setTitle(mShowBlocked ? R.string.title_blocked : R.string.title_conversation_list);
|
|
||||||
BlockedConversationHelper.bindBlockedMenuItem(mContext, mPrefs, mBlockedItem, mShowBlocked);
|
|
||||||
initLoaderManager();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,6 +172,17 @@ public class ConversationListFragment extends QKFragment implements LoaderManage
|
|||||||
return mShowBlocked ? R.string.title_blocked : R.string.title_conversation_list;
|
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
|
@Override
|
||||||
public void onItemClick(Conversation conversation, View view) {
|
public void onItemClick(Conversation conversation, View view) {
|
||||||
if (mAdapter.isInMultiSelectMode()) {
|
if (mAdapter.isInMultiSelectMode()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user