Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e8d9946 authored by calderwoodra's avatar calderwoodra Committed by android-build-merger
Browse files

Merge "Fixed overlapping fragments issue." am: c692948f

am: 6b1553d4

Change-Id: Iffd5340168778da74a2c32511cd8de07a9ebcdc5
parents f1e4d538 6b1553d4
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1186,8 +1186,12 @@ public class OldMainActivityPeer implements MainActivityPeer, FragmentUtilListen
     *
     * <p>Executes all fragment shows/hides in one transaction with no conflicting transactions
     * (like showing and hiding the same fragment in the same transaction). See a bug.
     *
     * <p>Special care should be taken to avoid calling this method several times in a short window
     * as it can lead to fragments overlapping.
     */
    private void showFragment(@NonNull Fragment fragment, String tag) {
      LogUtil.enterBlock("MainBottomNavBarBottomNavTabListener.showFragment");
      Fragment speedDial = fragmentManager.findFragmentByTag(SPEED_DIAL_TAG);
      Fragment callLog = fragmentManager.findFragmentByTag(CALL_LOG_TAG);
      Fragment contacts = fragmentManager.findFragmentByTag(CONTACTS_TAG);
@@ -1200,6 +1204,8 @@ public class OldMainActivityPeer implements MainActivityPeer, FragmentUtilListen
      fragmentShown |= showIfEqualElseHide(transaction, fragment, voicemail);

      if (!fragmentShown) {
        LogUtil.i(
            "MainBottomNavBarBottomNavTabListener.showFragment", "Not added yet: " + fragment);
        transaction.add(R.id.fragment_container, fragment, tag);
      }
      transaction.commit();
+2 −1
Original line number Diff line number Diff line
@@ -155,7 +155,8 @@ public final class BottomNavBar extends LinearLayout {
    int voicemailcurrentVisibility = voicemail.getVisibility();

    if (voicemailpreviousVisibility != voicemailcurrentVisibility
        && voicemailpreviousVisibility == View.VISIBLE) {
        && voicemailpreviousVisibility == View.VISIBLE
        && getSelectedTab() == TabIndex.VOICEMAIL) {
      LogUtil.i("OldMainActivityPeer.showVoicemail", "hid VM tab and moved to speed dial tab");
      selectTab(TabIndex.SPEED_DIAL);
    }