Always consider subscreens as right of parent for animations
This commit is contained in:
parent
35bbf884ab
commit
b8f8b69703
3 changed files with 11 additions and 3 deletions
|
@ -42,12 +42,16 @@ public enum FragmentsAvailable {
|
|||
public boolean isRightOf(FragmentsAvailable fragment) {
|
||||
switch (this) {
|
||||
case HISTORY:
|
||||
case HISTORY_DETAIL:
|
||||
return fragment == UNKNOW;
|
||||
|
||||
case HISTORY_DETAIL:
|
||||
return HISTORY.isRightOf(fragment) || fragment == HISTORY;
|
||||
|
||||
case CONTACTS:
|
||||
return HISTORY_DETAIL.isRightOf(fragment) || fragment == HISTORY_DETAIL;
|
||||
|
||||
case CONTACT:
|
||||
return HISTORY.isRightOf(fragment) || fragment == HISTORY || fragment == HISTORY_DETAIL;
|
||||
return CONTACTS.isRightOf(fragment) || fragment == CONTACTS;
|
||||
|
||||
case DIALER:
|
||||
return CONTACTS.isRightOf(fragment) || fragment == CONTACT || fragment == CONTACTS;
|
||||
|
@ -55,10 +59,12 @@ public enum FragmentsAvailable {
|
|||
case SETTINGS:
|
||||
return DIALER.isRightOf(fragment) || fragment == DIALER;
|
||||
|
||||
case CHAT:
|
||||
case CHATLIST:
|
||||
return SETTINGS.isRightOf(fragment) || fragment == SETTINGS;
|
||||
|
||||
case CHAT:
|
||||
return CHATLIST.isRightOf(fragment) || fragment == CHATLIST;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -301,6 +301,7 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
|||
Intent intent = new Intent(ACTION_MAIN);
|
||||
intent.setClass(this, PreferencesActivity.class);
|
||||
startActivityForResult(intent, SETTINGS_ACTIVITY);
|
||||
//FIXME : Require API 5+
|
||||
if (FragmentsAvailable.SETTINGS.isRightOf(currentFragment)) {
|
||||
overridePendingTransition(R.anim.slide_in_right_to_left, R.anim.slide_out_right_to_left);
|
||||
} else {
|
||||
|
|
|
@ -112,6 +112,7 @@ public class LinphonePreferencesActivity extends PreferenceActivity implements O
|
|||
}
|
||||
}
|
||||
|
||||
//FIXME : Require API 5+
|
||||
private void finishWithCustomAnimation(FragmentsAvailable newFragment) {
|
||||
finish();
|
||||
if (FragmentsAvailable.SETTINGS.isRightOf(newFragment)) {
|
||||
|
|
Loading…
Reference in a new issue