Fixed landscape incall view on phones (and by the way uniformised all imageview buttons into textviews in all incall views)

This commit is contained in:
Sylvain Berfini 2014-02-27 12:12:19 +01:00
parent dd0d5dfc3f
commit 945a96435c
6 changed files with 65 additions and 113 deletions

View file

@ -55,33 +55,30 @@
<LinearLayout <LinearLayout
android:id="@+id/menu" android:id="@+id/menu"
android:visibility="gone"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:gravity="bottom" android:gravity="bottom"
android:orientation="horizontal" > android:orientation="horizontal" >
<ImageView <TextView
android:id="@+id/pause" android:id="@+id/pause"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:adjustViewBounds="true" android:background="@drawable/pause_off"
android:contentDescription="@string/content_description_pause" android:gravity="center"
android:scaleType="fitXY" android:paddingTop="30dp" />
android:src="@drawable/pause_off" />
<ImageView <TextView
android:id="@+id/conference" android:id="@+id/conference"
android:visibility="gone" android:visibility="gone"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:adjustViewBounds="true" android:background="@drawable/conference"
android:contentDescription="@string/content_description_conference" android:gravity="center"
android:scaleType="fitXY" android:paddingTop="30dp" />
android:src="@drawable/conference" />
<TextView <TextView
android:id="@+id/video" android:id="@+id/video"
@ -105,15 +102,14 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1" />
<ImageView <TextView
android:id="@+id/hangUp" android:id="@+id/hangUp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0.94" android:layout_weight="0.94"
android:adjustViewBounds="true" android:background="@drawable/hangup"
android:contentDescription="@string/content_description_hang_up" android:gravity="center"
android:scaleType="fitXY" android:paddingTop="30dp" />
android:src="@drawable/hangup" />
<TextView <TextView
android:id="@+id/speaker" android:id="@+id/speaker"
@ -219,15 +215,14 @@
</LinearLayout> </LinearLayout>
<ImageView <TextView
android:id="@+id/dialer" android:id="@+id/dialer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:adjustViewBounds="true" android:background="@drawable/dialer_alt"
android:contentDescription="@string/content_description_numpad" android:gravity="center"
android:scaleType="fitXY" android:paddingTop="30dp" />
android:src="@drawable/dialer_alt" />
</LinearLayout> </LinearLayout>

View file

@ -207,46 +207,34 @@
android:background="@android:color/black" android:background="@android:color/black"
android:orientation="horizontal" > android:orientation="horizontal" >
<ImageView <TextView
android:id="@+id/pause" android:id="@+id/pause"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:adjustViewBounds="true" android:background="@drawable/pause_off" />
android:contentDescription="@string/content_description_pause"
android:scaleType="fitXY"
android:src="@drawable/pause_off" />
<ImageView <TextView
android:id="@+id/conference" android:id="@+id/conference"
android:visibility="gone" android:visibility="gone"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:adjustViewBounds="true" android:background="@drawable/conference" />
android:contentDescription="@string/content_description_conference"
android:scaleType="fitXY"
android:src="@drawable/conference" />
<ImageView <TextView
android:id="@+id/hangUp" android:id="@+id/hangUp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0.97" android:layout_weight="0.97"
android:adjustViewBounds="true" android:background="@drawable/hangup" />
android:contentDescription="@string/content_description_hang_up"
android:scaleType="fitXY"
android:src="@drawable/hangup" />
<ImageView <TextView
android:id="@+id/dialer" android:id="@+id/dialer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:adjustViewBounds="true" android:background="@drawable/dialer_alt" />
android:contentDescription="@string/content_description_numpad"
android:scaleType="fitXY"
android:src="@drawable/dialer_alt" />
</LinearLayout> </LinearLayout>

View file

