Fix contact list in tablet version

Disable old animations
This commit is contained in:
Margaux Clerc 2016-03-07 14:45:08 +01:00 committed by Jehan Monnier
parent 32d5369c0d
commit d292f73585
2 changed files with 5 additions and 5 deletions

View file

@ -324,7 +324,7 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
} }
public void displayFirstContact(){ public void displayFirstContact(){
if(contactsList.getAdapter().getCount() > 0) { if(contactsList.getAdapter() != null && contactsList.getAdapter().getCount() > 0) {
LinphoneActivity.instance().displayContact((Contact) contactsList.getAdapter().getItem(0), false); LinphoneActivity.instance().displayContact((Contact) contactsList.getAdapter().getItem(0), false);
} else { } else {
LinphoneActivity.instance().displayEmptyFragment(); LinphoneActivity.instance().displayEmptyFragment();

View file

@ -424,7 +424,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
private void changeFragment(Fragment newFragment, FragmentsAvailable newFragmentType, boolean withoutAnimation) { private void changeFragment(Fragment newFragment, FragmentsAvailable newFragmentType, boolean withoutAnimation) {
FragmentTransaction transaction = getFragmentManager().beginTransaction(); FragmentTransaction transaction = getFragmentManager().beginTransaction();
if (!withoutAnimation && !isAnimationDisabled && currentFragment.shouldAnimate()) { /*if (!withoutAnimation && !isAnimationDisabled && currentFragment.shouldAnimate()) {
if (newFragmentType.isRightOf(currentFragment)) { if (newFragmentType.isRightOf(currentFragment)) {
transaction.setCustomAnimations(R.anim.slide_in_right_to_left, transaction.setCustomAnimations(R.anim.slide_in_right_to_left,
R.anim.slide_out_right_to_left, R.anim.slide_out_right_to_left,
@ -436,7 +436,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
R.anim.slide_in_right_to_left, R.anim.slide_in_right_to_left,
R.anim.slide_out_right_to_left); R.anim.slide_out_right_to_left);
} }
} }*/
if (newFragmentType != FragmentsAvailable.DIALER if (newFragmentType != FragmentsAvailable.DIALER
|| newFragmentType != FragmentsAvailable.CONTACTS_LIST || newFragmentType != FragmentsAvailable.CONTACTS_LIST
@ -495,13 +495,13 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
transaction.replace(R.id.fragmentContainer2, new EmptyFragment()); transaction.replace(R.id.fragmentContainer2, new EmptyFragment());
} }
if (!withoutAnimation && !isAnimationDisabled && currentFragment.shouldAnimate()) { /*if (!withoutAnimation && !isAnimationDisabled && currentFragment.shouldAnimate()) {
if (newFragmentType.isRightOf(currentFragment)) { if (newFragmentType.isRightOf(currentFragment)) {
transaction.setCustomAnimations(R.anim.slide_in_right_to_left, R.anim.slide_out_right_to_left, R.anim.slide_in_left_to_right, R.anim.slide_out_left_to_right); transaction.setCustomAnimations(R.anim.slide_in_right_to_left, R.anim.slide_out_right_to_left, R.anim.slide_in_left_to_right, R.anim.slide_out_left_to_right);
} else { } else {
transaction.setCustomAnimations(R.anim.slide_in_left_to_right, R.anim.slide_out_left_to_right, R.anim.slide_in_right_to_left, R.anim.slide_out_right_to_left); transaction.setCustomAnimations(R.anim.slide_in_left_to_right, R.anim.slide_out_left_to_right, R.anim.slide_in_right_to_left, R.anim.slide_out_right_to_left);
} }
} }*/
transaction.replace(R.id.fragmentContainer, newFragment); transaction.replace(R.id.fragmentContainer, newFragment);
} }
transaction.commitAllowingStateLoss(); transaction.commitAllowingStateLoss();