Fix zooming issue on some devices + use same menu layout for settings view
This commit is contained in:
parent
f79633ca4b
commit
796026f061
2 changed files with 90 additions and 70 deletions
|
@ -12,7 +12,7 @@
|
|||
<LinearLayout
|
||||
android:id="@+id/menu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="90dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
@ -22,10 +22,11 @@
|
|||
android:layout_weight="0.2">
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_history"
|
||||
android:id="@+id/history"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@string/content_description_history"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/history" />
|
||||
|
||||
|
@ -33,51 +34,70 @@
|
|||
android:id="@+id/missedCalls"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:background="@drawable/missed_calls_bg"
|
||||
android:gravity="center"
|
||||
android:textSize="20dp"
|
||||
android:visibility="gone"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:background="@drawable/missed_calls_bg" />
|
||||
|
||||
android:visibility="gone" />
|
||||
</RelativeLayout>
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_contacts"
|
||||
android:id="@+id/contacts"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.2"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@string/content_description_contacts"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/contacts" />
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_dialer"
|
||||
android:id="@+id/dialer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.2"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@string/content_description_dialer"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/dialer" />
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_settings"
|
||||
android:id="@+id/settings"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.2"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@string/content_description_settings"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/settings" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.2">
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_chat"
|
||||
android:id="@+id/chat"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.2"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@string/content_description_chat"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/chat" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/missedChats"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:background="@drawable/missed_calls_bg"
|
||||
android:gravity="center"
|
||||
android:textSize="20dp"
|
||||
android:visibility="gone" />
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
|
@ -171,7 +171,7 @@ public class VideoCallFragment extends Fragment implements OnGestureListener, On
|
|||
public boolean onScale(CompatibilityScaleGestureDetector detector) {
|
||||
mZoomFactor *= detector.getScaleFactor();
|
||||
// Don't let the object get too small or too large.
|
||||
mZoomFactor = Math.max(0.1f, Math.min(mZoomFactor, mVideoView.getHeight() / LinphoneManager.getLc().getPreferredVideoSize().height));
|
||||
mZoomFactor = Math.max(0.1f, Math.min(mZoomFactor, ((float) mVideoView.getHeight()) / LinphoneManager.getLc().getPreferredVideoSize().height));
|
||||
|
||||
LinphoneManager.getLc().getCurrentCall().zoomVideo(mZoomFactor, mZoomCenterX, mZoomCenterY);
|
||||
return true;
|
||||
|
@ -204,9 +204,9 @@ public class VideoCallFragment extends Fragment implements OnGestureListener, On
|
|||
@Override
|
||||
public boolean onDoubleTap(MotionEvent e) {
|
||||
if (LinphoneUtils.isCallEstablished(LinphoneManager.getLc().getCurrentCall())) {
|
||||
if (mZoomFactor == 1) {
|
||||
if (mZoomFactor == 1.f) {
|
||||
// Zoom to make the video fill the screen in height
|
||||
mZoomFactor = mVideoView.getHeight() / LinphoneManager.getLc().getPreferredVideoSize().height;
|
||||
mZoomFactor = ((float) mVideoView.getHeight()) / LinphoneManager.getLc().getPreferredVideoSize().height;
|
||||
}
|
||||
else {
|
||||
resetZoom();
|
||||
|
@ -220,7 +220,7 @@ public class VideoCallFragment extends Fragment implements OnGestureListener, On
|
|||
}
|
||||
|
||||
private void resetZoom() {
|
||||
mZoomFactor = 1;
|
||||
mZoomFactor = 1.f;
|
||||
mZoomCenterX = mZoomCenterY = 0.5f;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue