summaryrefslogtreecommitdiff
path: root/InCallUI/src/com/android/incallui/VideoCallFragment.java
diff options
context:
space:
mode:
Diffstat (limited to 'InCallUI/src/com/android/incallui/VideoCallFragment.java')
-rw-r--r--InCallUI/src/com/android/incallui/VideoCallFragment.java42
1 files changed, 6 insertions, 36 deletions
diff --git a/InCallUI/src/com/android/incallui/VideoCallFragment.java b/InCallUI/src/com/android/incallui/VideoCallFragment.java
index a2511f23d..11b5bc65f 100644
--- a/InCallUI/src/com/android/incallui/VideoCallFragment.java
+++ b/InCallUI/src/com/android/incallui/VideoCallFragment.java
@@ -402,21 +402,12 @@ public class VideoCallFragment extends BaseFragment<VideoCallPresenter,
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
- mIsLandscape = getResources().getConfiguration().orientation
- == Configuration.ORIENTATION_LANDSCAPE;
+ mIsLandscape = getResources().getBoolean(R.bool.is_layout_landscape);
Log.d(this, "onActivityCreated: IsLandscape=" + mIsLandscape);
getPresenter().init(getActivity());
}
- /**
- * Handles creation of the fragment view.
- *
- * @param inflater The inflater.
- * @param container The view group containing the fragment.
- * @param savedInstanceState The saved instance state.
- * @return
- */
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
@@ -451,36 +442,15 @@ public class VideoCallFragment extends BaseFragment<VideoCallPresenter,
}
/**
- * Centers the display view vertically for portrait orientation, and horizontally for
- * lanscape orientations. The view is centered within the available space not occupied by
- * the call card.
+ * Centers the display view vertically for portrait orientations. The view is centered within
+ * the available space not occupied by the call card. This is a no-op for landscape mode.
*
* @param displayVideo The video view to center.
*/
private void centerDisplayView(View displayVideo) {
- // In a lansdcape layout we need to ensure we horizontally center the view based on whether
- // the layout is left-to-right or right-to-left.
- // In a left-to-right locale, the space for the video view is to the right of the call card
- // so we need to translate it in the +X direction.
- // In a right-to-left locale, the space for the video view is to the left of the call card
- // so we need to translate it in the -X direction.
- final boolean isLayoutRtl = InCallPresenter.isRtl();
-
- ViewGroup.LayoutParams params = displayVideo.getLayoutParams();
- float spaceBesideCallCard = InCallPresenter.getInstance().getSpaceBesideCallCard();
- Log.d(this, "centerDisplayView: IsLandscape= " + mIsLandscape + " Layout width: " +
- params.width + " height: " + params.height + " spaceBesideCallCard: "
- + spaceBesideCallCard);
- if (mIsLandscape) {
- float videoViewTranslation = params.width / 2
- - spaceBesideCallCard / 2;
- if (isLayoutRtl) {
- displayVideo.setTranslationX(-videoViewTranslation);
- } else {
- displayVideo.setTranslationX(videoViewTranslation);
- }
- } else {
- float videoViewTranslation = params.height / 2
+ if (!mIsLandscape) {
+ float spaceBesideCallCard = InCallPresenter.getInstance().getSpaceBesideCallCard();
+ float videoViewTranslation = displayVideo.getHeight() / 2
- spaceBesideCallCard / 2;
displayVideo.setTranslationY(videoViewTranslation);
}