Merge "New back behavior"
This commit is contained in:
commit
af1179ca22
@ -225,14 +225,14 @@ public class MessageListXL extends Activity implements
|
|||||||
/**
|
/**
|
||||||
* Performs the back action.
|
* Performs the back action.
|
||||||
*
|
*
|
||||||
* @param mayCloseActivity if true, the activity will close if it's already on top of the
|
* @param isSystemBackKey set true if the system back key is pressed, rather than the home
|
||||||
* internal back state stack.
|
* icon on action bar.
|
||||||
*/
|
*/
|
||||||
private boolean onBackPressed(boolean mayCloseActivity) {
|
private boolean onBackPressed(boolean isSystemBackKey) {
|
||||||
if (mFragmentManager.onBackPressed()) {
|
if (mFragmentManager.onBackPressed(isSystemBackKey)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (mayCloseActivity) {
|
if (isSystemBackKey) {
|
||||||
// Perform the default behavior.
|
// Perform the default behavior.
|
||||||
super.onBackPressed();
|
super.onBackPressed();
|
||||||
return true;
|
return true;
|
||||||
|
@ -346,12 +346,13 @@ class MessageListXLFragmentManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles back press.
|
* Handles the back event.
|
||||||
*
|
*
|
||||||
* @return true "back" is handled.
|
* @param isSystemBackKey See {@link ThreePaneLayout#onBackPressed}
|
||||||
|
* @return true if the event is handled.
|
||||||
*/
|
*/
|
||||||
public boolean onBackPressed() {
|
public boolean onBackPressed(boolean isSystemBackKey) {
|
||||||
return mThreePane.onBackPressed();
|
return mThreePane.onBackPressed(isSystemBackKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -212,7 +212,14 @@ public class ThreePaneLayout extends LinearLayout implements View.OnClickListene
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean onBackPressed() {
|
/**
|
||||||
|
* Handles the back event.
|
||||||
|
*
|
||||||
|
* @param isSystemBackKey set true if the system back key is pressed, rather than the home
|
||||||
|
* icon on action bar.
|
||||||
|
* @return true if the event is handled.
|
||||||
|
*/
|
||||||
|
public boolean onBackPressed(boolean isSystemBackKey) {
|
||||||
if (isLandscape()) {
|
if (isLandscape()) {
|
||||||
switch (mPaneState) {
|
switch (mPaneState) {
|
||||||
case STATE_RIGHT_VISIBLE:
|
case STATE_RIGHT_VISIBLE:
|
||||||
@ -222,7 +229,11 @@ public class ThreePaneLayout extends LinearLayout implements View.OnClickListene
|
|||||||
} else {
|
} else {
|
||||||
switch (mPaneState) {
|
switch (mPaneState) {
|
||||||
case STATE_RIGHT_VISIBLE:
|
case STATE_RIGHT_VISIBLE:
|
||||||
changePaneState(STATE_PORTRAIT_MIDDLE_EXPANDED, true);
|
if (isSystemBackKey) {
|
||||||
|
changePaneState(STATE_LEFT_VISIBLE, true);
|
||||||
|
} else {
|
||||||
|
changePaneState(STATE_PORTRAIT_MIDDLE_EXPANDED, true);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
case STATE_PORTRAIT_MIDDLE_EXPANDED:
|
case STATE_PORTRAIT_MIDDLE_EXPANDED:
|
||||||
changePaneState(STATE_LEFT_VISIBLE, true);
|
changePaneState(STATE_LEFT_VISIBLE, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user