Added sent/received video resolution in status bar

This commit is contained in:
Sylvain Berfini 2014-02-27 11:31:12 +01:00
parent 9c8b9f2f34
commit c4fde8d83f
7 changed files with 74 additions and 13 deletions

View file

@ -40,7 +40,7 @@
android:id="@+id/call_stats_title" android:id="@+id/call_stats_title"
android:textStyle="bold" android:textStyle="bold"
android:textColor="@color/text_default" android:textColor="@color/text_default"
android:textSize="18dp"/> android:textSize="18sp"/>
</TableRow> </TableRow>
@ -55,7 +55,7 @@
android:text="@string/call_stats_codec" android:text="@string/call_stats_codec"
android:textStyle="bold" android:textStyle="bold"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="12dp"/> android:textSize="12sp"/>
<TextView <TextView
android:id="@+id/codec" android:id="@+id/codec"
@ -64,7 +64,7 @@
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:gravity="right|center_vertical" android:gravity="right|center_vertical"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="12dp"/> android:textSize="12sp"/>
</TableRow> </TableRow>
@ -79,7 +79,7 @@
android:text="@string/call_stats_upload" android:text="@string/call_stats_upload"
android:textStyle="bold" android:textStyle="bold"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="12dp"/> android:textSize="12sp"/>
<TextView <TextView
android:id="@+id/uploadBandwith" android:id="@+id/uploadBandwith"
@ -88,7 +88,7 @@
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:gravity="right|center_vertical" android:gravity="right|center_vertical"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="12dp"/> android:textSize="12sp"/>
</TableRow> </TableRow>
@ -103,7 +103,7 @@
android:text="@string/call_stats_download" android:text="@string/call_stats_download"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textStyle="bold" android:textStyle="bold"
android:textSize="12dp"/> android:textSize="12sp"/>
<TextView <TextView
android:id="@+id/downloadBandwith" android:id="@+id/downloadBandwith"
@ -112,7 +112,7 @@
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:gravity="right|center_vertical" android:gravity="right|center_vertical"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="12dp"/> android:textSize="12sp"/>
</TableRow> </TableRow>
@ -127,7 +127,7 @@
android:text="@string/call_stats_ice" android:text="@string/call_stats_ice"
android:textStyle="bold" android:textStyle="bold"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="12dp"/> android:textSize="12sp"/>
<TextView <TextView
android:id="@+id/ice" android:id="@+id/ice"
@ -136,7 +136,32 @@
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:gravity="right|center_vertical" android:gravity="right|center_vertical"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="12dp"/> android:textSize="12sp"/>
</TableRow>
<TableRow
android:id="@+id/video_resolution_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left|center_vertical"
android:text="@string/call_stats_video_resolution"
android:textStyle="bold"
android:textColor="@android:color/white"
android:textSize="12sp"/>
<TextView
android:id="@+id/video_resolution"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:gravity="right|center_vertical"
android:textColor="@android:color/white"
android:textSize="12sp"/>
</TableRow> </TableRow>
@ -179,7 +204,7 @@
android:id="@+id/statusText" android:id="@+id/statusText"
android:text="@string/status_not_connected" android:text="@string/status_not_connected"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="14dp" android:textSize="14sp"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -221,7 +246,7 @@
android:id="@+id/exit" android:id="@+id/exit"
android:text="@string/menu_exit" android:text="@string/menu_exit"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="14dp" android:textSize="14sp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"

View file

@ -139,6 +139,31 @@
android:textSize="12sp"/> android:textSize="12sp"/>
</TableRow> </TableRow>
<TableRow
android:id="@+id/video_resolution_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left|center_vertical"
android:text="@string/call_stats_video_resolution"
android:textStyle="bold"
android:textColor="@android:color/white"
android:textSize="12sp"/>
<TextView
android:id="@+id/video_resolution"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:gravity="right|center_vertical"
android:textColor="@android:color/white"
android:textSize="12sp"/>
</TableRow>
</TableLayout> </TableLayout>

View file

@ -230,6 +230,7 @@
<string name="call_stats_upload">Bande passante envoi :</string> <string name="call_stats_upload">Bande passante envoi :</string>
<string name="call_stats_download">Bande passante réception :</string> <string name="call_stats_download">Bande passante réception :</string>
<string name="call_stats_ice">Connexion ICE :</string> <string name="call_stats_ice">Connexion ICE :</string>
<string name="call_stats_video_resolution">Taille vidéo:</string>
<!-- Used by Android to help blind people by describing them images --> <!-- Used by Android to help blind people by describing them images -->
<string name="content_description_add_contact"></string> <string name="content_description_add_contact"></string>