@ -53,7 +53,6 @@
<RelativeLayout <RelativeLayout
android:id="@+id/menu" android:id="@+id/menu"
android:visibility="gone"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
@ -139,38 +138,30 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<ImageView <TextView
android:id="@+id/conference" android:id="@+id/conference"
android:visibility="gone" android:visibility="gone"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:contentDescription="@string/content_description_conference" android:background="@drawable/conference" />
android:scaleType="fitXY"
android:src="@drawable/conference" />
<ImageView <TextView
android:id="@+id/pause" android:id="@+id/pause"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:contentDescription="@string/content_description_pause" android:background="@drawable/pause_off" />
android:scaleType="fitXY"
android:src="@drawable/pause_off" />
<ImageView <TextView
android:id="@+id/dialer" android:id="@+id/dialer"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:contentDescription="@string/content_description_numpad" android:background="@drawable/dialer_alt" />
android:scaleType="fitXY"
android:src="@drawable/dialer_alt" />
<ImageView <TextView
android:id="@+id/hangUp" android:id="@+id/hangUp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:contentDescription="@string/content_description_hang_up" android:background="@drawable/hangup" />
android:scaleType="fitXY"
android:src="@drawable/hangup" />
</LinearLayout> </LinearLayout>

View file

@ -53,7 +53,6 @@
<RelativeLayout <RelativeLayout
android:id="@+id/menu" android:id="@+id/menu"
android:visibility="gone"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
@ -139,38 +138,30 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<ImageView <TextView
android:id="@+id/conference" android:id="@+id/conference"
android:visibility="gone" android:visibility="gone"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:contentDescription="@string/content_description_conference" android:background="@drawable/conference" />
android:scaleType="fitXY"
android:src="@drawable/conference" />
<ImageView <TextView
android:id="@+id/pause" android:id="@+id/pause"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:contentDescription="@string/content_description_pause" android:background="@drawable/pause_off" />
android:scaleType="fitXY"
android:src="@drawable/pause_off" />
<ImageView <TextView
android:id="@+id/dialer" android:id="@+id/dialer"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:contentDescription="@string/content_description_numpad" android:background="@drawable/dialer_alt" />
android:scaleType="fitXY"
android:src="@drawable/dialer_alt" />
<ImageView <TextView
android:id="@+id/hangUp" android:id="@+id/hangUp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:contentDescription="@string/content_description_hang_up" android:background="@drawable/hangup" />
android:scaleType="fitXY"
android:src="@drawable/hangup" />
</LinearLayout> </LinearLayout>

View file

@ -54,7 +54,6 @@
<LinearLayout <LinearLayout
android:id="@+id/menu" android:id="@+id/menu"
android:visibility="invisible"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
@ -252,46 +251,34 @@
android:background="@android:color/black" android:background="@android:color/black"
android:orientation="horizontal" > android:orientation="horizontal" >
<ImageView <TextView
android:id="@+id/pause" android:id="@+id/pause"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:adjustViewBounds="true" android:background="@drawable/pause_off" />
android:contentDescription="@string/content_description_pause"
android:scaleType="fitXY"
android:src="@drawable/pause_off" />
<ImageView <TextView
android:id="@+id/conference" android:id="@+id/conference"
android:visibility="gone" android:visibility="gone"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:adjustViewBounds="true" android:background="@drawable/conference" />
android:contentDescription="@string/content_description_conference"
android:scaleType="fitXY"
android:src="@drawable/conference" />
<ImageView <TextView
android:id="@+id/hangUp" android:id="@+id/hangUp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0.97" android:layout_weight="0.97"
android:adjustViewBounds="true" android:background="@drawable/hangup" />
android:contentDescription="@string/content_description_hang_up"
android:scaleType="fitXY"
android:src="@drawable/hangup" />
<ImageView <TextView
android:id="@+id/dialer" android:id="@+id/dialer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:adjustViewBounds="true" android:background="@drawable/dialer_alt" />
android:contentDescription="@string/content_description_numpad"
android:scaleType="fitXY"
android:src="@drawable/dialer_alt" />
</LinearLayout> </LinearLayout>

View file

