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

Commit b45b73eb authored by wangqi's avatar wangqi Committed by android-build-merger
Browse files

Merge "Add support of dialpad in RTT call."

am: 261cba95

Change-Id: I71219ff2f52cbbc0459485fa583ea230ff6c27f1
parents fd9f616e 261cba95
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@
    <Space style="@style/DialpadSpaceStyle"/>
  </LinearLayout>
  <Space
      android:id="@+id/end_call_space"
      android:layout_width="match_parent"
      android:layout_height="?attr/dialpad_end_key_spacing"/>
</LinearLayout>
+8 −0
Original line number Diff line number Diff line
@@ -84,6 +84,8 @@ public class DialpadFragment extends BaseFragment<DialpadPresenter, DialpadUi>
  private DtmfKeyListener dtmfKeyListener;
  private DialpadView dialpadView;
  private int currentTextColor;
  private View endCallSpace;
  private boolean shouldShowEndCallSpace = true;

  @Override
  public void onClick(View v) {
@@ -152,6 +154,7 @@ public class DialpadFragment extends BaseFragment<DialpadPresenter, DialpadUi>
    View backButton = dialpadView.findViewById(R.id.dialpad_back);
    backButton.setVisibility(View.VISIBLE);
    backButton.setOnClickListener(this);
    endCallSpace = dialpadView.findViewById(R.id.end_call_space);

    return parent;
  }
@@ -160,6 +163,7 @@ public class DialpadFragment extends BaseFragment<DialpadPresenter, DialpadUi>
  public void onResume() {
    super.onResume();
    updateColors();
    endCallSpace.setVisibility(shouldShowEndCallSpace ? View.VISIBLE : View.GONE);
  }

  public void updateColors() {
@@ -268,6 +272,10 @@ public class DialpadFragment extends BaseFragment<DialpadPresenter, DialpadUi>
    }
  }

  public void setShouldShowEndCallSpace(boolean show) {
    shouldShowEndCallSpace = show;
  }

  /**
   * LinearLayout with getter and setter methods for the translationY property using floats, for
   * animation purposes.
+20 −5
Original line number Diff line number Diff line
@@ -830,7 +830,7 @@ public class InCallActivity extends TransactionSafeFragmentActivity

    // Note:  onInCallScreenDialpadVisibilityChange is called here to ensure that the dialpad FAB
    // repositions itself.
    getInCallScreen().onInCallScreenDialpadVisibilityChange(show);
    getInCallOrRttCallScreen().onInCallScreenDialpadVisibilityChange(show);
  }

  private void showDialpadFragment() {
@@ -842,11 +842,15 @@ public class InCallActivity extends TransactionSafeFragmentActivity
    FragmentTransaction transaction = dialpadFragmentManager.beginTransaction();
    DialpadFragment dialpadFragment = getDialpadFragment();
    if (dialpadFragment == null) {
      transaction.add(getDialpadContainerId(), new DialpadFragment(), Tags.DIALPAD_FRAGMENT);
      dialpadFragment = new DialpadFragment();
      transaction.add(getDialpadContainerId(), dialpadFragment, Tags.DIALPAD_FRAGMENT);
    } else {
      transaction.show(dialpadFragment);
      dialpadFragment.setUserVisibleHint(true);
    }
    // RTT call screen doesn't show end call button inside dialpad, thus the space reserved for end
    // call button should be removed.
    dialpadFragment.setShouldShowEndCallSpace(didShowInCallScreen);
    transaction.commitAllowingStateLoss();
    dialpadFragmentManager.executePendingTransactions();

@@ -967,7 +971,7 @@ public class InCallActivity extends TransactionSafeFragmentActivity
  }

  public boolean getCallCardFragmentVisible() {
    return didShowInCallScreen || didShowVideoCallScreen;
    return didShowInCallScreen || didShowVideoCallScreen || didShowRttCallScreen;
  }

  public void dismissKeyguard(boolean dismiss) {
@@ -1100,7 +1104,7 @@ public class InCallActivity extends TransactionSafeFragmentActivity

  @Nullable
  public FragmentManager getDialpadFragmentManager() {
    InCallScreen inCallScreen = getInCallScreen();
    InCallScreen inCallScreen = getInCallOrRttCallScreen();
    if (inCallScreen != null) {
      return inCallScreen.getInCallScreenFragment().getChildFragmentManager();
    }
@@ -1108,7 +1112,7 @@ public class InCallActivity extends TransactionSafeFragmentActivity
  }

  public int getDialpadContainerId() {
    return getInCallScreen().getAnswerAndDialpadContainerResourceId();
    return getInCallOrRttCallScreen().getAnswerAndDialpadContainerResourceId();
  }

  @Override
@@ -1586,6 +1590,17 @@ public class InCallActivity extends TransactionSafeFragmentActivity
    return (RttCallScreen) getSupportFragmentManager().findFragmentByTag(Tags.RTT_CALL_SCREEN);
  }

  private InCallScreen getInCallOrRttCallScreen() {
    InCallScreen inCallScreen = null;
    if (didShowInCallScreen) {
      inCallScreen = getInCallScreen();
    }
    if (didShowRttCallScreen) {
      inCallScreen = getRttCallScreen();
    }
    return inCallScreen;
  }

  @Override
  public void onPseudoScreenStateChanged(boolean isOn) {
    LogUtil.i("InCallActivity.onPseudoScreenStateChanged", "isOn: " + isOn);
+4 −2
Original line number Diff line number Diff line
@@ -333,11 +333,13 @@ public class RttChatFragment extends Fragment
  public void updateInCallScreenColors() {}

  @Override
  public void onInCallScreenDialpadVisibilityChange(boolean isShowing) {}
  public void onInCallScreenDialpadVisibilityChange(boolean isShowing) {
    overflowMenu.setDialpadButtonChecked(isShowing);
  }

  @Override
  public int getAnswerAndDialpadContainerResourceId() {
    return 0;
    return R.id.incall_dialpad_container;
  }

  @Override
+4 −0
Original line number Diff line number Diff line
@@ -87,4 +87,8 @@ public class RttOverflowMenu extends PopupWindow implements OnCheckedChangeListe
      speakerButton.setOnCheckedChangeListener(null);
    }
  }

  void setDialpadButtonChecked(boolean isChecked) {
    dialpadButton.setChecked(isChecked);
  }
}
Loading