View file

@ -277,6 +277,7 @@
<string name="call_stats_upload">Полоса пропускания загрузки:</string> <string name="call_stats_upload">Полоса пропускания загрузки:</string>
<string name="call_stats_download">Полоса пропускания скачивания:</string> <string name="call_stats_download">Полоса пропускания скачивания:</string>
<string name="call_stats_ice">Подключение ICE:</string> <string name="call_stats_ice">Подключение ICE:</string>
<string name="call_stats_video_resolution">Video size:</string>
<!-- Used by Android to help blind people by describing them images --> <!-- Used by Android to help blind people by describing them images -->
<string name="content_description_add_contact">Кнопка добавить к контактам</string> <string name="content_description_add_contact">Кнопка добавить к контактам</string>

View file

@ -275,6 +275,7 @@
<string name="call_stats_upload">Upload bandwidth:</string> <string name="call_stats_upload">Upload bandwidth:</string>
<string name="call_stats_download">Download bandwidth:</string> <string name="call_stats_download">Download bandwidth:</string>
<string name="call_stats_ice">ICE connectivity:</string> <string name="call_stats_ice">ICE connectivity:</string>
<string name="call_stats_video_resolution">Video size:</string>
<!-- Used by Android to help blind people by describing them images --> <!-- Used by Android to help blind people by describing them images -->
<string name="content_description_add_contact">Add to contacts button</string> <string name="content_description_add_contact">Add to contacts button</string>

View file

@ -439,7 +439,10 @@ public class StatusFragment extends Fragment {
final TextView dl = (TextView) view.findViewById(R.id.downloadBandwith); final TextView dl = (TextView) view.findViewById(R.id.downloadBandwith);
final TextView ul = (TextView) view.findViewById(R.id.uploadBandwith); final TextView ul = (TextView) view.findViewById(R.id.uploadBandwith);
final TextView ice = (TextView) view.findViewById(R.id.ice); final TextView ice = (TextView) view.findViewById(R.id.ice);
if (codec == null || dl == null || ul == null || ice == null) { final TextView videoResolution = (TextView) view.findViewById(R.id.video_resolution);
final View videoResolutionLayout = view.findViewById(R.id.video_resolution_layout);
if (codec == null || dl == null || ul == null || ice == null || videoResolution == null || videoResolutionLayout == null) {
mTimer.cancel(); mTimer.cancel();
return; return;
} }
@ -462,6 +465,9 @@ public class StatusFragment extends Fragment {
dl.setText(String.valueOf((int) videoStats.getDownloadBandwidth()) + " / " + (int) audioStats.getDownloadBandwidth() + " kbits/s"); dl.setText(String.valueOf((int) videoStats.getDownloadBandwidth()) + " / " + (int) audioStats.getDownloadBandwidth() + " kbits/s");
ul.setText(String.valueOf((int) videoStats.getUploadBandwidth()) + " / " + (int) audioStats.getUploadBandwidth() + " kbits/s"); ul.setText(String.valueOf((int) videoStats.getUploadBandwidth()) + " / " + (int) audioStats.getUploadBandwidth() + " kbits/s");
ice.setText(videoStats.getIceState().toString()); ice.setText(videoStats.getIceState().toString());
videoResolutionLayout.setVisibility(View.VISIBLE);
videoResolution.setText("" + params.getSentVideoSize().toDisplayableString() + " / ↓ " + params.getReceivedVideoSize().toDisplayableString());
} }
} else { } else {
final LinphoneCallStats audioStats = call.getAudioStats(); final LinphoneCallStats audioStats = call.getAudioStats();
@ -474,6 +480,8 @@ public class StatusFragment extends Fragment {
dl.setText(String.valueOf((int) audioStats.getDownloadBandwidth()) + " kbits/s"); dl.setText(String.valueOf((int) audioStats.getDownloadBandwidth()) + " kbits/s");
ul.setText(String.valueOf((int) audioStats.getUploadBandwidth()) + " kbits/s"); ul.setText(String.valueOf((int) audioStats.getUploadBandwidth()) + " kbits/s");
ice.setText(audioStats.getIceState().toString()); ice.setText(audioStats.getIceState().toString());
videoResolutionLayout.setVisibility(View.GONE);
} }
} }
} }

@ -1 +1 @@
Subproject commit 3cd4eb5e75c6f9606ead1a38e4708b8031c44191 Subproject commit 3a3f331ca30c0cffee9bfaab7edf66d148f968d1