@ -83,8 +83,8 @@ public class InCallActivity extends FragmentActivity implements
private Handler mHandler = new Handler(); private Handler mHandler = new Handler();
private Handler mControlsHandler = new Handler(); private Handler mControlsHandler = new Handler();
private Runnable mControls; private Runnable mControls;
private ImageView pause, hangUp, dialer, switchCamera, conference; private ImageView switchCamera;
private TextView video, micro, speaker, options, addCall, transfer; private TextView pause, hangUp, dialer, video, micro, speaker, options, addCall, transfer, conference;
private TextView audioRoute, routeSpeaker, routeReceiver, routeBluetooth; private TextView audioRoute, routeSpeaker, routeReceiver, routeBluetooth;
private LinearLayout routeLayout; private LinearLayout routeLayout;
private StatusFragment status; private StatusFragment status;
@ -203,14 +203,14 @@ public class InCallActivity extends FragmentActivity implements
options = (TextView) findViewById(R.id.options); options = (TextView) findViewById(R.id.options);
options.setOnClickListener(this); options.setOnClickListener(this);
options.setEnabled(false); options.setEnabled(false);
pause = (ImageView) findViewById(R.id.pause); pause = (TextView) findViewById(R.id.pause);
pause.setOnClickListener(this); pause.setOnClickListener(this);
pause.setEnabled(false); pause.setEnabled(false);
hangUp = (ImageView) findViewById(R.id.hangUp); hangUp = (TextView) findViewById(R.id.hangUp);
hangUp.setOnClickListener(this); hangUp.setOnClickListener(this);
conference = (ImageView) findViewById(R.id.conference); conference = (TextView) findViewById(R.id.conference);
conference.setOnClickListener(this); conference.setOnClickListener(this);
dialer = (ImageView) findViewById(R.id.dialer); dialer = (TextView) findViewById(R.id.dialer);
dialer.setOnClickListener(this); dialer.setOnClickListener(this);
dialer.setEnabled(false); dialer.setEnabled(false);
numpad = (Numpad) findViewById(R.id.numpad); numpad = (Numpad) findViewById(R.id.numpad);
@ -319,9 +319,9 @@ public class InCallActivity extends FragmentActivity implements
List<LinphoneCall> pausedCalls = LinphoneUtils.getCallsInState(LinphoneManager.getLc(), Arrays.asList(State.Paused)); List<LinphoneCall> pausedCalls = LinphoneUtils.getCallsInState(LinphoneManager.getLc(), Arrays.asList(State.Paused));
if (pausedCalls.size() == 1) { if (pausedCalls.size() == 1) {
pause.setImageResource(R.drawable.pause_on); pause.setBackgroundResource(R.drawable.pause_on);
} else { } else {
pause.setImageResource(R.drawable.pause_off); pause.setBackgroundResource(R.drawable.pause_off);
} }
} }
} }
@ -572,7 +572,7 @@ public class InCallActivity extends FragmentActivity implements
isVideoCallPaused = true; isVideoCallPaused = true;
showAudioView(); showAudioView();
} }
pause.setImageResource(R.drawable.pause_on); pause.setBackgroundResource(R.drawable.pause_on);
} }
} else { } else {
List<LinphoneCall> pausedCalls = LinphoneUtils.getCallsInState(lc, Arrays.asList(State.Paused)); List<LinphoneCall> pausedCalls = LinphoneUtils.getCallsInState(lc, Arrays.asList(State.Paused));
@ -584,7 +584,7 @@ public class InCallActivity extends FragmentActivity implements
isVideoCallPaused = false; isVideoCallPaused = false;
showVideoView(); showVideoView();
} }
pause.setImageResource(R.drawable.pause_off); pause.setBackgroundResource(R.drawable.pause_off);
} }
} else if (call != null) { } else if (call != null) {
lc.resumeCall(call); lc.resumeCall(call);
@ -592,7 +592,7 @@ public class InCallActivity extends FragmentActivity implements
isVideoCallPaused = false; isVideoCallPaused = false;
showVideoView(); showVideoView();
} }
pause.setImageResource(R.drawable.pause_off); pause.setBackgroundResource(R.drawable.pause_off);
} }
} }
} }
@ -734,7 +734,7 @@ public class InCallActivity extends FragmentActivity implements
return; return;
} }
dialer.setImageResource(R.drawable.dialer_alt); dialer.setBackgroundResource(R.drawable.dialer_alt);
if (isAnimationDisabled) { if (isAnimationDisabled) {
numpad.setVisibility(View.GONE); numpad.setVisibility(View.GONE);
} else { } else {
@ -768,7 +768,7 @@ public class InCallActivity extends FragmentActivity implements
if (numpad.getVisibility() == View.VISIBLE) { if (numpad.getVisibility() == View.VISIBLE) {
hideNumpad(); hideNumpad();
} else { } else {
dialer.setImageResource(R.drawable.dialer_alt_back); dialer.setBackgroundResource(R.drawable.dialer_alt_back);
if (isAnimationDisabled) { if (isAnimationDisabled) {
numpad.setVisibility(View.VISIBLE); numpad.setVisibility(View.VISIBLE);
} else { } else {