Fix incall icons lost state when rotation
This commit is contained in:
parent
7f7b2d5eae
commit
35f05e03be
3 changed files with 21 additions and 0 deletions
|
@ -31,6 +31,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
android:contentDescription="@string/content_description_switch_camera"
|
android:contentDescription="@string/content_description_switch_camera"
|
||||||
android:layout_marginTop="40dp"
|
android:layout_marginTop="40dp"
|
||||||
android:src="@drawable/switch_camera"
|
android:src="@drawable/switch_camera"
|
||||||
|
@ -175,6 +176,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
android:contentDescription="@string/content_description_pause"
|
android:contentDescription="@string/content_description_pause"
|
||||||
android:scaleType="fitXY"
|
android:scaleType="fitXY"
|
||||||
android:src="@drawable/pause_off" />
|
android:src="@drawable/pause_off" />
|
||||||
|
@ -185,6 +187,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
android:contentDescription="@string/content_description_conference"
|
android:contentDescription="@string/content_description_conference"
|
||||||
android:scaleType="fitXY"
|
android:scaleType="fitXY"
|
||||||
android:src="@drawable/conference" />
|
android:src="@drawable/conference" />
|
||||||
|
@ -216,6 +219,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
android:contentDescription="@string/content_description_hang_up"
|
android:contentDescription="@string/content_description_hang_up"
|
||||||
android:scaleType="fitXY"
|
android:scaleType="fitXY"
|
||||||
android:src="@drawable/hangup" />
|
android:src="@drawable/hangup" />
|
||||||
|
@ -247,6 +251,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
android:contentDescription="@string/content_description_numpad"
|
android:contentDescription="@string/content_description_numpad"
|
||||||
android:scaleType="fitXY"
|
android:scaleType="fitXY"
|
||||||
android:src="@drawable/dialer_alt" />
|
android:src="@drawable/dialer_alt" />
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
android:contentDescription="@string/content_description_switch_camera"
|
android:contentDescription="@string/content_description_switch_camera"
|
||||||
android:layout_marginTop="40dp"
|
android:layout_marginTop="40dp"
|
||||||
android:visibility="invisible"
|
android:visibility="invisible"
|
||||||
|
@ -191,6 +192,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
android:contentDescription="@string/content_description_pause"
|
android:contentDescription="@string/content_description_pause"
|
||||||
android:scaleType="fitXY"
|
android:scaleType="fitXY"
|
||||||
android:src="@drawable/pause_off" />
|
android:src="@drawable/pause_off" />
|
||||||
|
@ -201,6 +203,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
android:contentDescription="@string/content_description_conference"
|
android:contentDescription="@string/content_description_conference"
|
||||||
android:scaleType="fitXY"
|
android:scaleType="fitXY"
|
||||||
android:src="@drawable/conference" />
|
android:src="@drawable/conference" />
|
||||||
|
@ -210,6 +213,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
android:contentDescription="@string/content_description_hang_up"
|
android:contentDescription="@string/content_description_hang_up"
|
||||||
android:scaleType="fitXY"
|
android:scaleType="fitXY"
|
||||||
android:src="@drawable/hangup" />
|
android:src="@drawable/hangup" />
|
||||||
|
@ -219,6 +223,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
android:contentDescription="@string/content_description_numpad"
|
android:contentDescription="@string/content_description_numpad"
|
||||||
android:scaleType="fitXY"
|
android:scaleType="fitXY"
|
||||||
android:src="@drawable/dialer_alt" />
|
android:src="@drawable/dialer_alt" />
|
||||||
|
|
|
@ -124,6 +124,9 @@ public class InCallActivity extends FragmentActivity implements
|
||||||
|
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
// Fragment already created, no need to create it again (else it will generate a memory leak with duplicated fragments)
|
// Fragment already created, no need to create it again (else it will generate a memory leak with duplicated fragments)
|
||||||
|
isSpeakerEnabled = savedInstanceState.getBoolean("Speaker");
|
||||||
|
isMicMuted = savedInstanceState.getBoolean("Mic");
|
||||||
|
refreshInCallActions();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,6 +148,14 @@ public class InCallActivity extends FragmentActivity implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onSaveInstanceState(Bundle outState) {
|
||||||
|
outState.putBoolean("Speaker", isSpeakerEnabled);
|
||||||
|
outState.putBoolean("Mic", isMicMuted);
|
||||||
|
|
||||||
|
super.onSaveInstanceState(outState);
|
||||||
|
}
|
||||||
|
|
||||||
private void initUI() {
|
private void initUI() {
|
||||||
video = (TextView) findViewById(R.id.video);
|
video = (TextView) findViewById(R.id.video);
|
||||||
video.setOnClickListener(this);
|
video.setOnClickListener(this);
|
||||||
|
|
Loading…
Reference in a new issue